/* ============================================================================
   iSpace Support Portal — design system (v4, iSpace brand)
   One source of truth for colour, type, spacing, elevation and components.
   Class names are kept stable so every existing page restyles automatically.
   ========================================================================== */

:root {
    /* ---- Brand ---- */
    --primary: #0f7c90;
    --primary-600: #0b6678;
    --primary-700: #084f62;
    --primary-soft: #e4f4f7;
    --accent: #8dbb2f;
    --grad-primary: linear-gradient(135deg, #0f7c90 0%, #23a7bb 58%, #8dbb2f 100%);
    --grad-brand: linear-gradient(135deg, #063548 0%, #0f7c90 65%, #8dbb2f 100%);
    --on-primary: #ffffff;
    --primary-container: #c7edf3;
    --on-primary-container: #062f3f;

    /* ---- Neutrals (slate) ---- */
    --ink: #101820;
    --on-surface: #24313b;
    --on-surface-variant: #66737d;
    --outline: #96a1aa;
    --outline-variant: #dce4e8;
    --surface-container-lowest: #ffffff;
    --surface-container-low: #f7fafb;
    --surface-container: #edf3f5;
    --surface-container-high: #e2ebef;
    --surface-container-highest: #d4e0e5;
    --app-bg: #f4f8f9;
    --background: #f4f8f9;
    --on-background: var(--ink);

    /* ---- Dark sidebar ---- */
    --side-1: #052a3a;
    --side-2: #083b4e;
    --side-on: #f5fbfc;
    --side-muted: #9eb8c2;
    --side-hover: rgba(255,255,255,.06);

    /* ---- Semantic (soft bg + strong text) ---- */
    --status-open: #0f7c90;        --status-open-bg: #e4f4f7;
    --status-progress: #b45309;    --status-progress-bg: #fef3da;
    --status-resolved: #059669;    --status-resolved-bg: #d9f7ec;
    --status-closed: #667085;      --status-closed-bg: #eef1f6;
    --status-waiting: #b45309;     --status-waiting-bg: #fef3da;

    --prio-p1: #e11d48;            --prio-p1-bg: #ffe4ea;   /* critical */
    --prio-p2: #d97706;            --prio-p2-bg: #fef0d6;   /* high */
    --prio-p3: #0f7c90;            --prio-p3-bg: #e4f4f7;   /* medium */
    --prio-p4: #667085;            --prio-p4-bg: #eef1f6;   /* low */

    --sla-ok: #059669;             --sla-ok-bg: #d9f7ec;
    --sla-breach: #e11d48;         --sla-breach-bg: #ffe4ea;

    --error: #e11d48;              --on-error: #fff;
    --error-container: #ffe4ea;    --on-error-container: #9f1239;

    /* ---- Type ---- */
    --font-head: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
    --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

    /* ---- Spacing ---- */
    --space-1: 4px;  --space-2: 8px;  --space-3: 12px; --space-4: 16px;
    --space-5: 20px; --space-6: 24px; --space-8: 32px; --space-10: 40px;
    --sidebar-width: 264px;
    --topbar-height: 72px;
    --container-padding: 32px;
    --gutter: 24px;
    --card-padding: 22px;

    /* ---- Radius ---- */
    --radius-sm: 6px;
    --radius: 8px;           /* controls */
    --radius-md: 8px;        /* small cards */
    --radius-lg: 8px;        /* panels */
    --radius-xl: 12px;
    --radius-full: 9999px;

    /* ---- Elevation ---- */
    --border: 1px solid var(--outline-variant);
    --shadow-xs: 0 1px 2px rgba(16,24,40,.05);
    --shadow-sm: 0 1px 3px rgba(16,24,40,.06), 0 1px 2px rgba(16,24,40,.04);
    --shadow-md: 0 10px 28px -8px rgba(16,24,40,.14), 0 2px 6px -2px rgba(16,24,40,.06);
    --shadow-lg: 0 28px 56px -16px rgba(16,24,40,.22);
    --shadow-cta: 0 10px 22px -8px rgba(15,124,144,.42);
    --ring: 0 0 0 4px rgba(15,124,144,.16);
    --brand-shape: rgba(15, 124, 144, .035);
    --brand-shape-light: rgba(255, 255, 255, .045);
}

/* ============================ Base ============================ */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: var(--font-body);
    font-size: 14px; line-height: 1.5;
    color: var(--on-surface);
    background:
        linear-gradient(135deg, transparent 0 54%, var(--brand-shape) 54% 56%, transparent 56%),
        linear-gradient(24deg, transparent 0 72%, rgba(141, 187, 47, .026) 72% 74%, transparent 74%),
        radial-gradient(900px 420px at 84% -80px, rgba(35, 167, 187, .18), transparent 62%),
        radial-gradient(760px 360px at -14% 12%, rgba(141, 187, 47, .10), transparent 56%),
        linear-gradient(145deg, #f9fcfd 0%, #eef8fa 42%, var(--app-bg) 100%);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
a { color: var(--primary-600); text-decoration: none; }
a:hover { color: var(--primary-700); }
h1, h2, h3, h4 { font-family: var(--font-head); margin: 0; color: var(--ink); letter-spacing: 0; }

.page-title { font-size: 26px; line-height: 1.2; font-weight: 700; }
.section-title { font-family: var(--font-head); font-size: 16px; line-height: 1.3; font-weight: 700; color: var(--ink); }
.text-muted { color: var(--on-surface-variant); }
.label { font-size: 11.5px; line-height: 1.4; font-weight: 600; letter-spacing: 0; color: var(--on-surface-variant); text-transform: uppercase; }

/* ============================ App shell ============================ */
.app { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-width);
    background:
        linear-gradient(138deg, transparent 0 58%, var(--brand-shape-light) 58% 61%, transparent 61%),
        linear-gradient(28deg, transparent 0 76%, rgba(255,255,255,.032) 76% 78%, transparent 78%),
        radial-gradient(360px 260px at 15% 0%, rgba(35,167,187,.32), transparent 68%),
        radial-gradient(300px 240px at 120% 100%, rgba(141,187,47,.16), transparent 64%),
        linear-gradient(180deg, #083f54 0%, var(--side-2) 42%, var(--side-1) 100%);
    color: var(--side-on);
    display: flex; flex-direction: column;
    position: fixed; inset: 0 auto 0 0; height: 100vh;
    z-index: 40; padding: 6px;
}
.sidebar::after { /* subtle inner edge highlight */
    content: ""; position: absolute; inset: 0 0 0 auto; width: 1px; background: rgba(255,255,255,.05);
}
.sidebar__brand { display: flex; align-items: center; padding: 18px 16px 22px; }
.brand-lockup h1 {
    color: #fff;
    font-family: var(--font-head);
    font-size: 30px;
    line-height: 1.05;
    font-weight: 700;
    letter-spacing: 0;
}
.brand-lockup h1::after {
    content: "";
    display: block;
    width: 38px;
    height: 3px;
    margin-top: 8px;
    border-radius: 999px;
    background: linear-gradient(90deg, #35b6dd, var(--accent));
}
.brand-lockup .label {
    color: var(--side-muted);
    font-size: 12px;
    margin-top: 7px;
    text-transform: none;
}
.brand-lockup--auth h1 { font-size: 36px; }
.brand-lockup--auth .label { color: rgba(231,233,245,.68); font-size: 12.5px; }

.nav { display: flex; flex-direction: column; gap: 2px; padding: 0 10px; flex: 1; overflow-y: auto; }
.nav__item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: 8px;
    color: var(--side-muted); font-weight: 500; font-size: 14px; position: relative;
    transition: background .15s, color .15s;
}
.nav__item:hover { background: var(--side-hover); color: #fff; text-decoration: none; }
.nav__item.is-active {
    background: linear-gradient(90deg, rgba(35,167,187,.28), rgba(141,187,47,.08));
    color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);
}
.nav__item.is-active::before {
    content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
    width: 3px; height: 18px; border-radius: 0 4px 4px 0; background: var(--accent);
}
.nav__item .material-symbols-outlined { font-size: 21px; }
.nav__group-label { color: var(--side-muted); font-size: 10.5px; letter-spacing: 0; text-transform: uppercase; padding: 18px 12px 6px; opacity: .8; }

.sidebar__footer { padding: 10px; }
.side-user { display: flex; align-items: center; gap: 10px; margin: 8px 6px 4px; padding: 10px; border-radius: 8px; background: rgba(255,255,255,.04); }
.side-user__meta { min-width: 0; }
.side-user__meta .nm { color: #fff; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user__meta .rl { color: var(--side-muted); font-size: 11.5px; }

/* floating create-ticket action */
.floating-ticket-cta {
    position: fixed;
    right: 32px;
    bottom: 28px;
    z-index: 70;
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--primary-600);
    color: #fff;
    border: 1px solid rgba(8, 63, 84, .14);
    box-shadow: 0 18px 42px -18px rgba(5, 42, 58, .46), 0 8px 16px -12px rgba(15, 124, 144, .42);
    transition: transform .15s, box-shadow .15s, background .15s;
}
.floating-ticket-cta::before {
    content: "New support request";
    position: absolute;
    right: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%) translateX(6px);
    opacity: 0;
    white-space: nowrap;
    border-radius: 8px;
    padding: 8px 10px;
    background: var(--ink);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    box-shadow: var(--shadow-md);
    pointer-events: none;
    transition: opacity .15s, transform .15s;
}
.floating-ticket-cta .material-symbols-outlined {
    font-size: 26px;
}
.floating-ticket-cta:hover {
    color: #fff;
    text-decoration: none;
    transform: translateY(-2px);
    background: var(--primary-700);
    box-shadow: 0 24px 52px -20px rgba(5, 42, 58, .44), 0 12px 24px -14px rgba(15, 124, 144, .38);
}
.floating-ticket-cta:hover::before {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

.main { flex: 1; margin-left: var(--sidebar-width); display: flex; flex-direction: column; min-width: 0; }

/* ---- Topbar ---- */
.topbar {
    height: var(--topbar-height); display: flex; align-items: center; gap: var(--space-4);
    padding: 0 var(--container-padding); position: sticky; top: 0; z-index: 30;
    background: rgba(248,251,252,.88); backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid rgba(7,53,72,.10);
}
.topbar__search { flex: 1; max-width: 460px; position: relative; }
.topbar__search input {
    width: 100%; height: 42px; padding: 0 16px 0 42px;
    border: 1px solid var(--outline-variant); border-radius: var(--radius-full); background: #fff;
    font-size: 14px; color: var(--on-surface); box-shadow: var(--shadow-xs);
    transition: box-shadow .15s, border-color .15s;
}
.topbar__search input::placeholder { color: var(--outline); }
.topbar__search input:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
.topbar__search .material-symbols-outlined { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--outline); font-size: 20px; }
.topbar__spacer { flex: 1; }
.topbar__actions { display: flex; align-items: center; gap: var(--space-3); }
.topbar__divider { width: 1px; height: 28px; background: var(--outline-variant); margin: 0 4px; }

.icon-btn { width: 40px; height: 40px; background: #fff; border: 1px solid var(--outline-variant); color: var(--on-surface-variant); cursor: pointer; display: grid; place-items: center; position: relative; border-radius: 8px; box-shadow: var(--shadow-xs); transition: background .15s, color .15s; }
.icon-btn:hover { background: var(--surface-container-low); color: var(--ink); }
.icon-btn .dot { position: absolute; top: 7px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--error); border: 2px solid #fff; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 5px 6px 5px 12px; border-radius: var(--radius-full); background: #fff; border: 1px solid var(--outline-variant); box-shadow: var(--shadow-xs); cursor: pointer; }
.user-chip__meta { text-align: right; line-height: 1.2; }
.user-chip__meta .name { font-weight: 600; font-size: 13px; color: var(--ink); }
.avatar { width: 34px; height: 34px; border-radius: var(--radius-full); background: var(--grad-brand); display: grid; place-items: center; font-weight: 700; font-size: 13px; color: #fff; overflow: hidden; flex-shrink: 0; }

.content { padding: var(--container-padding); flex: 1; max-width: 1560px; width: 100%; }
.content::before {
    content: "";
    display: block;
    height: 4px;
    width: 96px;
    border-radius: 999px;
    background: var(--grad-primary);
    margin-bottom: 18px;
}
.breadcrumb { font-size: 12px; color: var(--on-surface-variant); margin-bottom: 6px; font-weight: 500; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-6); flex-wrap: wrap; }

/* ============================ Cards ============================ */
.card {
    background: var(--surface-container-lowest); border: 1px solid var(--outline-variant);
    border-radius: var(--radius-lg); padding: var(--card-padding); box-shadow: var(--shadow-sm);
    transition: box-shadow .18s, transform .18s, border-color .18s;
}
.card--flush { padding: 0; overflow: hidden; }
.card--hover:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.page-form-shell { max-width: 920px; }

/* ---- KPI cards ---- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 18px; margin-bottom: var(--gutter); }
@media (min-width: 1280px) { .stat-grid--5 { grid-template-columns: repeat(5, 1fr); } }
.kpi { position: relative; overflow: hidden; }
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--grad-primary); opacity: .9; }
.kpi:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.kpi__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.kpi__icon { width: 46px; height: 46px; border-radius: 8px; display: grid; place-items: center; }
.kpi__icon .material-symbols-outlined { font-size: 24px; }
.kpi__value { font-family: var(--font-head); font-size: 32px; font-weight: 800; line-height: 1; letter-spacing: 0; color: var(--ink); }
.kpi__label { color: var(--on-surface-variant); font-size: 13px; margin-top: 7px; font-weight: 500; }

/* legacy stat-card (kept) */
.stat-card { display: flex; flex-direction: column; gap: var(--space-2); }
.stat-card__top { display: flex; align-items: center; justify-content: space-between; }
.stat-card__icon { width: 40px; height: 40px; border-radius: 8px; display: grid; place-items: center; }
.stat-card__value { font-family: var(--font-head); font-size: 30px; line-height: 1; font-weight: 800; color: var(--ink); }
.stat-card__label { color: var(--on-surface-variant); font-size: 13px; }

.chip { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; letter-spacing: 0; }
.chip--up { color: var(--status-resolved); background: var(--status-resolved-bg); }
.chip--down { color: var(--error); background: var(--error-container); }
.chip--flat { color: var(--on-surface-variant); background: var(--surface-container); }

/* ============================ Buttons ============================ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 42px; padding: 0 18px; border-radius: 8px;
    font-family: var(--font-body); font-size: 14px; font-weight: 600;
    border: 1px solid transparent; cursor: pointer; white-space: nowrap;
    transition: transform .12s, box-shadow .15s, background .15s, filter .15s;
}
.btn .material-symbols-outlined { font-size: 19px; }
.btn--primary { background: var(--primary-600); color: #fff; box-shadow: var(--shadow-cta); }
.btn--primary:hover { filter: brightness(1.05); color: #fff; }
.btn--secondary { background: #fff; color: var(--ink); border-color: var(--outline-variant); box-shadow: var(--shadow-xs); }
.btn--secondary:hover { background: var(--surface-container-low); }
.btn--ghost { background: transparent; color: var(--on-surface-variant); }
.btn--ghost:hover { background: var(--surface-container); color: var(--ink); }
.btn--danger { background: var(--error); color: #fff; box-shadow: 0 10px 22px -10px rgba(225,29,72,.6); }
.btn--danger:hover { filter: brightness(1.05); color: #fff; }
.btn--block { width: 100%; }
.btn--lg { height: 48px; font-size: 15px; padding: 0 22px; }
.btn--sm { height: 34px; font-size: 13px; padding: 0 12px; border-radius: 8px; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ============================ Badges (pills) ============================ */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: var(--radius-full); font-size: 12px; font-weight: 600; line-height: 16px; white-space: nowrap; }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--open { color: var(--status-open); background: var(--status-open-bg); }
.badge--inprogress { color: var(--status-progress); background: var(--status-progress-bg); }
.badge--resolved { color: var(--status-resolved); background: var(--status-resolved-bg); }
.badge--closed { color: var(--status-closed); background: var(--status-closed-bg); }
.badge--waitingclient { color: var(--status-waiting); background: var(--status-waiting-bg); }
.badge--p1 { color: var(--prio-p1); background: var(--prio-p1-bg); }
.badge--p2 { color: var(--prio-p2); background: var(--prio-p2-bg); }
.badge--p3 { color: var(--prio-p3); background: var(--prio-p3-bg); }
.badge--p4 { color: var(--prio-p4); background: var(--prio-p4-bg); }

.sla { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.sla--ok { color: var(--sla-ok); }
.sla--breach { color: var(--sla-breach); }

/* ============================ Tables ============================ */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; }
table.data thead th {
    text-align: left; font-size: 11px; font-weight: 700; letter-spacing: 0;
    text-transform: uppercase; color: var(--on-surface-variant);
    padding: 14px 18px; background: var(--surface-container-low);
    border-bottom: 1px solid var(--outline-variant); white-space: nowrap;
}
table.data tbody td { padding: 15px 18px; border-bottom: 1px solid var(--surface-container); vertical-align: middle; }
table.data tbody tr { transition: background .12s; }
table.data tbody tr:hover { background: var(--primary-soft); }
table.data tbody tr:last-child td { border-bottom: none; }
.cell-ref { color: var(--primary-600); font-weight: 700; }
.cell-subject { font-weight: 600; color: var(--ink); }
.cell-sub { font-size: 12px; color: var(--on-surface-variant); }

/* ============================ Filters ============================ */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--outline-variant); }
.filter { position: relative; }
.input, .select {
    height: 42px; padding: 0 14px; border: 1px solid var(--outline-variant); border-radius: 8px;
    background: #fff; font-size: 14px; color: var(--on-surface); min-width: 140px;
    transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
.filters .search { flex: 1; min-width: 220px; position: relative; }
.filters .search input { width: 100%; padding-left: 40px; }
.filters .search .material-symbols-outlined { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--outline); font-size: 20px; }

