/* ===== Design tokens (light) ===== */
:root {
    --brand-900: #0A3358;
    --brand-800: #0D4276;
    --brand-700: #0E4A84;
    --brand-600: #105090;
    --brand-500: #1665AE;
    --brand-400: #3C84C7;
    --brand-300: #7FB0DC;
    --brand-100: #E4EEF7;
    --brand-50: #F1F6FB;
    --gold-700: #C8941E;
    --gold-600: #E0A521;
    --gold-500: #F0A92B;
    --gold-400: #F6BD52;
    --gold-100: #FBF1DD;
    --ok: #1F8A5B;
    --ok-bg: #E6F4EC;
    --warn: #B7791F;
    --warn-bg: #FBF1DD;
    --danger: #C0392B;
    --danger-bg: #FBE9E7;
    --info: #0B6FB0;
    --purple: #7C4DBC;
    --ink: #16202B;
    --ink-2: #3A4757;
    --muted: #647488;
    --faint: #94A3B8;
    --line: #E5EAF0;
    --line-2: #EEF2F6;
    --bg: #F4F6F9;
    --surface: #FFFFFF;
    --surface-2: #FAFBFC;
    --sidebar: #0C2E52;
    --sidebar-2: #0A2747;
    --sidebar-line: #1B4068;
    --sidebar-ink: #A9C2DC;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --shadow-sm: 0 4px 14px rgba(16,40,72,.08), 0 1px 3px rgba(16,40,72,.06);
    --shadow: 0 4px 16px rgba(16,40,72,.08), 0 1px 3px rgba(16,40,72,.05);
    --shadow-lg: 0 16px 48px rgba(11,32,58,.18), 0 4px 12px rgba(11,32,58,.08);
    --font: 'Plus Jakarta Sans','Segoe UI',system-ui,sans-serif;
    --mono: 'JetBrains Mono','Consolas',monospace;
    --sidebar-w: 248px;
    --topbar-h: 62px;
    --dens: 1;
}
/* ===== Design tokens (dark) ===== */
[data-theme=dark] {
    --ink: #EAF1F8;
    --ink-2: #BBC9D8;
    --muted: #8295A8;
    --faint: #5F7488;
    --line: #28333F;
    --line-2: #1F2A34;
    --bg: #0D151E;
    --surface: #161F2A;
    --surface-2: #1C2733;
    --brand-50: #152538;
    --brand-100: #1C3450;
    --gold-100: #2B2410;
    --ok-bg: #10261B;
    --warn-bg: #2A2410;
    --danger-bg: #2C1614;
    --info: #2E8BD4;
    --sidebar: #0A131D;
    --sidebar-2: #0A131D;
    --sidebar-line: #1E2A36;
    --sidebar-ink: #9DB2C8;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.45);
    --shadow: 0 4px 16px rgba(0,0,0,.5), 0 1px 3px rgba(0,0,0,.4);
    --shadow-lg: 0 18px 50px rgba(0,0,0,.6), 0 4px 14px rgba(0,0,0,.5);
}

/* ===== base ===== */
.ct-root, .ct-root * {
    box-sizing: border-box;
}

.ct-root {
    font-family: var(--font);
    color: var(--ink);
}

/* ===== sidebar ===== */
.ct-sidebar {
    background: linear-gradient(180deg,var(--sidebar) 0%,var(--sidebar-2) 100%);
    color: #fff;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ct-sb-brand {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding: 14px 16px 14px 38px;
    min-height: var(--topbar-h);
    height: 100%;
}

    .ct-sb-brand img {
        height: 26px;
        width: auto;
        flex-shrink: 0;
    }

.ct-bt {
    font-weight: 800;
    font-size: 16px;
    letter-spacing: -0.2px;
    line-height: 1;
    color: #fff;
}

.ct-bs {
    font-size: 10px;
    color: var(--gold-400);
    font-weight: 600;
    letter-spacing: 1.5px;
    margin-top: 3px;
}

.ct-sb-scroll {
    overflow-y: auto;
}

.ct-nav-grp {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.3px;
    color: #5C7CA0;
    padding: 6px 12px 4px 26px;
    text-transform: uppercase;
}

.ct-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px 10px 26px;
    border-radius: 9px;
    color: var(--sidebar-ink);
    font-weight: 500;
    font-size: 14.5px;
    margin-bottom: 2px;
    position: relative;
    transition: .14s;
    cursor: pointer;
    user-select: none;
}

    .ct-nav-item:hover {
        background: rgba(255,255,255,.06);
        color: #fff;
    }

    .ct-nav-item.on {
        background: linear-gradient(90deg,rgba(240,169,43,.16),rgba(240,169,43,.02));
        color: #fff;
        font-weight: 600;
    }

        .ct-nav-item.on::before {
            content: '';
            position: absolute;
            left: 8px;
            top: 9px;
            bottom: 9px;
            width: 3px;
            border-radius: 3px;
            background: var(--gold-500);
        }

        .ct-nav-item.on .ct-ni-ico {
            color: var(--gold-400);
            opacity: 1;
        }

