@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif&family=Geist:wght@400;500;600;700&family=Geist+Mono&display=swap');

/* === Tokens === */
:root {
  --bg: #f7f6f3;
  --surface: #ffffff;
  --ink: #0f1013;
  --ink-2: #3a3d45;
  --muted: #7a7d86;
  --line: #ecebe6;
  --line-2: #e2e0d9;
  --accent: #3b4cff;
  --accent-soft: #eef0ff;
  --emerald: #0f7a5b;
  --emerald-soft: #e5f3ee;
  --amber: #a76a00;
  --amber-soft: #fbf1dc;
  --rose: #b3323a;
  --rose-soft: #fbe8ea;
  --font-serif: 'Instrument Serif', Georgia, serif;
  --font-sans: 'Geist', system-ui, sans-serif;
  --font-mono: 'Geist Mono', monospace;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 999px;
  --shadow-sm: 0 1px 2px rgba(15,16,19,.06);
  --shadow-md: 0 4px 12px rgba(15,16,19,.08);
  --shadow-lg: 0 8px 24px rgba(15,16,19,.12);
}

/* === Reset === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font-sans); background: var(--bg); color: var(--ink); font-size: 13.5px; line-height: 1.5; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 3px; }

/* === Layout === */
.app { width: 1440px; margin: 0 auto; display: flex; min-height: 100vh; }
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.content { padding: 28px 32px 60px; }