/* ============================ Forms ============================ */
.form-grid { display: grid; gap: var(--space-5); }
.field { display: flex; flex-direction: column; gap: 7px; }
.field > label { font-size: 13px; font-weight: 600; color: var(--ink); }
.field .control {
    width: 100%; min-height: 42px; padding: 11px 14px;
    border: 1px solid var(--outline-variant); border-radius: 8px; background: #fff;
    font-family: var(--font-body); font-size: 14px; color: var(--on-surface);
    transition: border-color .15s, box-shadow .15s;
}
.field textarea.control { min-height: 130px; resize: vertical; }
.field .control:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
.field .with-icon { position: relative; }
.field .with-icon .control { padding-left: 42px; }
.field .with-icon .material-symbols-outlined { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--outline); font-size: 20px; }
/* password-visibility toggles sitting inside an input render as bare icons */
.with-icon .icon-btn { background: transparent; border: none; box-shadow: none; width: 34px; height: 34px; }
.with-icon .icon-btn:hover { background: transparent; color: var(--ink); }
.field-error { color: var(--error); font-size: 12px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--space-5); }

/* dropzone */
.dropzone { border: 1.5px dashed var(--outline-variant); border-radius: 8px; padding: var(--space-8); text-align: center; color: var(--on-surface-variant); background: var(--surface-container-low); cursor: pointer; transition: border-color .15s, color .15s, background .15s; }
.dropzone:hover,
.dropzone.is-dragging { border-color: var(--primary); color: var(--primary-600); background: var(--primary-soft); }