.ct-ni-ico {
    display: flex;
    opacity: .92;
    width: 18px;
    justify-content: center;
}

.ct-nav-badge {
    margin-left: auto;
    background: var(--gold-500);
    color: #3A2A06;
    font-size: 10.5px;
    font-weight: 800;
    border-radius: 20px;
    min-width: 19px;
    height: 19px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}

.ct-live-dot {
    margin-left: auto;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #3FD68C;
    box-shadow: 0 0 0 0 rgba(63,214,140,.6);
    animation: ct-pulse 1.6s infinite;
}

.ct-sb-foot {
    padding: 12px;
    border-top: 1px solid var(--sidebar-line);
}

.ct-sb-help {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border-radius: 10px;
    background: rgba(255,255,255,.05);
    font-size: 12px;
    color: var(--sidebar-ink);
}

    .ct-sb-help b {
        color: #fff;
        display: block;
        font-size: 12.5px;
    }

@keyframes ct-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(63,214,140,.5)
    }

    70% {
        box-shadow: 0 0 0 7px rgba(63,214,140,0)
    }

    100% {
        box-shadow: 0 0 0 0 rgba(63,214,140,0)
    }
}

/* ===== topbar ===== */
.ct-topbar {
    height: 100%;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 22px;
}

.ct-tenant-switch {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 6px 11px 6px 8px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    font-weight: 600;
    font-size: 13px;
    min-width: 200px;
    cursor: pointer;
    transition: .14s;
    color: var(--ink);
}

    .ct-tenant-switch:hover {
        border-color: var(--brand-300);
    }

.ct-tenant-logo {
    width: 26px;
    height: 26px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 11px;
    flex-shrink: 0;
}

.ct-ts-meta {
    text-align: left;
    line-height: 1.15;
    flex: 1;
}

    .ct-ts-meta span {
        display: block;
        font-size: 13px;
        color: var(--ink);
    }

    .ct-ts-meta small {
        font-size: 10.5px;
        color: var(--muted);
        font-weight: 500;
    }

.ct-spacer {
    flex: 1;
}

.ct-theme-toggle {
    width: 46px;
    height: 26px;
    border-radius: 20px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    display: flex;
    align-items: center;
    padding: 2px;
    cursor: pointer;
    position: relative;
}

.ct-theme-knob {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold-600);
    font-size: 12px;
    transition: .22s cubic-bezier(.4,.1,.3,1.4);
}

[data-theme=dark] .ct-theme-knob {
    transform: translateX(20px);
}

.ct-icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    cursor: pointer;
    transition: .14s;
    border: 1px solid transparent;
    position: relative;
}

    .ct-icon-btn:hover {
        background: var(--surface-2);
        color: var(--ink);
    }

    .ct-icon-btn .ct-dot {
        position: absolute;
        top: 6px;
        right: 6px;
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: var(--danger);
        border: 2px solid var(--surface);
    }

.ct-topbar-user {
    display: flex;
    align-items: center;
    gap: 9px;
    padding-left: 14px;
    border-left: 1px solid var(--line);
}

.ct-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    background: var(--brand-600);
    color: #fff;
}

.ct-user-meta {
    line-height: 1.2;
}

    .ct-user-meta b {
        font-size: 13px;
        color: var(--ink);
        display: block;
    }

    .ct-user-meta small {
        font-size: 11px;
        color: var(--muted);
    }

/* ===== content + page ===== */
.ct-content {
    height: 100%;
    overflow-y: auto;
    padding: 24px 26px 40px;
    background: var(--bg);
}

.ct-page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.ct-page-title {
    font-size: 23px;
    font-weight: 800;
    letter-spacing: -0.4px;
    color: var(--ink);
}

.ct-page-sub {
    font-size: 13px;
    color: var(--muted);
    margin-top: 3px;
}

/* ===== cards / kpis ===== */
.ct-grid {
    display: grid;
    gap: 16px;
}

.ct-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.ct-seg {
    background: var(--surface-2);
    border: 1px solid #E5EAF0;
    border-radius: 9px;
}

.ct-tbl tbody tr:hover {
    background: var(--brand-50);
    cursor: pointer;
}

.ct-tbl tbody tr.sel {
    background: var(--brand-50);
}

.ct-chip-on {
    background: var(--surface);
    border: 2px solid #81B0DA;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.ct-chip-hover {
    background: var(--surface);
    border: 1px solid #81B0DA;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.ct-card-pad {
    padding: 18px;
}

.ct-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 18px;
    border-bottom: 1px solid var(--line-2);
}

.ct-card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--ink);
}

