/* =====================================================================
   DG Technology CRM — theme engine
   Every colour comes from variables; [data-theme] on <html> switches them.
   [data-neon="1"] turns on HUD/glow styling, [data-motion="on"] animations.
   ===================================================================== */

/* ---------- Clean Light (also the default for pages without a theme) ---------- */
:root {
  color-scheme: light;
  --bg: #f4f6fb;
  --bg-img: radial-gradient(1200px 600px at 100% -10%, rgba(37, 99, 235, .07), transparent 60%);
  --surface: #ffffff;
  --surface-solid: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #eef2f7;
  --blur: 0px;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-strong: #93c5fd;
  --input-bg: #ffffff;
  --input-line: #cbd5e1;
  --brand: #2563eb;
  --brand-2: #4f46e5;
  --brand-ink: #ffffff;
  --brand-soft: #eff6ff;
  --brand-text: #1d4ed8;
  --accent: #06b6d4;
  --side-bg: #0f172a;
  --side-text: #cbd5e1;
  --side-muted: #64748b;
  --side-hover: #1e293b;
  --side-line: #1e293b;
  --topbar-bg: rgba(255, 255, 255, .88);
  --overlay: rgba(15, 23, 42, .5);
  --tip-bg: #0f172a;
  --ok: #047857;  --ok-soft: #d1fae5;  --ok-solid: #059669;
  --warn: #b45309; --warn-soft: #fef3c7; --warn-solid: #d97706;
  --err: #b91c1c; --err-soft: #fee2e2; --err-solid: #dc2626;
  --info: #1d4ed8; --info-soft: #dbeafe;
  --sky: #0369a1; --sky-soft: #e0f2fe;
  --violet: #6d28d9; --violet-soft: #ede9fe;
  --neutral: #475569; --neutral-soft: #f1f5f9;
  --glow: 0 0 0 1px rgba(37, 99, 235, .25), 0 8px 24px rgba(37, 99, 235, .12);
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 4px 16px rgba(15, 23, 42, .05);
  --radius: 12px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-head: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
}

/* ---------- shared dark base ---------- */
[data-theme="cyber"], [data-theme="matrix"], [data-theme="redteam"], [data-theme="synthwave"], [data-theme="aurora"], [data-theme="midnight"] {
  color-scheme: dark;
  --surface-solid: #0b1222;
  --surface-2: rgba(255, 255, 255, .035);
  --surface-3: rgba(255, 255, 255, .06);
  --blur: 14px;
  --text-2: #c3cfe4;
  --overlay: rgba(2, 4, 12, .72);
  --ok: #34d399;  --ok-soft: rgba(52, 211, 153, .14);  --ok-solid: #10b981;
  --warn: #fbbf24; --warn-soft: rgba(251, 191, 36, .14); --warn-solid: #d97706;
  --err: #f87171; --err-soft: rgba(248, 113, 113, .15); --err-solid: #ef4444;
  --info: #60a5fa; --info-soft: rgba(96, 165, 250, .15);
  --sky: #38bdf8; --sky-soft: rgba(56, 189, 248, .14);
  --violet: #c4b5fd; --violet-soft: rgba(167, 139, 250, .16);
  --neutral: #a3b1c9; --neutral-soft: rgba(148, 163, 184, .14);
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 10px 30px rgba(0, 0, 0, .35);
  --font-head: "Orbitron", "Inter", system-ui, sans-serif;
}

/* ---------- Cyber Neon (default) ---------- */
[data-theme="cyber"] {
  --bg: #04070f;
  --bg-img: radial-gradient(1100px 650px at 88% -12%, rgba(0, 229, 255, .14), transparent 60%),
            radial-gradient(900px 600px at -12% 112%, rgba(168, 85, 247, .16), transparent 60%),
            linear-gradient(rgba(0, 229, 255, .045) 1px, transparent 1px),
            linear-gradient(90deg, rgba(0, 229, 255, .045) 1px, transparent 1px);
  --bg-size: auto, auto, 46px 46px, 46px 46px;
  --surface: rgba(10, 17, 36, .68);
  --surface-solid: #0a1124;
  --text: #e6f3ff;
  --muted: #8ea3c7;
  --line: rgba(110, 170, 255, .14);
  --line-strong: rgba(0, 229, 255, .45);
  --input-bg: rgba(3, 8, 20, .65);
  --input-line: rgba(110, 170, 255, .24);
  --brand: #00e5ff;
  --brand-2: #7c3aed;
  --brand-ink: #00121a;
  --brand-soft: rgba(0, 229, 255, .12);
  --brand-text: #5ff0ff;
  --accent: #ff2bd6;
  --side-bg: rgba(3, 7, 18, .78);
  --side-text: #b8c7e0;
  --side-muted: #5b7299;
  --side-hover: rgba(0, 229, 255, .08);
  --side-line: rgba(110, 170, 255, .12);
  --topbar-bg: rgba(4, 8, 20, .55);
  --tip-bg: #0a1124;
  --glow: 0 0 0 1px rgba(0, 229, 255, .4), 0 0 26px rgba(0, 229, 255, .22);
}