/* ============================ Timeline ============================ */
.timeline { display: flex; flex-direction: column; gap: var(--space-4); }
.tl-item { display: flex; gap: var(--space-3); }
.tl-item__avatar { flex-shrink: 0; }
.tl-bubble { flex: 1; background: var(--surface-container-low); border: 1px solid var(--outline-variant); border-radius: 8px; padding: 12px 16px; }
.tl-bubble__head { display: flex; justify-content: space-between; gap: var(--space-3); margin-bottom: 4px; }
.tl-bubble__author { font-weight: 600; font-size: 13px; color: var(--ink); }
.tl-bubble__time { font-size: 12px; color: var(--on-surface-variant); }
.tl-item--internal .tl-bubble { background: var(--status-progress-bg); border-color: #f4d9a6; }
.tl-event { text-align: center; font-size: 12px; color: var(--on-surface-variant); padding: var(--space-2) 0; }
.tl-event span { background: var(--surface-container); padding: 4px 12px; border-radius: var(--radius-full); }

/* ============================ Empty / loading ============================ */
.empty-state { text-align: center; padding: 56px var(--space-6); color: var(--on-surface-variant); }
.empty-state .material-symbols-outlined { font-size: 50px; color: var(--outline-variant); }
.empty-state h3 { margin: var(--space-3) 0 var(--space-2); color: var(--ink); }
.skeleton { background: linear-gradient(90deg, var(--surface-container) 25%, var(--surface-container-high) 37%, var(--surface-container) 63%); background-size: 400% 100%; animation: shimmer 1.2s infinite; border-radius: var(--radius); }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* ============================ Pagination ============================ */
.pagination { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; gap: var(--space-3); flex-wrap: wrap; }
.pager { display: flex; gap: 4px; }
.pager a, .pager span { min-width: 38px; height: 38px; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--outline-variant); background: #fff; font-size: 13px; font-weight: 600; color: var(--on-surface-variant); }
.pager a:hover { background: var(--surface-container-low); color: var(--ink); }
.pager .is-active { background: var(--grad-primary); color: #fff; border-color: transparent; }

/* ============================ Panel header / segmented ============================ */
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--outline-variant); gap: 12px; flex-wrap: wrap; }
.segmented { display: inline-flex; background: var(--surface-container); border-radius: 8px; padding: 3px; gap: 2px; }
.segmented button, .segmented a { border: none; background: transparent; padding: 7px 15px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--on-surface-variant); cursor: pointer; }
.segmented .is-on { background: #fff; color: var(--primary-600); box-shadow: var(--shadow-xs); }

/* ============================ Charts ============================ */
.bars { display: flex; flex-direction: column; gap: 14px; }
.bar-row { display: grid; grid-template-columns: 64px 1fr 32px; align-items: center; gap: 12px; }
.bar-track { height: 10px; background: var(--surface-container); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: var(--grad-primary); }

.donut-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.donut { width: 150px; height: 150px; border-radius: 50%;
    background: conic-gradient(var(--c1) calc(var(--a)*1%), var(--c2) 0 calc((var(--a)+var(--b))*1%), var(--c3) 0 calc((var(--a)+var(--b)+var(--c))*1%), var(--c4) 0);
    display: grid; place-items: center; position: relative; }
.donut::after { content: ""; width: 104px; height: 104px; background: #fff; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--outline-variant); }
.donut__center { position: absolute; text-align: center; }
.donut__center b { font-family: var(--font-head); font-size: 28px; font-weight: 800; display: block; line-height: 1; color: var(--ink); }
.legend { display: flex; flex-direction: column; gap: 11px; flex: 1; min-width: 150px; }
.legend__item { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--on-surface); }
.legend__dot { width: 10px; height: 10px; border-radius: 4px; }

/* ============================ Modal ============================ */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15,20,34,.5); display: grid; place-items: center; z-index: 60; backdrop-filter: blur(2px); }
.modal { background: #fff; border-radius: var(--radius-lg); padding: var(--space-6); width: min(460px, 92vw); box-shadow: var(--shadow-lg); }
.modal h3 { margin-bottom: var(--space-2); }
.modal__actions { display: flex; justify-content: flex-end; gap: var(--space-3); margin-top: var(--space-5); }

/* ============================ Toast ============================ */
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 80; background: var(--ink); color: #fff; padding: 13px 18px; border-radius: 8px; box-shadow: var(--shadow-lg); display: flex; gap: 10px; align-items: center; font-weight: 500; animation: toastIn .25s ease, toastOut .3s ease 4s forwards; }
.toast .material-symbols-outlined { color: #a5f3d0; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(12px); } }

/* ============================ Toggle switch ============================ */
.switch { position: relative; display: inline-block; width: 42px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--outline-variant); border-radius: 999px; transition: .2s; cursor: pointer; }
.switch span::before { content: ""; position: absolute; height: 18px; width: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: var(--shadow-xs); }
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::before { transform: translateX(18px); }

/* ============================ Misc ============================ */
.row-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--grad-primary); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }

