:root {
    --sigma-sidebar: #101827;
    --sigma-sidebar-soft: #172033;
    --sigma-sidebar-active: #2f6df6;
    --sigma-bg: #f3f6fb;
    --sigma-surface: #ffffff;
    --sigma-border: #dfe6f1;
    --sigma-muted: #64748b;
    --sigma-text: #111827;
    --sigma-ring: rgba(47, 109, 246, .18);
}

* {
    letter-spacing: 0;
}

body {
    background:
        radial-gradient(circle at top left, rgba(47, 109, 246, .10), transparent 28rem),
        linear-gradient(180deg, #f7f9fd 0%, var(--sigma-bg) 100%);
    color: var(--sigma-text);
    min-height: 100vh;
}

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background:
        linear-gradient(140deg, rgba(16, 24, 39, .92), rgba(22, 32, 51, .86)),
        radial-gradient(circle at top right, rgba(47, 109, 246, .32), transparent 24rem);
}

.auth-box {
    width: min(430px, calc(100vw - 32px));
}

.auth-brand {
    color: #fff;
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.auth-brand h1 {
    font-size: 1.25rem;
    margin: 0;
    font-weight: 700;
}

.auth-brand span {
    color: rgba(255, 255, 255, .7);
    font-size: .875rem;
}

.auth-box .card {
    border: 0;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .28);
}

.app-shell {
    min-height: 100vh;
}

.sidebar {
    width: 280px;
    background: linear-gradient(180deg, var(--sigma-sidebar) 0%, var(--sigma-sidebar-soft) 100%);
    color: #fff;
    position: fixed;
    inset: 0 auto 0 0;
    padding: 22px 16px;
    box-shadow: 12px 0 34px rgba(15, 23, 42, .16);
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.brand-block {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 8px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, .10);
}

.brand-mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: linear-gradient(135deg, #2f6df6, #13b8a6);
    color: #fff;
    font-weight: 800;
    box-shadow: 0 14px 30px rgba(47, 109, 246, .28);
}

.brand-block h1 {
    font-size: 1rem;
    font-weight: 750;
    margin: 0;
}

.brand-block span,
.sidebar-footer {
    color: rgba(255, 255, 255, .64);
    font-size: .8rem;
}

.sidebar-nav {
    display: grid;
    gap: 6px;
}

.sidebar-nav a {
    color: rgba(255, 255, 255, .74);
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 12px;
    border-radius: 8px;
    text-decoration: none;
    transition: background .16s ease, color .16s ease, transform .16s ease;
}

.sidebar-nav a i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: rgba(47, 109, 246, .18);
    color: #fff;
}

.sidebar-nav a.active {
    box-shadow: inset 3px 0 0 var(--sigma-sidebar-active);
}

.sidebar-footer {
    margin-top: auto;
    padding: 14px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .06);
}

.sidebar-url {
    color: #fff;
    font-weight: 650;
    margin-top: 3px;
}

.main {
    margin-left: 280px;
    min-height: 100vh;
}

.topbar {
    background: rgba(255, 255, 255, .88);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--sigma-border);
    position: sticky;
    top: 0;
    z-index: 20;
}

.page-kicker {
    color: var(--sigma-muted);
    font-size: .8rem;
    font-weight: 650;
    text-transform: uppercase;
}

.page-title {
    font-size: 1.35rem;
    font-weight: 780;
}

.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 11px;
    color: #475569;
    background: #f8fafc;
    border: 1px solid var(--sigma-border);
    border-radius: 999px;
    font-size: .875rem;
}

.btn-icon-text {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.card {
    border-radius: 8px;
    border-color: var(--sigma-border);
}

.card.border-0,
.card-metric {
    box-shadow: 0 14px 34px rgba(15, 23, 42, .07);
}

.card-header {
    border-bottom-color: var(--sigma-border);
}

.card-metric {
    border: 0;
    overflow: hidden;
}

.card-metric .card-body {
    min-height: 122px;
}

.metric-card-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.metric-icon {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    color: #2f6df6;
    background: #edf4ff;
    font-size: 1.25rem;
}

.metric-primary { border-left: 4px solid #2f6df6; }
.metric-success { border-left: 4px solid #15946c; }
.metric-danger { border-left: 4px solid #e5484d; }
.metric-warning { border-left: 4px solid #f59e0b; }
.metric-primary .metric-icon { background: #2f6df6; color: #fff; }
.metric-success .metric-icon { background: #15946c; color: #fff; }
.metric-danger .metric-icon { background: #e5484d; color: #fff; }
.metric-warning .metric-icon { background: #f59e0b; color: #fff; }

.slim-progress {
    height: 8px;
    background: #eef2f7;
}

.info-list {
    display: grid;
    gap: 12px;
}

.info-list > div,
.service-row,
.interface-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--sigma-border);
}

.info-list > div:last-child,
.service-row:last-child,
.interface-row:last-child {
    border-bottom: 0;
}

.info-list span {
    color: var(--sigma-muted);
    font-size: .875rem;
}

.info-list strong,
.service-row span,
.interface-row strong {
    font-size: .925rem;
    text-align: right;
}

.interface-row {
    align-items: flex-start;
    flex-direction: column;
}

.display-6 {
    font-weight: 780;
}

.table {
    --bs-table-hover-bg: #f8fafc;
}

.table td,
.table th {
    vertical-align: middle;
}

.table thead th {
    color: #475569;
    font-size: .78rem;
    text-transform: uppercase;
    background: #f8fafc;
    border-bottom: 1px solid var(--sigma-border);
}

.form-control,
.form-select {
    border-color: var(--sigma-border);
    border-radius: 8px;
}

.form-control:focus,
.form-select:focus {
    border-color: #2f6df6;
    box-shadow: 0 0 0 .22rem var(--sigma-ring);
}

.btn {
    border-radius: 8px;
    font-weight: 650;
}

.btn-primary {
    background: #2f6df6;
    border-color: #2f6df6;
}

.btn-primary:hover {
    background: #255bd2;
    border-color: #255bd2;
}

.secret-placeholder {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    color: var(--sigma-muted);
}

.page-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.ajax-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--sigma-muted);
    font-size: .875rem;
}

.ajax-status::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #94a3b8;
}

.ajax-status.is-loading::before { background: #f59e0b; }
.ajax-status.is-ok::before { background: #15946c; }
.ajax-status.is-error::before { background: #e5484d; }

.table-responsive {
    min-height: 120px;
}

code {
    white-space: normal;
    word-break: break-word;
    color: #1d4ed8;
}

@media (max-width: 991.98px) {
    .sidebar {
        position: static;
        width: 100%;
        min-height: auto;
        border-radius: 0;
    }

    .sidebar-footer {
        display: none;
    }

    .sidebar-nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .main {
        margin-left: 0;
    }

    .topbar {
        position: static;
    }
}

@media (max-width: 767.98px) {
    .topbar,
    main.p-4 {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    .topbar {
        align-items: flex-start !important;
        gap: 12px;
        flex-direction: column;
    }

    .sidebar-nav {
        grid-template-columns: 1fr;
    }

    .page-toolbar {
        align-items: stretch;
    }

    .page-toolbar > * {
        width: 100%;
    }

    .user-chip {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}
