/* ==================================================================
       RECRUIT CRM - "LUMINOUS CYAN" DESIGN SYSTEM
       Light theme · Electric Cyan accents · Bento layout
       Every class name used by JavaScript.html is preserved.
       ================================================================== */
    @import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

    :root {
        /* Canvas & surfaces */
        --bg: #f8fafc;
        --bg-2: #f1f5f9;
        --card: #ffffff;
        --line: #e2e8f0;
        --line-soft: #eef2f7;

        /* Ink */
        --ink-900: #0f172a;
        --ink-700: #334155;
        --ink-600: #475569;
        --ink-500: #64748b;
        --ink-400: #64748b;   /* kept as a text colour by the app → AA-safe on white */
        --ink-300: #94a3b8;   /* decorative only */
        --ink-200: #cbd5e1;

        /* Cyan brand */
        --cyan-50: #ecfeff;
        --cyan-100: #cffafe;
        --cyan-200: #a5f3fc;
        --cyan-400: #22d3ee;
        --cyan-500: #06b6d4;
        --cyan-600: #0891b2;
        --cyan-700: #0e7490;
        --cyan-800: #155e75;
        --neon: #00d2eb;

        /* Legacy aliases (referenced inline by the app) → mapped to cyan */
        --brand: #0891b2;
        --brand-600: #0e7490;
        --brand-soft: #ecfeff;
        --teal: #0891b2;
        --teal-soft: #ecfeff;
        --navy-900: #0f172a;
        --navy-950: #0b1120;

        /* Semantic */
        --green: #059669;
        --green-500: #10b981;
        --green-soft: #ecfdf5;
        --amber: #b45309;
        --amber-500: #f59e0b;
        --amber-soft: #fffbeb;
        --rose: #e11d48;
        --rose-500: #f43f5e;
        --rose-soft: #fff1f2;
        --violet: #7c3aed;
        --violet-soft: #f5f3ff;
        --sky: #0369a1;
        --sky-soft: #f0f9ff;

        /* Shape & depth */
        --radius: 14px;
        --radius-sm: 10px;
        --radius-lg: 20px;
        --shadow-xs: 0 1px 2px rgba(15, 23, 42, .04);
        --shadow-sm: 0 1px 3px rgba(15, 23, 42, .05), 0 1px 2px rgba(15, 23, 42, .03);
        --shadow-md: 0 10px 25px -5px rgba(6, 182, 212, .08), 0 4px 10px -4px rgba(15, 23, 42, .06);
        --shadow-lg: 0 24px 48px -12px rgba(15, 23, 42, .18);
        --glow: 0 0 0 4px rgba(6, 182, 212, .14);

        /* Type */
        --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
        --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

        --sidebar-w: 252px;
        --sidebar-w-collapsed: 78px;
        --topbar-h: 68px;
    }

    /* ---------- Reset ---------- */
    *, *::before, *::after { box-sizing: border-box; }

    html, body {
        margin: 0;
        padding: 0;
        height: 100%;
        font-family: var(--font);
        font-size: 14px;
        background: var(--bg);
        color: var(--ink-900);
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        text-rendering: optimizeLegibility;
    }

    a { color: inherit; text-decoration: none; }
    button { font-family: inherit; }
    textarea { font-family: inherit; }
    svg { flex-shrink: 0; }
    b, strong { font-weight: 700; }

    ::selection { background: var(--cyan-100); color: var(--cyan-800); }
    ::-webkit-scrollbar { width: 10px; height: 10px; }
    ::-webkit-scrollbar-thumb { background: #d5dde8; border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }
    ::-webkit-scrollbar-thumb:hover { background: #b6c2d2; border: 3px solid transparent; background-clip: content-box; }
    ::-webkit-scrollbar-track { background: transparent; }

    :focus-visible { outline: 2px solid var(--cyan-500); outline-offset: 2px; }

    .mono, .num-cell { font-family: var(--mono); font-feature-settings: "tnum" 1; letter-spacing: -.01em; }
    .num-cell { font-size: 12.5px; font-weight: 500; white-space: nowrap; }

    /* ---------- Form controls (global) ---------- */
    input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
    select,
    textarea {
        font-family: var(--font);
        font-size: 13.5px;
        color: var(--ink-900);
        background: #fff;
        border: 1px solid var(--line);
        border-radius: 10px;
        padding: 10px 12px;
        transition: border-color .15s, box-shadow .15s, background .15s;
        box-shadow: var(--shadow-xs);
    }
    select {
        appearance: none;
        -webkit-appearance: none;
        padding-right: 34px;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 11px center;
        cursor: pointer;
    }
    input:hover:not(:focus), select:hover:not(:focus), textarea:hover:not(:focus) { border-color: #cfd8e3; }
    input:focus, select:focus, textarea:focus { outline: none; border-color: var(--cyan-500); box-shadow: var(--glow); }
    input::placeholder, textarea::placeholder { color: var(--ink-300); }
    input[type="file"] {
        font-family: var(--font);
        font-size: 12.5px;
        color: var(--ink-600);
        width: 100%;
        padding: 10px;
        border: 1.5px dashed var(--line);
        border-radius: 10px;
        background: var(--bg);
    }
    input[type="file"]::file-selector-button {
        font-family: var(--font);
        border: none;
        background: var(--cyan-50);
        color: var(--cyan-700);
        font-weight: 700;
        padding: 7px 12px;
        border-radius: 8px;
        margin-right: 10px;
        cursor: pointer;
    }

    .field { margin-bottom: 16px; position: relative; }
    .field label { font-size: 12px; font-weight: 700; color: var(--ink-700); display: block; margin-bottom: 7px; letter-spacing: .01em; }
    .field input:not([type="checkbox"]):not([type="radio"]),
    .field select,
    .field textarea { width: 100%; }
    .field.is-required label::after { content: ""; }
    .field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--rose-500); box-shadow: 0 0 0 4px rgba(244, 63, 94, .12); }
    .field .field-error { display: none; font-size: 11.5px; font-weight: 600; color: var(--rose); margin-top: 6px; }
    .field.invalid .field-error { display: flex; align-items: center; gap: 5px; }

    /* ---------- Buttons ---------- */
    .btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 10px 16px;
        min-height: 40px;
        border-radius: 10px;
        border: 1px solid transparent;
        cursor: pointer;
        font-size: 13px;
        font-weight: 700;
        letter-spacing: .005em;
        white-space: nowrap;
        transition: transform .08s ease, box-shadow .18s, background .18s, border-color .18s, color .18s;
    }
    .btn:active { transform: translateY(1px) scale(.99); }
    .btn svg { width: 16px; height: 16px; }
    .btn-primary {
        background: linear-gradient(135deg, var(--cyan-600) 0%, var(--cyan-700) 100%);
        color: #fff;
        box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 8px 18px -6px rgba(8, 145, 178, .55);
    }
    .btn-primary:hover { background: linear-gradient(135deg, var(--cyan-700) 0%, var(--cyan-800) 100%); box-shadow: 0 1px 0 rgba(255, 255, 255, .2) inset, 0 10px 22px -6px rgba(8, 145, 178, .6); }
    .btn-block { width: 100%; }
    .btn-ghost { background: #fff; color: var(--ink-700); border-color: var(--line); box-shadow: var(--shadow-xs); }
    .btn-ghost:hover { background: var(--bg); border-color: #cfd8e3; color: var(--ink-900); }
    .btn-soft { background: var(--cyan-50); color: var(--cyan-700); border-color: var(--cyan-100); }
    .btn-soft:hover { background: var(--cyan-100); border-color: var(--cyan-200); }
    .btn-danger { background: var(--rose-soft); color: var(--rose); border-color: #ffe0e6; }
    .btn-danger:hover { background: #ffe4e9; }
    .btn-sm { padding: 6px 11px; min-height: 32px; font-size: 12px; border-radius: 8px; gap: 6px; }
    .btn-sm svg { width: 14px; height: 14px; }
    .btn-icon { padding: 0; width: 40px; min-width: 40px; }
    .btn-icon.btn-sm { width: 32px; min-width: 32px; }
    .btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

    .link-btn { background: none; border: none; color: var(--cyan-700); cursor: pointer; font-size: 12.5px; font-weight: 700; padding: 0; display: inline-flex; align-items: center; gap: 4px; }
    .link-btn:hover { color: var(--cyan-800); text-decoration: underline; text-underline-offset: 3px; }

    .error-banner { background: var(--rose-soft); color: var(--rose); padding: 11px 13px; border-radius: 10px; font-size: 12.5px; margin-bottom: 16px; display: none; font-weight: 600; border: 1px solid #ffe0e6; }

    /* ---------- Boot loader ---------- */
    #bootLoader {
        position: fixed;
        inset: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        gap: 16px;
        background: radial-gradient(800px 400px at 50% 40%, var(--cyan-50), var(--bg) 70%);
        z-index: 9999;
        color: var(--ink-500);
    }
    #bootLoader .boot-mark { width: 52px; height: 52px; border-radius: 15px; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--cyan-400), var(--cyan-700)); color: #fff; font-weight: 800; font-size: 22px; box-shadow: 0 14px 30px -10px rgba(6, 182, 212, .6); }
    .spinner {
        width: 30px;
        height: 30px;
        border-radius: 50%;
        border: 3px solid var(--cyan-100);
        border-top-color: var(--cyan-500);
        animation: spin .75s linear infinite;
    }
    @keyframes spin { to { transform: rotate(360deg); } }

    /* ---------- Login ---------- */
    #loginScreen {
        position: fixed;
        inset: 0;
        display: none;
        align-items: stretch;
        justify-content: center;
        background: var(--bg);
    }
    .login-split { display: grid; grid-template-columns: 1.05fr 1fr; width: 100%; min-height: 100%; }
    .login-art {
        position: relative;
        overflow: hidden;
        background:
            radial-gradient(600px 380px at 15% 10%, rgba(34, 211, 238, .35), transparent 60%),
            radial-gradient(520px 420px at 90% 90%, rgba(8, 145, 178, .35), transparent 60%),
            linear-gradient(160deg, #0b1120 0%, #0f2a3a 55%, #0b3b4a 100%);
        color: #e2f7fb;
        padding: 52px;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }
    .login-art::before {
        content: "";
        position: absolute;
        inset: 0;
        background-image: linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
        background-size: 44px 44px;
        mask-image: radial-gradient(circle at 40% 40%, #000 0%, transparent 75%);
        -webkit-mask-image: radial-gradient(circle at 40% 40%, #000 0%, transparent 75%);
    }
    .login-art > * { position: relative; }
    .login-art .art-brand { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 16px; color: #fff; }
    .login-art .art-brand .mark { width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(135deg, var(--cyan-400), var(--cyan-600)); display: flex; align-items: center; justify-content: center; color: #04232c; font-weight: 800; box-shadow: 0 0 24px rgba(34, 211, 238, .55); }
    .login-art h2 { font-size: 38px; line-height: 1.12; letter-spacing: -.035em; margin: 0 0 14px; color: #fff; max-width: 460px; }
    .login-art h2 span { color: var(--cyan-400); }
    .login-art p { font-size: 14.5px; line-height: 1.65; color: #a8c6cf; max-width: 420px; margin: 0; }
    .art-stats { display: flex; gap: 12px; flex-wrap: wrap; }
    .art-stat { background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); border-radius: 14px; padding: 14px 16px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); min-width: 140px; }
    .art-stat .k { font-size: 11px; color: #8fb4bf; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
    .art-stat .v { font-family: var(--mono); font-size: 14px; color: #fff; margin-top: 6px; font-weight: 600; display: flex; align-items: center; gap: 7px; }
    .art-stat .v svg { color: var(--cyan-400); }

    .login-pane { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
    .login-card {
        width: 400px;
        max-width: 100%;
        background: var(--card);
        border-radius: 22px;
        padding: 40px 36px;
        border: 1px solid var(--line);
        box-shadow: var(--shadow-lg);
    }
    .login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 30px; }
    .login-brand .mark { width: 42px; height: 42px; border-radius: 12px; background: linear-gradient(135deg, var(--cyan-400), var(--cyan-700)); display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 17px; box-shadow: 0 10px 22px -8px rgba(6, 182, 212, .7); }
    .login-brand .txt { font-weight: 800; font-size: 16px; letter-spacing: -.02em; }
    .login-brand .sub { font-size: 11.5px; color: var(--ink-500); font-weight: 500; }
    .login-card h1 { font-size: 26px; margin: 0 0 6px; letter-spacing: -.03em; }
    .login-card p.hint { font-size: 13.5px; color: var(--ink-500); margin: 0 0 24px; line-height: 1.55; }
    .login-card .btn-primary { min-height: 46px; font-size: 14px; margin-top: 6px; }

    /* ---------- App shell ---------- */
    #appShell { display: none; height: 100vh; }
    .shell-grid { display: grid; grid-template-columns: var(--sidebar-w) 1fr; height: 100vh; transition: grid-template-columns .22s ease; }
    body.sidebar-collapsed .shell-grid { grid-template-columns: var(--sidebar-w-collapsed) 1fr; }

    .sidebar {
        background: rgba(255, 255, 255, .86);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border-right: 1px solid var(--line);
        display: flex;
        flex-direction: column;
        padding: 18px 14px 14px;
        min-width: 0;
        overflow: hidden;
        position: relative;
        z-index: 60;
    }
    .sidebar .brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 20px; min-width: 0; }
    .sidebar .brand .mark {
        width: 36px; height: 36px; border-radius: 11px;
        background: linear-gradient(135deg, var(--cyan-400), var(--cyan-700));
        display: flex; align-items: center; justify-content: center;
        color: #fff; font-weight: 800; font-size: 15px; flex-shrink: 0;
        box-shadow: 0 8px 18px -6px rgba(6, 182, 212, .65);
    }
    .sidebar .brand .txt { color: var(--ink-900); font-weight: 800; font-size: 15px; letter-spacing: -.02em; line-height: 1.2; white-space: nowrap; }
    .sidebar .brand .sub { font-size: 10.5px; color: var(--ink-500); font-weight: 600; white-space: nowrap; letter-spacing: .02em; }
    .sidebar-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; margin: 0 -6px; padding: 0 6px; }

    .nav-group { margin-top: 2px; }
    .nav-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-300); font-weight: 700; padding: 14px 12px 7px; white-space: nowrap; }
    .nav-item {
        position: relative;
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 10px 12px;
        min-height: 42px;
        border-radius: 11px;
        font-size: 13.5px;
        font-weight: 600;
        cursor: pointer;
        margin-bottom: 2px;
        color: var(--ink-600);
        transition: background .15s, color .15s;
        white-space: nowrap;
        border: none;
        background: none;
        width: 100%;
        text-align: left;
        font-family: inherit;
    }
    .nav-item .ic { width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; color: var(--ink-400); transition: color .15s; }
    .nav-item .ic svg { width: 19px; height: 19px; }
    .nav-item:hover { background: var(--bg-2); color: var(--ink-900); }
    .nav-item:hover .ic { color: var(--ink-700); }
    .nav-item.active { background: linear-gradient(90deg, var(--cyan-50), rgba(236, 254, 255, .4)); color: var(--cyan-800); }
    .nav-item.active .ic { color: var(--cyan-600); }
    .nav-item.active::before {
        content: "";
        position: absolute;
        left: -14px;
        top: 9px;
        bottom: 9px;
        width: 4px;
        border-radius: 0 4px 4px 0;
        background: var(--neon);
        box-shadow: 0 0 12px rgba(0, 210, 235, .8);
    }
    .nav-text { overflow: hidden; text-overflow: ellipsis; }

    .sidebar-footer { margin-top: 12px; padding: 12px 4px 0; border-top: 1px solid var(--line); }
    .user-chip { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line-soft); min-width: 0; }
    .user-chip .av {
        width: 34px; height: 34px; border-radius: 10px;
        background: linear-gradient(135deg, var(--cyan-100), var(--cyan-200));
        color: var(--cyan-800);
        display: flex; align-items: center; justify-content: center;
        font-size: 13.5px; font-weight: 800; flex-shrink: 0;
        position: relative;
    }
    .user-chip .av::after { content: ""; position: absolute; right: -2px; bottom: -2px; width: 10px; height: 10px; border-radius: 50%; background: var(--green-500); border: 2px solid #fff; }
    .user-chip .info { line-height: 1.3; overflow: hidden; flex: 1; min-width: 0; }
    .user-chip .name { font-size: 13px; font-weight: 700; color: var(--ink-900); white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
    .user-chip .role { font-size: 11px; color: var(--ink-500); font-weight: 600; }
    /* Account card in the sidebar footer: profile on top, two clear actions below */
    .account-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-xs); overflow: hidden; }
    .account-card .user-chip { background: none; border: 0; border-radius: 0; padding: 10px 12px; }
    .account-actions { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line-soft); background: var(--bg); }
    .account-actions form { margin: 0; display: flex; }
    .account-actions form + a, .account-actions > form { border-left: 1px solid var(--line-soft); }
    .acc-btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 6px; border: 0; background: none; cursor: pointer; font-family: inherit; font-size: 12px; font-weight: 700; color: var(--ink-600); text-decoration: none; transition: background .15s, color .15s; white-space: nowrap; }
    .acc-btn svg { width: 15px; height: 15px; flex-shrink: 0; }
    .acc-btn:hover { background: #fff; color: var(--cyan-700); }
    .acc-btn.danger:hover { background: var(--rose-soft); color: var(--rose); }
    .acc-btn:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--cyan-400); }
    .sidebar-actions { display: flex; gap: 6px; margin-top: 8px; }
    .sidebar-actions .btn { flex: 1; }
    .logout-btn { width: 100%; margin-top: 8px; }

    /* Collapsed sidebar */
    body.sidebar-collapsed .sidebar .brand .brand-text,
    body.sidebar-collapsed .sidebar .nav-text,
    body.sidebar-collapsed .sidebar .nav-label,
    body.sidebar-collapsed .sidebar .user-chip .info,
    body.sidebar-collapsed .sidebar .btn-label { display: none; }
    body.sidebar-collapsed .sidebar .brand { justify-content: center; padding-left: 0; padding-right: 0; }
    body.sidebar-collapsed .sidebar .nav-item { justify-content: center; padding: 10px 0; }
    body.sidebar-collapsed .sidebar .nav-label { display: block; height: 10px; padding: 0; font-size: 0; }
    body.sidebar-collapsed .sidebar .user-chip { justify-content: center; background: none; border-color: transparent; }
    body.sidebar-collapsed .sidebar .user-chip { flex-direction: column; gap: 4px; }
    body.sidebar-collapsed .sidebar .account-actions { grid-template-columns: 1fr; }
    body.sidebar-collapsed .sidebar .account-actions > form { border-left: 0; border-top: 1px solid var(--line-soft); }
    body.sidebar-collapsed .sidebar .account-card .user-chip { padding: 10px 0; }
    body.sidebar-collapsed .sidebar .sidebar-actions { flex-direction: column; }

    .main-col { display: flex; flex-direction: column; min-width: 0; height: 100vh; position: relative; }
    .topbar {
        height: var(--topbar-h);
        flex-shrink: 0;
        position: sticky;
        top: 0;
        z-index: 40;
        background: rgba(248, 250, 252, .78);
        backdrop-filter: blur(12px) saturate(160%);
        -webkit-backdrop-filter: blur(12px) saturate(160%);
        border-bottom: 1px solid rgba(226, 232, 240, .9);
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        padding: 0 28px;
    }
    .topbar-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
    .topbar-title { min-width: 0; }
    .breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; color: var(--ink-500); margin-bottom: 2px; white-space: nowrap; }
    .breadcrumb svg { width: 12px; height: 12px; color: var(--ink-300); }
    .breadcrumb .bc-link { cursor: pointer; }
    .breadcrumb .bc-link:hover { color: var(--cyan-700); }
    .breadcrumb .bc-current { color: var(--cyan-700); }
    .topbar h2 { font-size: 18px; margin: 0; letter-spacing: -.025em; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: inline; }
    .topbar .crumb { font-size: 12.5px; color: var(--ink-500); font-weight: 500; display: inline; margin-left: 10px; white-space: nowrap; }
    .topbar .title-row { display: flex; align-items: baseline; min-width: 0; overflow: hidden; }
    #topbarActions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
    .topbar-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
    .topbar-date { font-family: var(--mono); font-size: 11.5px; color: var(--ink-500); background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 6px 11px; display: inline-flex; align-items: center; gap: 6px; }
    .topbar-date svg { width: 13px; height: 13px; color: var(--cyan-600); }
    .icon-btn {
        width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line);
        background: #fff; color: var(--ink-600); cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
        transition: all .15s; flex-shrink: 0;
    }
    .icon-btn:hover { color: var(--cyan-700); border-color: var(--cyan-200); background: var(--cyan-50); }
    .icon-btn svg { width: 18px; height: 18px; }
    .mobile-only { display: none; }

    .content-scroll { flex: 1; overflow-y: auto; padding: 26px 28px 40px; scroll-behavior: smooth; }
    .content-scroll > * { animation: viewIn .28s ease both; }
    @keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

    .sidebar-backdrop { display: none; }

    /* ---------- Cards / grids ---------- */
    .card {
        background: var(--card);
        border-radius: var(--radius);
        box-shadow: var(--shadow-sm);
        border: 1px solid var(--line);
        transition: box-shadow .2s ease, border-color .2s ease, transform .2s ease;
        min-width: 0;
    }
    .card:hover { box-shadow: var(--shadow-md); }
    .card-pad { padding: 20px 22px; }
    .grid { display: grid; gap: 18px; }
    .grid > * { min-width: 0; }
    .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

    /* Bento utility grid (12 columns) */
    .bento { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 18px; margin-bottom: 18px; }
    .bento > * { min-width: 0; }
    .span-3 { grid-column: span 3; }
    .span-4 { grid-column: span 4; }
    .span-5 { grid-column: span 5; }
    .span-6 { grid-column: span 6; }
    .span-7 { grid-column: span 7; }
    .span-8 { grid-column: span 8; }
    .span-12 { grid-column: span 12; }

    .section-title { font-size: 14.5px; font-weight: 800; margin: 0 0 14px; letter-spacing: -.015em; display: flex; align-items: center; gap: 8px; }
    .section-title .st-ic { width: 28px; height: 28px; border-radius: 8px; background: var(--cyan-50); color: var(--cyan-700); display: inline-flex; align-items: center; justify-content: center; }
    .section-title .st-ic svg { width: 15px; height: 15px; }
    .section-sub { font-size: 12px; color: var(--ink-500); font-weight: 500; margin-top: 2px; }
    .section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 12px; flex-wrap: wrap; }

    /* ---------- Stat cards (used on Dashboard + Reports) ---------- */
    .stat-card { padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; position: relative; overflow: hidden; }
    .stat-card.clickable { cursor: pointer; }
    .stat-card.clickable:hover { border-color: var(--cyan-200); box-shadow: var(--shadow-md); transform: translateY(-2px); }
    .stat-card .top-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
    .stat-card .label { font-size: 12px; color: var(--ink-600); font-weight: 700; }
    .stat-card .icon { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 15px; }
    .stat-card .icon svg { width: 18px; height: 18px; }
    .stat-card .value { font-family: var(--mono); font-size: 25px; font-weight: 700; letter-spacing: -.03em; color: var(--ink-900); line-height: 1.2; }
    .stat-card .sub { font-size: 11.5px; color: var(--ink-500); font-weight: 500; }

    .ic-indigo, .ic-cyan { background: var(--cyan-50); color: var(--cyan-700); }
    .ic-teal { background: #effcfd; color: var(--cyan-600); }
    .ic-amber { background: var(--amber-soft); color: var(--amber); }
    .ic-rose { background: var(--rose-soft); color: var(--rose); }
    .ic-green { background: var(--green-soft); color: var(--green); }
    .ic-violet { background: var(--violet-soft); color: var(--violet); }
    .ic-slate { background: var(--bg-2); color: var(--ink-600); }

    /* ---------- KPI Bento cards (Dashboard) ---------- */
    .kpi-card { padding: 20px 20px 16px; display: flex; flex-direction: column; gap: 12px; position: relative; overflow: hidden; cursor: pointer; text-align: left; font-family: inherit; color: inherit; width: 100%; }
    .kpi-card::after {
        content: "";
        position: absolute;
        right: -60px; top: -60px;
        width: 160px; height: 160px; border-radius: 50%;
        background: radial-gradient(circle, rgba(34, 211, 238, .14), transparent 70%);
        pointer-events: none;
        transition: transform .4s ease;
    }
    .kpi-card:hover { border-color: var(--cyan-200); transform: translateY(-3px); box-shadow: 0 18px 36px -12px rgba(6, 182, 212, .22), 0 4px 10px -4px rgba(15, 23, 42, .06); }
    .kpi-card:hover::after { transform: scale(1.25); }
    .kpi-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
    .kpi-label { font-size: 12.5px; font-weight: 700; color: var(--ink-600); display: flex; align-items: center; gap: 9px; }
    .kpi-ic { width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; }
    .kpi-ic svg { width: 17px; height: 17px; }
    .kpi-go { width: 26px; height: 26px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; color: var(--ink-300); transition: all .2s; }
    .kpi-card:hover .kpi-go { color: var(--cyan-700); background: var(--cyan-50); transform: translateX(2px); }
    .kpi-go svg { width: 15px; height: 15px; }
    .kpi-main { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
    .kpi-value { font-family: var(--mono); font-size: 32px; font-weight: 700; letter-spacing: -.04em; line-height: 1; color: var(--ink-900); }
    .kpi-value small { font-size: 13px; font-weight: 600; color: var(--ink-500); letter-spacing: -.01em; margin-left: 4px; }
    .kpi-money { font-family: var(--mono); font-size: 12.5px; font-weight: 600; color: var(--cyan-700); }
    .kpi-money span { color: var(--ink-500); font-family: var(--font); font-weight: 600; font-size: 11.5px; }
    .kpi-foot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 11.5px; color: var(--ink-500); font-weight: 600; min-height: 24px; }
    .kpi-spark { display: block; width: 100%; height: 40px; }
    .kpi-mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; border-top: 1px dashed var(--line); padding-top: 11px; }
    .kpi-mini-stats > div { min-width: 0; }
    .kpi-mini-stats .k { font-size: 10.5px; color: var(--ink-500); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .kpi-mini-stats .v { font-family: var(--mono); font-size: 13px; font-weight: 700; color: var(--ink-900); margin-top: 2px; }

    /* Segmented distribution bar */
    .seg-bar { display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: var(--bg-2); gap: 2px; }
    .seg-bar > span { display: block; height: 100%; min-width: 2px; transition: width .5s ease; }
    .seg-legend { display: flex; gap: 10px; flex-wrap: wrap; font-size: 11px; color: var(--ink-500); font-weight: 600; }
    .seg-legend b { color: var(--ink-900); font-family: var(--mono); font-weight: 700; }
    .seg-legend { min-height: 16px; }
    .seg-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 3px; margin-right: 5px; vertical-align: -0.5px; }

    /* Chips / pills */
    .chip-delta, .chip-tag {
        display: inline-flex; align-items: center; gap: 4px;
        padding: 3px 8px; border-radius: 999px;
        font-size: 11px; font-weight: 700; white-space: nowrap;
        font-family: var(--mono); letter-spacing: -.01em;
    }
    .chip-delta svg, .chip-tag svg { width: 12px; height: 12px; }
    .chip-delta.up { background: var(--green-soft); color: var(--green); }
    .chip-delta.down { background: var(--rose-soft); color: var(--rose); }
    .chip-delta.flat { background: var(--bg-2); color: var(--ink-600); }
    .chip-tag { font-family: var(--font); letter-spacing: 0; }
    .chip-tag.cyan { background: var(--cyan-50); color: var(--cyan-700); box-shadow: 0 0 0 1px var(--cyan-100) inset; }
    .chip-tag.warn { background: var(--amber-soft); color: var(--amber); box-shadow: 0 0 0 1px #fde9b8 inset; }
    .chip-tag.ok { background: var(--green-soft); color: var(--green); }
    .chip-tag.danger { background: var(--rose-soft); color: var(--rose); }
    .chip-tag.slate { background: var(--bg-2); color: var(--ink-600); }
    .pulse-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; position: relative; display: inline-block; }
    .pulse-dot::after { content: ""; position: absolute; inset: -3px; border-radius: 50%; border: 2px solid currentColor; opacity: .5; animation: pulse 1.6s ease-out infinite; }
    @keyframes pulse { from { transform: scale(.6); opacity: .7; } to { transform: scale(1.8); opacity: 0; } }

    /* Secondary metric strip */
    .metric-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; padding: 0; overflow: hidden; margin-bottom: 18px; }
    .metric-cell { padding: 16px 20px; border-right: 1px solid var(--line-soft); display: flex; align-items: center; gap: 14px; cursor: default; min-width: 0; background: none; border-top: none; border-bottom: none; border-left: none; font-family: inherit; text-align: left; color: inherit; }
    .metric-cell:last-child { border-right: none; }
    .metric-cell.clickable { cursor: pointer; transition: background .15s; }
    .metric-cell.clickable:hover { background: var(--cyan-50); }
    .metric-cell .m-ic { width: 38px; height: 38px; border-radius: 11px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
    .metric-cell .m-ic svg { width: 18px; height: 18px; }
    .metric-cell .m-body { min-width: 0; }
    .metric-cell .m-label { font-size: 11.5px; color: var(--ink-500); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .metric-cell .m-value { font-family: var(--mono); font-size: 18px; font-weight: 700; letter-spacing: -.03em; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .metric-cell .m-sub { font-size: 11px; color: var(--ink-500); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

    /* ---------- Charts ---------- */
    .chart-box { position: relative; width: 100%; height: 300px; }
    .chart-box.sm { height: 220px; }
    .trend-card { display: flex; flex-direction: column; align-self: stretch; width: 100%; min-width: 0; }
    .trend-card .chart-box { height: 220px; min-height: 0; }
    .chart-box canvas { display: block; }
    .chart-summary { display: flex; gap: 26px; flex-wrap: wrap; margin-bottom: 14px; }
    .chart-summary .cs-k { font-size: 11px; color: var(--ink-500); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; display: flex; align-items: center; gap: 6px; }
    .chart-summary .cs-v { font-family: var(--mono); font-size: 19px; font-weight: 700; letter-spacing: -.03em; margin-top: 3px; }
    .chart-summary .cs-k i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; }

    .chart-tooltip {
        position: absolute;
        pointer-events: none;
        background: rgba(15, 23, 42, .94);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        color: #fff;
        border-radius: 12px;
        padding: 10px 12px;
        font-size: 12px;
        min-width: 150px;
        box-shadow: 0 16px 32px -10px rgba(15, 23, 42, .45);
        border: 1px solid rgba(34, 211, 238, .25);
        transform: translate(-50%, calc(-100% - 12px));
        transition: opacity .12s ease, left .1s ease, top .1s ease;
        z-index: 10;
        white-space: nowrap;
    }
    .chart-tooltip .tt-title { font-weight: 700; font-size: 11.5px; color: #a5f3fc; margin-bottom: 7px; letter-spacing: .02em; }
    .chart-tooltip .tt-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 4px; }
    .chart-tooltip .tt-row span { display: flex; align-items: center; gap: 7px; color: #cbd5e1; }
    .chart-tooltip .tt-row i { width: 8px; height: 8px; border-radius: 3px; display: inline-block; }
    .chart-tooltip .tt-row b { font-family: var(--mono); font-weight: 600; color: #fff; }

    /* Legacy SVG chart (fallback when Chart.js is unavailable) */
    .chart-legend { display: flex; gap: 16px; font-size: 11.5px; color: var(--ink-600); font-weight: 600; margin-bottom: 6px; }
    .chart-legend .legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: middle; }
    .combo-chart { width: 100%; height: auto; display: block; overflow: visible; }
    .chart-hit { cursor: pointer; }
    .chart-tip { opacity: 0; transition: opacity .12s ease; pointer-events: none; }
    .chart-hit:hover ~ .chart-tip { opacity: 1; }

    /* Segmented toggle */
    .tab-group { display: inline-flex; gap: 4px; flex-wrap: wrap; }
    .tab-pill {
        padding: 7px 13px;
        border-radius: 999px;
        font-size: 12px;
        font-weight: 700;
        cursor: pointer;
        background: #fff;
        border: 1px solid var(--line);
        color: var(--ink-600);
        transition: all .15s;
        white-space: nowrap;
        user-select: none;
        font-family: inherit;
        line-height: 1.3;
    }
    .tab-pill:hover { border-color: var(--cyan-200); color: var(--cyan-700); background: var(--cyan-50); }
    .tab-pill.active { background: var(--ink-900); color: #fff; border-color: var(--ink-900); box-shadow: 0 6px 14px -6px rgba(15, 23, 42, .5); }
    .segmented { display: inline-flex; background: var(--bg-2); border: 1px solid var(--line); border-radius: 11px; padding: 3px; gap: 2px; }
    .segmented .tab-pill { border: none; background: transparent; border-radius: 8px; padding: 6px 12px; }
    .segmented .tab-pill:hover { background: rgba(255, 255, 255, .7); }
    .segmented .tab-pill.active { background: #fff; color: var(--cyan-800); box-shadow: 0 1px 3px rgba(15, 23, 42, .1), 0 0 0 1px var(--cyan-100); }
    .spacer { flex: 1; }

    /* ---------- Funnel analytics ---------- */
    .funnel { display: flex; flex-direction: column; }
    .funnel-caption { font-size: 11px; color: var(--ink-500); font-weight: 600; margin: -6px 0 8px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
    .funnel-caption svg { width: 11px; height: 11px; }
    .funnel-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 10px; align-items: center; padding: 6px 0; border-radius: 8px; }
    .funnel-row .f-name { font-size: 12.5px; font-weight: 700; color: var(--ink-700); display: flex; align-items: center; gap: 8px; min-width: 0; }
    .funnel-row .f-name .f-idx { font-family: var(--mono); font-size: 10.5px; color: var(--ink-500); width: 20px; height: 20px; border-radius: 6px; background: var(--bg-2); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
    .funnel-row .f-name span.t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .funnel-row .f-count { font-family: var(--mono); font-size: 12.5px; font-weight: 700; text-align: right; white-space: nowrap; }
    .funnel-row .f-count small { font-weight: 500; color: var(--ink-500); margin-left: 4px; }
    .funnel-row .f-track { grid-column: 1 / -1; height: 8px; background: var(--bg-2); border-radius: 999px; overflow: hidden; position: relative; }
    .funnel-row .f-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--cyan-400), var(--cyan-600)); box-shadow: 0 0 10px rgba(34, 211, 238, .45); transition: width .6s cubic-bezier(.2, .8, .2, 1); }
    .funnel-row.is-win .f-fill { background: linear-gradient(90deg, #34d399, var(--green)); box-shadow: 0 0 10px rgba(16, 185, 129, .35); }
    .funnel-drop { display: inline-flex; align-items: center; gap: 2px; padding: 1px 6px 1px 4px; border-radius: 999px; background: var(--bg-2); font-family: var(--mono); font-size: 10px; font-weight: 700; color: var(--ink-600); flex-shrink: 0; }
    .funnel-drop svg { width: 10px; height: 10px; }
    .funnel-drop.bad { background: var(--rose-soft); }
    .funnel-drop.good { background: var(--green-soft); }
    .funnel-drop.bad { color: var(--rose); }
    .funnel-drop.good { color: var(--green); }
    .funnel-exits { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
    .funnel-exits .fx-title { width: 100%; font-size: 10.5px; color: var(--ink-500); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
    .funnel-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; padding: 12px 14px; background: linear-gradient(90deg, var(--cyan-50), #f7feff); border: 1px solid var(--cyan-100); border-radius: 12px; }
    .funnel-foot .k { font-size: 11.5px; font-weight: 700; color: var(--cyan-800); }
    .funnel-foot .v { font-family: var(--mono); font-size: 18px; font-weight: 700; color: var(--cyan-800); }

    /* ---------- Leaderboard ---------- */
    .leaderboard-row { margin-bottom: 14px; display: grid; grid-template-columns: 30px 1fr; gap: 0 12px; align-items: center; }
    .leaderboard-row:last-child { margin-bottom: 0; }
    .leaderboard-row .lb-rank { grid-row: span 2; width: 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-weight: 700; font-size: 12px; background: var(--bg-2); color: var(--ink-600); }
    .leaderboard-row .lb-rank.r1 { background: linear-gradient(135deg, var(--cyan-400), var(--cyan-600)); color: #fff; box-shadow: 0 6px 14px -6px rgba(6, 182, 212, .8); }
    .leaderboard-row .lb-rank.r2 { background: var(--cyan-100); color: var(--cyan-800); }
    .leaderboard-row .lb-rank.r3 { background: var(--cyan-50); color: var(--cyan-700); }
    .leaderboard-row .lb-top { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; margin-bottom: 6px; gap: 8px; min-width: 0; }
    .leaderboard-row .lb-top .row-link { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .leaderboard-row .lb-top b { font-family: var(--mono); font-weight: 600; font-size: 12px; white-space: nowrap; }

    /* ---------- Donut / gauges ---------- */
    .donut-card { display: flex; align-items: center; gap: 16px; }
    .donut-card .donut-label { font-size: 12.5px; color: var(--ink-700); font-weight: 700; margin-bottom: 4px; }
    .donut-card .donut-sub { font-size: 11.5px; color: var(--ink-500); }
    .donut-card svg text { font-family: var(--mono); }
    .donut-wrap { display: grid; grid-template-columns: 136px minmax(0, 1fr); gap: 18px; align-items: center; }
    .donut-canvas { position: relative; width: 136px; height: 136px; }
    .donut-canvas > svg { width: 136px; height: 136px; }
    .donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; text-align: center; }
    .donut-center .dc-v { font-family: var(--mono); font-size: 20px; font-weight: 700; letter-spacing: -.03em; }
    .donut-center .dc-k { font-size: 10.5px; color: var(--ink-500); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
    .legend-list { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
    .legend-list .li { display: flex; align-items: flex-start; gap: 9px; min-width: 0; }
    .legend-list .li i { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; margin-top: 3px; }
    .legend-list .li .lk { font-size: 12px; font-weight: 700; color: var(--ink-700); flex: 1; min-width: 0; line-height: 1.35; }
    .legend-list .li .lv { display: block; font-family: var(--mono); font-size: 11.5px; font-weight: 600; color: var(--ink-900); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .rate-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--line); }
    .rate-pair .donut-card { gap: 10px; }

    /* ---------- Urgency radar ---------- */
    .radar-list { display: flex; flex-direction: column; gap: 8px; }
    .radar-item { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; border: 1px solid var(--line-soft); background: var(--bg); cursor: pointer; transition: all .15s; width: 100%; text-align: left; font-family: inherit; color: inherit; }
    .radar-item:hover { border-color: #fde9b8; background: var(--amber-soft); transform: translateX(2px); }
    .radar-item .r-ic { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: var(--amber-soft); color: var(--amber); }
    .radar-item.critical .r-ic { background: var(--rose-soft); color: var(--rose); }
    .radar-item .r-ic svg { width: 17px; height: 17px; }
    .radar-item .r-body { flex: 1; min-width: 0; }
    .radar-item .r-name { font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .radar-item .r-sub { font-size: 11.5px; color: var(--ink-500); font-weight: 500; }
    .radar-item .r-arrow { color: var(--ink-300); }
    .radar-item .r-arrow svg { width: 16px; height: 16px; }
    .radar-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 26px 10px; text-align: center; color: var(--ink-500); font-size: 12.5px; font-weight: 600; }
    .radar-empty .re-ic { width: 46px; height: 46px; border-radius: 14px; background: var(--green-soft); color: var(--green); display: flex; align-items: center; justify-content: center; }

    /* ---------- Tables ---------- */
    .table-wrap { overflow-x: auto; border-radius: var(--radius); }
    table.data-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; font-variant-numeric: tabular-nums; }
    table.data-table thead th {
        position: sticky; top: 0;
        text-align: left;
        font-size: 10.5px;
        text-transform: uppercase;
        letter-spacing: .07em;
        color: var(--ink-500);
        padding: 12px 16px;
        background: #fbfcfe;
        border-bottom: 1px solid var(--line);
        font-weight: 800;
        white-space: nowrap;
    }
    table.data-table tbody td { padding: 13px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; color: var(--ink-700); }
    table.data-table tbody tr { transition: background .12s, box-shadow .12s; }
    table.data-table tbody tr:hover { background: linear-gradient(90deg, rgba(236, 254, 255, .75), rgba(236, 254, 255, .25)); }
    table.data-table tbody tr:hover td:first-child { box-shadow: inset 3px 0 0 var(--cyan-400); }
    table.data-table tbody tr:last-child td { border-bottom: none; }
    table.data-table td:last-child { white-space: nowrap; text-align: right; }
    table.data-table th:last-child { text-align: right; }
    table.data-table tbody tr .row-actions { opacity: .55; transition: opacity .15s; }
    table.data-table tbody tr:hover .row-actions { opacity: 1; }
    .card > .table-wrap table.data-table thead th:first-child { border-top-left-radius: var(--radius); }
    .card > .table-wrap table.data-table thead th:last-child { border-top-right-radius: var(--radius); }
    .card-pad .table-wrap { border: 1px solid var(--line); }

    .row-link { cursor: pointer; font-weight: 700; color: var(--ink-900); transition: color .12s; }
    .row-link:hover { color: var(--cyan-700); }
    .muted { color: var(--ink-500); }
    .small { font-size: 12px; }
    .avatar-sm { width: 28px; height: 28px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; background: var(--cyan-50); color: var(--cyan-800); font-size: 11.5px; font-weight: 800; margin-right: 10px; vertical-align: middle; flex-shrink: 0; }
    .cell-flex { display: inline-flex; align-items: center; }

    /* ---------- Badges ---------- */
    .badge {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 4px 10px 4px 9px;
        border-radius: 999px;
        font-size: 11.5px;
        font-weight: 700;
        white-space: nowrap;
        line-height: 1.35;
        box-shadow: 0 0 0 1px rgba(15, 23, 42, .04) inset;
    }
    .badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; flex-shrink: 0; }
    .badge-dot { width: 6px; height: 6px; border-radius: 50%; }
    .badge-open { background: var(--cyan-50); color: var(--cyan-700); box-shadow: 0 0 0 1px var(--cyan-100) inset, 0 0 12px -2px rgba(34, 211, 238, .35); }
    .badge-hold { background: var(--amber-soft); color: var(--amber); }
    .badge-hired { background: var(--green-soft); color: var(--green); }
    .badge-nohire { background: var(--rose-soft); color: var(--rose); }
    .badge-cancelled { background: var(--bg-2); color: var(--ink-600); }
    .badge-active { background: var(--green-soft); color: var(--green); }
    .badge-inactive { background: var(--bg-2); color: var(--ink-600); }

    /* Pipeline stage badges */
    .stage-Sourced { background: #f1f5f9; color: #475569; }
    .stage-Screened { background: #ecfeff; color: #0e7490; }
    .stage-Interview-by-Merojob { background: #e0f7fb; color: #155e75; }
    .stage-Profile-Submitted-to-Client { background: #f0f9ff; color: #0369a1; }
    .stage-Profile-Shortlisted-by-Client { background: #eef6ff; color: #1d4ed8; }
    .stage-Profile-not-Shortlisted-by-Client { background: #fff1f2; color: #be123c; }
    .stage-Interview-scheduled-by-client { background: #f5f3ff; color: #6d28d9; }
    .stage-Attended-Interview { background: #faf5ff; color: #7e22ce; }
    .stage-Not-attended-Interview { background: #fff1f2; color: #e11d48; }
    .stage-Selected-but-on-hold { background: #fffbeb; color: #b45309; }
    .stage-Offered-by-Client { background: #fefce8; color: #a16207; }
    .stage-Offer-Rejected { background: #fff1f2; color: #be123c; }
    .stage-Hired { background: #ecfdf5; color: #047857; box-shadow: 0 0 0 1px #a7f3d0 inset; }
    .stage-Rejected { background: #fff1f2; color: #e11d48; }

    /* Lead stage badges */
    .leadstage-New { background: #f1f5f9; color: #475569; }
    .leadstage-Contacted { background: #ecfeff; color: #0e7490; }
    .leadstage-Meeting-Scheduled { background: #f0f9ff; color: #0369a1; }
    .leadstage-Proposal-Sent { background: #f5f3ff; color: #6d28d9; }
    .leadstage-Negotiation { background: #fffbeb; color: #b45309; }
    .leadstage-Converted { background: #ecfdf5; color: #047857; box-shadow: 0 0 0 1px #a7f3d0 inset; }
    .leadstage-Lost { background: #fff1f2; color: #e11d48; }

    /* Audit trail */
    .audit-action-badge { background: var(--bg-2); color: var(--ink-600); }
    .audit-actor { font-weight: 700; color: var(--ink-900); }
    .audit-mini-item .timeline-ic { background: var(--bg-2); color: var(--ink-600); }

    /* ---------- Toolbar / filters ---------- */
    .toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
    .toolbar > select, .toolbar > input { min-height: 40px; }
    .search-box {
        display: flex; align-items: center; gap: 9px;
        background: #fff;
        border: 1px solid var(--line);
        border-radius: 11px;
        padding: 0 12px;
        min-height: 42px;
        flex: 1;
        min-width: 220px;
        max-width: 380px;
        box-shadow: var(--shadow-xs);
        transition: border-color .15s, box-shadow .15s;
        position: relative;
    }
    .search-box:focus-within { border-color: var(--cyan-500); box-shadow: var(--glow); }
    .search-box > span, .search-box > svg { color: var(--ink-400); display: inline-flex; }
    .search-box svg { width: 16px; height: 16px; }
    .search-box input,
    .search-box input:not([type="checkbox"]):not([type="radio"]):not([type="file"]) { border: none !important; outline: none; box-shadow: none !important; font-size: 13.5px; width: 100%; background: transparent; padding: 10px 0; }
    .search-box .kbd { font-family: var(--mono); font-size: 10.5px; color: var(--ink-500); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px; background: var(--bg); }
    .search-box.loading::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, transparent, var(--cyan-400), transparent); background-size: 200% 100%; animation: shimmer 1s linear infinite; }
    @keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
    .result-count { font-size: 12px; font-weight: 600; color: var(--ink-500); margin-left: auto; }
    .result-count b { font-family: var(--mono); color: var(--ink-900); }

    /* ---------- Modal ---------- */
    .modal-overlay {
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, .32);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        display: none;
        align-items: center;
        justify-content: center;
        z-index: 200;
        padding: 20px;
        animation: fadeIn .18s ease;
    }
    @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
    .modal-box {
        background: #fff;
        border-radius: var(--radius-lg);
        width: 580px;
        max-width: 100%;
        max-height: 90vh;
        display: flex;
        flex-direction: column;
        border: 1px solid var(--line);
        box-shadow: 0 30px 60px -15px rgba(15, 23, 42, .35), 0 0 0 1px rgba(255, 255, 255, .5) inset;
        animation: pop .22s cubic-bezier(.2, .9, .3, 1.15);
        overflow: hidden;
    }
    @keyframes pop { from { transform: translateY(8px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
    .modal-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 22px; border-bottom: 1px solid var(--line-soft); background: linear-gradient(180deg, #fbfeff, #fff); flex-shrink: 0; }
    .modal-head h3 { margin: 0; font-size: 16px; letter-spacing: -.02em; font-weight: 800; display: flex; align-items: center; gap: 10px; min-width: 0; }
    .modal-head h3::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--neon); box-shadow: 0 0 10px rgba(0, 210, 235, .9); flex-shrink: 0; }
    .modal-close { cursor: pointer; color: var(--ink-500); font-size: 20px; line-height: 1; background: var(--bg); border: 1px solid var(--line); width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; transition: all .15s; }
    .modal-close:hover { color: var(--ink-900); background: var(--bg-2); }
    /* The form wraps head/body/foot, so it must be the flex column that lets the body scroll. */
    .modal-box > form { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; margin: 0; }
    .modal-body { padding: 20px 22px 6px; overflow-y: auto; flex: 1 1 auto; min-height: 0; overscroll-behavior: contain; }
    .modal-foot { padding: 14px 22px; border-top: 1px solid var(--line-soft); display: flex; justify-content: flex-end; gap: 10px; background: #fcfdfe; flex-shrink: 0; }
    .form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
    /* KPI target + weight rows: wide target (80%), narrow weight (20%) */
    .form-row-2:has(.kpi-weight-input), .form-row-2:has(.kpi-w) { grid-template-columns: 4fr 1fr; }
    .modal-hero { display: flex; gap: 14px; align-items: flex-start; padding: 14px; border-radius: 14px; background: linear-gradient(135deg, var(--cyan-50), #f6feff); border: 1px solid var(--cyan-100); margin-bottom: 16px; }
    .modal-hero .mh-ic { width: 42px; height: 42px; border-radius: 12px; background: linear-gradient(135deg, var(--cyan-400), var(--cyan-700)); color: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: 0 8px 16px -6px rgba(6, 182, 212, .7); }
    .modal-hero .mh-ic svg { width: 20px; height: 20px; }
    .modal-hero.danger { background: var(--rose-soft); border-color: #ffe0e6; }
    .modal-hero.danger .mh-ic { background: linear-gradient(135deg, #fb7185, var(--rose)); box-shadow: 0 8px 16px -6px rgba(225, 29, 72, .6); }
    .modal-hero .mh-t { font-size: 14px; font-weight: 800; margin-bottom: 3px; }
    .modal-hero .mh-s { font-size: 12.5px; color: var(--ink-600); line-height: 1.55; }
    .check-list { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
    .check-list li { position: relative; padding-left: 24px; font-size: 12.5px; color: var(--ink-700); font-weight: 500; line-height: 1.5; }
    .check-list li svg { position: absolute; left: 0; top: 2px; width: 15px; height: 15px; color: var(--green); }

    /* ---------- Detail page ---------- */
    .back-link { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-600); cursor: pointer; margin-bottom: 14px; font-weight: 700; padding: 6px 10px 6px 8px; border-radius: 9px; border: 1px solid var(--line); background: #fff; transition: all .15s; }
    .back-link svg { width: 14px; height: 14px; transition: transform .15s; }
    .back-link:hover { color: var(--cyan-700); border-color: var(--cyan-200); background: var(--cyan-50); }
    .back-link:hover svg { transform: translateX(-2px); }
    .detail-header {
        display: flex; align-items: flex-start; justify-content: space-between;
        margin-bottom: 18px; gap: 16px; flex-wrap: wrap;
        padding: 20px 22px;
        background: #fff;
        border: 1px solid var(--line);
        border-radius: var(--radius);
        box-shadow: var(--shadow-sm);
        position: relative;
        overflow: hidden;
    }
    .detail-header::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--cyan-400), var(--cyan-600) 40%, transparent); }
    .detail-header > div:last-child { flex-wrap: wrap; }
    .detail-header select { min-height: 40px; font-weight: 600; }
    .detail-title { font-size: 21px; font-weight: 800; letter-spacing: -.03em; margin: 0 0 6px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
    .detail-sub { font-size: 13px; color: var(--ink-600); line-height: 1.6; }
    .kv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 22px; }
    .kv-item { min-width: 0; }
    .kv-item .k { font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-500); font-weight: 800; margin-bottom: 4px; }
    .kv-item .v { font-size: 13.5px; color: var(--ink-900); font-weight: 600; overflow-wrap: anywhere; }
    .tabs-underline { display: flex; gap: 22px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
    .tab-underline-item { padding: 10px 2px; font-size: 13.5px; font-weight: 700; color: var(--ink-500); cursor: pointer; border-bottom: 2px solid transparent; }
    .tab-underline-item.active { color: var(--cyan-700); border-color: var(--cyan-500); }

    /* ---------- Steppers (lead stage + job order pipeline) ---------- */
    .stepper-card { margin-bottom: 18px; }
    .stepper { display: flex; align-items: flex-start; gap: 0; overflow-x: auto; padding: 4px 2px 2px; }
    .step { flex: 1; min-width: 104px; display: flex; flex-direction: column; align-items: center; text-align: center; position: relative; padding: 0 4px; background: none; border: none; font-family: inherit; color: inherit; }
    .step::before { content: ""; position: absolute; top: 17px; left: calc(-50% + 22px); right: calc(50% + 22px); height: 3px; border-radius: 3px; background: var(--line); }
    .step:first-child::before { display: none; }
    .step.done::before, .step.current::before { background: linear-gradient(90deg, var(--cyan-500), var(--cyan-400)); box-shadow: 0 0 8px rgba(34, 211, 238, .5); }
    .step .s-dot {
        width: 36px; height: 36px; border-radius: 50%;
        display: flex; align-items: center; justify-content: center;
        background: #fff; border: 2px solid var(--line); color: var(--ink-500);
        font-family: var(--mono); font-size: 12px; font-weight: 700;
        position: relative; z-index: 1; transition: all .2s;
    }
    .step .s-dot svg { width: 16px; height: 16px; }
    .step.done .s-dot { background: var(--cyan-500); border-color: var(--cyan-500); color: #fff; }
    .step.current .s-dot { background: #fff; border-color: var(--cyan-500); color: var(--cyan-700); box-shadow: 0 0 0 5px rgba(6, 182, 212, .15), 0 0 18px rgba(34, 211, 238, .5); }
    .step.won .s-dot { background: var(--green-500); border-color: var(--green-500); color: #fff; box-shadow: 0 0 0 5px rgba(16, 185, 129, .15); }
    .step.lost .s-dot { background: var(--rose-500); border-color: var(--rose-500); color: #fff; }
    .step .s-label { font-size: 11.5px; font-weight: 700; color: var(--ink-600); margin-top: 9px; line-height: 1.3; }
    .step.current .s-label, .step.done .s-label { color: var(--ink-900); }
    .step .s-meta { font-family: var(--mono); font-size: 11px; color: var(--ink-500); margin-top: 2px; font-weight: 600; }
    .step .s-count { font-family: var(--mono); font-size: 17px; font-weight: 700; color: var(--ink-900); margin-top: 3px; }
    .step.clickable { cursor: pointer; }
    .step.clickable:hover .s-dot { border-color: var(--cyan-400); color: var(--cyan-700); transform: scale(1.06); }
    .stepper-note { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); font-size: 12px; color: var(--ink-500); font-weight: 600; }

    /* ---------- Logs / timeline ---------- */
    .log-form { display: flex; gap: 10px; margin-bottom: 16px; align-items: flex-start; flex-wrap: wrap; padding: 12px; background: var(--bg); border: 1px solid var(--line-soft); border-radius: 12px; }
    .log-form select { max-width: 160px; }
    .log-form textarea { flex: 1; min-width: 220px; resize: vertical; min-height: 42px; }
    .timeline { display: flex; flex-direction: column; gap: 0; position: relative; }
    .timeline-item { display: flex; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line-soft); position: relative; }
    .timeline-item:last-child { border-bottom: none; }
    .timeline-ic {
        width: 34px; height: 34px; border-radius: 10px;
        background: var(--cyan-50); color: var(--cyan-700);
        display: flex; align-items: center; justify-content: center;
        font-size: 13px; flex-shrink: 0; font-weight: 800;
    }
    .timeline-ic svg { width: 16px; height: 16px; }
    .tl-call { background: var(--cyan-50); color: var(--cyan-700); }
    .tl-meeting { background: var(--violet-soft); color: var(--violet); }
    .tl-interview { background: var(--amber-soft); color: var(--amber); }
    .tl-whatsapp { background: var(--green-soft); color: var(--green); }
    .tl-email { background: var(--sky-soft); color: var(--sky); }
    .tl-visit { background: #fdf2f8; color: #be185d; }
    .tl-other { background: var(--bg-2); color: var(--ink-600); }
    .timeline-body { flex: 1; min-width: 0; }
    .timeline-top { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; flex-wrap: wrap; }
    .timeline-type { font-size: 12.5px; font-weight: 800; }
    .timeline-meta { font-size: 11.5px; color: var(--ink-500); font-weight: 500; }
    .timeline-note { font-size: 13px; color: var(--ink-700); line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
    .log-pill { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 6px; font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
    .timeline-time { font-family: var(--mono); font-size: 11px; color: var(--ink-500); white-space: nowrap; margin-left: auto; }

    /* Dashboard activity feed (vertical rail) */
    .feed .timeline-item { border-bottom: none; padding: 10px 0; }
    .feed .timeline-item::before { content: ""; position: absolute; left: 16px; top: 46px; bottom: -8px; width: 2px; background: var(--line-soft); }
    .feed .timeline-item:last-child::before { display: none; }
    .feed-scroll { max-height: 470px; overflow-y: auto; margin-right: -10px; padding-right: 10px; }

    /* ---------- Pipeline board ---------- */
    .pipeline-board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 10px; scroll-snap-type: x proximity; }
    .pipeline-col { min-width: 218px; width: 218px; flex-shrink: 0; background: var(--bg); border: 1px solid var(--line-soft); border-radius: 14px; padding: 10px; scroll-snap-align: start; }
    .pipeline-col-head { font-size: 11.5px; font-weight: 800; color: var(--ink-600); padding: 4px 4px 10px; display: flex; justify-content: space-between; align-items: center; gap: 6px; }
    .pipeline-col-head > span:last-child { font-family: var(--mono); background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; font-size: 11px; }
    .pipeline-col-head .badge { white-space: normal; text-align: left; }
    .pipeline-card { background: #fff; border-radius: 12px; padding: 12px; margin-bottom: 8px; box-shadow: var(--shadow-xs); border: 1px solid var(--line); position: relative; transition: all .15s; }
    .pipeline-card:hover { border-color: var(--cyan-200); box-shadow: var(--shadow-md); transform: translateY(-1px); }
    .pipeline-card .card-top-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; }
    .pipeline-card .cname { font-size: 13px; font-weight: 800; margin-bottom: 2px; cursor: pointer; }
    .pipeline-card .cname:hover { color: var(--cyan-700); }
    .pipeline-card .csrc { font-size: 11px; color: var(--ink-500); margin-bottom: 9px; font-weight: 500; }
    .pipeline-card select { width: 100%; font-size: 11.5px; padding: 6px 28px 6px 9px; border-radius: 8px; background-position: right 8px center; }

    .card-menu-wrap { position: relative; flex-shrink: 0; }
    .card-menu-btn { background: none; border: none; cursor: pointer; font-size: 15px; line-height: 1; color: var(--ink-500); padding: 3px 6px; border-radius: 7px; }
    .card-menu-btn:hover { background: var(--bg-2); color: var(--ink-900); }
    .card-menu-dropdown { position: absolute; top: 100%; right: 0; margin-top: 4px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); z-index: 30; display: none; min-width: 200px; overflow: hidden; padding: 4px; }
    .card-menu-dropdown.open { display: block; animation: pop .15s ease; }
    .card-menu-dropdown button { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 9px 11px; background: none; border: none; cursor: pointer; font-size: 12.5px; font-weight: 700; color: var(--rose); border-radius: 8px; font-family: inherit; }
    .card-menu-dropdown button:hover { background: var(--rose-soft); }

    .pipeline-summary { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
    .pipeline-summary .chip { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 11px 16px; min-width: 116px; box-shadow: var(--shadow-xs); }
    .pipeline-summary .chip .num { font-family: var(--mono); font-size: 20px; font-weight: 700; display: block; letter-spacing: -.03em; }
    .pipeline-summary .chip .lbl { font-size: 10.5px; color: var(--ink-500); font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }

    /* ---------- Empty state ---------- */
    .empty-state { text-align: center; padding: 48px 20px; color: var(--ink-500); }
    .empty-state .big-ic { width: 56px; height: 56px; border-radius: 16px; margin: 0 auto 14px; background: linear-gradient(135deg, var(--cyan-50), var(--cyan-100)); color: var(--cyan-700); display: flex; align-items: center; justify-content: center; font-size: 22px; }
    .empty-state .big-ic svg { width: 24px; height: 24px; }
    .empty-state .msg { font-size: 14px; font-weight: 800; color: var(--ink-700); margin-bottom: 4px; }
    .empty-state .sub { font-size: 12.5px; }
    .empty-state.small { padding: 22px 14px; font-size: 12.5px; }

    /* Skeleton loader */
    .skeleton-wrap { display: grid; gap: 18px; }
    .skel { border-radius: var(--radius); background: linear-gradient(90deg, #eef2f7 0%, #f6f9fc 40%, #eef2f7 80%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }

    /* ---------- Toasts ---------- */
    #toastHost { position: fixed; bottom: 22px; right: 22px; z-index: 500; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
    .toast {
        display: flex; align-items: flex-start; gap: 11px;
        background: #fff;
        color: var(--ink-900);
        padding: 12px 14px 12px 12px;
        border-radius: 14px;
        font-size: 13px;
        border: 1px solid var(--line);
        box-shadow: 0 20px 40px -14px rgba(15, 23, 42, .28);
        animation: toastIn .28s cubic-bezier(.2, .9, .3, 1.2);
        max-width: 380px;
        min-width: 260px;
        font-weight: 600;
        line-height: 1.45;
        position: relative;
        overflow: hidden;
    }
    .toast .t-ic { width: 28px; height: 28px; border-radius: 9px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: var(--cyan-50); color: var(--cyan-700); }
    .toast .t-ic svg { width: 15px; height: 15px; }
    .toast .t-msg { flex: 1; padding-top: 4px; }
    .toast .t-x { background: none; border: none; color: var(--ink-400); cursor: pointer; padding: 4px; border-radius: 6px; display: inline-flex; }
    .toast .t-x:hover { background: var(--bg-2); color: var(--ink-900); }
    .toast .t-x svg { width: 14px; height: 14px; }
    .toast::after { content: ""; position: absolute; left: 0; bottom: 0; height: 3px; background: var(--cyan-400); animation: toastBar 3.8s linear forwards; }
    .toast.ok .t-ic { background: var(--green-soft); color: var(--green); }
    .toast.ok::after { background: var(--green-500); }
    .toast.err .t-ic { background: var(--rose-soft); color: var(--rose); }
    .toast.err::after { background: var(--rose-500); }
    .toast.leaving { animation: toastOut .22s ease forwards; }
    @keyframes toastIn { from { transform: translateY(12px) scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
    @keyframes toastOut { to { transform: translateX(20px); opacity: 0; } }
    @keyframes toastBar { from { width: 100%; } to { width: 0; } }
    @keyframes slideUp { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }

    /* ---------- Misc ---------- */
    .file-drop { border: 1.5px dashed var(--line); border-radius: 12px; padding: 16px; text-align: center; font-size: 12.5px; color: var(--ink-600); cursor: pointer; background: var(--bg); }
    .file-drop:hover { border-color: var(--cyan-400); background: var(--cyan-50); }
    .chip-file { display: inline-flex; align-items: center; gap: 7px; background: var(--cyan-50); color: var(--cyan-800); padding: 7px 12px; border-radius: 9px; font-size: 12px; font-weight: 700; margin-top: 8px; border: 1px solid var(--cyan-100); transition: all .15s; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .chip-file:hover { background: var(--cyan-100); }
    .chip-file svg { width: 14px; height: 14px; }
    .progress-bar { height: 7px; border-radius: 999px; background: var(--bg-2); overflow: hidden; }
    .progress-bar > div { height: 100%; background: linear-gradient(90deg, var(--cyan-400), var(--cyan-600)); border-radius: 999px; transition: width .6s cubic-bezier(.2, .8, .2, 1); }
    .divider { height: 1px; background: var(--line); margin: 18px 0; }
    .required-mark { color: var(--rose); }

    .assign-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
    .assign-row .assign-row-select { flex: 1; min-width: 0; }

    /* KPI metric cards */
    .kpi-metric-card { cursor: pointer; }
    .kpi-metric-card:hover { border-color: var(--cyan-200); box-shadow: var(--shadow-md); transform: translateY(-2px); }
    .kpi-metric-card.selected { border-color: var(--cyan-500); box-shadow: var(--glow), var(--shadow-md); }
    .kpi-weight-input, .kpi-target-input { font-family: var(--mono) !important; }

    /* ---------- Responsive ---------- */
    @media (max-width: 1280px) {
        .span-3 { grid-column: span 6; }
        .span-4 { grid-column: span 6; }
        .span-8 { grid-column: span 12; }
        .span-5, .span-7 { grid-column: span 12; }
        .metric-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
        .metric-cell:nth-child(2) { border-right: none; }
        .metric-cell:nth-child(-n+2) { border-bottom: 1px solid var(--line-soft); }
    }
    @media (max-width: 1100px) {
        .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
        .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    }
    @media (max-width: 1024px) {
        .shell-grid, body.sidebar-collapsed .shell-grid { grid-template-columns: 1fr; }
        .sidebar {
            position: fixed; top: 0; bottom: 0; left: 0;
            width: var(--sidebar-w);
            transform: translateX(-102%);
            transition: transform .25s ease;
            box-shadow: var(--shadow-lg);
            background: #fff;
        }
        body.sidebar-open .sidebar { transform: none; }
        body.sidebar-collapsed .sidebar .brand .brand-text,
        body.sidebar-collapsed .sidebar .nav-text,
        body.sidebar-collapsed .sidebar .user-chip .info,
        body.sidebar-collapsed .sidebar .btn-label { display: initial; }
        body.sidebar-collapsed .sidebar .nav-label { display: block; height: auto; padding: 14px 12px 7px; font-size: 10.5px; }
        body.sidebar-collapsed .sidebar .nav-item { justify-content: flex-start; padding: 10px 12px; }
        .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(15, 23, 42, .3); backdrop-filter: blur(3px); z-index: 55; opacity: 0; pointer-events: none; transition: opacity .2s; }
        body.sidebar-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }
        .mobile-only { display: inline-flex; }
        .desktop-only { display: none !important; }
        .topbar { padding: 0 16px; }
        .content-scroll { padding: 18px 16px 32px; }
    }
    @media (max-width: 860px) {
        .login-split { grid-template-columns: 1fr; }
        .login-art { display: none; }
        .topbar .crumb { display: none; }
        .topbar-date { display: none; }
    }
    @media (max-width: 720px) {
        .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
        .grid > [style*="span 2"] { grid-column: auto !important; }
        .span-3, .span-4, .span-6, .span-8, .span-12 { grid-column: span 12; }
        .metric-strip { grid-template-columns: 1fr; }
        .metric-cell { border-right: none !important; border-bottom: 1px solid var(--line-soft); }
        .form-row-2 { grid-template-columns: 1fr; gap: 0; }
        .kv-grid { grid-template-columns: 1fr; }
        .donut-wrap { grid-template-columns: 1fr; justify-items: center; }
        .rate-pair { grid-template-columns: 1fr; }
        .search-box { max-width: none; min-width: 100%; }
        .detail-header { padding: 16px; }
        .detail-header > div:last-child { width: 100%; }
        #topbarActions .btn .btn-label { display: none; }
        .modal-overlay { align-items: flex-end; padding: 0; }
        .modal-box { border-radius: 20px 20px 0 0; max-height: 92vh; }
        #toastHost { left: 12px; right: 12px; bottom: 12px; align-items: stretch; }
        .toast { max-width: none; }
    }

    @media (prefers-reduced-motion: reduce) {
        *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
    }


    /* ==================================================================
       Django (MVT) additions
       ================================================================== */
    a.kpi-card, a.metric-cell { color: inherit; text-decoration: none; }
    .inline-form { display: inline; margin: 0; }
    .row-actions { display: inline-flex; gap: 6px; justify-content: flex-end; }
    .field .helptext { display: block; font-size: 11.5px; color: var(--ink-500); margin-top: 6px; }
    .errorlist { list-style: none; margin: 6px 0 0; padding: 0; color: var(--rose); font-size: 11.5px; font-weight: 600; }
    .field.invalid label { color: var(--rose); }
    .form-errors { background: var(--rose-soft); color: var(--rose); border: 1px solid #ffe0e6; border-radius: 10px; padding: 10px 12px; font-size: 12.5px; font-weight: 600; margin-bottom: 14px; display: flex; gap: 8px; align-items: flex-start; }
    .form-errors svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }
    .field input[type="checkbox"] { width: auto; }
    .form-page { max-width: 640px; margin: 0 auto; }
    .form-page .modal-box { width: 100%; max-height: none; animation: none; }

    /* Checkbox list with live filter (assign candidates) */
    .check-filter { margin-bottom: 10px; }
    .check-list-box { max-height: 340px; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; padding: 4px; background: var(--bg); }
    .check-list-box ul, .check-list-box div[id] { list-style: none; margin: 0; padding: 0; }
    .check-list-box label { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink-700); }
    .check-list-box label:hover { background: #fff; }
    .check-list-box input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--cyan-600); }
    .check-count { font-size: 12px; font-weight: 700; color: var(--cyan-700); }

    /* Pagination */
    .pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line-soft); font-size: 12.5px; color: var(--ink-500); font-weight: 600; }
    .pager .pager-links { display: flex; gap: 6px; }

    /* Status "select" button (opens modal) */
    .status-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font: 700 13px var(--font); color: var(--ink-900); cursor: pointer; box-shadow: var(--shadow-xs); }
    .status-btn:hover { border-color: var(--cyan-200); background: var(--cyan-50); }
    .status-btn svg { width: 14px; height: 14px; color: var(--ink-500); }

    /* Pipeline card stage select */
    .pipeline-card form { margin: 0; }
    .pipeline-drop { min-height: 48px; border-radius: 10px; transition: background .15s; }
    .pipeline-col.drag-over .pipeline-drop { background: var(--cyan-50, #ecfeff); outline: 2px dashed var(--cyan-200); outline-offset: -2px; }
    .pipeline-card[draggable=true] { cursor: grab; }
    .pipeline-card.dragging { opacity: .45; }
    .pipeline-card.saving { opacity: .6; pointer-events: none; }

    /* Funnel/tab panes toggled by JS */
    [data-pane][hidden] { display: none !important; }

    /* Error pages */
    .error-page { min-height: 70vh; display: flex; align-items: center; justify-content: center; }

/* Date picker (flatpickr) in the Luminous Cyan palette */
.flatpickr-calendar { font-family: var(--font); border-radius: 14px; border: 1px solid var(--line); box-shadow: 0 20px 40px -12px rgba(15, 23, 42, .28); z-index: 1000 !important; }
.flatpickr-day.selected, .flatpickr-day.selected:hover { background: var(--cyan-600, #0891b2); border-color: var(--cyan-600, #0891b2); }
.flatpickr-day.today { border-color: var(--cyan-400, #22d3ee); }
.flatpickr-day:hover { background: var(--cyan-50, #ecfeff); border-color: var(--cyan-100, #cffafe); }
.flatpickr-months .flatpickr-month, .flatpickr-weekdays, span.flatpickr-weekday { color: var(--ink-900); fill: var(--ink-900); }
.flatpickr-calendar .fp-clear { display: block; width: 100%; padding: 8px; border: 0; border-top: 1px solid var(--line-soft); background: none; color: var(--cyan-700); font-weight: 700; font-size: 12.5px; cursor: pointer; border-radius: 0 0 14px 14px; }
.flatpickr-calendar .fp-clear:hover { background: var(--cyan-50, #ecfeff); }
input.flatpickr-input[readonly] { cursor: pointer; }
