/* ==========================================================================
   CA Office OS — design system
   Tokens → base → layout → components → pages → motion
   ========================================================================== */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('../vendor/fonts/inter-latin-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+20B9, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('../vendor/fonts/inter-latin-ext-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- tokens ---------- */
:root {
  --brand: #4f46e5;
  --brand-rgb: 79, 70, 229;
  --brand-ink: #ffffff;
  --brand-soft: rgba(var(--brand-rgb), .10);
  --brand-softer: rgba(var(--brand-rgb), .06);

  --bg: #f5f6fa;
  --surface: #ffffff;
  --surface-2: #f9fafc;
  --surface-hover: #f3f4f8;
  --border: #e6e8ef;
  --border-strong: #d6d9e3;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;
  --faint: #94a3b8;

  --ok: #059669;   --ok-soft: #ecfdf5;
  --warn: #d97706; --warn-soft: #fffbeb;
  --bad: #dc2626;  --bad-soft: #fef2f2;
  --info: #0284c7; --info-soft: #f0f9ff;
  --violet: #7c3aed; --violet-soft: #f5f3ff;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 6px 16px -6px rgba(15, 23, 42, .08);
  --shadow-lg: 0 12px 40px -12px rgba(15, 23, 42, .25);
  --ring: 0 0 0 3px rgba(var(--brand-rgb), .25);

  --rail-w: 76px;
  --subnav-w: 252px;
  --topbar-h: 60px;
  --rail-bg: #eef0f6;
  --rail-ink: #475569;
  --rail-hover: rgba(15, 23, 42, .06);

  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --dur-fast: 140ms;
  --dur: 240ms;
  --dur-slow: 420ms;

  --bs-body-font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans', 'Noto Sans Devanagari', sans-serif;
  --bs-body-bg: var(--bg);
  --bs-body-color: var(--text);
  --bs-border-color: var(--border);
  --bs-primary: var(--brand);
  --bs-primary-rgb: var(--brand-rgb);
  --bs-link-color: var(--brand);
  --bs-link-color-rgb: var(--brand-rgb);
  --bs-link-hover-color: var(--brand);
  --bs-focus-ring-color: rgba(var(--brand-rgb), .25);
}

[data-bs-theme="dark"] {
  --bg: #0b0f19;
  --surface: #121826;
  --surface-2: #161d2d;
  --surface-hover: #1b2335;
  --border: #232c3f;
  --border-strong: #2e3950;
  --text: #e6e9f2;
  --text-2: #c3c9d8;
  --muted: #8b95ab;
  --faint: #5f6b84;
  --ok-soft: rgba(5, 150, 105, .14);
  --warn-soft: rgba(217, 119, 6, .14);
  --bad-soft: rgba(220, 38, 38, .14);
  --info-soft: rgba(2, 132, 199, .14);
  --violet-soft: rgba(124, 58, 237, .16);
  --brand-soft: rgba(var(--brand-rgb), .18);
  --brand-softer: rgba(var(--brand-rgb), .10);
  --rail-bg: #0a0e17;
  --rail-ink: #94a0b8;
  --rail-hover: rgba(255, 255, 255, .06);
  --shadow: 0 1px 3px rgba(0, 0, 0, .4), 0 8px 24px -8px rgba(0, 0, 0, .5);
  --shadow-lg: 0 16px 48px -12px rgba(0, 0, 0, .7);
  --bs-body-bg: var(--bg);
  --bs-body-color: var(--text);
  --bs-border-color: var(--border);
  --bs-secondary-bg: var(--surface-2);
  --bs-tertiary-bg: var(--surface-2);
}

/* ---------- base ---------- */
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased;
  letter-spacing: -.005em;
  overflow-x: hidden;
}
h1, h2, h3, h4, h5, h6 { color: var(--text); letter-spacing: -.02em; font-weight: 650; }
a { text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
.text-muted, .form-text { color: var(--muted) !important; }
.pre-wrap { white-space: pre-wrap; word-break: break-word; }
.min-w-0 { min-width: 0; }
.pick-list { max-height: 300px; padding: .35rem; }
.mono { font-family: ui-monospace, 'SF Mono', 'Cascadia Code', Menlo, Consolas, monospace; font-size: .92em; letter-spacing: 0; }
.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.icon-sm { width: 15px; height: 15px; vertical-align: -2px; }
.icon-lg { width: 22px; height: 22px; }
:focus-visible { outline: none; box-shadow: var(--ring) !important; border-radius: 6px; }
::selection { background: rgba(var(--brand-rgb), .2); }
.skip-link { position: absolute; left: 1rem; top: 1rem; z-index: 3000; background: var(--surface); padding: .5rem 1rem; border-radius: var(--radius-sm); }

/* scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }

/* ---------- bootstrap overrides ---------- */
.btn { --bs-btn-border-radius: 10px; --bs-btn-font-weight: 550; --bs-btn-padding-y: .5rem; --bs-btn-padding-x: .95rem; transition: transform var(--dur-fast) var(--ease), background-color var(--dur-fast), box-shadow var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast); display: inline-flex; align-items: center; justify-content: center; gap: .45rem; }
.btn:active { transform: scale(.97); }
.btn-sm { --bs-btn-padding-y: .32rem; --bs-btn-padding-x: .65rem; --bs-btn-border-radius: 8px; --bs-btn-font-size: .82rem; }
.btn-brand { background: var(--brand); color: var(--brand-ink); border: 1px solid var(--brand); box-shadow: 0 1px 2px rgba(var(--brand-rgb), .3), inset 0 1px 0 rgba(255, 255, 255, .15); }
.btn-brand:hover, .btn-brand:focus-visible { background: color-mix(in srgb, var(--brand) 88%, #000); color: var(--brand-ink); border-color: transparent; box-shadow: 0 6px 16px -6px rgba(var(--brand-rgb), .6); }
.btn-brand:disabled { background: var(--brand); color: var(--brand-ink); opacity: .6; }
.btn-ghost { background: transparent; border: 1px solid transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-hover); color: var(--text); }
.btn-soft { background: var(--surface); border: 1px solid var(--border); color: var(--text-2); box-shadow: var(--shadow-sm); }
.btn-soft:hover { border-color: var(--border-strong); background: var(--surface-2); color: var(--text); }
.btn-soft-danger { background: var(--bad-soft); border: 1px solid transparent; color: var(--bad); }
.btn-soft-danger:hover { background: var(--bad); color: #fff; }
.btn-icon { padding: .45rem; width: 38px; height: 38px; }
.btn-icon.btn-sm { width: 30px; height: 30px; padding: .3rem; }

.form-select { padding-right: 2.25rem !important; }
.form-control, .form-select { border-radius: 10px; border-color: var(--border-strong); background-color: var(--surface); color: var(--text); padding: .55rem .8rem; transition: border-color var(--dur-fast), box-shadow var(--dur-fast); }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: var(--ring); background-color: var(--surface); color: var(--text); }
.form-control::placeholder { color: var(--faint); }
.form-label { font-weight: 550; font-size: .85rem; color: var(--text-2); margin-bottom: .35rem; }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-check-input:focus { box-shadow: var(--ring); border-color: var(--brand); }
.form-switch .form-check-input { width: 2.4em; height: 1.3em; cursor: pointer; }
.input-icon { position: relative; }
.input-icon .icon { position: absolute; left: .8rem; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.input-icon .form-control { padding-left: 2.4rem; }
.invalid-feedback { font-size: .8rem; }
.form-control.is-invalid, .form-select.is-invalid { animation: shake 360ms var(--ease); }

.table { --bs-table-bg: transparent; --bs-table-color: var(--text); --bs-table-hover-bg: var(--surface-hover); --bs-table-border-color: var(--border); margin: 0; }
.table > :not(caption) > * > * { padding: .8rem 1rem; }
.table thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table tbody tr { transition: background-color var(--dur-fast); }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr:last-child td { border-bottom: 0; }

.dropdown-menu { border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: .4rem; background: var(--surface); --bs-dropdown-link-color: var(--text-2); --bs-dropdown-link-hover-bg: var(--surface-hover); --bs-dropdown-link-hover-color: var(--text); animation: pop-in var(--dur) var(--ease); }
.dropdown-item { border-radius: 8px; padding: .5rem .7rem; display: flex; align-items: center; gap: .6rem; font-size: .9rem; }
.dropdown-item.text-danger:hover { background: var(--bad-soft); }
.modal-content, .offcanvas { background: var(--surface); color: var(--text); border-color: var(--border); }
.modal-content { border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); border: 1px solid var(--border); }
.modal.fade .modal-dialog { transform: translateY(12px) scale(.97); opacity: 0; transition: transform var(--dur) var(--ease-spring), opacity var(--dur) var(--ease); }
.modal.show .modal-dialog { transform: none; opacity: 1; }
.modal-backdrop.show { opacity: .4; backdrop-filter: blur(2px); }
.offcanvas-backdrop.show { opacity: .35; }
.offcanvas.hiding, .modal.fade:not(.show) { pointer-events: none; }
.offcanvas.drawer { width: min(520px, 100vw) !important; border-left: 1px solid var(--border); transition: transform var(--dur-slow) var(--ease) !important; }
.offcanvas.drawer .offcanvas-header { border-bottom: 1px solid var(--border); padding: 1.1rem 1.4rem; }
.offcanvas.drawer .offcanvas-body { padding: 1.4rem; }
.offcanvas-title { font-weight: 650; }
.nav-tabs { border-bottom: 1px solid var(--border); gap: .25rem; }

/* ---------- auth screens (sign in, register, reset, invitations) ---------- */
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(440px, 46%) 1fr; background: var(--surface); }
.auth-hero { position: sticky; top: 0; height: 100vh; overflow: hidden; color: #fff; padding: 2.5rem 3rem; display: flex; flex-direction: column; background: linear-gradient(160deg, color-mix(in srgb, var(--brand) 92%, #000) 0%, color-mix(in srgb, var(--brand) 55%, #0b1020) 55%, #0b1020 100%); }
.auth-hero .ah-grid { position: absolute; inset: 0; background-image: linear-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .06) 1px, transparent 1px); background-size: 44px 44px; -webkit-mask-image: radial-gradient(ellipse at 30% 20%, #000 20%, transparent 75%); mask-image: radial-gradient(ellipse at 30% 20%, #000 20%, transparent 75%); }
.auth-hero .ah-glow { position: absolute; width: 520px; height: 520px; right: -180px; bottom: -160px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--brand) 40%, #14b8a6) 0%, transparent 65%); opacity: .45; animation: float 16s ease-in-out infinite; }
.auth-hero > * { position: relative; z-index: 1; }
.ah-brand { color: #fff; font-size: 1.05rem; }
.ah-brand:hover { color: #fff; text-decoration: none; }
.ah-brand .brand-mark { background: rgba(255, 255, 255, .16); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); }
.ah-body { flex: 1; display: flex; flex-direction: column; justify-content: center; max-width: 470px; padding: 2rem 0; }
.ah-body h2 { color: #fff; font-size: clamp(1.8rem, 2.6vw, 2.35rem); line-height: 1.15; letter-spacing: -.03em; font-weight: 720; margin-bottom: .9rem; }
.ah-body > p { color: rgba(255, 255, 255, .72); font-size: 1rem; line-height: 1.6; margin-bottom: 2rem; }
.ah-stack { display: flex; flex-direction: column; gap: .7rem; margin-bottom: 2rem; }
.ah-card { display: flex; align-items: center; gap: .8rem; padding: .8rem .95rem; border-radius: 14px; color: var(--text); background: rgba(255, 255, 255, .96); box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .55); opacity: 0; animation: rise var(--dur-slow) var(--ease) forwards; }
.ah-card.c1 { animation-delay: 80ms; } .ah-card.c2 { animation-delay: 180ms; margin-left: 1.75rem; } .ah-card.c3 { animation-delay: 280ms; margin-left: .75rem; }
.ah-card > div { flex: 1; min-width: 0; line-height: 1.25; }
.ah-card strong { display: block; font-size: .88rem; color: #0f172a; }
.ah-card small { color: #64748b; font-size: .76rem; }
.ah-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.ah-ic.ok { background: #ecfdf5; color: #059669; } .ah-ic.warn { background: #fffbeb; color: #d97706; } .ah-ic.violet { background: #f5f3ff; color: #7c3aed; }
.ah-points { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .65rem; }
.ah-points li { display: flex; align-items: center; gap: .65rem; font-size: .9rem; color: rgba(255, 255, 255, .82); }
.ah-points .icon { width: 17px; height: 17px; color: color-mix(in srgb, var(--brand) 30%, #a7f3d0); }
.ah-foot { font-size: .8rem; color: rgba(255, 255, 255, .5); }

.auth-panel { display: flex; flex-direction: column; min-height: 100vh; padding: 1.25rem 1.5rem; background: var(--surface); }
.auth-top { display: flex; align-items: center; gap: .5rem; }
.auth-card { flex: 1; width: 100%; max-width: 420px; margin: 0 auto; display: flex; flex-direction: column; justify-content: center; padding: 2rem 0; }
#auth-content { animation: rise var(--dur-slow) var(--ease); }
.auth-legal { text-align: center; font-size: .78rem; color: var(--faint); }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; margin-bottom: 2rem; border-radius: 12px; background: var(--surface-hover); border: 1px solid var(--border); }
.auth-tabs a { text-align: center; padding: .5rem; border-radius: 9px; font-size: .88rem; font-weight: 600; color: var(--muted); transition: background var(--dur-fast), color var(--dur-fast), box-shadow var(--dur-fast); }
.auth-tabs a:hover { color: var(--text); text-decoration: none; }
.auth-tabs a.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.auth-head { margin-bottom: 1.6rem; }
.auth-head h1, #auth-content h1 { font-size: 1.75rem; letter-spacing: -.03em; font-weight: 720; margin-bottom: .35rem; }
.auth-head p { color: var(--muted); margin: 0; font-size: .95rem; }
.auth-badge { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); margin-bottom: 1.1rem; }
.auth-badge .icon { width: 22px; height: 22px; }
.auth-badge.lg { width: 64px; height: 64px; border-radius: 20px; margin: 0 auto; animation: pop-in var(--dur-slow) var(--ease-spring); }
.auth-badge.lg .icon { width: 28px; height: 28px; }
.auth-badge.ok { background: var(--ok-soft); color: var(--ok); }
.auth-badge.bad { background: var(--bad-soft); color: var(--bad); }
#auth-view .form-control { height: 46px; border-radius: 11px; background-color: var(--surface-2); font-size: .95rem; }
#auth-view .form-control:focus { background-color: var(--surface); }
#auth-view .form-control.otp-input { height: 58px; }
/* Browser autofill: keep our colours instead of the grey/blue fill */
#auth-view .form-control:-webkit-autofill, #auth-view .form-control:-webkit-autofill:hover, #auth-view .form-control:-webkit-autofill:focus { -webkit-text-fill-color: var(--text); caret-color: var(--text); -webkit-box-shadow: 0 0 0 1000px var(--surface-2) inset; box-shadow: 0 0 0 1000px var(--surface-2) inset; transition: background-color 9999s ease-out 0s; }
#auth-view .form-control:-webkit-autofill:focus { -webkit-box-shadow: 0 0 0 1000px var(--surface) inset, var(--ring); box-shadow: 0 0 0 1000px var(--surface) inset, var(--ring); }
.pw-wrap .form-control { padding-right: 2.9rem; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border: 0; border-radius: 8px; background: transparent; color: var(--faint); display: grid; place-items: center; transition: background var(--dur-fast), color var(--dur-fast); }
.pw-toggle:hover, .pw-toggle.on { background: var(--surface-hover); color: var(--text); }
.pw-toggle .icon { position: static; transform: none; color: inherit; }
.pw-meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: .55rem; }
.pw-meter span { height: 4px; border-radius: 4px; background: var(--border); transition: background var(--dur); }
.pw-meter small { grid-column: 1 / -1; font-size: .78rem; color: var(--muted); margin-top: .15rem; }
.pw-meter[data-s="0"] span:nth-child(-n+1), .pw-meter[data-s="1"] span:nth-child(-n+1) { background: var(--bad); }
.pw-meter[data-s="2"] span:nth-child(-n+2) { background: var(--warn); }
.pw-meter[data-s="3"] span:nth-child(-n+3) { background: var(--info); }
.pw-meter[data-s="4"] span { background: var(--ok); }
.auth-submit { height: 48px; border-radius: 12px; font-size: .98rem; margin-top: .4rem; }
.auth-perks { list-style: none; padding: 0; margin: 1.1rem 0 0; display: flex; flex-direction: column; gap: .35rem; font-size: .82rem; color: var(--muted); }
.auth-perks .icon { color: var(--ok); margin-right: .25rem; }
.auth-alt { text-align: center; color: var(--muted); font-size: .88rem; margin: 1.75rem 0 0; }
.auth-alt a { font-weight: 600; }
.otp-input { font-size: 1.6rem; letter-spacing: .5em; text-align: center; font-weight: 600; font-family: ui-monospace, Menlo, monospace; }
@media (max-width: 991.98px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
  .auth-panel { padding: 1rem 1.25rem; }
}
@media (min-width: 992px) and (max-height: 760px) { .ah-stack { display: none; } }

/* ---------- brand mark ---------- */
.brand { display: flex; align-items: center; gap: .65rem; font-weight: 700; letter-spacing: -.02em; }
.brand-mark { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: .8rem; letter-spacing: .02em; background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 55%, #14b8a6)); box-shadow: 0 6px 14px -6px rgba(var(--brand-rgb), .7); flex: none; }

/* ---------- app shell: rail | section menu | header + content (Teams-style) ---------- */
.app-shell { display: flex; min-height: 100vh; }

/* left navigation = app rail + section menu, fixed */
.nav-wrap { position: fixed; inset: 0 auto 0 0; z-index: 1040; display: flex; transition: transform var(--dur-slow) var(--ease); }

.rail { width: var(--rail-w); flex: none; display: flex; flex-direction: column; align-items: center; gap: .25rem; padding: .7rem 0 .8rem; background: var(--rail-bg); border-right: 1px solid var(--border); }
.rail-brand { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: .6rem; border-radius: 12px; }
.rail-brand:hover { text-decoration: none; }
.rail-brand .brand-mark { width: 38px; height: 38px; }
.rail-apps { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .15rem; width: 100%; overflow-y: auto; scrollbar-width: none; }
.rail-apps::-webkit-scrollbar { display: none; }
.rail-foot { display: flex; flex-direction: column; align-items: center; gap: .15rem; width: 100%; padding-top: .5rem; border-top: 1px solid var(--border); }
.rail-item { position: relative; width: calc(100% - 12px); display: flex; flex-direction: column; align-items: center; gap: .2rem; padding: .5rem .15rem .45rem; border-radius: 10px; color: var(--rail-ink); font-size: .66rem; font-weight: 600; letter-spacing: .01em; transition: background var(--dur-fast), color var(--dur-fast); }
.rail-item:hover { background: var(--rail-hover); color: var(--text); text-decoration: none; }
.rail-item .rail-ic { position: relative; display: grid; place-items: center; width: 34px; height: 28px; border-radius: 8px; transition: background var(--dur-fast), transform var(--dur-fast) var(--ease-spring); }
.rail-item .rail-ic .icon { width: 21px; height: 21px; }
.rail-item:active .rail-ic { transform: scale(.92); }
.rail-item.active { color: var(--brand); }
.rail-item.active .rail-ic { background: var(--brand-soft); }
.rail-item.active .rail-ic .icon { stroke-width: 2.1; }
.rail-item.active::before { content: ''; position: absolute; left: -6px; top: 22%; bottom: 22%; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); animation: grow-y var(--dur) var(--ease); }
.rail-label { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail-dot { position: absolute; top: 1px; right: 2px; width: 9px; height: 9px; border-radius: 50%; background: var(--bad); box-shadow: 0 0 0 2px var(--rail-bg); }

.subnav { width: var(--subnav-w); flex: none; display: flex; flex-direction: column; background: var(--surface); border-right: 1px solid var(--border); transition: margin-left var(--dur) var(--ease), opacity var(--dur) var(--ease); }
.subnav-head { height: var(--topbar-h); flex: none; display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: 0 .65rem 0 1.15rem; border-bottom: 1px solid var(--border); }
.subnav-eyebrow { font-size: .7rem; color: var(--muted); font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.subnav-title { font-size: 1.05rem; margin: 0; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-nav { flex: 1; overflow-y: auto; padding: .4rem .6rem 1rem; }
.side-nav .sn-group { animation: rise var(--dur) var(--ease) both; }
.side-nav .sn-group + .sn-group { margin-top: .35rem; }
.side-nav .section { font-size: .68rem; font-weight: 650; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); padding: .9rem .65rem .35rem; white-space: nowrap; }
.side-link { position: relative; display: flex; align-items: center; gap: .7rem; padding: .5rem .65rem; margin: 1px 0; border-radius: 8px; color: var(--text-2); font-weight: 520; font-size: .9rem; white-space: nowrap; transition: background var(--dur-fast), color var(--dur-fast); }
.side-link > span:not(.count) { overflow: hidden; text-overflow: ellipsis; }
.side-link .icon { color: var(--muted); transition: color var(--dur-fast); }
.side-link:hover { background: var(--surface-hover); color: var(--text); text-decoration: none; }
.side-link.active { background: var(--brand-soft); color: var(--brand); font-weight: 620; }
.side-link.active .icon { color: var(--brand); }
.side-link .count { margin-left: auto; font-size: .7rem; font-weight: 650; background: var(--bad); color: #fff; border-radius: 999px; padding: .08rem .45rem; min-width: 1.4rem; text-align: center; }
.side-link .count.neutral { background: var(--surface-hover); color: var(--muted); }

.main { flex: 1; min-width: 0; margin-left: calc(var(--rail-w) + var(--subnav-w)); transition: margin-left var(--dur) var(--ease); }
.topbar { position: sticky; top: 0; z-index: 1030; height: var(--topbar-h); display: flex; align-items: center; gap: .6rem; padding: 0 1.25rem; background: color-mix(in srgb, var(--surface) 86%, transparent); backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid var(--border); }
.top-crumbs { display: flex; align-items: center; gap: .35rem; min-width: 0; font-size: .9rem; white-space: nowrap; }
.top-crumbs .tc-app { color: var(--muted); font-weight: 550; }
.top-crumbs .icon { color: var(--faint); }
.top-crumbs .tc-page { color: var(--text); font-weight: 620; overflow: hidden; text-overflow: ellipsis; }
.top-crumbs a.tc-page:hover { color: var(--brand); }
.search-trigger { display: flex; align-items: center; gap: .6rem; height: 38px; width: min(440px, 36vw); margin: 0 auto; padding: 0 .8rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); color: var(--faint); font-size: .88rem; transition: border-color var(--dur-fast), box-shadow var(--dur-fast), background var(--dur-fast); }
.search-trigger:hover { border-color: var(--border-strong); background: var(--surface); box-shadow: var(--shadow-sm); }
.search-trigger kbd { margin-left: auto; background: var(--surface); color: var(--muted); border: 1px solid var(--border); font-size: .7rem; padding: .05rem .35rem; border-radius: 6px; font-family: inherit; }
.top-actions { display: flex; align-items: center; gap: .25rem; flex: none; }
.firm-chip { display: flex; align-items: center; gap: .55rem; height: 38px; max-width: 230px; padding: 0 .55rem 0 .3rem; margin-right: .25rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); text-align: left; transition: border-color var(--dur-fast), background var(--dur-fast); }
.firm-chip:hover { border-color: var(--border-strong); background: var(--surface-hover); }
.firm-chip .firm-logo { width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: .7rem; flex: none; }
.firm-chip .meta { min-width: 0; line-height: 1.15; }
.firm-chip .meta strong { display: block; font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.firm-chip .meta small { display: block; color: var(--muted); font-size: .7rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; font-size: .75rem; font-weight: 650; color: #fff; flex: none; }
.avatar-sm { width: 26px; height: 26px; font-size: .64rem; }
.avatar-xs { width: 22px; height: 22px; font-size: .58rem; }
.user-btn { display: flex; align-items: center; padding: 2px; margin-left: .2rem; border-radius: 999px; border: 2px solid transparent; background: transparent; color: var(--text); transition: border-color var(--dur-fast); }
.user-btn:hover, .user-btn[aria-expanded="true"] { border-color: var(--brand-soft); }
.content { padding: 1.5rem 1.75rem 2.5rem; max-width: 1440px; }
.show-menu-btn { display: none !important; }

/* desktop: section menu can be hidden, leaving just the rail */
@media (min-width: 992px) {
  body.sb-collapsed .subnav { margin-left: calc(-1 * var(--subnav-w)); opacity: 0; pointer-events: none; }
  body.sb-collapsed .main { margin-left: var(--rail-w); }
  body.sb-collapsed .show-menu-btn { display: inline-flex !important; }
}

/* tablet/phone: rail + section menu slide in together */
@media (max-width: 991.98px) {
  .nav-wrap { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  body.sb-open .nav-wrap { transform: none; }
  .subnav { width: min(var(--subnav-w), calc(100vw - var(--rail-w) - 40px)); }
  .main { margin-left: 0; }
  .sb-scrim { position: fixed; inset: 0; background: rgba(15, 23, 42, .4); z-index: 1035; opacity: 0; pointer-events: none; transition: opacity var(--dur); }
  body.sb-open .sb-scrim { opacity: 1; pointer-events: auto; }
  .search-trigger { width: 38px; margin: 0 0 0 auto; padding: 0; justify-content: center; flex: none; background: transparent; border-color: transparent; }
  .search-trigger .st-text, .search-trigger kbd { display: none; }
  .firm-chip .meta, .firm-chip > [data-icon] { display: none; }
  .firm-chip { padding: 0 .3rem; }
  .topbar { padding: 0 .75rem; gap: .35rem; }
  .content { padding: 1rem; }
}
@media (max-width: 575.98px) {
  .top-crumbs .tc-app, .top-crumbs .icon { display: none; }
  .firm-chip { display: none; }
}

/* avatar colours (deterministic per name) */
.av-0 { background: #059669; } .av-1 { background: #0d9488; } .av-2 { background: #059669; } .av-3 { background: #d97706; } .av-4 { background: #db2777; }
.av-5 { background: #7c3aed; } .av-6 { background: #0d9488; } .av-7 { background: #ea580c; } .av-8 { background: #15803d; } .av-9 { background: #65a30d; }

/* ---------- surfaces & components ---------- */
.card-surface { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card-surface.pad { padding: 1.25rem; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); }
.card-head h2, .card-head h3 { font-size: .98rem; margin: 0; display: flex; align-items: center; gap: .5rem; }
.card-body-pad { padding: 1.25rem; }
.lift { transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur); }
.lift:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border-strong); }

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.page-head h1 { font-size: 1.55rem; margin: 0; }
.page-head .sub { color: var(--muted); margin: .25rem 0 0; font-size: .92rem; }
.page-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; font-size: .84rem; color: var(--muted); margin-bottom: .6rem; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--brand); }

.stat { position: relative; overflow: hidden; padding: 1.15rem 1.2rem; display: flex; flex-direction: column; gap: .35rem; height: 100%; color: var(--text); }
.stat:hover { text-decoration: none; color: var(--text); }
.stat .label { display: flex; align-items: center; gap: .5rem; font-size: .82rem; color: var(--muted); font-weight: 550; }
.stat .ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; }
.stat .value { font-size: 1.9rem; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat .hint { font-size: .78rem; color: var(--muted); }
.tone-brand .ic { background: var(--brand-soft); color: var(--brand); }
.tone-ok .ic { background: var(--ok-soft); color: var(--ok); }
.tone-warn .ic { background: var(--warn-soft); color: var(--warn); }
.tone-bad .ic { background: var(--bad-soft); color: var(--bad); }
.tone-info .ic { background: var(--info-soft); color: var(--info); }
.tone-violet .ic { background: var(--violet-soft); color: var(--violet); }
.tone-bad .value { color: var(--bad); }

.pill { display: inline-flex; align-items: center; gap: .35rem; padding: .2rem .6rem; border-radius: 999px; font-size: .74rem; font-weight: 600; white-space: nowrap; line-height: 1.4; }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.pill.no-dot::before { display: none; }
.pill-ok { background: var(--ok-soft); color: var(--ok); }
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.pill-bad { background: var(--bad-soft); color: var(--bad); }
.pill-info { background: var(--info-soft); color: var(--info); }
.pill-violet { background: var(--violet-soft); color: var(--violet); }
.pill-brand { background: var(--brand-soft); color: var(--brand); }
.pill-muted { background: var(--surface-hover); color: var(--muted); }
.tag { display: inline-flex; align-items: center; gap: .3rem; padding: .12rem .5rem; border-radius: 6px; font-size: .74rem; font-weight: 550; background: var(--surface-hover); color: var(--text-2); border: 1px solid var(--border); }

.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 11px; background: var(--surface-hover); border: 1px solid var(--border); flex-wrap: wrap; }
.seg button { border: 0; background: transparent; color: var(--muted); font-weight: 560; font-size: .85rem; padding: .38rem .8rem; border-radius: 8px; display: inline-flex; align-items: center; gap: .4rem; transition: background var(--dur-fast), color var(--dur-fast), box-shadow var(--dur-fast); }
.seg button:hover { color: var(--text); }
.seg button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.seg button .n { font-size: .7rem; background: var(--border); color: var(--text-2); border-radius: 999px; padding: 0 .4rem; }
.seg button.active .n { background: var(--brand-soft); color: var(--brand); }

.tabs-u { display: flex; gap: 1.25rem; border-bottom: 1px solid var(--border); margin-bottom: 1.25rem; overflow-x: auto; }
.tabs-u button { position: relative; border: 0; background: none; color: var(--muted); font-weight: 560; padding: .7rem 0; white-space: nowrap; display: inline-flex; align-items: center; gap: .4rem; }
.tabs-u button:hover { color: var(--text); }
.tabs-u button.active { color: var(--brand); }
.tabs-u button.active::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--brand); border-radius: 2px; animation: grow-x var(--dur) var(--ease); }
.tabs-u .n { font-size: .7rem; background: var(--surface-hover); border-radius: 999px; padding: 0 .4rem; color: var(--muted); }

.toolbar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-bottom: 1rem; }
.toolbar .grow { flex: 1 1 240px; }

.empty { text-align: center; padding: 3.5rem 1rem; color: var(--muted); }
.empty .ic { width: 56px; height: 56px; margin: 0 auto 1rem; border-radius: 16px; display: grid; place-items: center; background: var(--brand-softer); color: var(--brand); }
.empty .ic .icon { width: 26px; height: 26px; }
.empty h3 { font-size: 1.05rem; color: var(--text); margin-bottom: .35rem; }

.kv { display: grid; grid-template-columns: minmax(120px, 38%) 1fr; gap: .55rem 1rem; margin: 0; font-size: .9rem; }
.kv dt { color: var(--muted); font-weight: 500; }
.kv dd { margin: 0; color: var(--text); word-break: break-word; }

.list-plain { list-style: none; padding: 0; margin: 0; }
.list-row { display: flex; align-items: center; gap: .75rem; padding: .7rem 0; border-bottom: 1px solid var(--border); }
.list-row:last-child { border-bottom: 0; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .title { font-weight: 560; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.list-row .meta { font-size: .8rem; color: var(--muted); }

.banner { display: flex; gap: .85rem; align-items: flex-start; padding: .9rem 1.1rem; border-radius: var(--radius); border: 1px solid; margin-bottom: 1.25rem; animation: rise var(--dur) var(--ease); }
.banner .icon { margin-top: 2px; }
.banner-warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 30%, transparent); color: color-mix(in srgb, var(--warn) 75%, var(--text)); }
.banner-info { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 30%, transparent); color: color-mix(in srgb, var(--info) 75%, var(--text)); }
.banner-bad { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 30%, transparent); color: color-mix(in srgb, var(--bad) 80%, var(--text)); }
.banner .grow { flex: 1; }