.ct-kpi-label {
    font-size: 12px;
    color: var(--muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .4px;
}

.ct-kpi-val {
    font-size: 28px;
    font-weight: 800;
    color: var(--ink);
    letter-spacing: -0.5px;
    margin-top: 6px;
}

.ct-kpi-ico {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

/* ===== buttons ===== */
.ct-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border-radius: 9px;
    font-weight: 600;
    font-size: 13px;
    transition: .14s;
    white-space: nowrap;
    border: 1px solid transparent;
    cursor: pointer;
    height: 38px;
    padding: 0 15px;
    font-family: var(--font);
}

.ct-btn-primary {
    background: var(--brand-600);
    color: #fff;
    box-shadow: 0 1px 3px rgba(16,80,144,.3);
}

    .ct-btn-primary:hover {
        background: var(--brand-700);
    }

.ct-btn-ghost {
    background: transparent;
    color: var(--muted);
    border-color: var(--line);
}

    .ct-btn-ghost:hover {
        background: var(--surface-2);
        color: var(--ink);
    }

.ct-btn-gold {
    background: var(--gold-500);
    color: #3A2A06;
}

.ct-btn-sm {
    height: 32px;
    padding: 0 11px;
    font-size: 12.5px;
    border-radius: 8px;
}

/* ===== pressed-state cue =====
   Add class="ct-press" to any clickable element's visible box to get a tactile
   push-down + inset-shadow when the user presses it (pure CSS :active, instant).
   Works on filled, ghost, bordered, and segmented buttons alike. */
.ct-press {
    cursor: pointer;
    transition: transform .06s ease, box-shadow .12s ease, filter .12s ease;
}

    .ct-press:active {
        transform: translateY(1px) scale(.985);
        filter: brightness(.93);
        box-shadow: inset 0 2px 5px rgba(8,20,40,.18);
    }

/* native .ct-btn buttons get the same press feel */
.ct-btn:active {
    transform: translateY(1px) scale(.99);
    filter: brightness(.94);
    box-shadow: inset 0 2px 5px rgba(8,20,40,.18);
}

/* ===== badges / tags / pills ===== */
.ct-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    background: var(--surface-2);
    border: 1px solid var(--line);
    color: var(--ink-2);
}

.ct-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border-radius: 20px;
    font-weight: 600;
    white-space: nowrap;
    line-height: 1.4;
    padding: 3px 10px;
    font-size: 11.5px;
}

.ct-badge-ok {
    background: var(--ok-bg);
    color: var(--ok);
}

.ct-badge-warn {
    background: var(--warn-bg);
    color: var(--warn);
}

.ct-badge-danger {
    background: var(--danger-bg);
    color: var(--danger);
}

.ct-badge-info {
    background: var(--brand-50);
    color: var(--info);
}

.ct-health-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.ct-hd-online {
    background: #3FD68C;
}

.ct-hd-warn {
    background: var(--gold-500);
}

.ct-hd-offline {
    background: var(--danger);
}

/* ===== table ===== */
.ct-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

    .ct-table th {
        text-align: left;
        padding: 11px 14px;
        font-size: 11px;
        font-weight: 700;
        color: var(--muted);
        text-transform: uppercase;
        letter-spacing: .5px;
        border-bottom: 1px solid var(--line);
        background: var(--surface-2);
    }

    .ct-table td {
        padding: 12px 14px;
        border-bottom: 1px solid var(--line-2);
        color: var(--ink-2);
    }

    .ct-table tr:hover td {
        background: var(--surface-2);
    }

.ct-mono {
    font-family: var(--mono);
    font-size: 12.5px;
}

.ct-faint {
    color: var(--faint);
}

.ct-muted {
    color: var(--muted);
}

/* ===== dropdown ===== */
.ct-dd {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 11px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.ct-dd-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 13px;
    cursor: pointer;
    font-size: 13px;
    color: var(--ink);
    transition: .1s;
}

    .ct-dd-item:hover {
        background: var(--surface-2);
    }

    .ct-dd-item.on {
        background: var(--brand-50);
    }

.ct-dd-head {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--muted);
    text-transform: uppercase;
    padding: 11px 13px 5px;
}

.ct-dd-divider {
    height: 1px;
    background: var(--line-2);
    margin: 4px 0;
}

/* scrollbars */
.ct-sb-scroll::-webkit-scrollbar, .ct-content::-webkit-scrollbar {
    width: 8px;
}

.ct-sb-scroll::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,.12);
    border-radius: 8px;
}

.ct-content::-webkit-scrollbar-thumb {
    background: var(--line);
    border-radius: 8px;
}

/* Invisible file-upload overlay: a Wisej Upload control placed on top of a styled
   button so the custom look shows through while the click opens the file picker. */
.ct-upload-overlay, .ct-upload-overlay * {
    opacity: 0 !important;
    cursor: pointer !important;
}