/* ---------- Matrix ---------- */
[data-theme="matrix"] {
  --bg: #000300;
  --bg-img: radial-gradient(900px 600px at 50% -20%, rgba(0, 255, 106, .12), transparent 65%);
  --surface: rgba(0, 16, 6, .74);
  --surface-solid: #001207;
  --text: #c9ffdc;
  --text-2: #9fe7b8;
  --muted: #5fae7e;
  --line: rgba(0, 255, 106, .14);
  --line-strong: rgba(0, 255, 106, .5);
  --input-bg: rgba(0, 10, 3, .75);
  --input-line: rgba(0, 255, 106, .25);
  --brand: #00ff6a;
  --brand-2: #00b84c;
  --brand-ink: #001a09;
  --brand-soft: rgba(0, 255, 106, .11);
  --brand-text: #4dff95;
  --accent: #b6ff00;
  --side-bg: rgba(0, 8, 2, .82);
  --side-text: #a6e9bd;
  --side-muted: #3f8a5b;
  --side-hover: rgba(0, 255, 106, .08);
  --side-line: rgba(0, 255, 106, .12);
  --topbar-bg: rgba(0, 6, 2, .6);
  --tip-bg: #001207;
  --glow: 0 0 0 1px rgba(0, 255, 106, .4), 0 0 26px rgba(0, 255, 106, .2);
  --font: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --font-head: "JetBrains Mono", ui-monospace, Consolas, monospace;
}

/* ---------- Red Team ---------- */
[data-theme="redteam"] {
  --bg: #090203;
  --bg-img: radial-gradient(1000px 620px at 90% -10%, rgba(255, 45, 70, .16), transparent 60%),
            radial-gradient(800px 560px at -10% 110%, rgba(255, 140, 50, .1), transparent 60%),
            linear-gradient(rgba(255, 60, 80, .04) 1px, transparent 1px),
            linear-gradient(90deg, rgba(255, 60, 80, .04) 1px, transparent 1px);
  --bg-size: auto, auto, 46px 46px, 46px 46px;
  --surface: rgba(26, 6, 10, .7);
  --surface-solid: #1a060a;
  --text: #ffe9ec;
  --muted: #c48a93;
  --line: rgba(255, 90, 110, .15);
  --line-strong: rgba(255, 59, 92, .5);
  --input-bg: rgba(14, 2, 5, .7);
  --input-line: rgba(255, 90, 110, .25);
  --brand: #ff3b5c;
  --brand-2: #ff8a3d;
  --brand-ink: #1a0005;
  --brand-soft: rgba(255, 59, 92, .13);
  --brand-text: #ff7b93;
  --accent: #ffb020;
  --side-bg: rgba(12, 2, 4, .82);
  --side-text: #f0c3ca;
  --side-muted: #8a4c56;
  --side-hover: rgba(255, 59, 92, .09);
  --side-line: rgba(255, 90, 110, .12);
  --topbar-bg: rgba(10, 2, 4, .58);
  --tip-bg: #1a060a;
  --glow: 0 0 0 1px rgba(255, 59, 92, .45), 0 0 26px rgba(255, 59, 92, .22);
}

/* ---------- Synthwave ---------- */
[data-theme="synthwave"] {
  --bg: #0d0221;
  --bg-img: linear-gradient(180deg, #0d0221 0%, #261447 55%, #3b0f4f 80%, #0d0221 100%);
  --surface: rgba(30, 10, 60, .66);
  --surface-solid: #1d0a3b;
  --text: #fde9ff;
  --muted: #c39bd8;
  --line: rgba(255, 110, 230, .16);
  --line-strong: rgba(255, 43, 214, .5);
  --input-bg: rgba(15, 4, 34, .7);
  --input-line: rgba(255, 110, 230, .26);
  --brand: #ff2bd6;
  --brand-2: #ff8a00;
  --brand-ink: #200018;
  --brand-soft: rgba(255, 43, 214, .14);
  --brand-text: #ff7be6;
  --accent: #00f0ff;
  --side-bg: rgba(14, 3, 32, .8);
  --side-text: #e7c6f5;
  --side-muted: #8a5ea6;
  --side-hover: rgba(255, 43, 214, .1);
  --side-line: rgba(255, 110, 230, .12);
  --topbar-bg: rgba(13, 2, 33, .55);
  --tip-bg: #1d0a3b;
  --glow: 0 0 0 1px rgba(255, 43, 214, .45), 0 0 28px rgba(255, 43, 214, .25);
}

/* ---------- Aurora ---------- */
[data-theme="aurora"] {
  --bg: #02101a;
  --bg-img: radial-gradient(900px 600px at 50% 120%, rgba(34, 211, 238, .08), transparent 60%);
  --surface: rgba(6, 26, 38, .62);
  --surface-solid: #061a26;
  --text: #e3fbf6;
  --muted: #86b8b0;
  --line: rgba(94, 234, 212, .15);
  --line-strong: rgba(52, 211, 153, .5);
  --input-bg: rgba(2, 14, 22, .7);
  --input-line: rgba(94, 234, 212, .25);
  --brand: #34d399;
  --brand-2: #22d3ee;
  --brand-ink: #00170f;
  --brand-soft: rgba(52, 211, 153, .13);
  --brand-text: #6ee7b7;
  --accent: #a78bfa;
  --side-bg: rgba(2, 12, 20, .78);
  --side-text: #bfe7df;
  --side-muted: #4f8a82;
  --side-hover: rgba(52, 211, 153, .09);
  --side-line: rgba(94, 234, 212, .12);
  --topbar-bg: rgba(2, 14, 22, .55);
  --tip-bg: #061a26;
  --glow: 0 0 0 1px rgba(52, 211, 153, .42), 0 0 26px rgba(34, 211, 238, .2);
  --font-head: "Inter", system-ui, sans-serif;
}

/* ---------- Midnight Pro (calm, professional dark) ---------- */
[data-theme="midnight"] {
  --bg: #0a0f1c;
  --bg-img: radial-gradient(1200px 600px at 100% -10%, rgba(59, 130, 246, .1), transparent 60%);
  --surface: #111a2d;
  --surface-solid: #111a2d;
  --blur: 0px;
  --text: #e5ebf5;
  --muted: #8b98b1;
  --line: #1f2b44;
  --line-strong: #3b82f6;
  --input-bg: #0c1424;
  --input-line: #26344f;
  --brand: #3b82f6;
  --brand-2: #6366f1;
  --brand-ink: #ffffff;
  --brand-soft: rgba(59, 130, 246, .14);
  --brand-text: #8db8ff;
  --accent: #22d3ee;
  --side-bg: #070b15;
  --side-text: #b4c0d6;
  --side-muted: #56637c;
  --side-hover: #121b2e;
  --side-line: #151f33;
  --topbar-bg: rgba(10, 15, 28, .85);
  --tip-bg: #1f2b44;
  --glow: 0 0 0 1px rgba(59, 130, 246, .35), 0 8px 24px rgba(0, 0, 0, .35);
  --font-head: "Inter", system-ui, sans-serif;
}

/* =====================================================================
   Base
   ===================================================================== */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { background: var(--bg); }
body {
  font-family: var(--font); font-size: 14px; color: var(--text); line-height: 1.45; -webkit-font-smoothing: antialiased;
  background-color: var(--bg); background-image: var(--bg-img); background-size: var(--bg-size, auto); background-attachment: fixed;
  min-height: 100vh;
}
::selection { background: var(--brand-soft); color: var(--text); }
a { color: var(--brand-text); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.25; }
h1 { font-size: 22px; font-family: var(--font-head); letter-spacing: .01em; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
code, .mono { font-family: var(--font-mono); font-size: 12.5px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.ok-text { color: var(--ok) !important; }
.err-text { color: var(--err) !important; }

/* custom scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 9px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--line-strong); background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* live background layer */
#fx { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 0; pointer-events: none; display: block; }
#app, #modal-root, #toasts { position: relative; z-index: 1; }
[data-neon="1"][data-motion="on"] body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 3;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, .022) 0 1px, transparent 1px 3px);
}