/* bars (task distribution) */
.bars { display: flex; flex-direction: column; gap: .8rem; }
.bar-row { display: grid; grid-template-columns: 130px 1fr 42px; align-items: center; gap: .75rem; font-size: .86rem; }
.bar-track { height: 10px; background: var(--surface-hover); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; width: 0; border-radius: 999px; transition: width 900ms var(--ease); }
.stack-bar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: var(--surface-hover); gap: 2px; }
.stack-bar span { transition: flex-grow 900ms var(--ease); flex-grow: 0; }

/* timeline */
.timeline { list-style: none; margin: 0; padding: 0 0 0 1.25rem; position: relative; }
.timeline::before { content: ''; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: var(--border); border-radius: 2px; }
.timeline li { position: relative; padding: 0 0 1.05rem .6rem; font-size: .88rem; }
.timeline li::before { content: ''; position: absolute; left: -1.25rem; top: 4px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 3px solid var(--border-strong); }
.timeline li.t-brand::before { border-color: var(--brand); }
.timeline li.t-ok::before { border-color: var(--ok); }
.timeline li.t-warn::before { border-color: var(--warn); }
.timeline li.t-bad::before { border-color: var(--bad); }
.timeline .when { color: var(--faint); font-size: .76rem; }

/* comments */
.comment { display: flex; gap: .7rem; margin-bottom: 1rem; animation: rise var(--dur) var(--ease); }
.comment .bubble { flex: 1; background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px 14px 14px 14px; padding: .65rem .85rem; font-size: .9rem; white-space: pre-wrap; word-break: break-word; }
.comment .who { font-size: .8rem; color: var(--muted); margin-bottom: .2rem; }
.comment .who strong { color: var(--text); }