*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: #cdd2de; border-radius: 999px; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: #b3b9c8; background-clip: content-box; }
.sidebar ::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); background-clip: content-box; }

/* ============================ Auth (login) ============================ */
.auth { min-height: 100vh; display: flex; background: #fff; }
.auth__brand {
    width: 52%;
    background:
        linear-gradient(138deg, transparent 0 56%, rgba(255,255,255,.046) 56% 59%, transparent 59%),
        linear-gradient(28deg, transparent 0 78%, rgba(255,255,255,.028) 78% 80%, transparent 80%),
        radial-gradient(780px 480px at 20% 5%, rgba(35, 167, 187, .30), transparent 62%),
        radial-gradient(620px 440px at 105% 85%, rgba(141, 187, 47, .16), transparent 60%),
        linear-gradient(150deg, #052636 0%, #073c50 48%, #0b5870 100%);
    color: #fff; padding: 64px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden;
}
.auth__brand-head { display: flex; align-items: center; gap: var(--space-3); position: relative; z-index: 1; }
.auth__headline {
    font-family: var(--font-head);
    font-size: 44px;
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: 0;
    color: #f8fcfd;
    margin-bottom: var(--space-4);
    position: relative;
    z-index: 1;
    text-shadow: 0 10px 28px rgba(0,0,0,.24);
}
.auth__sub { color: rgba(232, 244, 247, .84); font-size: 16px; line-height: 1.65; max-width: 31rem; position: relative; z-index: 1; }
.auth__points { display: flex; flex-direction: column; gap: 12px; margin-top: 28px; position: relative; z-index: 1; }
.auth__point { display: flex; align-items: center; gap: 10px; color: rgba(244,250,251,.90); font-size: 14px; font-weight: 500; }
.auth__point .material-symbols-outlined { font-size: 20px; color: #b6d96c; }
.auth__form { width: 48%; background: #fff; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 48px; }
.auth__form-inner { width: 100%; max-width: 420px; background: #fff; border: none; border-radius: 0; padding: 36px; box-shadow: none; }
.auth__form .page-title { color: #111c24; font-weight: 800; }
.auth__form .text-muted { color: #6d7a84; }
.auth__form .field > label { color: #263641; font-weight: 700; }
.auth__form .with-icon > .material-symbols-outlined { color: #95a5ae; }
.auth__form .field .control {
    border-color: #d9e3e7;
    color: #172530;
    box-shadow: 0 1px 2px rgba(16,24,40,.03);
}
.auth__form .field .control::placeholder { color: #89969f; }
.auth__form .field .control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(15,124,144,.13);
}
.auth__form a { color: var(--primary-600); font-weight: 700; }

/* ============================ Utilities ============================ */
.grid-2 { display: grid; grid-template-columns: 2fr 1fr; gap: var(--gutter); align-items: start; }
.stack { display: flex; flex-direction: column; gap: var(--space-4); }
.row { display: flex; align-items: center; gap: var(--space-3); }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.mt-4 { margin-top: var(--space-4); } .mt-6 { margin-top: var(--space-6); }
.mb-4 { margin-bottom: var(--space-4); } .mb-6 { margin-bottom: var(--space-6); }

/* ============================ Responsive ============================ */
@media (max-width: 1024px) {
    .grid-2 { grid-template-columns: 1fr; }
    .auth__brand { display: none; }
    .auth__form { width: 100%; }
}
@media (max-width: 768px) {
    :root { --container-padding: 16px; }
    .sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
    .sidebar.is-open { transform: translateX(0); }
    .main { margin-left: 0; }
    .menu-toggle { display: grid !important; }
    .page-title { font-size: 22px; }
    .topbar__search { display: none; }
    .user-chip__meta { display: none; }
    .floating-ticket-cta {
        right: 16px;
        bottom: 16px;
        width: 52px;
        height: 52px;
    }
    .floating-ticket-cta .material-symbols-outlined {
        font-size: 24px;
    }
    .floating-ticket-cta::before { display: none; }
}
.menu-toggle { display: none; }