/* =====================================================================
   Boot / auth
   ===================================================================== */
.boot { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; position: relative; z-index: 1; }
.boot img { filter: drop-shadow(0 0 18px var(--brand-soft)); }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.auth-page { min-height: 100vh; padding: 24px 16px; position: relative; }
.login-wrap { min-height: calc(100vh - 48px); display: flex; align-items: center; justify-content: center; }
.login-card, .install-card { width: 100%; max-width: 430px; background: var(--surface-solid); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 30px 70px rgba(0, 0, 0, .25); padding: 32px; position: relative; }
.install-card { max-width: 760px; margin: 24px auto; }
.install-card h2 { margin-top: 24px; font-size: 15px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.auth-brand img { width: 50px; height: 50px; border-radius: 12px; object-fit: contain; }
.auth-brand strong { display: block; font-size: 19px; font-family: var(--font-head); letter-spacing: .02em; }
.auth-brand span { color: var(--muted); font-size: 12.5px; }
.term { font-family: var(--font-mono); font-size: 11.5px; color: var(--brand-text); background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 18px; min-height: 86px; white-space: pre-wrap; line-height: 1.6; }
.term .ok { color: var(--ok); }
.caret { display: inline-block; width: 7px; height: 13px; background: var(--brand); vertical-align: -2px; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.checks { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 4px; }
.checks .ok { color: var(--ok); }
.checks .bad { color: var(--err); }
.seg { display: grid; gap: 8px; margin-bottom: 12px; }
.seg label { display: flex; gap: 8px; align-items: center; font-weight: 500; }
.btn.theme-fab { position: fixed; right: 18px; bottom: 18px; z-index: 20; backdrop-filter: blur(8px); }

/* animated neon border on the login card */
[data-neon="1"] .login-card { overflow: hidden; background: transparent; border-color: transparent; }
[data-neon="1"] .login-card::before {
  content: ""; position: absolute; inset: -60%; z-index: 0;
  background: conic-gradient(from 0deg, transparent 0 62%, var(--brand) 74%, var(--accent) 86%, transparent 100%);
  animation: spin 7s linear infinite;
}
[data-neon="1"] .login-card::after { content: ""; position: absolute; inset: 1.5px; border-radius: 17px; background: var(--surface-solid); z-index: 0; }
[data-neon="1"][data-motion="off"] .login-card::before { animation: none; }
.login-card > * { position: relative; z-index: 1; }

/* =====================================================================
   Layout
   ===================================================================== */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 244px; flex-shrink: 0; background: var(--side-bg); color: var(--side-text); display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; z-index: 30; border-right: 1px solid var(--side-line);
  backdrop-filter: blur(var(--blur)); -webkit-backdrop-filter: blur(var(--blur));
}
.side-brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; color: #fff; }
.side-brand img { width: 40px; height: 40px; border-radius: 10px; object-fit: contain; background: rgba(255, 255, 255, .05); }
.side-brand strong { display: block; font-size: 14.5px; line-height: 1.2; font-family: var(--font-head); letter-spacing: .03em; }
.side-brand span { font-size: 11px; color: var(--side-muted); font-family: var(--font-mono); letter-spacing: .12em; }
.nav { padding: 6px 10px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav .sec { font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; color: var(--side-muted); padding: 14px 10px 6px; font-family: var(--font-mono); }
[data-neon="1"] .nav .sec::before { content: "// "; opacity: .7; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--side-text); font-weight: 500; position: relative; transition: background .15s, color .15s; }
.nav a:hover { background: var(--side-hover); color: #fff; text-decoration: none; }
.nav a.active { background: linear-gradient(90deg, var(--brand), var(--brand-2)); color: var(--brand-ink); font-weight: 600; }
[data-neon="1"] .nav a.active { background: linear-gradient(90deg, var(--brand-soft), transparent); color: var(--brand-text); box-shadow: inset 3px 0 0 var(--brand); }
[data-neon="1"] .nav a.active svg { filter: drop-shadow(0 0 6px var(--brand)); }
.nav svg { width: 18px; height: 18px; flex-shrink: 0; }
.side-foot { padding: 12px 18px; font-size: 11px; color: var(--side-muted); border-top: 1px solid var(--side-line); font-family: var(--font-mono); letter-spacing: .04em; line-height: 1.7; }
.pulse { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok-solid); box-shadow: 0 0 0 0 var(--ok-solid); margin-right: 6px; vertical-align: 0; }
[data-motion="on"] .pulse { animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, .6); } 70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); } 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); } }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; background: var(--topbar-bg); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; padding: 10px 24px;
}
.menu-btn { display: none; }
.gsearch { position: relative; flex: 1; max-width: 460px; }
.gsearch input { width: 100%; padding-left: 34px; }
.gsearch > svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); }
.gresults { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--surface-solid); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); max-height: 420px; overflow: auto; padding: 6px; }
.gresults .grp { font-size: 11px; text-transform: uppercase; color: var(--muted); padding: 8px 8px 4px; font-family: var(--font-mono); }
.gresults a { display: block; padding: 7px 8px; border-radius: 6px; color: var(--text); }
.gresults a:hover { background: var(--brand-soft); text-decoration: none; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.sys-clock { font-family: var(--font-mono); font-size: 12px; color: var(--muted); padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); letter-spacing: .06em; }
.sys-clock b { color: var(--brand-text); font-weight: 600; }
.user-chip { display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; position: relative; }
.user-chip .menu { position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface-solid); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); min-width: 190px; padding: 6px; display: none; z-index: 40; }
.user-chip.open .menu { display: block; animation: pop .14s; }
.user-chip .menu a { display: block; padding: 8px 10px; border-radius: 6px; color: var(--text); }
.user-chip .menu a:hover { background: var(--brand-soft); text-decoration: none; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: var(--brand-ink); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; flex-shrink: 0; }
.avatar.lg { width: 52px; height: 52px; font-size: 18px; }
[data-neon="1"] .avatar { box-shadow: 0 0 14px var(--brand-soft); }
.view { padding: 24px; max-width: 1440px; width: 100%; margin: 0 auto; }