/* workflow stepper */
.stepper { display: flex; align-items: center; gap: 0; overflow-x: auto; padding: .25rem 0 .5rem; }
.step { display: flex; align-items: center; gap: .5rem; white-space: nowrap; color: var(--faint); font-size: .82rem; font-weight: 560; }
.step .dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--border-strong); background: var(--surface); transition: all var(--dur) var(--ease); }
.step.done { color: var(--text-2); }
.step.done .dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.step.current { color: var(--brand); }
.step.current .dot { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 4px rgba(var(--brand-rgb), .12); animation: pulse 2s infinite; }
.step-line { flex: 1 0 24px; height: 2px; background: var(--border); margin: 0 .5rem; min-width: 24px; position: relative; overflow: hidden; }
.step-line.done::after { content: ''; position: absolute; inset: 0; background: var(--ok); animation: grow-x 600ms var(--ease) both; transform-origin: left; }

/* kanban board */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(270px, 1fr); gap: 1rem; overflow-x: auto; padding-bottom: .75rem; scroll-snap-type: x proximity; }
.board-col { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-lg); display: flex; flex-direction: column; min-height: 320px; max-height: calc(100vh - 250px); scroll-snap-align: start; transition: background var(--dur-fast), border-color var(--dur-fast); }
.board-col.drag-over { background: var(--brand-softer); border-color: var(--brand); border-style: dashed; }
.board-col.drag-denied { opacity: .5; }
.board-col-head { display: flex; align-items: center; justify-content: space-between; padding: .8rem .9rem .6rem; font-weight: 620; font-size: .88rem; }
.board-col-body { flex: 1; overflow-y: auto; padding: 0 .6rem .6rem; display: flex; flex-direction: column; gap: .55rem; }
.kcard { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: .75rem .8rem; box-shadow: var(--shadow-sm); cursor: grab; transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), opacity var(--dur); animation: rise var(--dur) var(--ease) both; }
.kcard:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.kcard.dragging { opacity: .45; transform: rotate(2deg) scale(.98); }
.kcard .t { font-weight: 580; font-size: .9rem; margin: .2rem 0 .45rem; color: var(--text); line-height: 1.35; }
.kcard .krow { display: flex; align-items: center; justify-content: space-between; gap: .5rem; font-size: .76rem; color: var(--muted); }
.prio { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.prio-urgent { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }
.prio-high { background: var(--warn); }
.prio-normal { background: var(--info); }
.prio-low { background: var(--faint); }
.due-bad { color: var(--bad); font-weight: 600; }
.due-warn { color: var(--warn); font-weight: 600; }

/* group tree */
.tree-row td:first-child { position: relative; }
.tree-toggle { width: 22px; height: 22px; border: 0; background: transparent; border-radius: 6px; display: inline-grid; place-items: center; color: var(--muted); margin-right: .25rem; }
.tree-toggle:hover { background: var(--surface-hover); }
.tree-toggle .icon { transition: transform var(--dur) var(--ease); width: 14px; height: 14px; }
.tree-toggle.open .icon { transform: rotate(90deg); }
.tree-spacer { display: inline-block; width: 26px; }
.tree-row.hidden-row { display: none; }
.lvl-1 { padding-left: 1.6rem !important; } .lvl-2 { padding-left: 3.2rem !important; } .lvl-3 { padding-left: 4.8rem !important; } .lvl-4 { padding-left: 6.4rem !important; }

/* notifications */
.notif-count { position: absolute; top: 3px; right: 3px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--bad); color: #fff; font-size: .62rem; font-weight: 700; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--bg); animation: pop-in var(--dur) var(--ease-spring); }
.notif-menu { width: min(380px, 92vw); }
.notif-list { max-height: 420px; overflow-y: auto; padding: .35rem; }
.notif-item { display: flex; gap: .65rem; padding: .6rem .65rem; border-radius: 10px; color: var(--text); }
.notif-item:hover { background: var(--surface-hover); text-decoration: none; color: var(--text); }
.notif-item .dot { width: 8px; height: 8px; border-radius: 50%; margin-top: .45rem; background: transparent; flex: none; }
.notif-item.unread .dot { background: var(--brand); }
.notif-item small { display: block; color: var(--muted); font-size: .78rem; }
.notif-item .when { color: var(--faint); }
.notif-item .grow { min-width: 0; flex: 1; }

/* command palette */
.palette .modal-dialog { max-width: 620px; margin-top: 12vh; }
.palette .modal-content { overflow: hidden; }
.palette input { border: 0; border-bottom: 1px solid var(--border); border-radius: 0; padding: 1.1rem 1.2rem 1.1rem 3rem; font-size: 1.05rem; background: var(--surface); }
.palette input:focus { box-shadow: none; }
.palette .input-icon .icon { left: 1.15rem; }
.palette-results { max-height: 50vh; overflow-y: auto; padding: .5rem; }
.palette-results .grp { font-size: .7rem; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); padding: .6rem .7rem .3rem; font-weight: 650; }
.palette-item { display: flex; align-items: center; gap: .75rem; padding: .6rem .7rem; border-radius: 10px; color: var(--text); cursor: pointer; }
.palette-item .sub { margin-left: auto; color: var(--faint); font-size: .78rem; }
.palette-item.active, .palette-item:hover { background: var(--brand-soft); color: var(--brand); text-decoration: none; }
.palette-foot { border-top: 1px solid var(--border); padding: .5rem 1rem; font-size: .75rem; color: var(--faint); display: flex; gap: 1rem; }
.palette-foot kbd { background: var(--surface-hover); color: var(--muted); border: 1px solid var(--border); font-size: .7rem; padding: 0 .3rem; border-radius: 4px; }

