/* ============ A2Z ERP — design tokens ============
   Same control-room palette as a2zglobal.co (app/globals.css in a2z-web). */
:root {
  --bg: #04070d;
  --bg-2: #0a101c;
  --panel: #0a101c;
  --panel-2: #0e1626;
  --field: #060b14;
  --line: rgba(139, 149, 168, 0.16);
  --line-2: rgba(139, 149, 168, 0.28);
  --text: #f2f5fa;
  --text-2: #c3cad8;
  --muted: #8b95a8;
  --accent: #2563eb;
  --accent-glow: #4d8dff;
  --accent-soft: rgba(37, 99, 235, 0.14);
  --gold: #d4af37;
  --gold-soft: rgba(212, 175, 55, 0.14);
  --income: #34d399;
  --income-soft: rgba(52, 211, 153, 0.12);
  --expense: #fb7185;
  --expense-soft: rgba(251, 113, 133, 0.12);
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, 0.12);
  --violet: #a78bfa;
  --teal: #2dd4bf;
  --radius: 14px;
  --radius-sm: 10px;
  --font-display: 'Archivo Black', ui-sans-serif, system-ui, sans-serif;
  --font-body: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Consolas, monospace;
  --sidebar: 252px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
body::before { /* blueprint grid + glow, like the website */
  content: '';
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(37, 99, 235, 0.16), transparent 60%),
    radial-gradient(700px 400px at -10% 110%, rgba(37, 99, 235, 0.08), transparent 60%),
    linear-gradient(rgba(139, 149, 168, 0.045) 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(90deg, rgba(139, 149, 168, 0.045) 1px, transparent 1px) 0 0 / 48px 48px;
}
::selection { background: color-mix(in srgb, var(--accent) 45%, transparent); }
:focus-visible { outline: 2px solid var(--accent-glow); outline-offset: 2px; }
a { color: var(--accent-glow); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 600; }
.mono { font-family: var(--font-mono); }
.muted { color: var(--muted); }
.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pos { color: var(--income); }
.neg { color: var(--expense); }
.eyebrow {
  font: 500 11px/1 var(--font-mono);
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent-glow);
}
.eyebrow::before { content: '// '; opacity: 0.7; }

/* ---------- boot / auth screens ---------- */
.boot { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 14px; color: var(--muted); }
.boot img { width: 180px; opacity: 0.9; }
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card {
  width: min(440px, 100%);
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  border: 1px solid var(--line-2); border-radius: 18px;
  padding: 28px 26px 24px;
  box-shadow: 0 30px 80px -30px rgba(37, 99, 235, 0.35);
  position: relative;
}
.auth-card.wide { width: min(620px, 100%); }
.auth-card::before { /* accent corner ticks */
  content: ''; position: absolute; inset: -1px; border-radius: 18px; pointer-events: none;
  background:
    linear-gradient(var(--accent), var(--accent)) 0 0 / 22px 1px no-repeat,
    linear-gradient(var(--accent), var(--accent)) 0 0 / 1px 22px no-repeat,
    linear-gradient(var(--accent), var(--accent)) 100% 100% / 22px 1px no-repeat,
    linear-gradient(var(--accent), var(--accent)) 100% 100% / 1px 22px no-repeat;
}
.auth-brand { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.auth-brand img { width: 128px; height: auto; object-fit: contain; }
.auth-brand > div { border-left: 1px solid var(--line-2); padding-left: 16px; }
.auth-brand h1 { font: 22px/1.1 var(--font-display); text-transform: uppercase; letter-spacing: 0.02em; }
.auth-brand p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.auth form { display: grid; gap: 14px; }
.auth .btn { height: 44px; justify-content: center; }
.auth-foot { margin-top: 16px; text-align: center; color: var(--muted); font-size: 12px; }
.auth h2.sub { font-size: 13px; color: var(--text-2); margin-top: 6px; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: color-mix(in srgb, var(--bg-2) 88%, transparent);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(8px);
  display: flex; flex-direction: column;
  padding: 18px 14px;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 6px 18px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.brand img { width: 104px; height: auto; object-fit: contain; }
.brand > div { border-left: 1px solid var(--line-2); padding-left: 12px; }
.brand b { display: block; font: 18px/1 var(--font-display); text-transform: uppercase; letter-spacing: 0.04em; }
.brand span { display: block; margin-top: 5px; font: 500 10.5px/1 var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.nav-group { margin: 6px 0 14px; }
.nav-group > .eyebrow { display: block; padding: 6px 10px 8px; color: var(--muted); font-size: 10.5px; }
.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; margin: 2px 0;
  border-radius: var(--radius-sm); border: 1px solid transparent;
  color: var(--text-2); font-weight: 500; font-size: 13.5px;
}
.nav-link svg { color: var(--muted); flex: none; }
.nav-link:hover { background: rgba(139, 149, 168, 0.08); color: var(--text); text-decoration: none; }
.nav-link.active { background: var(--accent-soft); border-color: rgba(37, 99, 235, 0.35); color: var(--text); }
.nav-link.active svg { color: var(--accent-glow); }
.nav-link.soon { opacity: 0.45; pointer-events: none; }
.nav-link .tag { margin-left: auto; font: 500 9.5px/1 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line-2); border-radius: 6px; padding: 3px 5px; }
.side-foot { margin-top: auto; padding: 14px 10px 4px; border-top: 1px solid var(--line); color: var(--muted); font: 500 10.5px/1.6 var(--font-mono); letter-spacing: 0.06em; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 14px;
  padding: 14px 28px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.page-title h1 { font: 21px/1.1 var(--font-display); text-transform: uppercase; letter-spacing: 0.02em; margin-top: 6px; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.icon-btn.menu-btn { display: none; }
.view { padding: 24px 28px 48px; display: grid; gap: 20px; align-content: start; }
.stack { display: grid; gap: 20px; align-content: start; min-width: 0; }

/* user menu */
.user-menu { position: relative; }
.user-menu > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 5px 10px 5px 5px; border: 1px solid var(--line-2); border-radius: 999px; }
.user-menu > summary::-webkit-details-marker { display: none; }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-glow); font: 600 12px/1 var(--font-mono); border: 1px solid rgba(37, 99, 235, 0.4); }
.user-menu .who { line-height: 1.15; }
.user-menu .who b { display: block; font-size: 13px; font-weight: 600; }
.user-menu .who span { font-size: 11px; color: var(--muted); }
.menu-pop { position: absolute; right: 0; top: calc(100% + 8px); min-width: 210px; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 6px; box-shadow: 0 20px 50px -20px #000; z-index: 30; }
.menu-pop button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 0; background: none; color: var(--text-2); border-radius: 8px; cursor: pointer; font: inherit; text-align: left; }
.menu-pop button:hover { background: rgba(139, 149, 168, 0.1); color: var(--text); }