.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { margin: 0; }
.page-head .sub { color: var(--muted); font-size: 13px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.crumb { font-size: 12px; color: var(--muted); margin-bottom: 6px; font-family: var(--font-mono); }
[data-neon="1"] .page-head h1 {
  background: linear-gradient(90deg, var(--text) 0%, var(--brand-text) 55%, var(--accent) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none;
}
[data-neon="1"][data-motion="on"] .page-head h1:hover { animation: glitch .45s steps(2) 1; }
@keyframes glitch {
  0% { transform: translate(0); } 20% { transform: translate(-2px, 1px); filter: hue-rotate(40deg); }
  40% { transform: translate(2px, -1px); } 60% { transform: translate(-1px, -1px); filter: hue-rotate(-40deg); }
  80% { transform: translate(1px, 1px); } 100% { transform: translate(0); filter: none; }
}

/* =====================================================================
   Components
   ===================================================================== */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  backdrop-filter: blur(var(--blur)) saturate(140%); -webkit-backdrop-filter: blur(var(--blur)) saturate(140%);
  position: relative; transition: border-color .2s, box-shadow .2s, transform .2s;
}
[data-neon="1"] .card:hover { border-color: var(--line-strong); }
/* cursor spotlight */
[data-neon="1"][data-motion="on"] .card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .25s;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), var(--brand-soft), transparent 45%);
}
[data-neon="1"][data-motion="on"] .card:hover::before { opacity: 1; }
.card > * { position: relative; }
.card-pad { padding: 18px; }
.card-head { display: flex; align-items: center; gap: 8px; padding: 14px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card-head h3 { margin: 0; }
[data-neon="1"] .card-head h3 { font-family: var(--font-mono); font-size: 13px; text-transform: uppercase; letter-spacing: .08em; }
.card-head .actions { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-side { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.kpi { padding: 16px 18px; overflow: hidden; }
.kpi .label { color: var(--muted); font-size: 12.5px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.kpi .value { font-size: 24px; font-weight: 700; margin-top: 4px; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.kpi .hint { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kpi .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; box-shadow: 0 0 10px currentColor; }
[data-neon="1"] .kpi .label { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
[data-neon="1"] .kpi .value { font-family: var(--font-mono); font-weight: 600; text-shadow: 0 0 18px var(--brand-soft); }
/* HUD corner brackets */
[data-neon="1"] .kpi::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: .85;
  background:
    linear-gradient(var(--brand), var(--brand)) top left / 14px 2px no-repeat,
    linear-gradient(var(--brand), var(--brand)) top left / 2px 14px no-repeat,
    linear-gradient(var(--brand), var(--brand)) bottom right / 14px 2px no-repeat,
    linear-gradient(var(--brand), var(--brand)) bottom right / 2px 14px no-repeat;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font: inherit; font-weight: 600; cursor: pointer;
  white-space: nowrap; line-height: 1.2; position: relative; overflow: hidden; transition: background .15s, border-color .15s, box-shadow .2s, transform .15s;
}
.btn:hover { background: var(--surface-3); border-color: var(--line-strong); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); border-color: transparent; color: var(--brand-ink); }
.btn-primary:hover { background: linear-gradient(135deg, var(--brand), var(--brand-2)); box-shadow: var(--glow); border-color: transparent; transform: translateY(-1px); }
[data-motion="on"] .btn-primary::after {
  content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .35), transparent); transform: skewX(-20deg); transition: left .6s;
}
[data-motion="on"] .btn-primary:hover::after { left: 130%; }
.btn-danger { color: var(--err); }
.btn-danger:hover { background: var(--err-soft); border-color: var(--err); }
.btn-ok { background: var(--ok-solid); border-color: var(--ok-solid); color: #fff; }
.btn-ok:hover { background: var(--ok-solid); filter: brightness(1.1); box-shadow: 0 0 18px var(--ok-soft); }
.btn-sm { padding: 5px 10px; font-size: 12.5px; }
.btn-lg { padding: 11px 20px; font-size: 15px; width: 100%; margin-top: 12px; }
[data-neon="1"] .btn-lg { font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .12em; }
.btn-ghost { border-color: transparent; background: transparent; }
.icon-btn { padding: 6px; border: 0; background: transparent; border-radius: 6px; cursor: pointer; color: var(--muted); display: inline-flex; }
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn svg { width: 17px; height: 17px; }

.input, select.input, textarea.input {
  width: 100%; padding: 8px 10px; border: 1px solid var(--input-line); border-radius: 8px; font: inherit; color: var(--text);
  background: var(--input-bg); transition: border-color .15s, box-shadow .15s;
}
select.input option { background: var(--surface-solid); color: var(--text); }
.input::placeholder { color: var(--muted); opacity: .75; }
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
[data-neon="1"] .input:focus { box-shadow: 0 0 0 3px var(--brand-soft), 0 0 18px var(--brand-soft); }
textarea.input { resize: vertical; min-height: 70px; }
.input-sm { padding: 5px 8px; font-size: 13px; }
.form { display: flex; flex-direction: column; gap: 12px; }
.form label, .fl { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: 12.5px; color: var(--text-2); }
.form label.check, label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; font-size: 13.5px; color: var(--text); }
input[type=checkbox] { accent-color: var(--brand); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.span2 { grid-column: span 2; }
.span3 { grid-column: 1 / -1; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filters .input { width: auto; min-width: 140px; }
.filters .grow { flex: 1; min-width: 200px; }

.alert { padding: 10px 14px; border-radius: 8px; margin: 10px 0; font-size: 13.5px; border: 1px solid; }
.alert-ok { background: var(--ok-soft); color: var(--ok); border-color: var(--ok); }
.alert-err { background: var(--err-soft); color: var(--err); border-color: var(--err); }
.alert-warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn); }

/* badges */
.badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--neutral-soft); color: var(--neutral); white-space: nowrap; }
[data-neon="1"] .badge { border: 1px solid currentColor; border-color: color-mix(in srgb, currentColor 35%, transparent); letter-spacing: .02em; }
.b-new, .b-low, .b-inv-draft, .b-closed { background: var(--neutral-soft); color: var(--neutral); }
.b-qualified, .b-sales, .b-normal { background: var(--sky-soft); color: var(--sky); }
.b-proposal, .b-lead { background: var(--violet-soft); color: var(--violet); }
.b-negotiation, .b-pending, .b-unpaid, .b-inv-partial { background: var(--warn-soft); color: var(--warn); }
.b-won, .b-paid, .b-customer, .b-done, .b-inv-paid, .b-inv-accepted, .b-resolved { background: var(--ok-soft); color: var(--ok); }
.b-lost, .b-high, .b-inactive, .b-inv-overdue, .b-inv-declined { background: var(--err-soft); color: var(--err); }
.b-approved, .b-partial, .b-prospect, .b-manager, .b-inv-sent, .b-open { background: var(--info-soft); color: var(--info); }
.b-admin { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: var(--brand-ink); }
.b-urgent { background: var(--err-solid); color: #fff; }
.b-inv-cancelled { background: var(--neutral-soft); color: var(--muted); text-decoration: line-through; }
.chip { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-text); font-size: 11px; font-weight: 600; margin: 3px 4px 0 0; }