/* toasts */
.toast-stack { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 3000; display: flex; flex-direction: column; gap: .6rem; pointer-events: none; }
.toast-x { pointer-events: auto; display: flex; align-items: center; gap: .7rem; min-width: 260px; max-width: 380px; padding: .8rem 1rem; border-radius: 12px; background: var(--text); color: var(--bg); box-shadow: var(--shadow-lg); font-size: .9rem; animation: toast-in 360ms var(--ease-spring); }
.toast-x.leaving { animation: toast-out 260ms var(--ease) forwards; }
.toast-x .ic { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.toast-x.ok .ic { background: var(--ok); color: #fff; }
.toast-x.bad .ic { background: var(--bad); color: #fff; }
.toast-x.info .ic { background: var(--brand); color: #fff; }

/* skeletons */
.skel { position: relative; overflow: hidden; background: var(--surface-hover); border-radius: 8px; }
.skel::after { content: ''; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent); animation: shimmer 1.3s infinite; }
[data-bs-theme="dark"] .skel::after { background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .06), transparent); }
.skel-line { height: 12px; margin: .55rem 0; }
.skel-title { height: 26px; width: 40%; margin-bottom: 1rem; }
.skel-card { height: 112px; border-radius: var(--radius-lg); }

/* progress line at top during navigation */
.nav-progress { position: fixed; top: 0; left: 0; height: 2px; width: 0; background: linear-gradient(90deg, var(--brand), color-mix(in srgb, var(--brand) 50%, #14b8a6)); z-index: 4000; opacity: 0; transition: width 600ms var(--ease), opacity 300ms; box-shadow: 0 0 8px rgba(var(--brand-rgb), .6); }
.nav-progress.on { opacity: 1; width: 70%; }
.nav-progress.done { opacity: 0; width: 100%; transition: width 200ms, opacity 400ms 150ms; }

/* swatches */
.swatches { display: flex; flex-wrap: wrap; gap: .5rem; }
.swatch { width: 34px; height: 34px; border-radius: 10px; border: 2px solid transparent; cursor: pointer; transition: transform var(--dur-fast) var(--ease-spring); }
.swatch:hover { transform: scale(1.1); }
.swatch.active { border-color: var(--text); box-shadow: 0 0 0 2px var(--surface) inset; }
.sw-4f46e5 { background: #4f46e5; } .sw-0ea5e9 { background: #0ea5e9; } .sw-059669 { background: #059669; } .sw-d97706 { background: #d97706; }
.sw-dc2626 { background: #dc2626; } .sw-db2777 { background: #db2777; } .sw-7c3aed { background: #7c3aed; } .sw-1f4e79 { background: #1f4e79; } .sw-0f172a { background: #0f172a; }

/* MFA */
.qr-box { display: inline-block; padding: 12px; background: #fff; border-radius: 14px; border: 1px solid var(--border); animation: pop-in var(--dur-slow) var(--ease-spring); }
.qr-box svg { display: block; width: 184px; height: 184px; }
.codes-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .4rem .75rem; padding: 1rem; background: var(--surface-2); border: 1px dashed var(--border-strong); border-radius: var(--radius); }
.codes-grid code { font-size: .95rem; color: var(--text); }

/* responsive tables → cards */
@media (max-width: 767.98px) {
  .table-stack thead { display: none; }
  .table-stack, .table-stack tbody, .table-stack tr, .table-stack td { display: block; width: 100%; }
  .table-stack tr { border-bottom: 1px solid var(--border); padding: .6rem .25rem; }
  .table-stack > :not(caption) > * > * { padding: .3rem .85rem; border: 0; }
  .table-stack td[data-label] { display: flex; align-items: center; justify-content: space-between; gap: 1rem; text-align: right; }
  .table-stack td[data-label]::before { content: attr(data-label); flex: none; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); font-weight: 600; text-align: left; }
  .table-stack td[data-label]:first-child, .table-stack td[data-label="Client"], .table-stack td[data-label="Task"], .table-stack td[data-label="Member"], .table-stack td[data-label="Group"] { display: block; text-align: left; }
  .table-stack td[data-label]:first-child::before, .table-stack td[data-label="Client"]::before, .table-stack td[data-label="Task"]::before, .table-stack td[data-label="Member"]::before, .table-stack td[data-label="Group"]::before { display: none; }
  .table-stack td:empty { display: none; }
  .page-head h1 { font-size: 1.3rem; }
  .bar-row { grid-template-columns: 100px 1fr 36px; }
  .kv { grid-template-columns: 1fr; gap: .15rem; }
  .kv dd { margin-bottom: .5rem; }
}

/* ---------- public landing page ---------- */
.landing { min-height: 100vh; background: var(--surface); }
.lp-wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 1.25rem; }
.lp-nav { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--surface) 85%, transparent); backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid var(--border); }
.lp-nav .lp-wrap { height: 68px; display: flex; align-items: center; gap: 1.5rem; }
.lp-links { display: flex; gap: 1.5rem; margin-left: 1rem; }
.lp-links a { color: var(--text-2); font-weight: 550; font-size: .92rem; }
.lp-links a:hover { color: var(--brand); text-decoration: none; }
.lp-cta { margin-left: auto; display: flex; align-items: center; gap: .35rem; }
.lp-cta #lp-auth { display: flex; gap: .35rem; }

.lp-hero { position: relative; overflow: hidden; padding: 4.5rem 0 4rem; background: linear-gradient(180deg, var(--brand-softer), transparent 70%); }
.lp-glow { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .35; pointer-events: none; animation: float 16s ease-in-out infinite; }
.lp-glow.g1 { width: 420px; height: 420px; background: color-mix(in srgb, var(--brand) 70%, #14b8a6); top: -140px; right: -80px; }
.lp-glow.g2 { width: 320px; height: 320px; background: color-mix(in srgb, var(--brand) 55%, #f472b6); bottom: -160px; left: -100px; animation-delay: -6s; opacity: .22; }
.lp-hero-grid { position: relative; display: grid; grid-template-columns: 1fr 1.08fr; gap: 3rem; align-items: center; }
.lp-hero-copy { animation: rise var(--dur-slow) var(--ease) both; }
.lp-eyebrow { display: inline-flex; align-items: center; gap: .45rem; padding: .3rem .75rem; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-size: .8rem; font-weight: 620; margin-bottom: 1.25rem; }
.lp-hero h1 { font-size: clamp(2.1rem, 4.4vw, 3.35rem); line-height: 1.07; letter-spacing: -.035em; font-weight: 760; margin-bottom: 1.2rem; }
.lp-hero h1 span { background: linear-gradient(90deg, var(--brand), color-mix(in srgb, var(--brand) 45%, #84cc16)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lp-lead { font-size: 1.1rem; color: var(--text-2); line-height: 1.6; max-width: 34rem; margin-bottom: 1.75rem; }
.lp-actions { display: flex; flex-wrap: wrap; gap: .65rem; }
.lp-actions .btn-lg { --bs-btn-padding-y: .75rem; --bs-btn-padding-x: 1.3rem; --bs-btn-font-size: 1rem; --bs-btn-border-radius: 12px; }
.lp-points { list-style: none; padding: 0; margin: 1.75rem 0 0; display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; color: var(--muted); font-size: .88rem; }
.lp-points li { display: inline-flex; align-items: center; gap: .4rem; }
.lp-points .icon { color: var(--ok); }

/* product mock (pure HTML/CSS) */
.lp-hero-art { animation: rise var(--dur-slow) var(--ease) 120ms both; }
.lp-mock { display: grid; grid-template-columns: 54px 150px 1fr; height: 400px; border-radius: 18px; overflow: hidden; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 30px 80px -30px rgba(var(--brand-rgb), .45), var(--shadow-lg); transform: perspective(1600px) rotateY(-6deg) rotateX(2deg); transition: transform var(--dur-slow) var(--ease); }
.lp-mock:hover { transform: perspective(1600px) rotateY(-2deg); }
.m-rail { background: var(--rail-bg); border-right: 1px solid var(--border); display: flex; flex-direction: column; align-items: center; gap: .55rem; padding: .7rem 0; }
.m-logo { width: 28px; height: 28px; border-radius: 8px; background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 55%, #14b8a6)); margin-bottom: .35rem; }
.m-ri { width: 32px; height: 28px; display: grid; place-items: center; border-radius: 8px; color: var(--muted); }
.m-ri .icon { width: 17px; height: 17px; }
.m-ri.on { background: var(--brand-soft); color: var(--brand); }
.m-sub { border-right: 1px solid var(--border); padding: .8rem .55rem; display: flex; flex-direction: column; gap: .2rem; font-size: .72rem; }
.m-sub b { font-size: .85rem; padding: 0 .4rem .5rem; }
.m-sub small { font-size: .55rem; letter-spacing: .08em; color: var(--faint); font-weight: 700; padding: .5rem .4rem .15rem; }
.m-sub span { display: flex; align-items: center; gap: .4rem; padding: .35rem .4rem; border-radius: 6px; color: var(--text-2); }
.m-sub span.on { background: var(--brand-soft); color: var(--brand); font-weight: 650; }
.m-sub em { margin-left: auto; font-style: normal; background: var(--bad); color: #fff; border-radius: 999px; font-size: .55rem; padding: 0 .35rem; }
.m-main { display: flex; flex-direction: column; min-width: 0; background: var(--bg); }
.m-top { height: 44px; display: flex; align-items: center; gap: .6rem; padding: 0 .8rem; border-bottom: 1px solid var(--border); background: var(--surface); font-size: .72rem; color: var(--muted); }
.m-search { margin: 0 auto; display: flex; align-items: center; gap: .3rem; width: 45%; height: 24px; padding: 0 .5rem; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-2); color: var(--faint); }
.m-av { width: 22px; height: 22px; border-radius: 50%; background: #059669; }
.m-body { padding: .8rem; display: flex; flex-direction: column; gap: .7rem; }
.m-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: .55rem; }
.m-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: .6rem; display: flex; flex-direction: column; gap: .35rem; font-size: .7rem; animation: rise var(--dur-slow) var(--ease) both; }
.m-card:nth-child(2) { animation-delay: 120ms; } .m-card:nth-child(3) { animation-delay: 240ms; }
.m-card .pill { font-style: normal; font-size: .58rem; align-self: flex-start; padding: .1rem .45rem; }
.m-line { height: 6px; border-radius: 4px; background: var(--surface-hover); }
.m-line.s { width: 60%; }
.m-table { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: .3rem .6rem; }
.m-row { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: .8rem; padding: .55rem 0; border-bottom: 1px solid var(--border); }
.m-row:last-child { border-bottom: 0; }
.m-row span { height: 7px; border-radius: 4px; background: var(--surface-hover); }
.m-row span:first-child { background: color-mix(in srgb, var(--text) 14%, transparent); }

.lp-section { padding: 5rem 0; }
.lp-alt { background: var(--bg); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.lp-head { text-align: center; max-width: 640px; margin: 0 auto 2.75rem; }
.lp-kicker { display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); margin-bottom: .6rem; }
.lp-head h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); letter-spacing: -.03em; font-weight: 720; margin-bottom: .7rem; }
.lp-head p { color: var(--muted); font-size: 1.02rem; }
.lp-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.lp-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.35rem; }
.lp-card h3, .lp-steps h3, .lp-sec-item h3 { font-size: 1rem; margin: .9rem 0 .4rem; }
.lp-card p, .lp-steps p, .lp-sec-item p { color: var(--muted); font-size: .9rem; margin: 0; line-height: 1.55; }
.lp-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); flex: none; }
.lp-ic .icon { width: 21px; height: 21px; }
.lp-steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; counter-reset: s; }
.lp-steps li { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.35rem; }
.lp-step-n { position: absolute; top: 1.1rem; right: 1.2rem; font-size: 2rem; font-weight: 800; color: var(--border-strong); letter-spacing: -.04em; line-height: 1; }
.lp-sec-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 3rem; align-items: center; }
.lp-sec-list { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.lp-sec-item { display: flex; gap: .9rem; padding: 1.2rem; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface-2); }
.lp-sec-item h3 { margin-top: .1rem; }
.lp-band { padding: 0 0 5rem; }
.lp-band-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem; padding: 2.5rem; border-radius: 22px; color: #fff; background: radial-gradient(700px 300px at 0% 0%, color-mix(in srgb, var(--brand) 70%, #14b8a6), transparent 60%), linear-gradient(135deg, color-mix(in srgb, var(--brand) 85%, #000), #111827); }
.lp-band-inner h2 { color: #fff; font-size: 1.7rem; margin: 0 0 .35rem; }
.lp-band-inner p { margin: 0; opacity: .8; }
.lp-foot { border-top: 1px solid var(--border); padding: 2rem 0; background: var(--bg); }
.lp-foot .lp-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 2rem; }
.lp-foot nav { display: flex; gap: 1.25rem; }
.lp-foot nav a { color: var(--muted); font-size: .9rem; }
.lp-foot small { flex-basis: 100%; color: var(--faint); }

@media (max-width: 1099.98px) {
  .lp-grid, .lp-steps { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 991.98px) {
  .lp-hero-grid, .lp-sec-grid { grid-template-columns: 1fr; }
  .lp-hero { padding-top: 3rem; }
  .lp-mock { transform: none; height: 340px; grid-template-columns: 46px 0 1fr; }
  .lp-mock:hover { transform: none; }
  .m-sub { display: none; }
  .lp-links { display: none; }
}
@media (max-width: 575.98px) {
  .lp-grid, .lp-steps, .lp-sec-list { grid-template-columns: 1fr; }
  .lp-cta .btn-ghost:not(.btn-icon) { display: none; }
  .lp-nav .brand span:last-child { display: none; }
  .lp-section { padding: 3.5rem 0; }
  .lp-band-inner { padding: 1.75rem; }
  .m-cards { grid-template-columns: 1fr 1fr; }
  .m-card:nth-child(3) { display: none; }
}

/* ---------- motion ---------- */
.page-enter { animation: page-in var(--dur-slow) var(--ease) both; }
.stagger > * { animation: rise var(--dur-slow) var(--ease) both; }
.stagger > *:nth-child(1) { animation-delay: 0ms; }
.stagger > *:nth-child(2) { animation-delay: 40ms; }
.stagger > *:nth-child(3) { animation-delay: 80ms; }
.stagger > *:nth-child(4) { animation-delay: 120ms; }
.stagger > *:nth-child(5) { animation-delay: 160ms; }
.stagger > *:nth-child(6) { animation-delay: 200ms; }
.stagger > *:nth-child(7) { animation-delay: 240ms; }
.stagger > *:nth-child(8) { animation-delay: 280ms; }
.stagger > *:nth-child(n+9) { animation-delay: 300ms; }
.rows-in tbody tr { animation: fade-row var(--dur-slow) var(--ease) both; }
.rows-in tbody tr:nth-child(2) { animation-delay: 25ms; } .rows-in tbody tr:nth-child(3) { animation-delay: 50ms; }
.rows-in tbody tr:nth-child(4) { animation-delay: 75ms; } .rows-in tbody tr:nth-child(5) { animation-delay: 100ms; }
.rows-in tbody tr:nth-child(6) { animation-delay: 125ms; } .rows-in tbody tr:nth-child(7) { animation-delay: 150ms; }
.rows-in tbody tr:nth-child(8) { animation-delay: 175ms; } .rows-in tbody tr:nth-child(n+9) { animation-delay: 200ms; }
.flash { animation: flash 1.2s var(--ease); }

@keyframes page-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fade-row { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }
@keyframes pop-in { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
@keyframes grow-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes grow-y { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes shimmer { to { transform: translateX(100%); } }
@keyframes float { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(-20px, 25px) scale(1.08); } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 4px rgba(var(--brand-rgb), .12); } 50% { box-shadow: 0 0 0 7px rgba(var(--brand-rgb), .05); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(24px); } }
@keyframes shake { 0%, 100% { transform: none; } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@keyframes flash { 0% { background: rgba(var(--brand-rgb), .16); } 100% { background: transparent; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; animation-delay: 0ms !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }
}

/* ==========================================================================
   EaseBill skin — colours, type, layout details and motion matched to the EaseBill app.
   Loaded last in app.css so it overrides the base tokens and components above.
   ========================================================================== */
@font-face { font-family: 'Plus Jakarta Sans'; font-style: normal; font-display: swap; font-weight: 200 800; src: url('../vendor/fonts/plus-jakarta-sans-latin-wght-normal.woff2') format('woff2-variations'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+20B9, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Plus Jakarta Sans'; font-style: normal; font-display: swap; font-weight: 200 800; src: url('../vendor/fonts/plus-jakarta-sans-latin-ext-wght-normal.woff2') format('woff2-variations'); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-display: swap; font-weight: 100 800; src: url('../vendor/fonts/jetbrains-mono-latin-wght-normal.woff2') format('woff2-variations'); }

/* ---------- tokens: light ---------- */
:root {
  --brand: #059669; --brand-rgb: 5, 150, 105; --brand-ink: #ffffff;
  --brand-2: #047857;
  --brand-soft: rgba(var(--brand-rgb), .10); --brand-softer: rgba(var(--brand-rgb), .06);
  --bg: #f1f5f9; --surface: #ffffff; --surface-2: #f8fafc; --surface-hover: #f1f5f9;
  --border: #e2e8f0; --border-strong: #cbd5e1;
  --text: #0f172a; --text-2: #334155; --muted: #64748b; --faint: #94a3b8;
  --input-bg: #ffffff; --input-border: #cbd5e1;
  --topbar-bg: #ffffff; --footer-bg: #ffffff;
  --rail-bg: #eef2f7; --rail-ink: #475569; --rail-hover: rgba(15, 23, 42, .06); --panel-bg: #ffffff;
  --ok: #10b981; --ok-soft: rgba(16, 185, 129, .10);
  --warn: #f59e0b; --warn-soft: rgba(245, 158, 11, .10);
  --bad: #ef4444; --bad-soft: rgba(239, 68, 68, .10);
  --info: #0d9488; --info-soft: rgba(13, 148, 136, .10);
  --violet: #7c3aed; --violet-soft: rgba(124, 58, 237, .10);
  --radius-sm: 6px; --radius: 10px; --radius-lg: 14px;
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, .08), 0 1px 2px -1px rgba(0, 0, 0, .05);
  --shadow: 0 4px 16px -4px rgba(15, 23, 42, .12);
  --glow: 0 4px 12px rgba(var(--brand-rgb), .30);
  --rail-w: 76px; --subnav-w: 244px; --topbar-h: 58px; --ft-h: 54px;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
  --bs-body-font-family: var(--font-sans);
  --bs-body-font-size: .9rem;
}
/* ---------- tokens: dark (EaseBill default) ---------- */
[data-bs-theme="dark"] {
  --brand: #10b981; --brand-rgb: 16, 185, 129; --brand-2: #059669;
  --brand-soft: rgba(var(--brand-rgb), .16); --brand-softer: rgba(var(--brand-rgb), .08);
  --bg: #0a110e; --surface: #14201b; --surface-2: #101a16; --surface-hover: #1b2b24;
  --border: rgba(255, 255, 255, .08); --border-strong: rgba(255, 255, 255, .16);
  --text: #f8fafc; --text-2: #cbd5e1; --muted: #94a3b8; --faint: #64748b;
  --input-bg: rgba(0, 0, 0, .25); --input-border: rgba(255, 255, 255, .08);
  --topbar-bg: #0d1713; --footer-bg: #0d1713;
  --rail-bg: #0a110e; --rail-ink: #94a3b8; --rail-hover: rgba(255, 255, 255, .06); --panel-bg: #101a16;
  --ok-soft: rgba(16, 185, 129, .14); --warn-soft: rgba(245, 158, 11, .14); --bad-soft: rgba(239, 68, 68, .14);
  --info: #2dd4bf; --info-soft: rgba(45, 212, 191, .14); --violet: #8b5cf6; --violet-soft: rgba(139, 92, 246, .16);
  --shadow-sm: 0 4px 20px -2px rgba(0, 0, 0, .35);
  --shadow: 0 8px 28px -6px rgba(0, 0, 0, .5);
  --bs-body-bg: var(--bg); --bs-body-color: var(--text); --bs-border-color: var(--border);
  --bs-secondary-bg: var(--surface-2); --bs-tertiary-bg: var(--surface-2); --bs-emphasis-color: var(--text);
  --bs-secondary-color: var(--muted);
}
body { font-family: var(--font-sans); letter-spacing: 0; font-feature-settings: normal; }
h1, h2, h3, h4, h5, h6 { letter-spacing: -.02em; font-weight: 700; }
.mono, .font-mono, code, kbd { font-family: var(--font-mono); }

/* ---------- brand mark ---------- */
.brand-mark { border-radius: 10px; background: linear-gradient(135deg, #10b981 0%, #047857 100%); box-shadow: 0 4px 12px rgba(16, 185, 129, .35); }

/* ---------- rail (sections) ---------- */
.rail { background: var(--rail-bg); gap: 4px; padding: 10px 0; }
.rail-brand { margin-bottom: 8px; }
.rail-brand .brand-mark { width: 40px; height: 40px; }
.rail-apps, .rail-foot { gap: 2px; }
.rail-item { width: 64px; min-height: 54px; padding: 7px 2px 6px; justify-content: center; gap: 4px; border-radius: 10px; color: var(--rail-ink); font: 600 10.5px/1.1 var(--font-sans); letter-spacing: .1px; }
.rail-item .rail-ic { width: auto; height: auto; background: none !important; border-radius: 0; }
.rail-item .rail-ic .icon { width: 20px; height: 20px; stroke-width: 2; transition: transform .15s; }
.rail-item:hover { background: var(--rail-hover); color: var(--text); }
.rail-item:hover .rail-ic .icon { transform: scale(1.08); }
.rail-item.active { color: var(--brand); background: transparent; }
.rail-item.active .rail-ic .icon { stroke-width: 2.2; animation: tm-pop .4s cubic-bezier(.2, .9, .3, 1.4); }
.rail-item::before { content: ''; position: absolute; left: -6px; top: 12px; bottom: 12px; width: 4px; border-radius: 0 4px 4px 0; background: var(--brand); transform: scaleY(0); opacity: 0; transition: transform .25s cubic-bezier(.2, .9, .3, 1.3), opacity .2s; animation: none; }
.rail-item.active::before { transform: scaleY(1); opacity: 1; animation: none; }
.rail-item:active .rail-ic .icon { transform: scale(.88); }
.rail-dot { top: -3px; right: -5px; box-shadow: 0 0 0 2px var(--rail-bg); }
.rail-foot { border-top: 1px solid var(--border); padding-top: 10px; }

/* ---------- section menu (panel) ---------- */
.subnav { background: var(--panel-bg); }
.subnav-head { height: auto; padding: 18px 10px 12px 16px; border-bottom: 0; }
.subnav-eyebrow { font-size: 11px; font-weight: 600; color: var(--muted); }
.subnav-title { font-size: 20px; font-weight: 800; letter-spacing: -.3px; }
.side-nav { padding: 0 10px 12px; }
.side-nav .section { padding: 12px 10px 6px; font-size: 10px; font-weight: 700; letter-spacing: 1px; color: var(--faint); }
.side-nav .sn-group { animation: none; }
.side-link { gap: 12px; padding: 9px 10px; margin: 0 0 2px; border-radius: 10px; color: var(--text-2); font-size: 13.5px; font-weight: 500; }
.side-link .icon { box-sizing: content-box; width: 14px; height: 14px; padding: 8px; flex: none; border-radius: 50%; background: var(--rail-hover); color: var(--muted); transition: background .15s, color .15s, transform .2s; }
.side-link:hover { background: var(--rail-hover); color: var(--text); }
.side-link:hover .icon { transform: translateX(2px) scale(1.06); color: var(--text); }
.side-link.active { background: rgba(16, 185, 129, .16); color: var(--text); font-weight: 700; }
.side-link.active .icon { background: var(--brand); color: #fff; }
.side-link .count { font-size: 10px; }
.side-nav.sn-enter .sn-group { animation: tm-fade .25s ease both; }
.side-nav.sn-enter .side-link { animation: tm-slide .32s cubic-bezier(.2, .8, .2, 1) both; }
.side-nav.sn-enter .side-link:nth-of-type(2) { animation-delay: .03s; } .side-nav.sn-enter .side-link:nth-of-type(3) { animation-delay: .06s; }
.side-nav.sn-enter .side-link:nth-of-type(4) { animation-delay: .09s; } .side-nav.sn-enter .side-link:nth-of-type(5) { animation-delay: .12s; }
.side-nav.sn-enter .side-link:nth-of-type(n+6) { animation-delay: .15s; }
.side-nav.sn-enter .sn-group:nth-child(2) .side-link { animation-delay: .1s; } .side-nav.sn-enter .sn-group:nth-child(n+3) .side-link { animation-delay: .16s; }

/* ---------- header ---------- */
.topbar { height: var(--topbar-h); background: var(--topbar-bg); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); gap: 10px; padding: 0 16px; }
[data-bs-theme="light"] .topbar { box-shadow: 0 1px 3px rgba(0, 0, 0, .05); }
.tb-nav-group { gap: 2px; align-items: center; }
.tb-nav { width: 32px !important; height: 32px !important; color: var(--muted); }
.top-crumbs { font-size: 13px; }
.search-trigger { height: 36px; width: min(620px, 42vw); border-radius: 10px; background: var(--input-bg); border: 1px solid var(--border); color: var(--faint); font-size: 13.5px; }
[data-bs-theme="light"] .search-trigger { background: #f8fafc; }
.search-trigger:hover { border-color: var(--border-strong); background: var(--input-bg); box-shadow: none; }
.search-trigger kbd { background: transparent; border-color: var(--border-strong); font-family: var(--font-sans); }
.firm-chip { flex-direction: column; align-items: flex-end; justify-content: center; gap: 0; height: auto; padding: 4px 8px; margin-right: 0; border: 0; background: transparent; line-height: 1.15; }
.firm-chip:hover { background: var(--rail-hover); }
.firm-chip .meta { text-align: right; }
.firm-chip .meta strong { font-size: 14px; font-weight: 700; max-width: 200px; }
.firm-chip .meta small { font-size: 10.5px; font-weight: 600; color: #34d399; }
[data-bs-theme="light"] .firm-chip .meta small { color: #059669; }
.user-btn { position: relative; padding: 0; border: 0; }
.user-btn .avatar { width: 38px; height: 38px; background: linear-gradient(135deg, #14b8a6, #059669) !important; font-weight: 700; }
.user-btn:hover .avatar, .user-btn[aria-expanded="true"] .avatar { box-shadow: 0 0 0 2px var(--brand); }
.user-btn .status-dot { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 2px var(--topbar-bg); }
.notif-count { box-shadow: 0 0 0 2px var(--topbar-bg); }

/* ---------- footer bar ---------- */
.main { padding-bottom: calc(var(--ft-h) + 8px); }
.app-footer { position: fixed; bottom: 0; right: 0; left: calc(var(--rail-w) + var(--subnav-w)); height: var(--ft-h); z-index: 1020; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 18px; background: var(--footer-bg); border-top: 1px solid var(--border); box-shadow: 0 -4px 18px rgba(0, 0, 0, .18); transition: left var(--dur) var(--ease); }
[data-bs-theme="light"] .app-footer { box-shadow: 0 -2px 10px rgba(15, 23, 42, .05); }
body.sb-collapsed .app-footer { left: var(--rail-w); }
.ft-left, .ft-right { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ft-copy { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.ft-copy strong { color: var(--text-2); }
.ft-plan { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600; border: 1px solid var(--border); color: var(--muted); white-space: nowrap; }
.ft-plan:hover { text-decoration: none; border-color: var(--brand); color: var(--brand); }
.ft-plan.ft-trial { color: #14b8a6; border-color: rgba(20, 184, 166, .45); background: rgba(20, 184, 166, .08); }
.ft-plan.ft-expired { color: var(--bad); border-color: rgba(239, 68, 68, .5); background: var(--bad-soft); }
.ft-new { padding: .5rem 1rem !important; border-radius: 10px !important; font-size: .88rem !important; }
.ft-new .ft-caret { transition: transform .2s; transform: rotate(180deg); }
.ft-new[aria-expanded="true"] .ft-caret { transform: none; }
.ft-new-menu { min-width: 220px; }
.ft-new-menu .dropdown-header { font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--faint); }
@media (max-width: 991.98px) { .app-footer { left: 0 !important; padding: 0 10px; } .ft-copy { display: none; } }

/* ---------- content ---------- */
.content { padding: 22px 28px 28px; max-width: none; }
.page-head { align-items: center; margin-bottom: 22px; }
.page-head h1 { font-size: 24px; font-weight: 800; letter-spacing: -.5px; }
.page-head h1.has-ic { display: flex; align-items: center; gap: 12px; }
.page-ic { width: 40px; height: 40px; flex: none; display: inline-grid; place-items: center; border-radius: 10px; color: var(--brand); background: var(--brand-soft); border: 1px solid rgba(var(--brand-rgb), .28); }
.page-ic .icon { width: 20px; height: 20px; stroke-width: 2; animation: eb-icon-in .65s cubic-bezier(.34, 1.56, .64, 1) both; }
.page-head .sub { font-size: 13.5px; color: var(--muted); margin-top: 6px; }
.crumbs { font-size: 12.5px; }

/* cards */
.card-surface { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card-head { padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-head h2, .card-head h3 { font-size: 16px; font-weight: 700; }
.card-head h2 .icon, .card-head h3 .icon { color: var(--brand); animation: eb-icon-in .65s cubic-bezier(.34, 1.56, .64, 1) both; }
.card-surface.pad, .card-body-pad { padding: 20px; }
.lift:hover { transform: translateY(-3px); border-color: var(--border-strong); box-shadow: var(--shadow); }

/* KPI tiles */
.stat { padding: 20px; gap: .5rem; transition: transform .2s ease, border-color .2s ease; }
.stat .label { order: 0; justify-content: space-between; font-size: 11px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); }
.stat .label .ic { order: 2; width: 36px; height: 36px; border-radius: 10px; }
.stat .label .ic .icon { animation: eb-icon-in .65s cubic-bezier(.34, 1.56, .64, 1) both; }
.stat .value { font-family: var(--font-mono); font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.stat .hint { font-size: 12px; }
.tone-ok .value { color: var(--ok); } .tone-warn .value { color: var(--warn); } .tone-violet .value { color: var(--violet); } .tone-info .value { color: var(--info); }

/* buttons */
.btn { --bs-btn-border-radius: 10px; --bs-btn-font-weight: 600; --bs-btn-font-size: .845rem; --bs-btn-padding-y: .55rem; --bs-btn-padding-x: 1.1rem; transition: all .2s ease; }
.btn-sm { --bs-btn-padding-y: .38rem; --bs-btn-padding-x: .75rem; --bs-btn-font-size: .75rem; --bs-btn-border-radius: 6px; }
.btn-brand { background: linear-gradient(135deg, #10b981 0%, #059669 100%); border: 0; color: #fff; box-shadow: 0 4px 12px rgba(16, 185, 129, .3); }
.btn-brand:hover, .btn-brand:focus-visible { background: linear-gradient(135deg, #059669 0%, #047857 100%); color: #fff; box-shadow: 0 6px 16px rgba(16, 185, 129, .4); }
.btn-brand:disabled { background: #334155; color: #94a3b8; box-shadow: none; opacity: 1; }
.btn-soft { background: rgba(255, 255, 255, .06); border: 1px solid var(--border); color: var(--text); box-shadow: none; }
.btn-soft:hover { background: rgba(255, 255, 255, .12); color: var(--text); border-color: var(--border-strong); }
[data-bs-theme="light"] .btn-soft { background: #f1f5f9; border-color: #cbd5e1; color: #1e293b; }
[data-bs-theme="light"] .btn-soft:hover { background: #e2e8f0; color: #0f172a; }
.btn-ghost { color: var(--muted); }
.btn-ghost:hover { background: var(--rail-hover); color: var(--text); }
.btn-danger { background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); border: 0; box-shadow: 0 4px 12px rgba(239, 68, 68, .3); }
.btn-success { background: linear-gradient(135deg, #10b981 0%, #059669 100%); border: 0; box-shadow: 0 4px 12px rgba(16, 185, 129, .3); }
.btn-icon { width: 36px; height: 36px; border-radius: var(--radius-sm); }

/* forms */
.form-label { font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
[data-bs-theme="light"] .form-label { color: #475569; }
.form-control, .form-select { background-color: var(--input-bg); border: 1px solid var(--input-border); border-radius: var(--radius-sm); color: var(--text); padding: 9px 13px; font-size: 13.5px; }
.form-control:focus, .form-select:focus { background-color: var(--input-bg); border-color: var(--brand); box-shadow: 0 0 0 3px rgba(var(--brand-rgb), .2); }
[data-bs-theme="light"] .form-control:focus, [data-bs-theme="light"] .form-select:focus { background-color: #fff; }
.form-control::placeholder { color: var(--faint); }
.form-control:disabled, .form-control[readonly] { background-color: var(--surface-2); color: var(--muted); }
[data-bs-theme="dark"] .form-select option { background: var(--surface); color: var(--text); }
.input-group .btn-soft { border-color: var(--input-border); }
.form-text { font-size: 11.5px; }

/* tables */
.table { --bs-table-hover-bg: rgba(255, 255, 255, .03); font-size: 13.5px; }
[data-bs-theme="light"] .table { --bs-table-hover-bg: #f8fafc; }
.table > :not(caption) > * > * { padding: 14px 16px; border-bottom-color: var(--border); }
.table thead th { font-size: 11.5px; font-weight: 700; letter-spacing: .6px; color: var(--muted); background: rgba(255, 255, 255, .02); padding: 12px 16px; }
[data-bs-theme="light"] .table thead th { background: #f8fafc; color: #475569; }
[data-bs-theme="light"] .table tbody tr:nth-child(even) { background-color: rgba(15, 23, 42, .018); }

/* pills (EaseBill badges) */
.pill { border-radius: 6px; padding: 3px 9px; font-size: 11px; font-weight: 600; border: 1px solid transparent; }
.pill::before { display: none; }
[data-bs-theme="dark"] .pill-ok { color: #6ee7b7; background: rgba(16, 185, 129, .2); border-color: rgba(16, 185, 129, .3); }
[data-bs-theme="dark"] .pill-warn { color: #fcd34d; background: rgba(245, 158, 11, .2); border-color: rgba(245, 158, 11, .3); }
[data-bs-theme="dark"] .pill-bad { color: #fca5a5; background: rgba(239, 68, 68, .2); border-color: rgba(239, 68, 68, .3); }
[data-bs-theme="dark"] .pill-info { color: #5eead4; background: rgba(45, 212, 191, .18); border-color: rgba(45, 212, 191, .3); }
[data-bs-theme="dark"] .pill-violet { color: #c4b5fd; background: rgba(139, 92, 246, .2); border-color: rgba(139, 92, 246, .3); }
[data-bs-theme="dark"] .pill-brand { color: #6ee7b7; background: rgba(16, 185, 129, .2); border-color: rgba(16, 185, 129, .3); }
[data-bs-theme="light"] .pill-ok { border-color: rgba(16, 185, 129, .3); color: #047857; }
[data-bs-theme="light"] .pill-warn { border-color: rgba(245, 158, 11, .35); color: #b45309; }
[data-bs-theme="light"] .pill-bad { border-color: rgba(239, 68, 68, .3); color: #b91c1c; }
[data-bs-theme="light"] .pill-brand { border-color: rgba(5, 150, 105, .3); }
.tag { border-radius: 6px; font-family: var(--font-mono); font-size: 11px; }

/* tabs & segments */
.tabs-u { gap: 4px; }
.tabs-u button { padding: .7rem .9rem; font-size: 13.5px; font-weight: 600; border-radius: 8px 8px 0 0; transition: color .15s, background .15s; }
.tabs-u button:hover { background: var(--rail-hover); }
.seg { border-radius: 10px; background: var(--surface-2); }
.seg button.active { background: var(--brand); color: #fff; box-shadow: 0 4px 12px rgba(var(--brand-rgb), .3); }
.seg button.active .n { background: rgba(255, 255, 255, .25); color: #fff; }

/* drawers / dialogs / menus */
.offcanvas.drawer { width: min(640px, 100vw) !important; background: var(--surface); }
.offcanvas.drawer .offcanvas-header { background: var(--surface-2); padding: 16px 22px; }
.offcanvas.drawer .offcanvas-title { font-size: 1.15rem; font-weight: 800; }
.offcanvas.drawer .offcanvas-body { padding: 22px; }
.modal-content { background: var(--surface); border-radius: 14px; }
.dropdown-menu { background: var(--surface); border-color: var(--border); border-radius: 12px; }
.dropdown-item { font-size: 13.5px; }
.dropdown-item .icon { color: var(--muted); }
.dropdown-item:hover .icon { color: var(--brand); }
.palette .modal-content { border-radius: 14px; box-shadow: 0 24px 60px rgba(0, 0, 0, .45); animation: gs-rise .18s ease-out; }
.toast-x { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.banner { border-radius: 10px; }
.empty .ic { border-radius: 14px; background: var(--brand-soft); }
.skel { background: var(--surface-2); }
[data-bs-theme="dark"] .skel::after { background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .05), transparent); }
.nav-progress { background: linear-gradient(90deg, #10b981, #14b8a6); }

/* ---------- motion (EaseBill) ---------- */
@keyframes eb-icon-in { 0% { opacity: 0; transform: scale(.35) rotate(-25deg); } 60% { opacity: 1; transform: scale(1.18) rotate(6deg); } 100% { opacity: 1; transform: none; } }
@keyframes eb-pop { 0%, 100% { transform: none; } 35% { transform: scale(1.28) rotate(-10deg); } 70% { transform: scale(.94) rotate(4deg); } }
@keyframes eb-turn { to { transform: rotate(90deg); } }
@keyframes eb-spin { to { transform: rotate(360deg); } }
@keyframes eb-nudge-r { 0%, 100% { transform: none; } 50% { transform: translateX(4px); } }
@keyframes eb-nudge-l { 0%, 100% { transform: none; } 50% { transform: translateX(-4px); } }
@keyframes eb-nudge-d { 0%, 100% { transform: none; } 30% { transform: translateY(3px); } 60% { transform: translateY(-1px); } }
@keyframes eb-ring { 0%, 100% { transform: none; } 20% { transform: rotate(16deg); } 40% { transform: rotate(-13deg); } 60% { transform: rotate(8deg); } 80% { transform: rotate(-4deg); } }
@keyframes eb-shake { 0%, 100% { transform: none; } 20%, 60% { transform: translateX(-2px) rotate(-6deg); } 40%, 80% { transform: translateX(2px) rotate(6deg); } }
@keyframes eb-fly { 0% { transform: none; } 40% { transform: translate(6px, -6px) scale(.8); opacity: 0; } 41% { transform: translate(-6px, 6px) scale(.8); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes tm-pop { 0% { transform: scale(1); } 40% { transform: scale(1.22) rotate(-6deg); } 100% { transform: scale(1); } }
@keyframes tm-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes tm-slide { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: none; } }
@keyframes gs-rise { from { opacity: 0; transform: translateY(-10px) scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: no-preference) {
  :is(.btn, .btn-icon, .dropdown-item, .palette-item, .tabs-u button, .seg button, .user-btn, .firm-chip):hover .icon { animation: eb-pop .5s cubic-bezier(.34, 1.56, .64, 1); }
  :is(.btn, .dropdown-item):hover .icon:has(path[d="M12 5v14M5 12h14"]) { animation: eb-turn .35s ease-out both; }
  :is(.btn, .btn-icon):hover [data-icon="chevron-left"] .icon, :is(.btn, .btn-icon):hover .icon:has(path[d="m15 18-6-6 6-6"]) { animation: eb-nudge-l .45s ease-in-out 2; }
  :is(.btn, .btn-icon, .dropdown-item):hover .icon:has(path[d="m9 18 6-6-6-6"]), :is(.btn, .dropdown-item):hover .icon:has(path[d="M5 12h14M13 6l6 6-6 6"]) { animation: eb-nudge-r .45s ease-in-out 2; }
  :is(.btn, .dropdown-item):hover .icon:has(path[d="M12 3v12M7 10l5 5 5-5M4 21h16"]) { animation: eb-nudge-d .5s ease-in-out 2; }
  :is(.btn, .btn-icon, .dropdown-item):hover .icon:has(path[d^="M6 8a6 6 0 1 1 12 0"]), :is(.btn, .btn-icon):hover .icon:has(path[d^="M20 14.5A8.5"]) { animation: eb-ring .7s ease-in-out; }
  :is(.btn, .btn-icon):hover .icon:has(circle[r="4"] + path[d^="M12 2v2"]), :is(.btn, .dropdown-item):hover .icon:has(circle[r="3"] + path[d^="M19.4 15"]) { animation: eb-spin .7s ease-in-out; }
  :is(.btn, .btn-icon, .dropdown-item):hover .icon:has(path[d^="M3 6h18M8 6V4"]), :is(.btn, .btn-icon):hover .icon:has(path[d="M18 6 6 18M6 6l12 12"]) { animation: eb-shake .45s ease-in-out; }
  :is(.btn, .dropdown-item):hover .icon:has(path[d^="m22 2-7 20"]) { animation: eb-fly .7s ease-in-out; }
  .stat:hover .ic .icon, .lift:hover .ic .icon { animation: eb-pop .5s cubic-bezier(.34, 1.56, .64, 1); }
}
@media (prefers-reduced-motion: reduce) {
  .page-ic .icon, .card-head .icon, .stat .ic .icon, .rail-item.active .rail-ic .icon, .side-nav.sn-enter .side-link { animation: none !important; }
}

/* ---------- auth & landing in EaseBill colours ---------- */
.auth-hero { background: radial-gradient(circle at 2% 0%, #0e4a3b 0%, #0d1a15 38%, #0a130f 78%); }
.auth-hero .ah-glow { background: radial-gradient(circle, rgba(16, 185, 129, .55) 0%, transparent 65%); }
.auth-hero .ah-body h2 { font-weight: 800; letter-spacing: -.035em; }
.ah-points .icon { color: #34d399; }
[data-bs-theme="dark"] .auth-panel, [data-bs-theme="dark"] .auth-shell { background: #0a110e; }
[data-bs-theme="dark"] #auth-view .form-control { background-color: #07100c; border-color: #1d3329; }
.auth-submit { background: linear-gradient(90deg, #12c08a, #059669); box-shadow: 0 4px 12px rgba(5, 150, 105, .26); }
.auth-tabs a.active { color: var(--brand); }
[data-bs-theme="dark"] #auth-view .form-control:-webkit-autofill { -webkit-box-shadow: 0 0 0 1000px #07100c inset; box-shadow: 0 0 0 1000px #07100c inset; }
[data-bs-theme="dark"] .landing, [data-bs-theme="dark"] .lp-foot, [data-bs-theme="dark"] .lp-alt { background: #0a110e; }
[data-bs-theme="dark"] .lp-hero { background: radial-gradient(1100px 520px at 0% 0%, rgba(14, 74, 59, .55), transparent 60%), radial-gradient(800px 500px at 100% 10%, rgba(6, 182, 212, .12), transparent 60%); }
[data-bs-theme="dark"] .lp-nav { background: rgba(10, 17, 14, .85); }
.lp-hero h1 span { background: linear-gradient(90deg, #10b981 0%, #14b8a6 55%, #84cc16 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lp-eyebrow { border: 1px solid rgba(var(--brand-rgb), .4); }
.lp-mock { border-radius: 14px; }
[data-bs-theme="dark"] .lp-card, [data-bs-theme="dark"] .lp-steps li { background: #101a16; }
[data-bs-theme="dark"] .lp-sec-item { background: #101a16; }
.lp-band-inner { background: radial-gradient(700px 300px at 0% 0%, rgba(16, 185, 129, .65), transparent 60%), linear-gradient(135deg, #0e4a3b, #0a130f); }
.top-crumbs { display: none; }
/* auth hero widgets as dark glass (EaseBill finance board) */
.ah-card { background: rgba(6, 22, 16, .6); border: 1px solid rgba(255, 255, 255, .12); color: #eaf4ff; backdrop-filter: blur(6px); box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .65); }
.ah-card strong { color: #eaf4ff; }
.ah-card small { color: #afc2d8; }
.ah-ic.ok { background: rgba(16, 185, 129, .16); color: #34d399; } .ah-ic.warn { background: rgba(245, 158, 11, .16); color: #fbbf24; } .ah-ic.violet { background: rgba(139, 92, 246, .18); color: #a78bfa; }
.ah-card .pill-ok { color: #6ee7b7; background: rgba(16, 185, 129, .2); border-color: rgba(16, 185, 129, .3); }
.ah-card .pill-warn { color: #fcd34d; background: rgba(245, 158, 11, .2); border-color: rgba(245, 158, 11, .3); }
.ah-card .pill-violet { color: #c4b5fd; background: rgba(139, 92, 246, .2); border-color: rgba(139, 92, 246, .3); }
input::placeholder, textarea::placeholder { text-transform: none; letter-spacing: normal; }

/* dark mode: green accents everywhere (Bootstrap's own dark-mode blues overridden) */
[data-bs-theme="dark"] {
  --bs-primary: var(--brand); --bs-primary-rgb: var(--brand-rgb); --bs-primary-text-emphasis: #6ee7b7;
  --bs-primary-bg-subtle: rgba(16, 185, 129, .16); --bs-primary-border-subtle: rgba(16, 185, 129, .35);
  --bs-link-color: #34d399; --bs-link-color-rgb: 52, 211, 153; --bs-link-hover-color: #6ee7b7; --bs-link-hover-color-rgb: 110, 231, 183;
  --bs-focus-ring-color: rgba(16, 185, 129, .25); --bs-info: #2dd4bf; --bs-info-rgb: 45, 212, 191; --bs-info-text-emphasis: #5eead4;
}
[data-bs-theme="dark"] .text-primary { color: #34d399 !important; }
[data-bs-theme="dark"] .text-info { color: #2dd4bf !important; }
[data-bs-theme="dark"] .spinner-border.text-primary { color: var(--brand) !important; }
[data-bs-theme="dark"] .form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
[data-bs-theme="dark"] .form-check-input:focus, [data-bs-theme="dark"] .form-control:focus, [data-bs-theme="dark"] .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(16, 185, 129, .22); }
[data-bs-theme="dark"] ::selection { background: rgba(16, 185, 129, .3); }
[data-bs-theme="dark"] .tone-info .ic { background: rgba(45, 212, 191, .14); color: #2dd4bf; }
[data-bs-theme="dark"] .banner-info { background: rgba(16, 185, 129, .1); border-color: rgba(16, 185, 129, .3); color: #a7f3d0; }
[data-bs-theme="dark"] .dropdown-item:active, [data-bs-theme="dark"] .dropdown-item.active { background: var(--brand); color: #fff; }
[data-bs-theme="dark"] .page-link { color: #34d399; }
[data-bs-theme="dark"] .page-item.active .page-link { background: var(--brand); border-color: var(--brand); }

/* dark mode: no blue/violet tints — "review" states use lime instead of violet */
[data-bs-theme="dark"] { --violet: #a3e635; --violet-soft: rgba(163, 230, 53, .14); }
[data-bs-theme="dark"] .pill-violet, .ah-card .pill-violet { color: #d9f99d; background: rgba(163, 230, 53, .16); border-color: rgba(163, 230, 53, .3); }
.ah-ic.violet { background: rgba(163, 230, 53, .16); color: #bef264; }

/* ---------- dark mode: neutral #111111 surfaces, white text, green icons & active states ---------- */
[data-bs-theme="dark"] {
  --bg: #0a0a0a; --surface: #111111; --surface-2: #161616; --surface-hover: #1c1c1c;
  --border: rgba(255, 255, 255, .08); --border-strong: rgba(255, 255, 255, .16);
  --text: #ffffff; --text-2: #f1f1f1; --muted: #a3a3a3; --faint: #737373;
  --input-bg: #0a0a0a; --input-border: rgba(255, 255, 255, .10);
  --topbar-bg: #111111; --footer-bg: #111111;
  --rail-bg: #111111; --rail-ink: #ffffff; --rail-hover: rgba(255, 255, 255, .06); --panel-bg: #111111;
  --bs-body-bg: #0a0a0a; --bs-body-color: #ffffff;
}
[data-bs-theme="dark"] .rail, [data-bs-theme="dark"] .subnav, [data-bs-theme="dark"] .subnav-head { background: #111111; }
[data-bs-theme="dark"] .rail-item { color: #ffffff; }
[data-bs-theme="dark"] .rail-item .rail-ic .icon { color: #10b981; }
[data-bs-theme="dark"] .rail-item.active { color: #10b981; background: rgba(16, 185, 129, .10); }
[data-bs-theme="dark"] .side-link, [data-bs-theme="dark"] .side-link:hover { color: #ffffff; }
[data-bs-theme="dark"] .side-link .icon { color: #10b981; background: rgba(16, 185, 129, .10); }
[data-bs-theme="dark"] .side-link.active { color: #10b981; background: rgba(16, 185, 129, .14); }
[data-bs-theme="dark"] .side-link.active .icon { background: #10b981; color: #ffffff; }
[data-bs-theme="dark"] .subnav-title, [data-bs-theme="dark"] h1, [data-bs-theme="dark"] h2, [data-bs-theme="dark"] h3, [data-bs-theme="dark"] .card-head h2 { color: #ffffff; }
[data-bs-theme="dark"] .card-surface, [data-bs-theme="dark"] .modal-content, [data-bs-theme="dark"] .offcanvas, [data-bs-theme="dark"] .dropdown-menu { background: #111111; }
[data-bs-theme="dark"] .offcanvas.drawer .offcanvas-header { background: #161616; }
[data-bs-theme="dark"] .tabs-u button { color: #ffffff; }
[data-bs-theme="dark"] .tabs-u button.active { color: #10b981; }
[data-bs-theme="dark"] .tabs-u button.active::after { background: #10b981; }
[data-bs-theme="dark"] .seg button { color: #ffffff; }
[data-bs-theme="dark"] .btn-soft, [data-bs-theme="dark"] .btn-ghost { color: #ffffff; }
[data-bs-theme="dark"] .btn-soft .icon, [data-bs-theme="dark"] .btn-ghost .icon, [data-bs-theme="dark"] .dropdown-item .icon, [data-bs-theme="dark"] .card-head .icon, [data-bs-theme="dark"] .search-trigger .icon, [data-bs-theme="dark"] .input-icon .icon { color: #10b981; }
[data-bs-theme="dark"] .dropdown-item { color: #ffffff; }
[data-bs-theme="dark"] .firm-chip .meta strong { color: #ffffff; }
[data-bs-theme="dark"] .table thead th { background: #161616; }
[data-bs-theme="dark"] .palette-item { color: #ffffff; }
[data-bs-theme="dark"] .palette-item .icon { color: #10b981; }

/* avatar colours without blue/violet */
.av-2 { background: #047857; } .av-5 { background: #0f766e; } .av-6 { background: #16a34a; }
