/* ONE TAX NETWORK — Client Portal
   Design system matched to the live One Tax client portal:
   Plus Jakarta Sans · royal blue #2563EB · warm amber #F59E0B · light sidebar. */

:root {
    --brand: #2563EB;
    --brand-mid: #3B82F6;
    --brand-dark: #1D4ED8;
    --brand-soft: #EFF6FF;
    --brand-softer: #F8FAFC;
    --brand-grad: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
    --brand-grad-deep: linear-gradient(120deg, #60A5FA 0%, #3B82F6 45%, #2563EB 100%);

    --gold: #F59E0B;
    --gold-soft: #FFFBEB;

    /* legacy aliases so existing pages keep working */
    --navy: #2563EB;
    --navy-mid: #3B82F6;
    --navy-dark: #1D4ED8;
    --navy-light: #EFF6FF;
    --orange: #F59E0B;
    --orange-dark: #D97706;
    --orange-light: #FFFBEB;

    --page: #fafbfc;
    --surface: #ffffff;
    --surface-2: #f8fafc;

    --ink-900: #0f172a;
    --ink-700: #334155;
    --ink-500: #64748b;
    --ink-400: #94a3b8;

    --line: #eef2f7;
    --line-strong: #e2e8f0;

    --c-teal: #0d9488;
    --c-green: #16a34a;
    --c-amber: #f59e0b;
    --c-sky: #0284c7;
    --c-violet: #7c3aed;
    --c-rose: #e11d48;
    --c-pink: #db2777;
    --c-indigo: #4f46e5;
    --green: #16a34a;
    --sky: #0EA5E9;
    --violet: #7c3aed;
    --teal: #0d9488;
    --saffron: #F59E0B;
    --indigo: #4f46e5;

    --ok: #047857;
    --ok-soft: #ecfdf5;
    --warn: #b45309;
    --warn-soft: #fef3c7;
    --bad: #b91c1c;
    --bad-soft: #fee2e2;

    --radius: 16px;
    --radius-sm: 12px;
    --shadow-1: 0 2px 6px rgba(15, 23, 42, .05);
    --shadow-2: 0 14px 36px -18px rgba(15, 23, 42, .28);
    --shadow-3: 0 30px 70px -24px rgba(15, 23, 42, .45);
    --ease: cubic-bezier(.4, 0, .2, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
    background: var(--page);
    color: var(--ink-900);
    font-family: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 14.5px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}
body.no-scroll { overflow: hidden; }

h1, h2, h3, h4 { font-family: inherit; font-weight: 800; letter-spacing: -.02em; margin: 0; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--brand); color: #fff; }

.muted { color: var(--ink-500); }
.tabular { font-variant-numeric: tabular-nums; }
.right { text-align: right; }

/* ============ Frame ============ */
.sidebar {
    position: fixed; inset: 0 auto 0 0; width: 268px; z-index: 40;
    display: flex; flex-direction: column;
    background: #fff; border-right: 1px solid var(--line);
}
.sidebar-glow { display: none; }

.brand { position: relative; display: flex; align-items: center; gap: 13px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.brand-mark {
    width: 62px; height: 62px; flex: none; display: grid; place-items: center; border-radius: 50%;
    background: #fff; border: 2px solid var(--brand-soft); overflow: hidden;
    box-shadow: 0 6px 18px -8px rgba(37, 99, 235, .35);
}
.brand-mark img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.brand-text strong { display: block; color: var(--ink-900); font-size: 19px; font-weight: 800; letter-spacing: -.02em; }
.brand-text strong em { font-style: normal; color: var(--brand); }
.brand-text small { display: flex; align-items: center; gap: 6px; margin-top: 2px; color: var(--ink-400); font-size: 9.5px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; }
.brand-text small::before { content: ''; width: 6px; height: 6px; border-radius: 99px; background: var(--brand); }
.drawer-close { display: none; margin-left: auto; background: none; border: 0; color: var(--ink-400); font-size: 18px; cursor: pointer; }

.nav { position: relative; flex: 1; overflow-y: auto; padding: 16px 12px 20px; }
.nav-group { margin: 14px 10px 8px; font-size: 9.5px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-400); }
.nav-group:first-child { margin-top: 4px; }
.nav-link {
    position: relative; display: flex; align-items: center; gap: 12px;
    padding: 9px 12px; margin-bottom: 3px; border-radius: var(--radius-sm);
    color: var(--ink-700); font-size: 14px; font-weight: 600;
    transition: background-color .22s var(--ease), color .22s var(--ease), transform .22s var(--ease);
}
.nav-link i {
    width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 9px;
    font-size: 13px; background: color-mix(in srgb, var(--accent, var(--brand)) 12%, #fff); color: var(--accent, var(--brand));
    transition: transform .22s var(--ease), box-shadow .22s var(--ease);
}
.nav-link:hover { background: var(--brand-softer); color: var(--ink-900); }
.nav-link:hover i { transform: scale(1.08) rotate(-4deg); }
.nav-link.is-active { background: var(--brand-soft); color: var(--brand-dark); font-weight: 800; }
.nav-link.is-active i { box-shadow: 0 4px 12px -4px color-mix(in srgb, var(--accent, var(--brand)) 70%, transparent); }
.nav-bar { position: absolute; left: -12px; top: 6px; bottom: 6px; width: 4px; border-radius: 0 99px 99px 0; background: var(--brand); opacity: 0; transition: opacity .22s var(--ease); }
.nav-link.is-active .nav-bar { opacity: 1; }
.nav-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-badge {
    min-width: 20px; text-align: center; padding: 1px 7px; border-radius: 99px;
    background: var(--surface-2); color: var(--ink-500);
    font-size: 10.5px; font-weight: 800; font-variant-numeric: tabular-nums;
}
.nav-link.is-active .nav-badge { background: var(--brand); color: #fff; }

.sidebar-foot { position: relative; display: flex; align-items: center; gap: 11px; padding: 14px 16px; border-top: 1px solid var(--line); }
.side-user { display: flex; align-items: center; gap: 11px; min-width: 0; flex: 1; }
.side-user .avatar { width: 34px; height: 34px; flex: none; }
.side-user span { min-width: 0; }
.side-user strong { display: block; font-size: 12.5px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user small { display: block; color: var(--ink-400); font-size: 11px; font-variant-numeric: tabular-nums; }
.side-logout { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--surface-2); color: var(--ink-500); transition: background-color .2s var(--ease), color .2s var(--ease); }
.side-logout:hover { background: var(--bad-soft); color: var(--bad); }
.scrim { display: none; }

.main { margin-left: 268px; min-height: 100vh; }
.rainbow { display: none; }

.topbar {
    position: sticky; top: 0; z-index: 30;
    display: flex; align-items: center; gap: 14px;
    height: 64px; padding: 0 26px;
    background: rgba(255, 255, 255, .92); backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
}
.icon-btn { background: none; border: 0; font-size: 18px; color: var(--brand); cursor: pointer; padding: 8px 10px; border-radius: var(--radius-sm); transition: background-color .2s var(--ease); }
.icon-btn:hover { background: var(--brand-soft); }
.only-mobile { display: none; }

.crumb { display: flex; align-items: center; gap: 9px; font-size: 13.5px; font-weight: 700; color: var(--ink-900); }
.crumb .home { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-500); font-weight: 600; }
.crumb .home i { color: var(--brand); font-size: 13px; }
.crumb .sep { color: var(--ink-400); font-size: 11px; }
.crumb .dot { display: none; }

.topsearch { position: relative; flex: 0 1 340px; margin-left: 18px; }
.topsearch i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-400); font-size: 12.5px; }
.topsearch input {
    width: 100%; height: 40px; padding: 0 12px 0 36px;
    border: 1px solid var(--line); border-radius: 99px;
    background: var(--surface-2); font: inherit; font-size: 13.5px; color: var(--ink-900);
    transition: border-color .2s var(--ease), background-color .2s var(--ease), box-shadow .2s var(--ease);
}
.topsearch input:focus { outline: none; background: #fff; border-color: var(--brand-mid); box-shadow: 0 0 0 4px rgba(37, 99, 235, .12); }

.profile { position: relative; margin-left: auto; }
.profile-btn { display: flex; align-items: center; gap: 10px; padding: 5px 15px 5px 5px; border: 1px solid var(--line); border-radius: 99px; background: #fff; cursor: pointer; transition: box-shadow .2s var(--ease), border-color .2s var(--ease); }
.profile-btn:hover { border-color: var(--brand-soft); box-shadow: var(--shadow-1); }
.avatar { width: 30px; height: 30px; border-radius: 99px; display: grid; place-items: center; background: var(--brand-grad); color: #fff; font-size: 11px; font-weight: 800; }
.profile-text { text-align: left; line-height: 1.25; }
.profile-text strong { display: block; font-size: 11.5px; font-weight: 800; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-text small { display: block; font-size: 10.5px; color: var(--ink-400); font-variant-numeric: tabular-nums; }

.profile-menu { position: absolute; right: 0; top: calc(100% + 9px); width: 220px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-2); padding: 7px; display: none; animation: pop .18s var(--ease); }
.profile-menu.is-open { display: block; }
@keyframes pop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.profile-menu-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 5px; }
.profile-menu-head strong { display: block; font-size: 12.5px; }
.profile-menu-head small { color: var(--ink-400); font-size: 11px; }
.profile-menu a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; font-size: 13px; color: var(--ink-700); transition: background-color .18s var(--ease), color .18s var(--ease); }
.profile-menu a:hover { background: var(--brand-soft); color: var(--brand-dark); }
.profile-menu a.danger { color: var(--bad); }
.profile-menu a.danger:hover { background: var(--bad-soft); color: var(--bad); }

.logout-top { display: inline-flex; align-items: center; gap: 9px; height: 38px; padding: 0 16px; border: 1px solid var(--line-strong); border-radius: 11px; background: #fff; color: var(--ink-900); font-size: 13px; font-weight: 700; transition: border-color .2s var(--ease), background-color .2s var(--ease), color .2s var(--ease); }
.logout-top i { color: var(--bad); }
.logout-top:hover { background: var(--bad-soft); border-color: #fecaca; color: var(--bad); }

.content { padding: 26px 30px 60px; max-width: none; width: 100%; }
.content > * + * { margin-top: 20px; }

.fade-up { animation: fadeUp .42s var(--ease) both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.stagger > * { animation: fadeUp .45s var(--ease) both; }
.stagger > *:nth-child(1) { animation-delay: .02s; }
.stagger > *:nth-child(2) { animation-delay: .06s; }
.stagger > *:nth-child(3) { animation-delay: .1s; }
.stagger > *:nth-child(4) { animation-delay: .14s; }
.stagger > *:nth-child(5) { animation-delay: .18s; }
.stagger > *:nth-child(6) { animation-delay: .22s; }
.stagger > *:nth-child(7) { animation-delay: .26s; }
.stagger > *:nth-child(8) { animation-delay: .3s; }
@media (prefers-reduced-motion: reduce) { .fade-up, .stagger > * { animation: none; } }

/* ============ Blue banner (page head + dashboard hero) ============ */
.page-head, .hero {
    position: relative; overflow: hidden; display: flex; flex-wrap: wrap; align-items: center;
    justify-content: space-between; gap: 18px;
    padding: 26px 32px; border: 0; border-radius: var(--radius);
    background: var(--brand-grad-deep); box-shadow: 0 14px 34px -20px rgba(37, 99, 235, .8);
}
.page-head::after, .hero::after {
    content: ''; position: absolute; right: -60px; top: -70px; width: 300px; height: 300px; border-radius: 50%;
    background: rgba(255, 255, 255, .1);
}
.page-head > *, .hero > * { position: relative; z-index: 1; }
.page-head h1, .hero-body h1 { margin: 0; color: #fff; font-size: 27px; letter-spacing: -.03em; }
.page-head h1 em, .hero-body h1 em { font-style: normal; color: #FDE68A; }
.page-head .sub, .hero-body p { margin: 7px 0 0; max-width: 900px; color: rgba(255, 255, 255, .82); font-size: 13.5px; }
.eyebrow { display: none; }
.count-chip { display: inline-block; margin-left: 10px; padding: 2px 12px; border-radius: 99px; background: rgba(255, 255, 255, .2) !important; color: #fff !important; font-size: 13px; font-weight: 800; vertical-align: 5px; font-variant-numeric: tabular-nums; }
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.hero img, .hero-veil { display: none; }
.hero-body { position: relative; z-index: 1; max-width: 68%; }
.hero-tag { display: none; }
.hero-actions, .banner-chips { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 16px; }
.banner-chips span {
    display: inline-flex; align-items: center; gap: 8px; padding: 5px 13px; border-radius: 10px;
    background: rgba(255, 255, 255, .16); color: #fff; font-size: 12px; font-weight: 700;
    font-variant-numeric: tabular-nums; backdrop-filter: blur(4px);
}
.banner-chips i { font-size: 11px; opacity: .85; }

/* ============ Buttons ============ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 40px; padding: 0 19px; border: 1px solid var(--brand); border-radius: 11px;
    background: var(--brand); color: #fff; font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer;
    transition: transform .2s var(--ease), box-shadow .2s var(--ease), background-color .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease);
}
.btn:hover { background: var(--brand-dark); border-color: var(--brand-dark); transform: translateY(-2px); box-shadow: 0 12px 24px -14px rgba(37, 99, 235, .9); }
.btn-warm { background: #fff; border-color: #fff; color: var(--brand-dark); }
.btn-warm:hover { background: var(--gold-soft); border-color: var(--gold-soft); color: #92400e; }
.btn-ghost { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .38); color: #fff; }
.btn-ghost:hover { background: rgba(255, 255, 255, .28); border-color: rgba(255, 255, 255, .6); color: #fff; }
.btn-outline { background: #fff; border-color: var(--line-strong); color: var(--ink-700); }
.btn-outline:hover { background: var(--brand-soft); border-color: var(--brand-soft); color: var(--brand-dark); }
.btn-sm { height: 34px; padding: 0 14px; font-size: 12.5px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-link { background: none; border: 0; color: var(--brand); font-weight: 700; padding: 0; height: auto; border-radius: 0; }
.btn-link:hover { background: none; transform: none; box-shadow: none; color: var(--brand-dark); text-decoration: underline; }

/* ============ Grids & cards ============ */
.grid { display: grid; gap: 18px; }
.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)); }
.grid-2-1 { grid-template-columns: 2fr 1fr; }
.grid-1-1 { grid-template-columns: 1fr 1fr; }

.card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); }
.card-body { padding: 22px; }
.card-lg .card-body { padding: 24px; }

.stat { display: block; overflow: hidden; transition: transform .28s var(--ease), box-shadow .28s var(--ease), border-color .28s var(--ease); }
.stat .strip { position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease); }
.stat .halo { position: absolute; right: -26px; top: -26px; width: 104px; height: 104px; border-radius: 99px; background: var(--accent); opacity: .08; transition: transform .35s var(--ease); }
.stat:hover { transform: translateY(-5px); box-shadow: var(--shadow-2); border-color: var(--line-strong); }
.stat:hover .strip { transform: scaleX(1); }
.stat:hover .halo { transform: scale(1.18); }
.stat-top { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stat-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 15px; }
.stat-value { position: relative; margin: 14px 0 0; font-size: 27px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stat-hint { position: relative; margin: 5px 0 0; color: var(--ink-500); font-size: 12px; font-variant-numeric: tabular-nums; }

.label { display: flex; align-items: center; gap: 9px; margin: 0; font-size: 10.5px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-500); }
.label .rule { width: 22px; height: 3px; border-radius: 99px; }
.card h2 { margin: 8px 0 0; font-size: 18px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }

/* ============ Quick access ============ */
.qa-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 18px; }
.qa-tile {
    position: relative; overflow: hidden; display: block;
    padding: 20px; min-height: 118px;
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1);
    transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s var(--ease);
}
.qa-tile::before { content: ''; position: absolute; left: 0; top: 0; width: 100%; height: 3px; background: var(--qa); transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease); }
.qa-tile:hover { transform: translateY(-5px); box-shadow: var(--shadow-2); border-color: color-mix(in srgb, var(--qa) 26%, var(--line)); }
.qa-tile:hover::before { transform: scaleX(1); }
.qa-bg-icon { display: none; }
.qa-icon {
    width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center;
    background: color-mix(in srgb, var(--qa) 12%, #fff); color: var(--qa); font-size: 18px;
    border: 1px solid color-mix(in srgb, var(--qa) 22%, #fff);
    transition: transform .3s var(--ease), background-color .3s var(--ease), color .3s var(--ease);
}
.qa-tile:hover .qa-icon { background: var(--qa); color: #fff; transform: scale(1.06) rotate(-5deg); }
.qa-label { display: block; margin-top: 16px; font-size: 15px; font-weight: 800; color: var(--ink-900); }
.qa-count { display: block; margin-top: 4px; font-size: 12.5px; color: var(--ink-500); }
.qa-badge {
    position: absolute; right: 16px; top: 16px; min-width: 26px; height: 24px; padding: 0 9px;
    display: inline-flex; align-items: center; justify-content: center; border-radius: 99px;
    background: var(--brand); color: #fff; font-size: 11.5px; font-weight: 800; font-variant-numeric: tabular-nums;
}
.qa-cta { position: absolute; right: 18px; bottom: 18px; font-size: 12px; font-weight: 800; color: var(--qa); opacity: 0; transform: translateX(-4px); transition: opacity .3s var(--ease), transform .3s var(--ease); }
.qa-tile:hover .qa-cta { opacity: 1; transform: none; }

/* ============ Folders (financial-year cards) ============ */
.folder-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 20px; }
.folder {
    position: relative; overflow: hidden; cursor: pointer; text-align: left;
    padding: 20px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1);
    transition: transform .28s var(--ease), box-shadow .28s var(--ease), border-color .28s var(--ease);
    font: inherit; color: inherit; width: 100%; display: block;
}
.folder:hover { transform: translateY(-5px); box-shadow: var(--shadow-2); border-color: color-mix(in srgb, var(--fc, var(--brand)) 26%, var(--line)); }
.folder-ico {
    width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 20px;
    background: color-mix(in srgb, var(--fc, var(--brand)) 12%, #fff); color: var(--fc, var(--brand));
    border: 1px solid color-mix(in srgb, var(--fc, var(--brand)) 22%, #fff);
    transition: transform .3s var(--ease), background-color .3s var(--ease), color .3s var(--ease);
}
.folder:hover .folder-ico { background: var(--fc, var(--brand)); color: #fff; transform: scale(1.06) rotate(-5deg); }
.folder-name { display: block; margin-top: 16px; font-size: 19px; font-weight: 800; letter-spacing: -.02em; }
.folder-meta { display: block; margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--ink-500); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.folder-open { position: absolute; right: 18px; bottom: 18px; display: inline-flex; align-items: center; gap: 7px; font-size: 11.5px; font-weight: 800; color: var(--fc, var(--brand)); opacity: 0; transform: translateX(-4px); transition: opacity .3s var(--ease), transform .3s var(--ease); }
.folder:hover .folder-open { opacity: 1; transform: none; }
.folder-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }

/* ============ Status pills ============ */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; border-radius: 99px; border: 1px solid; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.pill i { width: 6px; height: 6px; border-radius: 99px; background: currentColor; }
.pill-success { background: var(--ok-soft); color: var(--ok); border-color: #a7f3d0; }
.pill-warning { background: var(--warn-soft); color: var(--warn); border-color: #fde68a; }
.pill-danger { background: var(--bad-soft); color: var(--bad); border-color: #fecaca; }
.pill-neutral { background: var(--surface-2); color: var(--ink-500); border-color: var(--line-strong); }

/* ============ Toolbar & tables ============ */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 18px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); }
.field { position: relative; }
.field i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--ink-400); font-size: 12.5px; }
.input, .select {
    height: 40px; padding: 0 13px; border: 1px solid var(--line-strong); border-radius: 11px;
    background: #fff; color: var(--ink-900); font: inherit; font-size: 13.5px;
    transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.input.with-icon { padding-left: 36px; }
.input:focus, .select:focus { outline: none; border-color: var(--brand-mid); box-shadow: 0 0 0 4px rgba(37, 99, 235, .12); }
.field-grow { flex: 0 1 330px; }
.field-grow .input { width: 100%; }
.toolbar-count { margin-left: auto; color: var(--ink-500); font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; }

.table-wrap { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-1); }
.table-scroll { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; }
table.data th {
    padding: 13px 16px; text-align: left; white-space: nowrap;
    background: var(--surface-2); color: var(--ink-500);
    font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
    border-bottom: 1px solid var(--line);
}
table.data td { padding: 13px 16px; border-bottom: 1px solid #f4f7fa; font-size: 13.5px; color: var(--ink-700); }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr { transition: background-color .18s var(--ease); }
table.data tbody tr.clickable { cursor: pointer; }
table.data tbody tr.clickable:hover { background: var(--brand-soft); }
td.strong { font-weight: 800; color: var(--ink-900); }

/* ============ Empty state ============ */
.empty { display: flex; flex-wrap: wrap; align-items: center; gap: 22px; padding: 30px 28px; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: linear-gradient(180deg, #fff, var(--brand-soft)); }
.empty img { width: 104px; height: 104px; border-radius: var(--radius-sm); object-fit: cover; flex: none; }
.empty h3 { font-size: 16px; }
.empty p { margin: 6px 0 0; max-width: 480px; color: var(--ink-500); font-size: 13px; }

/* ============ Definition lists ============ */
.dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px 26px; margin: 18px 0 0; }
.dl > div { min-width: 0; }
.dl dt { font-size: 10px; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; color: var(--ink-400); }
.dl dd { margin: 4px 0 0; font-size: 13.5px; font-weight: 600; color: var(--ink-900); word-break: break-word; }

.note { margin: 20px 0 0; padding: 12px 15px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--ink-500); font-size: 12.5px; }
.note-warm { background: var(--gold-soft); border-color: #fde68a; color: #92400e; }

/* ============ Dialog ============ */
.dialog { position: fixed; inset: 0; z-index: 90; display: none; align-items: center; justify-content: center; padding: 28px 20px; }
.dialog.is-open { display: flex; }
.dialog-scrim { position: absolute; inset: 0; background: rgba(15, 23, 42, .55); backdrop-filter: blur(3px); animation: fadeIn .2s var(--ease); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.dialog-panel {
    position: relative; z-index: 1; width: 100%; max-width: 900px;
    max-height: calc(100vh - 56px); overflow-y: auto;
    background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-3);
    padding: 0; animation: dialogIn .26s var(--ease);
}
@keyframes dialogIn { from { opacity: 0; transform: translateY(16px) scale(.985); } to { opacity: 1; transform: none; } }
.dialog-head { position: sticky; top: 0; z-index: 2; padding: 22px 26px 18px; background: var(--brand-grad); color: #fff; }
.dialog-head h3 { font-size: 20px; color: #fff; padding-right: 44px; }
.dialog-head .dialog-sub { margin: 5px 0 0; color: rgba(255, 255, 255, .8); font-size: 12.5px; }
.dialog-inner { padding: 22px 26px 26px; }
.dialog-x { position: absolute; right: 16px; top: 16px; z-index: 3; width: 32px; height: 32px; border-radius: 99px; background: rgba(255, 255, 255, .2); border: 0; color: #fff; font-size: 14px; cursor: pointer; transition: background-color .2s var(--ease), transform .2s var(--ease); }
.dialog-x:hover { background: rgba(255, 255, 255, .34); transform: rotate(90deg); }

/* ============ Lists ============ */
.stack { display: grid; gap: 10px; margin: 18px 0 0; }
.row-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; transition: transform .22s var(--ease), border-color .22s var(--ease), box-shadow .22s var(--ease); }
.row-card:hover { transform: translateX(3px); border-color: var(--brand-soft); box-shadow: var(--shadow-1); }
.row-card strong { display: block; font-size: 13.5px; font-weight: 800; color: var(--ink-900); }
.row-card small { display: block; margin-top: 3px; color: var(--ink-500); font-size: 12px; }

.alert-row { display: flex; align-items: flex-start; gap: 12px; padding: 13px 15px; border: 1px solid #fde68a; border-left: 3px solid var(--gold); border-radius: var(--radius-sm); background: var(--gold-soft); }
.alert-row i { color: var(--gold); margin-top: 3px; font-size: 12.5px; }
.alert-row p { margin: 0; font-size: 13.5px; font-weight: 600; color: var(--ink-900); }
.alert-row small { color: var(--ink-500); font-size: 12px; }

.feed { list-style: none; margin: 18px 0 0; padding: 0 0 0 20px; border-left: 2px solid var(--brand-soft); }
.feed li { position: relative; padding-bottom: 16px; }
.feed li:last-child { padding-bottom: 0; }
.feed li::before { content: ''; position: absolute; left: -25px; top: 6px; width: 9px; height: 9px; border-radius: 99px; background: var(--brand); box-shadow: 0 0 0 4px #fff; }
.feed p { margin: 0; font-size: 13.5px; font-weight: 600; }
.feed small { color: var(--ink-500); font-size: 12px; }

.legend { list-style: none; margin: 14px 0 0; padding: 0; }
.legend li { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; padding: 5px 0; border-bottom: 1px solid #f4f7fa; }
.legend li:last-child { border-bottom: 0; }
.legend span.k { display: flex; align-items: center; gap: 9px; color: var(--ink-500); }
.legend i { width: 9px; height: 9px; border-radius: 3px; }

.mods { list-style: none; margin: 16px 0 0; padding: 0; }
.mods a { display: flex; align-items: center; justify-content: space-between; padding: 10px; border-radius: var(--radius-sm); font-size: 13.5px; transition: background-color .2s var(--ease), transform .2s var(--ease); }
.mods a:hover { background: var(--brand-softer); transform: translateX(3px); }
.mods .k { display: flex; align-items: center; gap: 11px; color: var(--ink-700); font-weight: 600; }
.mods .ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-size: 12px; }
.mods .v { font-weight: 800; color: var(--ink-900); font-variant-numeric: tabular-nums; }

/* ============ CFS ============ */
.progress { height: 6px; border-radius: 99px; background: #e6eaf1; overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 99px; background: var(--brand-grad); transition: width .6s var(--ease); }
.cfs-meta { display: flex; flex-wrap: wrap; gap: 5px 20px; margin-top: 12px; color: var(--ink-500); font-size: 12px; font-variant-numeric: tabular-nums; }
.cfs-link { display: inline-flex; align-items: center; gap: 8px; margin-top: 16px; font-size: 13px; font-weight: 800; color: var(--brand); transition: gap .22s var(--ease); }
.cfs-link:hover { gap: 12px; color: var(--brand-dark); }

.timeline { list-style: none; margin: 22px 0 0; padding: 0; }
.timeline li { position: relative; display: flex; gap: 16px; padding-bottom: 24px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline .line { position: absolute; left: 15px; top: 34px; bottom: -4px; width: 2px; background: var(--line); }
.timeline li.done .line { background: #a7f3d0; }
.timeline .dot { position: relative; z-index: 1; flex: none; width: 31px; height: 31px; border-radius: 99px; display: grid; place-items: center; background: #fff; border: 2px solid var(--line-strong); color: var(--ink-400); font-size: 11px; }
.timeline li.done .dot { background: var(--c-green); border-color: var(--c-green); color: #fff; }
.timeline li.current .dot { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 0 0 5px rgba(37, 99, 235, .18); animation: pulse2 2.2s ease-in-out infinite; }
@keyframes pulse2 { 50% { box-shadow: 0 0 0 11px rgba(37, 99, 235, 0); } }
.timeline .stage { margin: 4px 0 0; font-size: 14px; font-weight: 800; color: var(--ink-400); }
.timeline li.done .stage, .timeline li.current .stage { color: var(--ink-900); }
.timeline .tag-now { margin-left: 9px; padding: 2px 9px; border-radius: 99px; background: var(--warn-soft); color: var(--warn); border: 1px solid #fde68a; font-size: 9.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; vertical-align: 2px; }
.timeline .when { margin: 3px 0 0; color: var(--ink-500); font-size: 12px; font-variant-numeric: tabular-nums; }
.timeline .why { margin: 4px 0 0; color: var(--ink-500); font-size: 12px; }

.history { list-style: none; margin: 16px 0 0; padding: 0; }
.history li { border-left: 2px solid var(--line); padding: 0 0 15px 16px; }
.history li:last-child { padding-bottom: 0; }
.history strong { font-size: 13px; font-weight: 800; color: var(--ink-900); }
.history small { display: block; margin-top: 2px; color: var(--ink-500); font-size: 12px; font-variant-numeric: tabular-nums; }

/* ============ Documents ============ */
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.doc-card { padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-1); transition: transform .22s var(--ease), box-shadow .22s var(--ease); }
.doc-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); }
.doc-top { display: flex; gap: 12px; }
.doc-ico { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-size: 15px; }
.doc-card strong { display: block; font-size: 13px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-card small { display: block; margin-top: 3px; color: var(--ink-500); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; padding-top: 12px; border-top: 1px solid #f4f7fa; }
.chip { padding: 3px 10px; border-radius: 99px; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--ink-500); font-size: 10.5px; font-weight: 700; }

/* ============ Auth ============ */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.02fr 1fr; background: #fff; }
.auth-art { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: 44px; background: var(--brand-grad-deep); }
.auth-art .glow { position: absolute; inset: 0; background: radial-gradient(700px 380px at 100% 105%, rgba(255, 255, 255, .18) 0, transparent 65%); }
.auth-art .mid { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 38px; }
.auth-art h1 { color: #fff; font-size: 39px; line-height: 1.14; }
.auth-art h1 em { font-style: normal; color: #FDE68A; }
.auth-art ul { list-style: none; margin: 28px 0 0; padding: 0; }
.auth-art li { display: flex; gap: 12px; margin-bottom: 15px; color: rgba(255, 255, 255, .84); font-size: 13.5px; }
.auth-art li i { flex: none; width: 8px; height: 8px; margin-top: 6px; border-radius: 99px; background: #FDE68A; }
.auth-art img { width: 280px; max-width: 38%; border-radius: var(--radius); box-shadow: 0 30px 64px -26px rgba(0, 0, 0, .55); }
.auth-art .foot { position: relative; color: rgba(255, 255, 255, .5); font-size: 10px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; }

.auth-form { position: relative; overflow: hidden; display: grid; place-items: center; padding: 44px 24px; background: #fff; }
.auth-form .glow { position: absolute; inset: 0; background: radial-gradient(600px 300px at 100% 0%, rgba(37, 99, 235, .07) 0, transparent 60%); }
.auth-box { position: relative; width: 100%; max-width: 420px; }
.auth-box h2 { margin: 11px 0 0; font-size: 28px; }
.auth-box .lede { margin: 11px 0 0; color: var(--ink-500); font-size: 13.5px; }
.auth-box form { margin-top: 26px; }
.form-row { margin-bottom: 16px; }
.form-row label { display: block; margin-bottom: 7px; font-size: 10px; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; color: var(--ink-500); }
.form-row .input { width: 100%; height: 46px; }
.form-row .hint { margin: 5px 0 0; color: var(--ink-400); font-size: 11.5px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.pw-wrap { position: relative; }
.pw-toggle { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--ink-400); cursor: pointer; font-size: 13px; }
.pw-toggle:hover { color: var(--brand); }
.btn-block { width: 100%; height: 46px; }
.brand-inline { display: none; align-items: center; gap: 11px; margin-bottom: 24px; }

.tabs { display: flex; gap: 3px; padding: 4px; margin-bottom: 24px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.tabs a { flex: 1; text-align: center; padding: 9px 10px; border-radius: 9px; color: var(--ink-500); font-size: 12.5px; font-weight: 800; transition: background-color .2s var(--ease), color .2s var(--ease); }
.tabs a.is-active { background: #fff; color: var(--brand); box-shadow: var(--shadow-1); }

.alert { padding: 12px 15px; border-radius: var(--radius-sm); border: 1px solid; font-size: 13px; margin-bottom: 16px; }
.alert-error { background: var(--bad-soft); color: var(--bad); border-color: #fecaca; }
.alert-ok { background: var(--ok-soft); color: var(--ok); border-color: #a7f3d0; }
.alert-info { background: var(--brand-soft); color: var(--brand-dark); border-color: #bfdbfe; }
.auth-note { display: flex; gap: 9px; margin: 24px 0 0; color: var(--ink-400); font-size: 11.5px; line-height: 1.65; }
.auth-alt { margin: 20px 0 0; padding-top: 18px; border-top: 1px solid var(--line); color: var(--ink-500); font-size: 12.5px; text-align: center; }
.auth-alt a { color: var(--brand); font-weight: 800; }

.steps { display: flex; align-items: center; gap: 11px; margin-bottom: 22px; }
.steps span { display: flex; align-items: center; gap: 8px; color: var(--ink-400); font-size: 11.5px; font-weight: 800; }
.steps b { width: 22px; height: 22px; border-radius: 99px; display: grid; place-items: center; border: 1px solid var(--line-strong); background: #fff; font-size: 10.5px; }
.steps .on { color: var(--brand); }
.steps .on b { background: var(--brand); border-color: var(--brand); color: #fff; }
.steps .sep { flex: 1; height: 2px; background: var(--line); border-radius: 99px; }

/* ============ Responsive ============ */
@media (max-width: 1400px) { .qa-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 1200px) {
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-3, .grid-2-1, .grid-1-1, .grid-2 { grid-template-columns: 1fr; }
    .qa-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .folder-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .hero-body { max-width: 100%; }
}
@media (max-width: 1023px) {
    .sidebar { transform: translateX(-100%); transition: transform .26s var(--ease); width: 280px; }
    .sidebar.is-open { transform: none; }
    .drawer-close { display: block; }
    .scrim { display: block; position: fixed; inset: 0; z-index: 39; background: rgba(15, 23, 42, .55); opacity: 0; pointer-events: none; transition: opacity .26s var(--ease); }
    .scrim.is-open { opacity: 1; pointer-events: auto; }
    .main { margin-left: 0; }
    .only-mobile { display: inline-flex; }
    .topsearch { display: none; }
    .qa-grid, .folder-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .auth { grid-template-columns: 1fr; }
    .auth-art { display: none; }
    .brand-inline { display: flex; }
}
@media (max-width: 720px) {
    .content { padding: 18px 14px 48px; }
    .topbar { padding: 0 14px; }
    .grid-4, .folder-grid, .qa-grid { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .page-head, .hero { padding: 22px 20px; }
    .page-head h1, .hero-body h1 { font-size: 22px; }
    .profile-text { display: none; }
    .dialog { padding: 12px; }
    .dialog-head { padding: 18px 20px 15px; }
    .dialog-inner { padding: 18px 20px 22px; }
}