/* tables */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
[data-neon="1"] .tbl th { font-family: var(--font-mono); }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr.clickable { cursor: pointer; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr.clickable:hover td { background: var(--brand-soft); }
.tbl tfoot td { font-weight: 700; background: var(--surface-2); border-top: 1px solid var(--line); }
.tbl .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
[data-neon="1"] .tbl .num { font-family: var(--font-mono); font-size: 13px; }
.tbl .w-check { width: 34px; }
.empty { padding: 36px 18px; text-align: center; color: var(--muted); }
.empty svg { width: 36px; height: 36px; opacity: .45; margin-bottom: 8px; }
.pager { display: flex; align-items: center; gap: 8px; justify-content: flex-end; padding: 12px 14px; border-top: 1px solid var(--line); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 9px 14px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--brand-text); border-bottom-color: var(--brand); }
[data-neon="1"] .tabs button.on { text-shadow: 0 0 12px var(--brand-soft); }

.dl { display: grid; grid-template-columns: 120px 1fr; gap: 8px 12px; font-size: 13.5px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; word-break: break-word; }

/* =====================================================================
   Pipeline
   ===================================================================== */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.col { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; display: flex; flex-direction: column; max-height: calc(100vh - 190px); backdrop-filter: blur(var(--blur)); -webkit-backdrop-filter: blur(var(--blur)); }
