        :root {
            --navy: #04162B;
            --navy-2: #072340;
            --blue: #0B63CE;
            --blue-600: #0A55B2;
            --blue-bright: #2E8BFF;
            --cyan: #22D3EE;
            --blue-soft: #E8F1FD;
            --bg: #F5F7FB;
            --card: #FFFFFF;
            --ink: #0A1020;
            --ink-2: #334155;
            --muted: #64748B;
            --line: #E4EAF2;
            --line-soft: #EEF3F9;
            --ok: #067A55;
            --ok-soft: #E4F8F0;
            --warn: #B45309;
            --warn-soft: #FEF4E6;
            --danger: #B42318;
            --danger-soft: #FEF3F2;
            --r-sm: 10px;
            --r: 13px;
            --r-lg: 18px;
            --shadow-xs: 0 1px 2px rgba(10, 16, 32, .05);
            --shadow-sm: 0 1px 2px rgba(10, 16, 32, .04), 0 6px 16px -12px rgba(10, 16, 32, .28);
            --shadow-md: 0 2px 6px rgba(10, 16, 32, .05), 0 18px 40px -24px rgba(10, 16, 32, .45);
            --ease: cubic-bezier(.22, .61, .36, 1);
        }

        * { box-sizing: border-box; }
        html { scroll-behavior: smooth; }
        html, body { height: 100%; }

        body {
            margin: 0;
            background:
                radial-gradient(1200px 500px at 100% -10%, rgba(46, 139, 255, .09), transparent 60%),
                radial-gradient(900px 400px at -10% 10%, rgba(34, 211, 238, .08), transparent 55%),
                var(--bg);
            color: var(--ink);
            font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
            font-size: 13.5px;
            line-height: 1.55;
            -webkit-font-smoothing: antialiased;
            text-rendering: optimizeLegibility;
        }

        ::selection { background: rgba(11, 99, 206, .18); }

        ::-webkit-scrollbar { width: 10px; height: 10px; }
        ::-webkit-scrollbar-track { background: transparent; }
        ::-webkit-scrollbar-thumb { background: #CBD6E4; border-radius: 999px; border: 2px solid var(--bg); }
        ::-webkit-scrollbar-thumb:hover { background: #A9BAD0; }

        a { color: var(--blue); text-decoration: none; transition: color .15s var(--ease); }
        a:hover { text-decoration: none; color: var(--blue-600); }
        h1, h2, h3 { font-family: 'Sora', 'Inter', sans-serif; letter-spacing: -.02em; }

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

        .sidebar {
            width: 252px;
            flex: 0 0 252px;
            background:
                radial-gradient(140% 60% at 0% 0%, rgba(11, 99, 206, .38) 0%, transparent 58%),
                radial-gradient(100% 50% at 100% 100%, rgba(34, 211, 238, .10) 0%, transparent 60%),
                linear-gradient(185deg, var(--navy) 0%, #04121F 100%);
            color: #C7D6E5;
            padding: 18px 14px 22px;
            position: sticky;
            top: 0;
            height: 100vh;
            overflow-y: auto;
            border-right: 1px solid rgba(255, 255, 255, .06);
            z-index: 40;
        }

        .brand { display: flex; align-items: center; gap: 11px; padding: 4px 6px 16px; }
        .brand-mark {
            width: 40px; height: 40px; flex: 0 0 40px; border-radius: 12px;
            background: linear-gradient(140deg, #2E8BFF, #22D3EE);
            display: grid; place-items: center;
            color: #fff; font-weight: 800; font-size: 13px; letter-spacing: .04em;
            box-shadow: 0 10px 24px -10px rgba(34, 211, 238, .9), inset 0 1px 0 rgba(255,255,255,.35);
            transition: transform .4s var(--ease);
        }
        .brand:hover .brand-mark { transform: rotate(-6deg) scale(1.04); }
        .brand-name { color: #fff; font-weight: 650; font-size: 14px; line-height: 1.25; }
        .brand-sub { color: #7A93AC; font-size: 10.5px; text-transform: uppercase; letter-spacing: .14em; }

        .nav-group { margin-top: 16px; }
        .nav-label { color: #5F7A94; font-size: 10px; text-transform: uppercase; letter-spacing: .14em; padding: 0 10px 7px; font-weight: 600; }
        .nav-link {
            display: flex; align-items: center; gap: 10px;
            padding: 9px 10px; border-radius: var(--r-sm);
            color: #B9CBDA; font-weight: 500; font-size: 13px;
            margin-bottom: 3px; position: relative;
            transition: background .2s var(--ease), color .2s var(--ease), transform .2s var(--ease);
        }
        .nav-link:hover { background: rgba(255, 255, 255, .07); color: #fff; transform: translateX(2px); }
        .nav-link.active {
            background: linear-gradient(90deg, rgba(46, 139, 255, .26), rgba(46, 139, 255, .08));
            color: #fff;
            box-shadow: inset 0 0 0 1px rgba(120, 190, 255, .25);
        }
        .nav-link.active::before {
            content: ''; position: absolute; left: -14px; top: 7px; bottom: 7px; width: 3px;
            border-radius: 0 4px 4px 0;
            background: linear-gradient(180deg, #22D3EE, #2E8BFF);
            box-shadow: 0 0 12px rgba(34, 211, 238, .8);
            animation: navPulse 2.6s ease-in-out infinite;
        }
        .nav-icon { width: 18px; height: 18px; flex: 0 0 18px; opacity: .9; transition: transform .25s var(--ease); }
        .nav-link:hover .nav-icon { transform: scale(1.08); }

        .sidebar-foot {
            margin-top: 22px; padding: 11px 12px; border-radius: var(--r);
            background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .07);
            font-size: 11.5px; color: #93A9BE;
        }
        .sidebar-foot strong { color: #E8F1FD; display: block; font-size: 12px; font-weight: 600; }
        .status-dot {
            width: 7px; height: 7px; border-radius: 50%; background: #34D399;
            display: inline-block; margin-right: 6px; position: relative;
        }
        .status-dot::after {
            content: ''; position: absolute; inset: -3px; border-radius: 50%;
            border: 1px solid rgba(52, 211, 153, .7);
            animation: ping 2s ease-out infinite;
        }

        .content { flex: 1; min-width: 0; display: flex; flex-direction: column; }

        .appbar {
            display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap;
            padding: 8px 26px; min-height: 60px;
            background: rgba(255, 255, 255, .78);
            backdrop-filter: saturate(180%) blur(14px);
            -webkit-backdrop-filter: saturate(180%) blur(14px);
            border-bottom: 1px solid rgba(226, 232, 240, .9);
            position: sticky; top: 0; z-index: 30;
        }
        .crumbs { color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 7px; }
        .crumbs b { color: var(--ink); font-weight: 600; }
        .crumbs .sep { color: #CBD5E1; }

        .search {
            margin-left: auto; display: flex; align-items: center; gap: 8px;
            background: #fff; border: 1px solid var(--line); border-radius: 11px;
            padding: 7px 11px; width: 270px; color: var(--muted);
            transition: border-color .2s var(--ease), box-shadow .2s var(--ease), width .3s var(--ease);
        }
        .search:focus-within { border-color: #A9C8EE; box-shadow: 0 0 0 4px rgba(11, 99, 206, .1); width: 310px; }
        .search input { border: none; padding: 0; font-size: 12.5px; background: transparent; }
        .search input:focus { outline: none; box-shadow: none; }

        .main { padding: 24px 26px 56px; width: 100%; max-width: 1440px; margin: 0 auto; }

        .page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
        .page-head h1 { margin: 0; font-size: 23px; font-weight: 700; }
        .page-head p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
        .page-actions { display: flex; gap: 8px; flex-wrap: nowrap; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
        .page-actions::-webkit-scrollbar { display: none; }

        /* ================= surfaces ================= */
        .card {
            background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
            box-shadow: var(--shadow-xs);
            transition: box-shadow .3s var(--ease), transform .3s var(--ease), border-color .3s var(--ease);
            position: relative;
        }
        .card > header { padding: 15px 18px; border-bottom: 1px solid var(--line-soft); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
        .card > header h2 { margin: 0; font-size: 13.5px; font-weight: 650; }
        .card-body { padding: 18px; }
        .card-foot { padding: 12px 18px; border-top: 1px solid var(--line-soft); }
        .card-hover:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: #D8E4F2; }

        .grid { display: grid; gap: 14px; }
        .grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
        .grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
        .grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
        .split { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 14px; align-items: start; }
        .clients-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }

        /* ================= KPI ================= */
        .kpi { padding: 16px 18px; overflow: hidden; }
        .kpi::after {
            content: ''; position: absolute; inset: 0 0 auto 0; height: 3px;
            background: linear-gradient(90deg, #2E8BFF, #22D3EE);
            opacity: 0; transition: opacity .3s var(--ease);
        }
        .kpi:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
        .kpi:hover::after { opacity: 1; }
        .kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
        .kpi .label { color: var(--muted); font-size: 11.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
        .kpi .value {
            font-size: 28px; font-weight: 700; letter-spacing: -.03em; margin-top: 8px;
            font-family: 'Sora', 'Inter', sans-serif; font-variant-numeric: tabular-nums;
        }
        .kpi .value small { font-size: 14px; font-weight: 600; color: var(--muted); margin-left: 2px; }
        .kpi .hint { color: var(--muted); font-size: 12px; margin-top: 3px; }
        .kpi-icon {
            width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center;
            background: linear-gradient(140deg, #EAF3FF, #DCEEFF); color: var(--blue);
            box-shadow: inset 0 1px 0 #fff;
            transition: transform .3s var(--ease);
        }
        .kpi:hover .kpi-icon { transform: scale(1.06) rotate(-3deg); }
        .kpi-icon.green { background: linear-gradient(140deg, #E6F9F1, #D6F5E9); color: var(--ok); }
        .kpi-icon.amber { background: linear-gradient(140deg, #FFF6E8, #FEEDD3); color: var(--warn); }
        .kpi-icon.red { background: linear-gradient(140deg, #FEF3F2, #FDE4E1); color: var(--danger); }
        .kpi svg.icon { width: 17px; height: 17px; }

        /* ================= buttons ================= */
        .btn {
            display: inline-flex; align-items: center; gap: 6px; justify-content: center;
            padding: 9px 14px; border-radius: 11px; border: 1px solid var(--line);
            background: #fff; color: var(--ink-2); font-weight: 600; font-size: 12.5px;
            cursor: pointer; text-decoration: none; box-shadow: var(--shadow-xs);
            transition: transform .12s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease), background .2s var(--ease);
            position: relative; overflow: hidden;
        }
        .btn:hover { border-color: #CBD5E1; background: #FBFCFE; box-shadow: var(--shadow-sm); transform: translateY(-1px); color: var(--ink-2); }
        .btn:active { transform: translateY(0) scale(.985); }
        .btn:focus-visible { outline: none; box-shadow: 0 0 0 4px rgba(11, 99, 206, .18); }
        .btn-primary {
            background: linear-gradient(135deg, #2E8BFF 0%, #0B63CE 55%, #0A55B2 100%);
            border-color: #0B63CE; color: #fff;
            box-shadow: 0 10px 22px -12px rgba(11, 99, 206, .95), inset 0 1px 0 rgba(255,255,255,.28);
        }
        .btn-primary:hover { background: linear-gradient(135deg, #3B95FF 0%, #0C6BE0 55%, #0A55B2 100%); color: #fff; box-shadow: 0 14px 28px -14px rgba(11, 99, 206, 1); }
        .btn-danger { color: var(--danger); border-color: #F3C1BC; background: #FEF3F2; }
        .btn-sm { padding: 5px 9px; font-size: 12px; border-radius: 9px; }
        .btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
        .btn.is-loading { color: transparent !important; pointer-events: none; }
        .btn.is-loading::after {
            content: ''; position: absolute; width: 14px; height: 14px; border-radius: 50%;
            border: 2px solid rgba(255, 255, 255, .55); border-top-color: #fff;
            animation: spin .7s linear infinite;
        }
        .btn:not(.btn-primary).is-loading::after { border-color: rgba(11, 99, 206, .3); border-top-color: var(--blue); }

        /* ================= pills ================= */
        .pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 650; white-space: nowrap; }
        .pill.gray { background: #F1F5F9; color: #475569; }
        .pill.blue { background: var(--blue-soft); color: var(--blue); }
        .pill.green { background: var(--ok-soft); color: var(--ok); }
        .pill.amber { background: var(--warn-soft); color: var(--warn); }
        .pill.red { background: var(--danger-soft); color: var(--danger); }
        .pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

        /* ================= tables ================= */
        .table-wrap { overflow-x: auto; }
        table { width: 100%; border-collapse: collapse; }
        thead th {
            text-align: left; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase;
            color: var(--muted); font-weight: 650; padding: 11px 18px; border-bottom: 1px solid var(--line-soft);
            background: #FAFCFF; white-space: nowrap;
        }
        tbody td { padding: 12px 18px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; transition: background .15s var(--ease); }
        tbody tr:last-child td { border-bottom: none; }
        tbody tr { transition: transform .15s var(--ease); }
        tbody tr:hover td { background: #F7FAFF; }
        tbody tr:hover { transform: translateX(1px); }
        .num { text-align: right; font-variant-numeric: tabular-nums; }

        .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; letter-spacing: -.01em; }
        .muted { color: var(--muted); }
        .help { color: var(--muted); font-size: 11.5px; }

        /* ================= forms ================= */
        .form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
        .form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
        .field { display: flex; flex-direction: column; gap: 5px; }
        .field.full { grid-column: 1 / -1; }
        label { font-size: 12px; font-weight: 600; color: var(--ink-2); }
        input, select, textarea {
            width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--r-sm);
            background: #fff; color: var(--ink); font: inherit; font-size: 13px;
            transition: border-color .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease);
        }
        input:hover, select:hover, textarea:hover { border-color: #CFDBEA; }
        input:focus, select:focus, textarea:focus { outline: none; border-color: #A9C8EE; box-shadow: 0 0 0 4px rgba(11, 99, 206, .12); }
        textarea { resize: vertical; min-height: 72px; }

        /* ================= toasts ================= */
        .flash-stack {
            position: fixed; right: 22px; bottom: 22px; z-index: 90;
            display: flex; flex-direction: column; gap: 10px; max-width: min(440px, calc(100vw - 32px));
        }
        .toast {
            display: flex; gap: 10px; align-items: flex-start;
            padding: 13px 14px; border-radius: 14px; font-size: 12.5px;
            background: #0B1526; color: #E9F1FA; border: 1px solid rgba(255, 255, 255, .1);
            box-shadow: 0 20px 45px -20px rgba(4, 22, 43, .8);
            animation: toastIn .35s var(--ease) both;
        }
        .toast.ok { border-left: 3px solid #34D399; }
        .toast.error { border-left: 3px solid #F87171; }
        .toast ul { margin: 0; padding-left: 16px; }
        .toast .toast-close {
            margin-left: auto; background: none; border: 0; color: #8FA6BE;
            cursor: pointer; font-size: 15px; line-height: 1; padding: 0 2px;
        }
        .toast.is-leaving { animation: toastOut .28s var(--ease) both; }

        .alert { padding: 11px 14px; border-radius: var(--r); margin-bottom: 0; font-size: 12.5px; border: 1px solid transparent; }
        .alert.ok { background: var(--ok-soft); border-color: #B7EBD8; color: #065F46; }
        .alert.error { background: var(--danger-soft); border-color: #FECDC9; color: #912018; }
        .alert ul { margin: 0; padding-left: 18px; }

        .toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
        .filters-toggle { display: none; }
        .tab-panel { display: none; }
        .tab-panel.is-active { display: block; animation: fadeUp .35s var(--ease) both; }
        .tab-bar { display: flex; gap: 6px; flex-wrap: wrap; padding: 12px 14px; }
        .tab-bar .btn.is-active { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: 0 8px 18px -12px rgba(11,99,206,.9); }
        .filter-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
        .filter-chips a { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; background: #EEF4FC; color: #2A5C93; font-size: 11.5px; font-weight: 600; }
        .filter-chips a:hover { background: #E1ECFA; color: #1D4E86; }
        .toolbar input, .toolbar select { width: auto; min-width: 132px; }

        .empty { padding: 32px 18px; text-align: center; color: var(--muted); font-size: 13px; }

        /* ================= dashboard pieces ================= */
        .quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
        .qa {
            display: flex; align-items: center; gap: 11px; padding: 14px 15px;
            background: #fff; border: 1px solid var(--line); border-radius: var(--r);
            color: var(--ink); box-shadow: var(--shadow-xs);
            transition: transform .2s var(--ease), border-color .2s var(--ease), box-shadow .2s var(--ease);
            position: relative; overflow: hidden;
        }
        .qa::after {
            content: ''; position: absolute; inset: 0;
            background: linear-gradient(120deg, transparent 30%, rgba(46, 139, 255, .07), transparent 70%);
            transform: translateX(-100%); transition: transform .5s var(--ease);
        }
        .qa:hover { text-decoration: none; border-color: #BFD3F0; transform: translateY(-2px); box-shadow: var(--shadow-sm); color: var(--ink); }
        .qa:hover::after { transform: translateX(100%); }
        .qa-icon {
            width: 36px; height: 36px; flex: 0 0 36px; border-radius: 11px; display: grid; place-items: center;
            background: linear-gradient(140deg, #EAF3FF, #DCEEFF); color: var(--blue);
            transition: transform .25s var(--ease);
        }
        .qa:hover .qa-icon { transform: scale(1.07); }
        .qa strong { display: block; font-size: 12.5px; font-weight: 650; }
        .qa span { color: var(--muted); font-size: 11.5px; }

        .spark { margin-top: 10px; height: 34px; width: 100%; display: block; }
        .spark polyline { stroke-dasharray: 600; stroke-dashoffset: 600; animation: drawLine 1.2s var(--ease) .2s forwards; }

        .bars { display: flex; align-items: flex-end; justify-content: center; gap: 22px; height: 168px; padding: 8px 4px 0; }
        .bar-col { flex: 1; max-width: 104px; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
        .bar-track { height: 130px; width: 100%; display: flex; align-items: flex-end; }
        .bar {
            width: 100%; border-radius: 8px 8px 3px 3px;
            background: linear-gradient(180deg, #4FB0FF, #0B63CE);
            min-height: 4px; position: relative;
            transform-origin: bottom; animation: growBar .8s var(--ease) both;
            box-shadow: 0 6px 14px -10px rgba(11, 99, 206, .9);
        }
        .bar-value { font-size: 11px; font-weight: 650; color: var(--ink-2); }
        .bar-label { font-size: 11px; color: var(--muted); white-space: nowrap; }

        .legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
        .legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; margin-right: 6px; }

        .timeline { list-style: none; margin: 0; padding: 4px 18px 14px; }
        .timeline li { display: flex; gap: 11px; padding: 10px 0; border-bottom: 1px dashed var(--line-soft); }
        .timeline li:last-child { border-bottom: none; }
        .tl-dot {
            width: 26px; height: 26px; flex: 0 0 26px; border-radius: 9px; display: grid; place-items: center;
            background: linear-gradient(140deg, #EEF4FF, #E2EDFF); color: #3B6FA8; font-size: 11px; font-weight: 700;
        }
        .tl-body { min-width: 0; }
        .tl-body strong { font-size: 12.5px; font-weight: 600; }
        .tl-body p { margin: 1px 0 0; font-size: 11.5px; color: var(--muted); }

        .alert-row { display: flex; align-items: center; gap: 10px; padding: 10px 18px; border-bottom: 1px solid var(--line-soft); }
        .alert-row:last-child { border-bottom: none; }
        .alert-row .tag { margin-left: auto; }

        .thumb { width: 42px; height: 42px; border-radius: 10px; background: #F1F5F9; display: grid; place-items: center; }
        .thumb svg { width: 36px; height: 36px; }

        .sheet-preview { background: #0B1220; border-radius: var(--r); padding: 10px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(255,255,255,.05); }
        .sheet-preview svg { width: 100%; height: auto; display: block; }

        .pagination { display: flex; gap: 6px; padding: 12px 18px; flex-wrap: wrap; }
        .pagination a, .pagination span { padding: 5px 10px; border-radius: 9px; border: 1px solid var(--line); font-size: 12px; color: var(--ink); transition: background .15s var(--ease), border-color .15s var(--ease); }
        .pagination a:hover { background: #F5F9FF; border-color: #CBDCF2; }
        .pagination .active { background: var(--blue); color: #fff; border-color: var(--blue); }

        dialog { border: none; border-radius: var(--r-lg); padding: 0; box-shadow: 0 30px 60px -20px rgba(2, 20, 43, .5); max-width: 560px; width: calc(100% - 32px); }
        dialog::backdrop { background: rgba(4, 22, 43, .45); backdrop-filter: blur(3px); }
        dialog[open] { animation: dialogIn .28s var(--ease) both; }

        .progress { height: 6px; border-radius: 999px; background: #EEF2F7; overflow: hidden; min-width: 70px; }
        .progress > span {
            display: block; height: 100%; border-radius: 999px;
            background: linear-gradient(90deg, #38BDF8, #0B63CE);
            position: relative; transition: width .4s var(--ease);
        }
        .progress > span::after {
            content: ''; position: absolute; inset: 0;
            background: linear-gradient(90deg, transparent, rgba(255,255,255,.5), transparent);
            animation: shimmer 1.6s linear infinite;
        }

        /* ================= animations ================= */
        @keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
        @keyframes navPulse { 0%, 100% { opacity: .65; } 50% { opacity: 1; } }
        @keyframes ping { 0% { transform: scale(.7); opacity: .8; } 80%, 100% { transform: scale(1.9); opacity: 0; } }
        @keyframes spin { to { transform: rotate(360deg); } }
        @keyframes growBar { from { transform: scaleY(0); } to { transform: scaleY(1); } }
        @keyframes drawLine { to { stroke-dashoffset: 0; } }
        @keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
        @keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
        @keyframes toastOut { to { opacity: 0; transform: translateY(8px) scale(.98); } }
        @keyframes dialogIn { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }

        .js-reveal { opacity: 0; transform: translateY(12px); }
        .js-reveal.is-visible {
            opacity: 1; transform: none;
            transition: opacity .5s var(--ease), transform .5s var(--ease);
            transition-delay: calc(var(--i, 0) * 40ms);
        }

        @media (prefers-reduced-motion: reduce) {
            *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
            .js-reveal { opacity: 1; transform: none; }
        }

        /* ================= responsive ================= */
        .nav-toggle {
            display: none; align-items: center; justify-content: center;
            width: 40px; height: 40px; flex: 0 0 40px; border-radius: 11px;
            border: 1px solid var(--line); background: #fff; color: var(--ink-2);
            cursor: pointer; box-shadow: var(--shadow-xs);
        }
        .nav-backdrop { display: none; }

        @media (max-width: 1180px) {
            .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
            .quick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
            .split { grid-template-columns: minmax(0, 1fr); }
            .clients-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
        }

        @media (max-width: 1024px) {
            .shell { display: block; }

            .sidebar {
                position: fixed; top: 0; left: 0; bottom: 0;
                width: 272px; height: 100vh; flex: none;
                transform: translateX(-104%);
                transition: transform .28s var(--ease);
                z-index: 60;
                padding: 18px 14px 22px;
                box-shadow: 0 24px 60px -20px rgba(2, 20, 43, .6);
            }
            body.nav-open .sidebar { transform: translateX(0); }
            body.nav-open { overflow: hidden; }

            .nav-backdrop {
                position: fixed; inset: 0; background: rgba(4, 22, 43, .45);
                backdrop-filter: blur(2px);
                z-index: 55; display: none;
            }
            body.nav-open .nav-backdrop { display: block; }

            .nav-toggle { display: inline-flex; }
            .nav-link.active::before { display: none; }
            .crumbs { display: flex; flex: 1 1 auto; min-width: 0; }
            .crumbs > span:first-child, .crumbs .sep { display: none; }
            .crumbs b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
            .appbar {
                padding: 8px 12px; height: auto; min-height: 56px;
                gap: 8px 10px; flex-wrap: wrap; align-content: center;
            }
            .crumbs { flex: 1 1 auto; min-width: 0; }
            .crumbs b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: inline-block; max-width: 100%; vertical-align: bottom; }
            .search { display: none; }
            .page-actions {
                order: 3; flex: 1 0 100%; width: 100%; margin-left: 0; min-width: 0;
                display: flex; flex-wrap: nowrap; gap: 8px;
                overflow-x: auto; max-width: none;
                scrollbar-width: none; -ms-overflow-style: none;
            }
            .page-actions::-webkit-scrollbar { display: none; }
            .page-actions .btn { flex: 0 0 auto; white-space: nowrap; padding: 7px 10px; font-size: 12px; }

            .main { padding: 16px 14px 44px; }
            .page-head h1 { font-size: 19px; }
            .form-grid, .form-grid.three, .grid.cols-2 { grid-template-columns: minmax(0, 1fr); }
            .grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
            .quick { grid-template-columns: minmax(0, 1fr); }
            .clients-grid { grid-template-columns: minmax(0, 1fr); }
            .card { overflow-x: auto; }
            .card table { width: max-content; min-width: 100%; }
            .card thead th, .card tbody td { white-space: nowrap; }
            .card > header { flex-direction: column; align-items: stretch; }
            .card > header > .pill { align-self: flex-start; }
            .filters-toggle { display: inline-flex; }
            .toolbar-inline { flex-direction: row !important; flex-wrap: nowrap !important; align-items: center; }
            .toolbar-inline .btn { width: auto !important; }
            .filters-panel { display: none; }
            .filters-panel.is-open { display: flex; }
            .toolbar { flex-direction: column; align-items: stretch; }
            .toolbar input, .toolbar select { width: 100%; }
            .toolbar .btn { width: 100%; }
            .kpi .value { font-size: 23px; }
            .flash-stack { left: 14px; right: 14px; bottom: 14px; max-width: none; }
        }

/* Tableaux denses : on évite le retour à la ligne des cellules (scroll horizontal). */
.table-wrap td, .table-wrap th { white-space: nowrap; }
.table-wrap td .help { white-space: normal; }
.table-wrap td, .table-wrap th { padding: 9px 10px; }