/* === Sidebar === */
.sidebar { width: 248px; background: transparent; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; flex-shrink: 0; padding: 18px 14px; border-right: 1px solid var(--line); overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 18px; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, #0f1013, #2a2d38); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 13px; letter-spacing: -.02em; box-shadow: 0 6px 14px rgba(15,16,19,.14); }
.brand-name { font-weight: 600; font-size: 15px; letter-spacing: -.01em; }
.brand-sub { font-size: 11px; color: var(--muted); margin-top: 1px; }
.workspace { margin: 0 4px 12px; padding: 10px 12px; background: #fff; border: 1px solid var(--line); border-radius: 12px; display: flex; align-items: center; gap: 10px; box-shadow: 0 1px 0 rgba(15,16,19,.02); cursor: pointer; transition: background var(--duration-fast); }
.workspace:hover { background: #fafaf7; }
.ws-ico { width: 26px; height: 26px; border-radius: 7px; background: #0f1013; color: #fff; display: grid; place-items: center; font-size: 11px; font-weight: 600; }
.ws-name { font-size: 12.5px; font-weight: 600; }
.ws-sub { font-size: 10.5px; color: var(--muted); }
.ws-caret { margin-left: auto; color: var(--muted); }
.nav { flex: 1; overflow: auto; padding: 4px 4px; }
.nav-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); padding: 14px 10px 6px; font-weight: 600; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 9px; color: var(--ink-2); font-size: 13px; font-weight: 500; cursor: pointer; margin-bottom: 1px; transition: background var(--duration-fast); }
.nav-item:hover { background: rgba(15,16,19,.04); }
.nav-item.active { background: #0f1013; color: #fff; }
.nav-item .ico, .nav-item svg:first-child { width: 15px; height: 15px; color: var(--muted); flex-shrink: 0; }
.nav-item.active svg { color: #fff; }
.badge { margin-left: auto; background: rgba(15,16,19,.06); color: var(--ink-2); font-size: 10px; padding: 1px 6px; border-radius: 6px; font-weight: 600; font-family: var(--font-mono); }
.nav-item.active .badge { background: rgba(255,255,255,.14); color: #fff; }
.side-foot { padding: 12px 8px 4px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 10px; margin-top: 4px; position: relative; }
.avatar { width: 32px; height: 32px; border-radius: 50%; color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 12px; flex-shrink: 0; }
.user-name { font-size: 12.5px; font-weight: 600; }
.user-role { font-size: 11px; color: var(--muted); }
.side-foot .dots { margin-left: auto; color: var(--muted); cursor: pointer; padding: 4px; border-radius: 6px; transition: background var(--duration-fast); }
.side-foot .dots:hover { background: rgba(15,16,19,.06); }
.user-menu { position: absolute; bottom: 100%; right: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-md); padding: 4px; min-width: 150px; z-index: 50; animation: fadeSlideDown var(--duration-fast) var(--ease-out); }
.user-menu-item { padding: 8px 12px; font-size: 13px; cursor: pointer; border-radius: 7px; color: var(--ink-2); transition: background var(--duration-fast); }
.user-menu-item:hover { background: rgba(15,16,19,.04); }

/* === Topbar === */
.topbar { padding: 14px 32px; display: flex; align-items: center; gap: 14px; position: sticky; top: 0; background: rgba(247,246,243,.85); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); z-index: 20; border-bottom: 1px solid var(--line); }
.search { flex: 1; max-width: 460px; position: relative; }
.search input { width: 100%; height: 38px; border: 1px solid var(--line-2); border-radius: var(--radius-md); padding: 0 12px 0 36px; font-size: 13px; background: #fff; font-family: inherit; color: var(--ink); transition: border-color var(--duration-fast), box-shadow var(--duration-fast); }
.search input::placeholder { color: var(--muted); }
.search input:focus { outline: none; border-color: #0f1013; box-shadow: 0 0 0 4px rgba(15,16,19,.06); }
.search svg { position: absolute; left: 12px; top: 11px; color: var(--muted); }
.kbd { position: absolute; right: 10px; top: 9px; font-size: 10px; color: var(--muted); border: 1px solid var(--line-2); padding: 2px 6px; border-radius: 5px; background: #fafaf7; font-family: var(--font-mono); }
.top-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.icon-btn { width: 38px; height: 38px; border-radius: var(--radius-md); display: grid; place-items: center; border: 1px solid var(--line-2); background: #fff; cursor: pointer; position: relative; color: var(--ink-2); transition: background var(--duration-fast); }
.icon-btn:hover { background: #fafaf7; }
.notif-dot { position: absolute; top: 8px; right: 8px; width: 7px; height: 7px; background: var(--accent); border-radius: 50%; border: 2px solid #fff; }

/* === Buttons === */
.btn { height: 38px; padding: 0 14px; border-radius: var(--radius-md); border: 1px solid var(--line-2); background: #fff; font-size: 13px; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; color: var(--ink); font-family: inherit; transition: background var(--duration-fast), transform 100ms; white-space: nowrap; }
.btn:hover { background: #fafaf7; }
.btn:active { transform: scale(0.98); }
.btn-primary { background: #0f1013; border-color: #0f1013; color: #fff; }
.btn-primary:hover { background: #22242c; }
.btn-danger { background: var(--rose); border-color: var(--rose); color: #fff; }
.btn-danger:hover { background: #9e2b32; }
.btn-ghost { border: none; background: transparent; }
.btn-ghost:hover { background: rgba(15,16,19,.05); }
.btn-sm { height: 32px; padding: 0 10px; font-size: 12px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* === Breadcrumbs === */
.crumbs { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; margin-bottom: 14px; }
.crumbs .sep { opacity: .5; }
.crumbs span:last-child { color: var(--ink); }
.crumbs a, .crumbs .crumb-link { color: var(--muted); text-decoration: none; cursor: pointer; }
.crumbs a:hover, .crumbs .crumb-link:hover { color: var(--ink); }

/* === Hero === */
.hero { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 24px; gap: 24px; }
.title-wrap h1 { font-family: var(--font-serif); font-size: 44px; font-weight: 400; letter-spacing: -.02em; line-height: 1.05; color: var(--ink); }
.title-wrap h1 em { font-style: italic; color: #5d6270; font-weight: 400; }
.subtitle { color: var(--muted); font-size: 13.5px; margin-top: 10px; max-width: 620px; }
.hero-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* === Segmented + Filters === */
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; flex-wrap: wrap; }
.segmented { display: inline-flex; background: #fff; border: 1px solid var(--line-2); border-radius: var(--radius-md); padding: 3px; gap: 2px; }
.seg { padding: 6px 12px; font-size: 12.5px; font-weight: 500; color: var(--muted); border-radius: 7px; cursor: pointer; transition: background var(--duration-fast), color var(--duration-fast); }
.seg:hover { color: var(--ink-2); }
.seg.active { background: #0f1013; color: #fff; }
.pillfilter { height: 34px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--radius-md); background: #fff; display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-2); cursor: pointer; transition: background var(--duration-fast); }
.pillfilter:hover { background: #fafaf7; }
.pillfilter svg { color: var(--muted); }

/* === KPI Cards === */
.kpi-hero { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 16px; margin-bottom: 22px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px 22px; position: relative; overflow: hidden; transition: box-shadow var(--duration-normal); }
.kpi:hover { box-shadow: var(--shadow-sm); }
.kpi.dark { background: linear-gradient(160deg, #0f1013 0%, #1c1e26 100%); color: #fff; border-color: #0f1013; }
.kpi-label { font-size: 12px; color: var(--muted); font-weight: 500; display: flex; align-items: center; gap: 8px; }
.kpi.dark .kpi-label { color: #a7abbb; }
.kpi-value { font-family: var(--font-serif); font-size: 44px; font-weight: 400; letter-spacing: -.02em; line-height: 1.05; margin-top: 12px; }
.kpi.dark .kpi-value { color: #fff; }
.kpi-value .unit { font-family: var(--font-sans); font-size: 16px; color: var(--muted); font-weight: 500; margin-left: 4px; }
.kpi.dark .kpi-value .unit { color: #a7abbb; }
.kpi-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; font-size: 12px; color: var(--muted); }
.kpi.dark .kpi-foot { color: #a7abbb; }
.spark { position: absolute; right: 0; bottom: 0; width: 60%; height: 70px; opacity: .9; pointer-events: none; }

/* === Trends === */
.trend { display: inline-flex; align-items: center; gap: 5px; font-weight: 500; padding: 3px 8px; border-radius: var(--radius-full); font-size: 11.5px; }
.trend.up { background: var(--emerald-soft); color: var(--emerald); }
.trend.dn { background: var(--rose-soft); color: var(--rose); }
.kpi.dark .trend.up { background: rgba(80,220,170,.15); color: #7ee7c1; }

/* === Grid === */
.grid { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-bottom: 16px; }
.grid-equal { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

/* === Panel === */
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; transition: box-shadow var(--duration-normal); }
.panel:hover { box-shadow: 0 2px 8px rgba(15,16,19,.04); }
.panel-head { padding: 20px 22px 8px; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.panel-title { font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.panel-desc { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.panel-actions { display: flex; gap: 6px; align-items: center; }
.panel-body { padding: 6px 22px 20px; }

/* === Tables === */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table thead th { text-align: left; padding: 12px 20px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line); background: #fafaf7; cursor: default; white-space: nowrap; }
.table thead th.sortable { cursor: pointer; }
.table thead th.sortable:hover { color: var(--ink); }
.table td { padding: 14px 20px; border-bottom: 1px solid var(--line); vertical-align: middle; color: var(--ink); }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: #fafaf7; }
.table-footer { padding: 14px 20px; display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }

/* === Product Cell === */
.product { display: flex; align-items: center; gap: 12px; }
.thumb { width: 34px; height: 34px; border-radius: 8px; background: linear-gradient(135deg, #eef0ff, #e5e7f8); display: grid; place-items: center; flex-shrink: 0; color: var(--accent); }
.pn { font-weight: 600; font-size: 13px; }
.sku { font-size: 11px; color: var(--muted); font-family: var(--font-mono); margin-top: 1px; }

/* === Pills === */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: var(--radius-full); font-size: 11px; font-weight: 500; line-height: 1; }
.pill.red { background: var(--rose-soft); color: var(--rose); }
.pill.amber { background: var(--amber-soft); color: var(--amber); }
.pill.green { background: var(--emerald-soft); color: var(--emerald); }
.pill.blue { background: var(--accent-soft); color: var(--accent); }
.pill .d { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* === Numbers === */
.num { font-family: var(--font-mono); font-weight: 500; font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); }

/* === Cover bar === */
.cover { display: flex; align-items: center; gap: 10px; }
.mini { width: 70px; height: 6px; background: #f2f1ec; border-radius: 3px; overflow: hidden; }
.mini i { display: block; height: 100%; border-radius: 3px; }

/* === Links === */
.link { color: var(--accent); font-weight: 500; font-size: 12.5px; text-decoration: none; cursor: pointer; }
.link:hover { text-decoration: underline; }

/* === Checkboxes === */
.check { width: 16px; height: 16px; border-radius: 5px; border: 1.5px solid var(--line-2); display: inline-block; vertical-align: middle; cursor: pointer; background: #fff; transition: background var(--duration-fast), border-color var(--duration-fast); }
.check.on { background: #0f1013; border-color: #0f1013; position: relative; }
.check.on:after { content: ""; position: absolute; left: 4px; top: 1px; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }

/* === Charts === */
.chart-wrap { padding: 6px 12px 18px; }
.legend { display: flex; gap: 16px; padding: 0 12px 6px; font-size: 12px; color: var(--ink-2); }
.dot { width: 8px; height: 8px; border-radius: 2px; display: inline-block; margin-right: 7px; vertical-align: middle; }
.chart { height: 280px; position: relative; }
.chart svg { width: 100%; height: 100%; }

/* === Aging === */
.aging { padding: 6px 22px 20px; }
.aging-total { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.aging-total .big { font-family: var(--font-serif); font-size: 34px; letter-spacing: -.02em; }
.aging-stack { display: flex; height: 14px; border-radius: 8px; overflow: hidden; background: #f2f1ec; margin-bottom: 16px; }
.aging-stack > span { display: block; height: 100%; }
.aging-list { display: flex; flex-direction: column; gap: 10px; }
.aging-item { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.aging-swatch { width: 10px; height: 10px; border-radius: 3px; }
.aging-name { color: var(--ink-2); flex: 1; }
.aging-val { font-family: var(--font-mono); font-weight: 600; }
.aging-pct { color: var(--muted); font-size: 11.5px; width: 44px; text-align: right; font-family: var(--font-mono); }

/* === Signals === */
.signals { padding: 6px 12px 16px; display: flex; flex-direction: column; gap: 8px; }
.signal { display: flex; gap: 12px; padding: 14px; border-radius: 12px; background: #fafaf7; border: 1px solid var(--line); align-items: flex-start; }
.signal.critical { background: linear-gradient(180deg, #fdeef0, #fbe8ea); border-color: #f6d3d7; }
.signal.warn { background: linear-gradient(180deg, #fdf5e2, #fbf1dc); border-color: #f2e2b5; }
.signal-ico { width: 32px; height: 32px; border-radius: 9px; background: #fff; display: grid; place-items: center; flex-shrink: 0; box-shadow: var(--shadow-sm); }
.signal-title { font-size: 13px; font-weight: 600; line-height: 1.35; }
.signal-desc { font-size: 12px; color: var(--muted); margin-top: 3px; }
.signal-meta { font-size: 11px; color: var(--muted); margin-top: 8px; display: flex; gap: 10px; align-items: center; }
.signal-meta .link { font-size: 11.5px; }

/* === Params === */
.params { padding: 6px 22px 20px; }
.param { display: flex; justify-content: space-between; align-items: center; padding: 11px 0; border-bottom: 1px dashed var(--line-2); font-size: 13px; }
.param:last-child { border-bottom: none; }
.param-name { color: var(--muted); font-size: 12.5px; }
.param-val { font-weight: 600; color: var(--ink); font-family: var(--font-mono); }
.param-val.badge-val { background: var(--accent-soft); color: var(--accent); padding: 2px 8px; border-radius: 6px; font-size: 11.5px; }

/* === Footer === */
.footer { padding: 20px 32px; color: var(--muted); font-size: 12px; display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--emerald); display: inline-block; margin-right: 6px; box-shadow: 0 0 0 3px var(--emerald-soft); }
.footer a { color: var(--muted); text-decoration: none; margin-left: 16px; cursor: pointer; }
.footer a:hover { color: var(--ink); }

/* === Toast === */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { pointer-events: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-md); padding: 12px 16px; min-width: 280px; max-width: 400px; box-shadow: var(--shadow-lg); display: flex; align-items: flex-start; gap: 10px; font-size: 13px; animation: slideInRight var(--duration-normal) var(--ease-out); }
.toast.removing { animation: fadeOut var(--duration-fast) var(--ease-in-out) forwards; }
.toast-icon { flex-shrink: 0; margin-top: 1px; }
.toast.success { border-left: 3px solid var(--emerald); }
.toast.success .toast-icon { color: var(--emerald); }
.toast.error { border-left: 3px solid var(--rose); }
.toast.error .toast-icon { color: var(--rose); }
.toast.warning { border-left: 3px solid var(--amber); }
.toast.warning .toast-icon { color: var(--amber); }
.toast.info { border-left: 3px solid var(--accent); }
.toast.info .toast-icon { color: var(--accent); }
.toast-msg { flex: 1; }
.toast-close { flex-shrink: 0; cursor: pointer; color: var(--muted); padding: 2px; border-radius: 4px; background: none; border: none; }
.toast-close:hover { color: var(--ink); background: rgba(15,16,19,.05); }

/* === Modal === */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15,16,19,.4); z-index: 1000; display: grid; place-items: center; animation: fadeIn var(--duration-normal) var(--ease-out); }
.modal { background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); animation: scaleIn var(--duration-normal) var(--ease-out); overflow: hidden; }
.modal-sm { width: 400px; }
.modal-md { width: 560px; }
.modal-lg { width: 720px; }
.modal-header { padding: 20px 24px 0; display: flex; justify-content: space-between; align-items: center; }
.modal-header h3 { font-size: 18px; font-weight: 600; }
.modal-body { padding: 16px 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }

/* === Dropdown === */
.dropdown-panel { position: absolute; top: 100%; left: 0; margin-top: 4px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-md); padding: 4px; min-width: 180px; z-index: 50; animation: fadeSlideDown var(--duration-fast) var(--ease-out); }
.dropdown-item { padding: 8px 12px; font-size: 13px; cursor: pointer; border-radius: 7px; color: var(--ink-2); transition: background var(--duration-fast); }
.dropdown-item:hover { background: rgba(15,16,19,.04); }
.dropdown-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 500; }

/* === Forms === */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12.5px; font-weight: 500; color: var(--ink-2); margin-bottom: 6px; }
.form-input, .form-select, .form-textarea { width: 100%; height: 38px; border: 1px solid var(--line-2); border-radius: var(--radius-md); padding: 0 12px; font-size: 13px; background: #fff; font-family: inherit; color: var(--ink); transition: border-color var(--duration-fast), box-shadow var(--duration-fast); }
.form-input:focus, .form-select:focus, .form-textarea:focus { outline: none; border-color: #0f1013; box-shadow: 0 0 0 4px rgba(15,16,19,.06); }
.form-textarea { height: 80px; padding: 10px 12px; resize: vertical; }
.form-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237a7d86' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
.form-error { border-color: var(--rose) !important; }
.form-error-msg { font-size: 11.5px; color: var(--rose); margin-top: 4px; }
.form-row { display: flex; gap: 16px; }
.form-row > * { flex: 1; }

/* === Timeline === */
.timeline { padding: 0; list-style: none; }
.timeline-item { display: flex; gap: 12px; padding-bottom: 20px; position: relative; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item:not(:last-child)::before { content: ''; position: absolute; left: 11px; top: 24px; bottom: 0; width: 1px; background: var(--line-2); }
.timeline-dot { width: 22px; height: 22px; border-radius: 50%; background: var(--accent-soft); border: 2px solid var(--accent); display: grid; place-items: center; flex-shrink: 0; }
.timeline-dot.green { background: var(--emerald-soft); border-color: var(--emerald); }
.timeline-dot.red { background: var(--rose-soft); border-color: var(--rose); }
.timeline-dot.amber { background: var(--amber-soft); border-color: var(--amber); }
.timeline-dot.gray { background: #f2f1ec; border-color: var(--line-2); }
.timeline-content { min-width: 0; }
.timeline-title { font-size: 13px; font-weight: 600; }
.timeline-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* === Login === */
.login-page { min-height: 100vh; display: grid; place-items: center; background: var(--bg); padding: 40px; }
.login-container { width: 480px; }
.login-brand { text-align: center; margin-bottom: 32px; }
.login-brand .brand-mark { width: 48px; height: 48px; font-size: 18px; margin: 0 auto 12px; }
.login-brand h2 { font-family: var(--font-serif); font-size: 28px; font-weight: 400; }
.login-brand p { color: var(--muted); font-size: 14px; margin-top: 4px; }
.login-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 24px; }
.user-cards { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.user-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; transition: border-color var(--duration-fast), background var(--duration-fast), box-shadow var(--duration-fast); }
.user-card:hover { border-color: var(--line-2); background: #fafaf7; }
.user-card.selected { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px rgba(59,76,255,.1); }
.user-card .avatar { width: 36px; height: 36px; font-size: 13px; }
.user-card-name { font-weight: 600; font-size: 13.5px; }
.user-card-role { font-size: 12px; color: var(--muted); }
.login-form { border-top: 1px solid var(--line); padding-top: 16px; }
.login-form .btn-primary { width: 100%; justify-content: center; height: 42px; font-size: 14px; }

/* === Toggle === */
.toggle { width: 36px; height: 20px; border-radius: 10px; background: var(--line-2); position: relative; cursor: pointer; transition: background var(--duration-fast); display: inline-block; }
.toggle.on { background: var(--emerald); }
.toggle::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform var(--duration-fast); }
.toggle.on::after { transform: translateX(16px); }

/* === Status Cards === */
.status-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px 20px; }
.status-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.status-indicator { width: 8px; height: 8px; border-radius: 50%; }
.status-indicator.connected { background: var(--emerald); box-shadow: 0 0 0 3px var(--emerald-soft); }
.status-indicator.error { background: var(--rose); box-shadow: 0 0 0 3px var(--rose-soft); }

/* === Tabs (vertical) === */
.vtabs { display: flex; gap: 0; }
.vtabs-list { width: 200px; flex-shrink: 0; border-right: 1px solid var(--line); padding: 8px; }
.vtab { padding: 10px 14px; font-size: 13px; cursor: pointer; border-radius: 8px; color: var(--ink-2); margin-bottom: 2px; transition: background var(--duration-fast); }
.vtab:hover { background: rgba(15,16,19,.04); }
.vtab.active { background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.vtabs-content { flex: 1; padding: 0 24px; }

/* === Quick Actions === */
.quick-actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.quick-action { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 12px; background: #fff; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; text-align: center; font-size: 12.5px; font-weight: 500; color: var(--ink-2); transition: border-color var(--duration-fast), box-shadow var(--duration-fast); }
.quick-action:hover { border-color: var(--accent); box-shadow: 0 2px 8px rgba(59,76,255,.08); }
.quick-action-icon { width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }

/* === Empty/Error States === */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 24px; text-align: center; color: var(--muted); }
.empty-state svg { margin-bottom: 16px; color: var(--line-2); }
.empty-state h3 { font-size: 16px; color: var(--ink); margin-bottom: 6px; font-weight: 600; }
.empty-state p { font-size: 13px; max-width: 300px; margin-bottom: 16px; }
.error-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 24px; text-align: center; }
.error-state svg { margin-bottom: 16px; color: var(--rose); }

/* === Access Denied === */
.access-denied { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 80px 24px; text-align: center; }
.access-denied h2 { font-family: var(--font-serif); font-size: 32px; margin-bottom: 8px; }
.access-denied p { color: var(--muted); margin-bottom: 24px; }

/* === Animations === */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes fadeSlideDown { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }
.animate-in { animation: fadeInUp var(--duration-slow) var(--ease-out) both; }
.stagger-1 { animation-delay: 50ms; }
.stagger-2 { animation-delay: 100ms; }
.stagger-3 { animation-delay: 150ms; }
.stagger-4 { animation-delay: 200ms; }
.stagger-5 { animation-delay: 250ms; }
.stagger-6 { animation-delay: 300ms; }

/* === Skeleton === */
.skeleton { background: linear-gradient(90deg, #f2f1ec 25%, #e8e7e2 50%, #f2f1ec 75%); background-size: 200% 100%; animation: pulse 1.5s ease-in-out infinite; border-radius: var(--radius-md); }

/* === Escalated row === */
.table tr.escalated td { background: var(--amber-soft); }

/* === Inline edit === */
.inline-input { height: 30px; border: 1px solid var(--accent); border-radius: var(--radius-sm); padding: 0 8px; font-size: 12px; font-family: inherit; width: 100%; }
.inline-input:focus { outline: none; box-shadow: 0 0 0 3px rgba(59,76,255,.1); }

/* === Misc === */
.text-right { text-align: right; }
.text-center { text-align: center; }
.flex-1 { flex: 1; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mt-16 { margin-top: 16px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-col { flex-direction: column; }