.col-head { padding: 12px 12px 8px; display: flex; align-items: center; gap: 6px; }
.col-head strong { font-size: 13px; }
.col-head .sum { margin-left: auto; font-size: 12px; color: var(--muted); font-weight: 600; font-family: var(--font-mono); }
.col-body { padding: 4px 8px 10px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; min-height: 80px; }
.col.drag-over { outline: 2px dashed var(--brand); outline-offset: -2px; box-shadow: var(--glow); }
.dcard { background: var(--surface-solid); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: grab; box-shadow: var(--shadow); transition: border-color .15s, transform .15s, box-shadow .15s; }
.dcard:hover { border-color: var(--line-strong); transform: translateY(-2px); box-shadow: var(--glow); }
.dcard.dragging { opacity: .5; }
.dcard .t { font-weight: 600; margin-bottom: 3px; }
.dcard .m { font-size: 12px; color: var(--muted); }
.dcard .v { font-weight: 700; margin-top: 6px; display: flex; align-items: center; justify-content: space-between; font-family: var(--font-mono); font-size: 13px; }
.stage-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; box-shadow: 0 0 8px currentColor; }

.stagebar { display: flex; gap: 4px; margin: 6px 0 4px; flex-wrap: wrap; }
.stagebar button { flex: 1; min-width: 90px; border: 0; padding: 8px 6px; font: inherit; font-size: 12px; font-weight: 600; background: var(--surface-3); color: var(--muted); cursor: pointer; clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 0 100%, 8px 50%); transition: filter .15s; }
.stagebar button:hover { filter: brightness(1.2); }
.stagebar button:first-child { clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 0 100%); border-radius: 6px 0 0 6px; }
.stagebar button.done { background: var(--brand-soft); color: var(--brand-text); }
.stagebar button.cur { background: linear-gradient(90deg, var(--brand), var(--brand-2)); color: var(--brand-ink); }
.stagebar button.won.cur { background: var(--ok-solid); color: #fff; }
.stagebar button.lost.cur { background: var(--err-solid); color: #fff; }

/* =====================================================================
   Charts
   ===================================================================== */
.bars { display: flex; align-items: flex-end; gap: 10px; height: 200px; padding: 10px 4px 0; }
.bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; min-width: 0; }
.bars .bv { width: 100%; max-width: 54px; background: linear-gradient(180deg, var(--brand), var(--brand-2)); border-radius: 6px 6px 2px 2px; min-height: 2px; position: relative; transform-origin: bottom; }
[data-neon="1"] .bars .bv { box-shadow: 0 0 18px var(--brand-soft); }
[data-motion="on"] .bars .bv { animation: barUp .9s cubic-bezier(.2, .8, .2, 1) both; }
[data-motion="on"] .bars .b:nth-child(2) .bv { animation-delay: .06s; }
[data-motion="on"] .bars .b:nth-child(3) .bv { animation-delay: .12s; }
[data-motion="on"] .bars .b:nth-child(4) .bv { animation-delay: .18s; }
[data-motion="on"] .bars .b:nth-child(5) .bv { animation-delay: .24s; }
[data-motion="on"] .bars .b:nth-child(6) .bv { animation-delay: .3s; }
@keyframes barUp { from { transform: scaleY(0); } }
.bars .bv:hover { filter: brightness(1.25); }
.bars .bv:hover::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); background: var(--tip-bg); color: var(--text); border: 1px solid var(--line-strong); padding: 3px 7px; border-radius: 5px; font-size: 11.5px; white-space: nowrap; z-index: 5; font-family: var(--font-mono); }
.bars .bl { font-size: 11px; color: var(--muted); white-space: nowrap; font-family: var(--font-mono); }
.hbar { display: grid; grid-template-columns: 140px 1fr auto; gap: 10px; align-items: center; margin: 8px 0; font-size: 13px; }
.hbar .track { background: var(--surface-3); border-radius: 6px; height: 10px; overflow: hidden; }
.hbar .fill { height: 100%; background: linear-gradient(90deg, var(--brand), var(--accent)); border-radius: 6px; transform-origin: left; }
[data-neon="1"] .hbar .fill { box-shadow: 0 0 12px var(--brand-soft); }
[data-motion="on"] .hbar .fill { animation: fillIn 1s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes fillIn { from { transform: scaleX(0); } }
.hbar .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress .pbar { height: 8px; background: var(--surface-3); border-radius: 6px; overflow: hidden; margin: 8px 0 4px; }
.progress .pbar div { height: 100%; background: linear-gradient(90deg, var(--brand-2), var(--brand)); border-radius: 6px; transform-origin: left; }
[data-motion="on"] .progress .pbar div { animation: fillIn 1.1s cubic-bezier(.2, .8, .2, 1) both; }

/* =====================================================================
   Lists / timeline
   ===================================================================== */
.list { display: flex; flex-direction: column; }
.list .li { display: flex; gap: 10px; align-items: center; padding: 10px 18px; border-bottom: 1px solid var(--line); transition: background .12s; }
a.li:hover { background: var(--brand-soft); }
.list .li:last-child { border-bottom: 0; }
.list .li .grow { flex: 1; min-width: 0; }
.list .li .sub { font-size: 12px; color: var(--muted); }
.list .li > svg { width: 18px; height: 18px; color: var(--muted); flex-shrink: 0; }
.timeline { padding: 6px 18px 12px; }
.tl { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.tl:last-child { border-bottom: 0; }
.tl .ic { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--brand-soft); color: var(--brand-text); flex-shrink: 0; }
[data-neon="1"] .tl .ic { box-shadow: 0 0 0 1px var(--line-strong), 0 0 12px var(--brand-soft); }
.tl .ic svg { width: 15px; height: 15px; }
.tl .grow { flex: 1; min-width: 0; }
.tl .meta { font-size: 12px; color: var(--muted); }
.tl .body { white-space: pre-wrap; margin-top: 4px; font-size: 13px; }
.task-check { width: 18px; height: 18px; cursor: pointer; accent-color: var(--ok-solid); }
.task-done .ttl { text-decoration: line-through; color: var(--muted); }
.overdue { color: var(--err); font-weight: 600; }
.dl a svg, .small svg, .sub svg { width: 14px; height: 14px; vertical-align: -2px; }

/* =====================================================================
   Modal / toast
   ===================================================================== */
.modal-back { position: fixed; inset: 0; background: var(--overlay); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; z-index: 100; animation: fade .15s; }
.modal { background: var(--surface-solid); border: 1px solid var(--line); border-radius: 14px; width: 100%; max-width: 560px; box-shadow: 0 30px 80px rgba(0, 0, 0, .45); animation: pop .18s; }
[data-neon="1"] .modal { border-color: var(--line-strong); box-shadow: 0 30px 80px rgba(0, 0, 0, .55), var(--glow); }
.modal.lg { max-width: 940px; }
.modal-head { display: flex; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; }
[data-neon="1"] .modal-head h2 { font-family: var(--font-head); font-size: 15px; letter-spacing: .05em; }
.modal-head .icon-btn { margin-left: auto; }
.modal-body { padding: 18px 20px; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 14px 14px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: translateY(10px) scale(.98); opacity: 0; } }
#toasts { position: fixed; right: 16px; bottom: 16px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--surface-solid); color: var(--text); border: 1px solid var(--line); border-left: 3px solid var(--brand); padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow); max-width: 380px; animation: pop .2s; font-weight: 500; }
[data-neon="1"] .toast { box-shadow: var(--shadow), 0 0 22px var(--brand-soft); }
.toast.err { border-left-color: var(--err-solid); }
.toast.ok { border-left-color: var(--ok-solid); }
.toast.warn { border-left-color: var(--warn-solid); }