/* ---------- buttons & controls ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 14px;
  border-radius: var(--radius-sm); border: 1px solid var(--line-2);
  background: transparent; color: var(--text);
  font: 600 13.5px/1 var(--font-body); cursor: pointer; white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn:hover { background: rgba(139, 149, 168, 0.1); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: #1d4fd0; }
.btn-income { background: var(--income-soft); border-color: rgba(52, 211, 153, 0.45); color: var(--income); }
.btn-income:hover { background: rgba(52, 211, 153, 0.2); }
.btn-expense { background: var(--expense-soft); border-color: rgba(251, 113, 133, 0.45); color: var(--expense); }
.btn-expense:hover { background: rgba(251, 113, 133, 0.2); }
.btn-danger { color: var(--expense); border-color: rgba(251, 113, 133, 0.45); }
.btn-danger.solid { background: #e11d48; border-color: #e11d48; color: #fff; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; border: 1px solid transparent; background: none; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: rgba(139, 149, 168, 0.12); color: var(--text); }
.icon-btn.danger:hover { color: var(--expense); }
.icon-btn:disabled { opacity: 0.35; cursor: not-allowed; }

.field { display: grid; gap: 6px; min-width: 0; }
.label { font-size: 12px; font-weight: 600; color: var(--text-2); letter-spacing: 0.01em; }
.hint { margin: 0; font-size: 12px; color: var(--muted); }
input, select, textarea {
  width: 100%; min-width: 0;
  background: var(--field); color: var(--text);
  border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  font: 14px/1.4 var(--font-body);
  padding: 9px 12px; height: 40px;
}
textarea { height: auto; min-height: 120px; resize: vertical; font-family: var(--font-body); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent-glow); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25); }
input:disabled, select:disabled, textarea:disabled { opacity: 0.55; }
input[type='date'] { color-scheme: dark; }
select { appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b95a8' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; }
input[type='search']::-webkit-search-cancel-button { filter: invert(0.6); }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

.seg { display: inline-flex; flex-wrap: wrap; gap: 3px; padding: 3px; background: var(--field); border: 1px solid var(--line-2); border-radius: 12px; }
.seg button { border: 0; background: none; color: var(--text-2); font: 600 13px/1 var(--font-body); padding: 9px 14px; border-radius: 9px; cursor: pointer; }
.seg button:hover { color: var(--text); background: rgba(139, 149, 168, 0.1); }
.seg button.active { background: var(--accent); color: #fff; }
.seg.type-seg { display: grid; grid-template-columns: 1fr 1fr; }
.seg.type-seg button { padding: 11px; font-size: 14px; }
.seg.type-seg button[data-type='income'].active { background: #059669; }
.seg.type-seg button[data-type='expense'].active { background: #e11d48; }
.seg.heads { display: flex; }
.seg.heads button { flex: 1; padding: 11px 10px; }
.seg-sm button { padding: 7px 10px; font-size: 12px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line-2); background: none; color: var(--text-2); font: 500 12.5px/1 var(--font-body); padding: 8px 12px; border-radius: 999px; cursor: pointer; }
.chip:hover { border-color: var(--accent-glow); color: var(--text); }
.chip.active { background: var(--accent-soft); border-color: var(--accent-glow); color: var(--text); }

.amount-wrap { display: flex; gap: 8px; }
.amount-wrap .seg { flex: none; }
.amount-wrap input { font: 600 16px/1 var(--font-mono); }

/* ---------- cards, stats, tables ---------- */
.card { background: color-mix(in srgb, var(--panel) 94%, transparent); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; min-width: 0; }
.card-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.card-head h2, .card-head h3 { font-size: 14px; font-weight: 600; }
.card-head .spacer { flex: 1; }
.card-title { font: 500 11px/1 var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.section-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.section-head h2 { font: 17px/1.2 var(--font-display); text-transform: uppercase; letter-spacing: 0.02em; }
.section-head .spacer { flex: 1; }
.section-head select { width: auto; min-width: 200px; }

.stat { position: relative; overflow: hidden; }
.stat .value { margin-top: 12px; font: 600 26px/1.1 var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .value.lg { font-size: 30px; }
.stat .sub { margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.stat .sub b { color: var(--text-2); font-weight: 600; }
.stat.hero { border-color: rgba(37, 99, 235, 0.4); background: linear-gradient(160deg, rgba(37, 99, 235, 0.16), transparent 55%), var(--panel); }
.stat .marker { position: absolute; top: 18px; right: 18px; width: 8px; height: 8px; border-radius: 50%; }

.table-wrap { overflow-x: auto; margin: 0 -18px -18px; }
table.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font: 500 10.5px/1 var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: rgba(139, 149, 168, 0.03); }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:hover td { background: rgba(139, 149, 168, 0.045); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .r { text-align: right; }
.table .c { text-align: center; }
.table .desc b { font-weight: 500; display: block; }
.table .desc span { color: var(--muted); font-size: 12px; }
.table .actions { white-space: nowrap; text-align: right; width: 1%; }
.table tfoot td { font-weight: 600; border-top: 1px solid var(--line-2); border-bottom: 0; background: rgba(139, 149, 168, 0.04); }
.table td.first-col, .table th.first-col { padding-left: 18px; }
.empty { padding: 34px 18px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--text-2); font-size: 14px; margin-bottom: 4px; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid var(--line-2); color: var(--text-2); white-space: nowrap; }
.pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.h-company::before { background: var(--accent-glow); }
.pill.h-p0::before { background: var(--gold); }
.pill.h-p1::before { background: var(--violet); }
.pill.h-p2::before { background: var(--teal); }
.pill.h-p3::before { background: #f472b6; }
.pill.h-p4::before { background: #a3e635; }
.type-badge { display: inline-block; font: 600 10.5px/1 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; padding: 5px 7px; border-radius: 6px; }
.type-badge.income { color: var(--income); background: var(--income-soft); }
.type-badge.expense { color: var(--expense); background: var(--expense-soft); }

.status { display: inline-flex; align-items: center; gap: 6px; font: 600 11px/1 var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; padding: 5px 8px; border-radius: 7px; white-space: nowrap; border: 1px solid transparent; }
.status.closed { color: var(--muted); border-color: var(--line-2); }
.status.current { color: var(--accent-glow); background: var(--accent-soft); }
.status.grace { color: var(--text-2); background: rgba(139, 149, 168, 0.12); }
.status.due { color: var(--warn); background: var(--warn-soft); }
.status.overdue { color: var(--expense); background: var(--expense-soft); }
.status.future { color: var(--muted); }

.banner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 13px 16px; border-radius: 12px; border: 1px solid; font-size: 13.5px; }
.banner.warn { border-color: rgba(251, 191, 36, 0.4); background: var(--warn-soft); color: #fde68a; }
.banner.bad { border-color: rgba(251, 113, 133, 0.4); background: var(--expense-soft); color: #fecdd3; }
.banner.info { border-color: rgba(37, 99, 235, 0.4); background: var(--accent-soft); color: #c7d7fe; }
.banner .spacer { flex: 1; }
.banner svg { flex: none; }

/* bar lists (magnitude, single hue) */
.bars { display: grid; gap: 12px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: baseline; }
.bar-row .name { font-size: 13px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row .amt { font: 500 13px/1 var(--font-mono); font-variant-numeric: tabular-nums; color: var(--text); }
.bar-row .amt small { color: var(--muted); font-size: 11px; margin-left: 6px; }
.bar-track { grid-column: 1 / -1; height: 8px; border-radius: 4px; background: rgba(139, 149, 168, 0.1); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 4px; background: var(--accent); min-width: 3px; }
.bar-row:hover .bar-fill { background: var(--accent-glow); }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.toolbar select, .toolbar input { width: auto; min-width: 170px; flex: 1 1 170px; }
.toolbar input[type='search'] { flex: 3 1 220px; }
.totals { display: flex; flex-wrap: wrap; gap: 10px; }
.total-chip { padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); min-width: 150px; }
.total-chip span { display: block; font: 500 10.5px/1 var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 7px; }
.total-chip b { font: 600 16px/1 var(--font-mono); font-variant-numeric: tabular-nums; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tabs a { padding: 10px 14px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--text); border-bottom-color: var(--accent); }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.kv .sep { grid-column: 1 / -1; border-top: 1px solid var(--line); margin: 2px 0; }
.kv .strong { color: var(--text); font-weight: 600; }

.loading { padding: 40px; text-align: center; color: var(--muted); }
.error-box { padding: 14px 16px; border-radius: 12px; border: 1px solid rgba(251, 113, 133, 0.4); background: var(--expense-soft); color: #fecdd3; }
.form-error { margin: 0; padding: 10px 12px; border-radius: 10px; border: 1px solid rgba(251, 113, 133, 0.4); background: var(--expense-soft); color: #fecdd3; font-size: 13px; }
.lock { color: var(--muted); display: inline-flex; }

/* ---------- modal (native <dialog>) ---------- */
dialog.modal {
  width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 48px);
  padding: 0; border: 1px solid var(--line-2); border-radius: 18px;
  background: var(--panel); color: var(--text);
  box-shadow: 0 40px 120px -30px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(37, 99, 235, 0.08);
  display: flex; flex-direction: column;
}
dialog.modal:not([open]) { display: none; }
dialog.modal.wide { width: min(880px, calc(100vw - 32px)); }
dialog.modal::backdrop { background: rgba(2, 4, 8, 0.72); backdrop-filter: blur(3px); }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px 14px 22px; border-bottom: 1px solid var(--line); margin: 0; }
.modal-head h2 { font: 16px/1.2 var(--font-display); text-transform: uppercase; letter-spacing: 0.02em; flex: 1; }
.modal-body { padding: 20px 22px; overflow-y: auto; display: grid; gap: 16px; }
.modal-foot { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--line); background: rgba(139, 149, 168, 0.03); border-radius: 0 0 18px 18px; }
.modal-foot .left { margin-right: auto; }
.entry-form { display: grid; gap: 16px; }

/* toasts */
#toasts { position: fixed; right: 18px; bottom: 18px; display: grid; gap: 8px; z-index: 100; }
.toast { padding: 12px 16px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line-2); box-shadow: 0 20px 40px -20px #000; font-size: 13.5px; max-width: 360px; animation: toast-in 0.18s ease-out; }
.toast.ok { border-color: rgba(52, 211, 153, 0.45); }
.toast.err { border-color: rgba(251, 113, 133, 0.5); color: #fecdd3; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 40; left: 0; top: 0; width: 270px; transform: translateX(-100%); transition: transform 0.2s ease; box-shadow: 20px 0 60px -20px #000; }
  body.nav-open .sidebar { transform: none; }
  body.nav-open::after { content: ''; position: fixed; inset: 0; background: rgba(2, 4, 8, 0.6); z-index: 35; }
  .icon-btn.menu-btn { display: inline-grid; }
  .topbar { padding: 12px 16px; gap: 10px; }
  .view { padding: 18px 16px 40px; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .user-menu .who { display: none; }
}
@media (max-width: 640px) {
  .hide-sm { display: none; }
  .table td, .table th { padding: 10px 10px; }
  .table td.first-col, .table th.first-col { padding-left: 14px; }
  .grid-4 { grid-template-columns: 1fr; }
  .row-2, .row-3 { grid-template-columns: 1fr; }
  .top-actions .btn .txt { display: none; }
  .top-actions .btn { padding: 0 11px; }
  .page-title h1 { font-size: 17px; }
  .page-title .eyebrow { display: none; }
  .stat .value { font-size: 23px; }
  .section-head select { width: 100%; }
  dialog.modal, dialog.modal.wide { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; margin: 0; }
  .modal-foot { border-radius: 0; }
  .seg.heads button { padding: 11px 6px; }
}