/* =====================================================================
   Editors
   ===================================================================== */
.items-tbl td { padding: 6px 6px; }
.items-tbl th { padding: 8px 6px; }
.items-tbl .input { padding: 6px 8px; }
.calc-box { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.calc-row { display: flex; justify-content: space-between; padding: 3px 0; font-size: 13.5px; gap: 10px; }
.calc-row.total { font-weight: 700; font-size: 15px; border-top: 1px solid var(--line); margin-top: 4px; padding-top: 8px; }
.calc-row.pool { color: var(--brand-text); font-weight: 700; }
[data-neon="1"] .calc-row span:last-child, [data-neon="1"] .calc-row b { font-family: var(--font-mono); }
.split-row { display: grid; grid-template-columns: 1fr 100px 120px 34px; gap: 8px; align-items: center; margin-bottom: 6px; }
fieldset.box { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin: 0; }
fieldset.box legend { font-weight: 700; font-size: 13px; padding: 0 6px; }
[data-neon="1"] fieldset.box legend { font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .08em; font-size: 12px; color: var(--brand-text); }
.logo-prev { width: 84px; height: 84px; border: 1px dashed var(--input-line); border-radius: 12px; display: flex; align-items: center; justify-content: center; background: var(--surface-2); overflow: hidden; }
.logo-prev img { max-width: 100%; max-height: 100%; }

/* =====================================================================
   v1.1 modules
   ===================================================================== */
.kpi.clickable { cursor: pointer; }
.kpi.clickable:hover { border-color: var(--line-strong); transform: translateY(-2px); box-shadow: var(--glow); }
.bell .icon-btn { position: relative; padding: 8px; }
.bell .icon-btn svg { width: 20px; height: 20px; }
.dotcount { position: absolute; top: 2px; right: 0; background: var(--err-solid); color: #fff; border-radius: 999px; font-size: 10px; font-weight: 700; min-width: 16px; height: 16px; line-height: 16px; text-align: center; padding: 0 4px; box-shadow: 0 0 10px var(--err-solid); }
.user-chip .menu.notif-menu { width: 340px; max-height: 440px; overflow: auto; }
.notif-head { display: flex; justify-content: space-between; align-items: center; padding: 6px 8px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; font-size: 13px; }
.user-chip .menu a.notif { display: block; padding: 8px 10px; border-radius: 6px; color: var(--text); margin-bottom: 2px; font-size: 13px; }
.user-chip .menu a.notif.unread { background: var(--brand-soft); box-shadow: inset 2px 0 0 var(--brand); }
.doc-wrap { overflow: hidden; }
.doc-frame { width: 100%; height: 1000px; border: 0; display: block; background: #fff; border-radius: var(--radius); }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal .dow { background: var(--surface-2); padding: 8px; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; border-bottom: 1px solid var(--line); font-family: var(--font-mono); letter-spacing: .06em; }
.cal .day { min-height: 112px; padding: 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); min-width: 0; transition: background .12s; }
.cal .day:hover { background: var(--surface-2); }
.cal .day:nth-child(7n) { border-right: 0; }
.cal .day.other { background: var(--surface-2); color: var(--muted); opacity: .7; }
.cal .dn { font-size: 12px; font-weight: 700; width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; font-family: var(--font-mono); }
.cal .day.today .dn { background: var(--brand); color: var(--brand-ink); border-radius: 50%; box-shadow: 0 0 14px var(--brand); }
.ev { display: block; font-size: 11.5px; padding: 2px 6px; border-radius: 5px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none !important; }
.card-head .ev { display: inline-block; margin: 0 0 0 4px; }
.ev-task { background: var(--sky-soft); color: var(--sky); }
.ev-task.done { text-decoration: line-through !important; opacity: .6; }
.ev-deal { background: var(--violet-soft); color: var(--violet); }
.ev-invoice { background: var(--warn-soft); color: var(--warn); }
.reply { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; background: var(--surface-2); }
.reply .meta { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.reply .body { white-space: pre-wrap; }
.rate-row { display: grid; grid-template-columns: 60px 1fr auto 34px; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.codebox { background: #050a16; color: #9ef6ff; border: 1px solid var(--line); padding: 10px 12px; border-radius: 8px; font-family: var(--font-mono); font-size: 12px; word-break: break-all; font-weight: 400; }
.avatar svg { width: 14px; height: 14px; }

/* =====================================================================
   Theme picker
   ===================================================================== */
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.theme-opt { border: 1px solid var(--line); border-radius: 12px; padding: 0; background: var(--surface-2); cursor: pointer; text-align: left; color: var(--text); font: inherit; overflow: hidden; transition: border-color .15s, transform .15s, box-shadow .15s; }
.theme-opt:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.theme-opt.on { border-color: var(--brand); box-shadow: var(--glow); }
.theme-opt .sw { height: 74px; position: relative; overflow: hidden; }
.theme-opt .sw i { position: absolute; border-radius: 6px; }
.theme-opt .meta { padding: 10px 12px; }
.theme-opt .meta b { display: block; font-size: 13.5px; }
.theme-opt .meta span { font-size: 12px; color: var(--muted); }
.theme-opt .tick { position: absolute; right: 8px; top: 8px; width: 22px; height: 22px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); display: none; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; }
.theme-opt.on .tick { display: flex; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.switch { position: relative; width: 42px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--surface-3); border: 1px solid var(--line); cursor: pointer; transition: background .2s; }
.switch span::after { content: ""; position: absolute; width: 18px; height: 18px; left: 2px; top: 2px; border-radius: 50%; background: var(--muted); transition: transform .2s, background .2s; }
.switch input:checked + span { background: var(--brand-soft); border-color: var(--brand); }
.switch input:checked + span::after { transform: translateX(18px); background: var(--brand); box-shadow: 0 0 10px var(--brand); }

/* page reveal */
[data-motion="on"] .view > * { animation: rise .45s cubic-bezier(.2, .8, .2, 1) both; }
[data-motion="on"] .view > *:nth-child(2) { animation-delay: .04s; }
[data-motion="on"] .view > *:nth-child(3) { animation-delay: .08s; }
[data-motion="on"] .view > *:nth-child(4) { animation-delay: .12s; }
[data-motion="on"] .view > *:nth-child(5) { animation-delay: .16s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

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

/* =====================================================================
   Responsive
   ===================================================================== */
@media (max-width: 1100px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-side { grid-template-columns: 1fr; }
  .sys-clock { display: none; }
}
@media (max-width: 860px) {
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 40px rgba(0, 0, 0, .5); background: var(--surface-solid); }
  .sidebar.open { transform: none; }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 10px 16px; }
  .view { padding: 16px; }
  .g2, .g3 { grid-template-columns: 1fr; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .user-chip .uname { display: none; }
  .split-row { grid-template-columns: 1fr 80px 34px; }
  .split-row .amt { display: none; }
  .hbar { grid-template-columns: 100px 1fr auto; }
  .dl { grid-template-columns: 100px 1fr; }
  .hide-sm { display: none; }
  .cal .day { min-height: 64px; padding: 3px; }
  .cal .ev { font-size: 10px; padding: 1px 3px; }
  .user-chip .menu.notif-menu { width: 290px; right: -90px; }
  .rate-row { grid-template-columns: 50px 1fr; }
  .doc-frame { height: 700px; }
}
@media (max-width: 520px) {
  .g4 { grid-template-columns: 1fr; }
  .kpi .value { font-size: 20px; }
  .modal-back { padding: 0; }
  .modal { border-radius: 0; min-height: 100vh; }
  .top-actions { gap: 4px; }
}

/* =====================================================================
   Print
   ===================================================================== */
@media print {
  html, body { background: #fff !important; color: #000; }
  #fx, body::after { display: none !important; }
  .sidebar, .topbar, .page-head .actions, .filters, #toasts, .theme-fab { display: none !important; }
  .view { padding: 0; max-width: none; }
  .card { box-shadow: none; break-inside: avoid; background: #fff; backdrop-filter: none; }
}
