/* =====================================================================
   VisionONE — design system
   Brand blue #1976D2 is the seed colour of the VisionONE "Deep Blue" theme.
   One font (Inter, falls back to Roboto), 4px spacing grid, one control height.
   ===================================================================== */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");

:root {
  /* Brand blue scale */
  --blue-50: #EAF3FD;
  --blue-100: #D3E6FB;
  --blue-200: #A9CDF6;
  --blue-500: #1976D2;
  --blue-600: #1565C0;
  --blue-700: #0D47A1;
  --blue-900: #082D66;
  --primary: var(--blue-500);
  --primary-hover: var(--blue-600);
  --primary-soft: var(--blue-50);

  /* Neutrals (blue-tinted) */
  --bg: #F3F6FB;
  --surface: #FFFFFF;
  --surface-2: #F7F9FD;
  --surface-3: #EEF2F8;
  --line: #E2E8F1;
  --line-2: #CBD5E3;
  --ink: #142339;
  --ink-2: #3D4E66;
  --muted: #6A7A90;

  /* Status */
  --ok: #1B8A57;   --ok-soft: #E5F4EC;
  --warn: #B26A08; --warn-soft: #FDF2DF;
  --crit: #D0372F; --crit-soft: #FCEAE8;
  --violet: #6A4FC8; --violet-soft: #EFEBFB;

  /* Charts */
  --c1: #1976D2; --c2: #42A5F5; --c3: #F2A33A; --c4: #26A07A; --c5: #7E57C2; --c6: #E0607E;

  --font: "Inter", "Roboto", "Segoe UI", system-ui, -apple-system, sans-serif;
  --r-sm: 6px; --r: 10px; --r-lg: 14px;
  --h: 40px;
  --side-w: 252px;
  --top-h: 60px;
  --shadow-1: 0 1px 2px rgba(20, 35, 57, .05), 0 1px 3px rgba(20, 35, 57, .04);
  --shadow-2: 0 10px 30px rgba(13, 71, 161, .14), 0 2px 6px rgba(20, 35, 57, .06);
  --ring: 0 0 0 3px rgba(25, 118, 210, .22);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }
h1, h2, h3 { margin: 0; color: var(--ink); letter-spacing: -0.01em; text-wrap: balance; }
h1 { font-size: 22px; font-weight: 600; line-height: 1.3; }
h2 { font-size: 15px; font-weight: 600; }
h3 { font-size: 13px; font-weight: 600; }
p { margin: 0; }
.num { font-variant-numeric: tabular-nums; text-align: right; }
.tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.label-caps { font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
svg.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
svg.i.sm { width: 16px; height: 16px; }
svg.i.lg { width: 24px; height: 24px; }
:focus-visible { outline: none; box-shadow: var(--ring); }

/* ---------- smooth page transitions ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .18s; }
.side { view-transition-name: side; }
.top { view-transition-name: top; }
.content { animation: page-in .22s ease-out both; }
body.leaving .content, body.leaving .auth-card { opacity: 0; transform: translateY(4px); transition: opacity .12s, transform .12s; }
@keyframes page-in { from { transform: translateY(8px); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- app shell ---------- */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100%; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; color: #fff; background: linear-gradient(180deg, var(--blue-700) 0%, var(--blue-600) 100%); z-index: 30; }
.side-brand { display: flex; align-items: center; gap: 10px; height: var(--top-h); padding: 0 18px; flex: none; border-bottom: 1px solid rgba(255, 255, 255, .12); }
.side-brand .logo { width: 34px; height: 34px; border-radius: 9px; background: #fff; display: grid; place-items: center; }
.side-brand .logo img { width: 24px; height: 24px; }
.side-brand b { display: block; font-size: 15px; font-weight: 700; color: #fff; letter-spacing: -0.01em; }
.side-brand span { display: block; font-size: 11px; color: rgba(255, 255, 255, .7); text-transform: uppercase; letter-spacing: .1em; }
.side nav { flex: 1; overflow-y: auto; padding: 8px 12px 16px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .25) transparent; }
.nav-h { padding: 16px 10px 6px; font-size: 10.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: rgba(255, 255, 255, .6); }
.nav-a { display: flex; align-items: center; gap: 11px; height: 38px; padding: 0 12px; border-radius: 8px; color: rgba(255, 255, 255, .88); font-size: 13.5px; font-weight: 500; }
.nav-a:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.nav-a.on { background: #fff; color: var(--blue-700); font-weight: 600; box-shadow: 0 2px 8px rgba(8, 45, 102, .25); }
.nav-a .badge { margin-left: auto; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 10px; background: rgba(255, 255, 255, .18); color: #fff; }
.nav-a.on .badge { background: var(--primary-soft); color: var(--primary); }
.switch-app { margin: 0 12px 12px; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: rgba(255, 255, 255, .12); color: #fff; border: 1px solid rgba(255, 255, 255, .16); flex: none; }
.switch-app:hover { background: rgba(255, 255, 255, .2); color: #fff; }
.switch-app small { display: block; font-size: 11px; color: rgba(255, 255, 255, .7); }
.switch-app b { display: block; font-size: 13px; font-weight: 600; }
.switch-app svg:last-child { margin-left: auto; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 20; height: var(--top-h); display: flex; align-items: center; gap: 12px; padding: 0 24px; background: var(--surface); border-bottom: 1px solid var(--line); }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); min-width: 0; white-space: nowrap; overflow: hidden; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--primary); }
.crumbs b { color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.crumbs svg { width: 14px; height: 14px; }
.top .grow { flex: 1; }
.chip-btn { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); font: 500 13px var(--font); cursor: pointer; white-space: nowrap; }
.chip-btn:hover { border-color: var(--line-2); background: var(--surface-2); color: var(--ink); }
.chip-btn .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.icon-btn { width: 36px; height: 36px; display: inline-grid; place-items: center; border: 0; border-radius: 9px; background: transparent; color: var(--ink-2); cursor: pointer; position: relative; }
.icon-btn:hover { background: var(--surface-3); color: var(--ink); }
.icon-btn .pip { position: absolute; top: 8px; right: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--crit); border: 2px solid var(--surface); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; font-size: 12px; font-weight: 600; color: #fff; background: var(--primary); }
.avatar.sm { width: 30px; height: 30px; font-size: 11px; }
.avatar.lg { width: 60px; height: 60px; font-size: 20px; }
.menu-btn { display: none; }
.content { padding: 24px; display: flex; flex-direction: column; gap: 20px; min-width: 0; max-width: 1560px; width: 100%; }

/* dropdown menu */
.dd { position: relative; }
.dd-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 240px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-2); padding: 6px; z-index: 50; }
.dd-menu a, .dd-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; background: none; border-radius: 7px; color: var(--ink); font: 500 13px var(--font); text-align: left; cursor: pointer; }
.dd-menu a:hover, .dd-menu button:hover { background: var(--surface-3); color: var(--ink); }
.dd-menu .on { color: var(--primary); background: var(--primary-soft); }
.dd-menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.dd-menu .danger { color: var(--crit); }

/* ---------- page header ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head .t { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1 1 340px; }
.page-head .t p { color: var(--muted); }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: var(--h); padding: 0 16px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface); color: var(--ink); font: 500 13.5px var(--font); cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, box-shadow .15s; }
.btn:hover { background: var(--surface-2); border-color: var(--muted); color: var(--ink); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface-3); }
.btn.danger { color: var(--crit); }
.btn.danger-solid { background: var(--crit); border-color: var(--crit); color: #fff; }
.btn.sm { height: 32px; padding: 0 11px; font-size: 12.5px; }
.btn.lg { height: 46px; font-size: 15px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); min-width: 0; }
.card-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.card-h .sub { font-size: 12.5px; color: var(--muted); }
.card-h .end { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.card-b { padding: 18px; }
.card-b.flush { padding: 0; }
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }

/* KPI tiles */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; box-shadow: var(--shadow-1); min-width: 0; }
.kpi .k-top { display: flex; align-items: center; gap: 10px; }
.kpi .k-ico { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.kpi .k-l { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.kpi .k-v { font-size: 23px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi .k-v small { font-size: 12.5px; font-weight: 500; color: var(--muted); margin-right: 4px; }
.kpi .k-f { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.up { color: var(--ok); font-weight: 600; }
.down { color: var(--crit); font-weight: 600; }

/* pills */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; background: var(--surface-3); color: var(--ink-2); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.crit { background: var(--crit-soft); color: var(--crit); }
.pill.info { background: var(--primary-soft); color: var(--primary); }
.pill.violet { background: var(--violet-soft); color: var(--violet); }
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface-2); font-size: 12px; color: var(--ink-2); white-space: nowrap; }

/* ---------- forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px 20px; }
.form-grid .s2 { grid-column: span 2; }
.form-grid .s3 { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); display: flex; gap: 4px; }
.field > label .req { color: var(--crit); }
.field > label .opt { margin-left: auto; font-weight: 400; color: var(--muted); font-size: 11.5px; }
.ctl { position: relative; display: flex; align-items: center; }
.input, .select, textarea.input { width: 100%; height: var(--h); padding: 0 12px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface); color: var(--ink); font: 400 14px var(--font); transition: border-color .15s, box-shadow .15s; }
textarea.input { height: auto; min-height: 84px; padding: 10px 12px; line-height: 1.5; resize: vertical; }
.input::placeholder { color: #9AA8BA; }
.input:hover, .select:hover { border-color: #A9B7CA; }
.input:focus, .select:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
.select { appearance: none; padding-right: 34px; cursor: pointer; background: var(--surface) 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='%236A7A90' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center; }
.input.amount { text-align: right; font-variant-numeric: tabular-nums; }
.input.code { text-transform: uppercase; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.input[readonly] { background: var(--surface-2); color: var(--ink-2); }
.ctl .pre, .ctl .suf { position: absolute; top: 0; bottom: 0; display: flex; align-items: center; font-size: 12.5px; font-weight: 600; color: var(--muted); pointer-events: none; }
.ctl .pre { left: 12px; }
.ctl .suf { right: 12px; }
.ctl.has-pre .input { padding-left: 50px; }
.ctl.has-suf .input { padding-right: 36px; }
.hint { min-height: 18px; font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; }
.field.ok .input { border-color: var(--ok); }
.field.ok .suf { color: var(--ok); }
.field.err .input, .field.err .select { border-color: var(--crit); }
.field.err .input:focus { box-shadow: 0 0 0 3px var(--crit-soft); }
.field.err .hint { color: var(--crit); }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; user-select: none; }
.check input { width: 16px; height: 16px; margin: 0; accent-color: var(--primary); }
.switch { position: relative; width: 38px; height: 22px; flex: none; display: inline-block; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 22px; background: var(--line-2); transition: background .15s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .15s; }
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { box-shadow: var(--ring); }
.form-sec .card-b { padding-bottom: 8px; }
.savebar { position: sticky; bottom: 0; z-index: 10; display: flex; align-items: center; gap: 8px; padding: 12px 18px; background: rgba(255, 255, 255, .94); backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-2); flex-wrap: wrap; }
.savebar .info { margin-right: auto; font-size: 12.5px; color: var(--muted); }

.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 9px; background: var(--surface-3); border: 1px solid var(--line); }
.seg button, .seg a { height: 30px; padding: 0 12px; border: 0; border-radius: 6px; background: transparent; color: var(--ink-2); font: 500 12.5px var(--font); cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; }
.seg .on { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-1); font-weight: 600; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs a, .tabs button { display: inline-flex; align-items: center; gap: 7px; height: 42px; padding: 0 14px; border: 0; background: none; border-bottom: 2px solid transparent; margin-bottom: -1px; color: var(--muted); font: 500 13.5px var(--font); cursor: pointer; white-space: nowrap; }
.tabs a:hover, .tabs button:hover { color: var(--ink); }
.tabs .on { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.tabs .n { font-size: 11px; padding: 1px 7px; border-radius: 9px; background: var(--surface-3); color: var(--ink-2); }
.tabs .on .n { background: var(--primary-soft); color: var(--primary); }

/* ---------- data grid ---------- */
.dg-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.search { position: relative; flex: 1 1 240px; max-width: 360px; }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search .input { height: 36px; padding-left: 36px; }
.facet { position: relative; }
.facet > .btn { height: 36px; }
.facet > .btn.on { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.facet > .btn b { font-weight: 700; }
.pop { position: absolute; left: 0; top: calc(100% + 6px); z-index: 40; min-width: 240px; max-height: 320px; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-2); padding: 6px; }
.pop.r { left: auto; right: 0; }
.pop .ph { display: flex; justify-content: space-between; padding: 6px 9px 8px; margin-bottom: 4px; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.pop .ph a { font-weight: 600; cursor: pointer; }
.pop label { display: flex; align-items: center; gap: 10px; padding: 7px 9px; border-radius: 6px; font-size: 13px; cursor: pointer; }
.pop label:hover { background: var(--surface-3); }
.pop label input { margin: 0; accent-color: var(--primary); }
.pop label .c { margin-left: auto; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 6px 0 10px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-size: 12.5px; font-weight: 500; }
.chip button { width: 18px; height: 18px; display: grid; place-items: center; border: 0; border-radius: 50%; background: none; color: inherit; cursor: pointer; }
.chip button:hover { background: var(--blue-100); }
.table-wrap { overflow: auto; max-height: 620px; }
table.t { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
table.t th { position: sticky; top: 0; z-index: 2; height: 40px; padding: 0 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; text-align: left; white-space: nowrap; user-select: none; }
table.t th.sort { cursor: pointer; }
table.t th.sort:hover { color: var(--ink); }
table.t th .arr { color: var(--primary); margin-left: 4px; }
table.t td { height: 48px; padding: 0 14px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
table.t tbody tr { transition: background .1s; }
table.t tbody tr:hover td { background: var(--surface-2); }
table.t tbody tr.click { cursor: pointer; }
table.t th.num, table.t td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.t tfoot td { position: sticky; bottom: 0; background: var(--surface-3); font-weight: 600; height: 42px; border-top: 1px solid var(--line-2); border-bottom: 0; }
table.t .act { width: 1%; text-align: right; }
table.t.compact td { height: 40px; }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who b { display: block; font-weight: 600; color: var(--ink); }
.who span { display: block; font-size: 12px; color: var(--muted); }
a.who:hover b { color: var(--primary); }
.dg-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.dg-foot b { color: var(--ink); }
.pager { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.pager button { min-width: 32px; height: 32px; padding: 0 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--ink-2); font: 500 12.5px var(--font); cursor: pointer; }
.pager button.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.pager button:disabled { opacity: .4; cursor: default; }
.dg-foot select { height: 32px; padding: 0 6px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--ink); font: inherit; }
.empty { padding: 48px 16px; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty b { font-size: 15px; color: var(--ink); }

/* key-value detail */
.kv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 24px; }
.kv div span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.kv div b { display: block; font-weight: 500; overflow-wrap: anywhere; }
.detail-head { display: flex; align-items: center; gap: 16px; padding: 20px; flex-wrap: wrap; }
.detail-head .t { flex: 1 1 280px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.detail-head .t .row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.detail-head .t p { color: var(--muted); }
.detail-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); border-top: 1px solid var(--line); }
.detail-strip div { padding: 12px 20px; border-left: 1px solid var(--line); }
.detail-strip div:first-child { border-left: 0; }
.detail-strip span { display: block; font-size: 12px; color: var(--muted); }
.detail-strip b { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.big-ico { width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); flex: none; }
.big-ico svg { width: 26px; height: 26px; }

/* lists */
.list .row { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); min-width: 0; color: var(--ink); }
.list .row:last-child { border-bottom: 0; }
a.row:hover { background: var(--surface-2); color: var(--ink); }
.list .row .g { flex: 1; min-width: 0; }
.list .row .g b { display: block; font-weight: 600; font-size: 13.5px; }
.list .row .g span { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ico { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; flex: none; background: var(--primary-soft); color: var(--primary); }
.ico.ok { background: var(--ok-soft); color: var(--ok); }
.ico.warn { background: var(--warn-soft); color: var(--warn); }
.ico.crit { background: var(--crit-soft); color: var(--crit); }
.ico.violet { background: var(--violet-soft); color: var(--violet); }
.bar { height: 8px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 6px; background: var(--primary); }

/* quick actions */
.quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.quick a { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); color: var(--ink); font-weight: 600; font-size: 13.5px; box-shadow: var(--shadow-1); transition: border-color .15s, transform .15s; }
.quick a:hover { border-color: var(--primary); transform: translateY(-1px); color: var(--ink); }

/* charts */
.chart { display: block; width: 100%; overflow: visible; }
.chart text { fill: var(--muted); font: 500 11px var(--font); font-variant-numeric: tabular-nums; }
.chart .gl { stroke: var(--line); }
.legend { display: flex; gap: 6px 14px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.tip { position: fixed; z-index: 90; pointer-events: none; background: var(--ink); color: #fff; padding: 8px 10px; border-radius: 8px; font-size: 12px; line-height: 1.45; font-variant-numeric: tabular-nums; box-shadow: var(--shadow-2); }

/* modal + toast */
.modal-bg { position: fixed; inset: 0; z-index: 100; background: rgba(8, 45, 102, .28); backdrop-filter: blur(2px); display: grid; place-items: center; padding: 16px; animation: fade .15s; }
.modal { width: min(440px, 100%); background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-2); padding: 22px; display: flex; flex-direction: column; gap: 14px; animation: pop .18s ease-out; }
.modal .m-ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--crit-soft); color: var(--crit); }
.modal p { color: var(--ink-2); }
.modal .m-act { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
@keyframes fade { from { background-color: transparent; } }
@keyframes pop { from { transform: scale(.97) translateY(6px); } }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 120; display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 10px; background: var(--ink); color: #fff; font-size: 13.5px; box-shadow: var(--shadow-2); transform: translateY(14px); opacity: 0; transition: all .2s; }
.toast.show { transform: none; opacity: 1; }
.toast svg { color: #6FD3A5; }

/* ---------- auth / selection screens ---------- */
.auth { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; padding: 32px 16px; background:
    radial-gradient(900px 500px at 15% 0%, rgba(66, 165, 245, .35), transparent 60%),
    radial-gradient(700px 500px at 100% 100%, rgba(13, 71, 161, .55), transparent 60%),
    linear-gradient(160deg, var(--blue-600), var(--blue-700) 60%, var(--blue-900)); }
.auth-brand { display: flex; align-items: center; gap: 12px; color: #fff; }
.auth-brand .logo { width: 44px; height: 44px; border-radius: 12px; background: #fff; display: grid; place-items: center; box-shadow: 0 6px 18px rgba(8, 45, 102, .35); }
.auth-brand .logo img { width: 30px; }
.auth-brand b { display: block; font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.auth-brand span { display: block; font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: rgba(255, 255, 255, .75); }
.auth-card { width: min(440px, 100%); background: var(--surface); border-radius: 18px; box-shadow: 0 24px 60px rgba(8, 45, 102, .35); padding: 32px; display: flex; flex-direction: column; gap: 20px; animation: page-in .25s ease-out both; }
.auth-card.wide { width: min(760px, 100%); }
.auth-card h1 { font-size: 24px; }
.auth-card .lead { color: var(--muted); margin-top: 4px; }
.auth-foot { color: rgba(255, 255, 255, .7); font-size: 12px; text-align: center; }
.steps { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.steps i { width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; font-style: normal; font-size: 11px; font-weight: 700; background: var(--surface-3); color: var(--muted); }
.steps .done i { background: var(--ok); color: #fff; }
.steps .now { color: var(--primary); font-weight: 600; }
.steps .now i { background: var(--primary); color: #fff; }
.steps hr { width: 24px; border: 0; border-top: 1px solid var(--line-2); margin: 0; }
.choice-list { display: flex; flex-direction: column; gap: 10px; }
.choice { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; text-align: left; font: inherit; color: inherit; width: 100%; transition: border-color .15s, box-shadow .15s, background .15s; }
.choice:hover { border-color: var(--blue-200); background: var(--surface-2); }
.choice.on { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary), var(--ring); background: var(--blue-50); }
.choice .mark { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 14px; flex: none; }
.choice .g { flex: 1; min-width: 0; }
.choice .g b { display: block; font-size: 14.5px; font-weight: 600; }
.choice .g span { display: block; font-size: 12.5px; color: var(--muted); }
.choice .radio { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line-2); flex: none; display: grid; place-items: center; }
.choice.on .radio { border-color: var(--primary); }
.choice.on .radio::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); }
.apps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.app-card { display: flex; flex-direction: column; gap: 14px; padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--ink); transition: border-color .15s, box-shadow .15s, transform .15s; }
.app-card:hover { border-color: var(--primary); box-shadow: var(--shadow-2); transform: translateY(-2px); color: var(--ink); }
.app-card .a-ico { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; color: #fff; }
.app-card .a-ico svg { width: 26px; height: 26px; }
.app-card b { font-size: 18px; font-weight: 700; display: block; }
.app-card p { color: var(--muted); font-size: 13px; }
.app-card ul { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.app-card .go { display: flex; align-items: center; gap: 6px; margin-top: auto; color: var(--primary); font-weight: 600; font-size: 13.5px; }
.app-card.off { opacity: .55; pointer-events: none; }

/* ---------- document (voucher / payslip) ---------- */
.doc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); overflow: hidden; }
.doc-h { display: flex; gap: 16px; align-items: center; padding: 22px 26px; border-bottom: 3px solid var(--primary); flex-wrap: wrap; }
.doc-h img { width: 42px; }
.doc-h .co b { display: block; font-size: 16px; font-weight: 700; }
.doc-h .co span { font-size: 12px; color: var(--muted); }
.doc-h .ttl { margin-left: auto; text-align: right; }
.doc-h .ttl b { display: block; font-size: 20px; font-weight: 700; color: var(--primary); }
.doc-h .ttl span { font-size: 12.5px; color: var(--muted); }
.doc-meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 20px; padding: 18px 26px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.doc-meta span { display: block; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.doc-meta b { font-weight: 600; overflow-wrap: anywhere; }
.doc-total { display: flex; justify-content: flex-end; padding: 16px 26px; border-top: 1px solid var(--line); }
.doc-total dl { margin: 0; display: grid; grid-template-columns: auto 140px; gap: 6px 24px; font-variant-numeric: tabular-nums; }
.doc-total dt { color: var(--muted); }
.doc-total dd { margin: 0; text-align: right; font-weight: 600; }
.doc-total .grand { font-size: 17px; color: var(--primary); font-weight: 700; border-top: 2px solid var(--ink); padding-top: 6px; }

/* line editor */
.lines td.in { padding: 0 6px; }
.lines td.in .input, .lines td.in .select { height: 36px; }
.lines .rm { color: var(--muted); }
.lines .rm:hover { color: var(--crit); background: var(--crit-soft); }
.balance { display: flex; align-items: center; gap: 10px; padding: 10px 16px; font-size: 13px; border-top: 1px solid var(--line); }

/* responsive */
@media (max-width: 1200px) { .cols-main { grid-template-columns: minmax(0, 1fr); } .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kv { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 960px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 272px; height: auto; transform: translateX(-100%); transition: transform .2s; }
  body.nav-open .side { transform: none; box-shadow: var(--shadow-2); }
  .menu-btn { display: inline-grid; }
  .cols-2, .cols-3 { grid-template-columns: minmax(0, 1fr); }
  .doc-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hide-md { display: none !important; }
}
@media (max-width: 640px) {
  .top { padding: 0 12px; gap: 6px; }
  .content { padding: 16px; }
  .form-grid, .kv { grid-template-columns: minmax(0, 1fr); }
  .form-grid .s2 { grid-column: auto; }
  .apps { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 12px 14px; }
  .kpi .k-v { font-size: 19px; }
  .auth-card { padding: 24px 20px; }
  .hide-sm { display: none !important; }
}

/* ---------- dialog (add / edit) ---------- */
.dlg-bg { position: fixed; inset: 0; z-index: 95; display: flex; align-items: center; justify-content: center; padding: 24px 16px; background: rgba(8, 45, 102, .32); backdrop-filter: blur(2px); animation: fade .15s; }
.dlg { width: 100%; max-width: 640px; max-height: calc(100vh - 48px); display: flex; flex-direction: column; background: var(--surface); border-radius: 16px; box-shadow: 0 24px 70px rgba(8, 45, 102, .35); overflow: hidden; animation: dlg-in .18s ease-out; }
.dlg.lg { max-width: 980px; }
.dlg.xl { max-width: 1200px; }
@keyframes dlg-in { from { transform: translateY(10px) scale(.985); } to { transform: none; } }
.dlg-h { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); flex: none; }
.dlg-h .g { flex: 1; min-width: 0; }
.dlg-h h2 { font-size: 17px; }
.dlg-h p { font-size: 12.5px; color: var(--muted); }
.dlg-h .seg { margin-right: 4px; }
.dlg-b { flex: 1; overflow: auto; padding: 20px; background: var(--surface); }
.dlg-b.split { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; padding: 0; }
.dlg-b.split > form { padding: 20px; min-width: 0; }
.dlg-b.split > aside { position: sticky; top: 0; align-self: stretch; background: var(--surface-2); border-left: 1px solid var(--line); min-height: 100%; }
.dlg-f { display: flex; align-items: center; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line); background: var(--surface-2); flex: none; flex-wrap: wrap; }
.dlg-f .info { margin-right: auto; font-size: 12.5px; color: var(--muted); }
.dsec + .dsec { margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--line); }
.dsec > h3 { display: flex; align-items: baseline; gap: 8px; margin-bottom: 12px; font-size: 13px; color: var(--primary); text-transform: uppercase; letter-spacing: .06em; }
.dsec > h3 span { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--muted); font-size: 12px; }
.dlg .form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dlg.md .form-grid, .dlg-b.split .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dlg.md .form-grid .s3, .dlg-b.split .form-grid .s3 { grid-column: 1 / -1; }
.dlg .card { box-shadow: none; }
body.dlg-open { overflow: hidden; }
@media (max-width: 760px) {
  .dlg-bg { padding: 0; align-items: flex-end; }
  .dlg, .dlg.lg, .dlg.xl { max-height: 94vh; border-radius: 16px 16px 0 0; }
  .dlg-b.split { grid-template-columns: minmax(0, 1fr); }
  .dlg-b.split > aside { position: static; border-left: 0; border-top: 1px solid var(--line); }
  .dlg .form-grid, .dlg.md .form-grid, .dlg-b.split .form-grid { grid-template-columns: minmax(0, 1fr); }
  .dlg .form-grid .s2 { grid-column: auto; }
}

/* ---------- hierarchical menu ---------- */
.nav-search { position: relative; margin: 12px 12px 4px; flex: none; }
.nav-search span { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: rgba(255, 255, 255, .65); display: flex; }
.nav-search input { width: 100%; height: 34px; padding: 0 10px 0 32px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, .18); background: rgba(255, 255, 255, .1); color: #fff; font: 400 13px var(--font); }
.nav-search input::placeholder { color: rgba(255, 255, 255, .6); }
.nav-search input:focus { outline: none; background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .45); }
.nav-grp { margin-top: 2px; }
.nav-g { display: flex; align-items: center; gap: 10px; width: 100%; height: 36px; padding: 0 10px 0 12px; border: 0; border-radius: 8px; background: transparent; color: rgba(255, 255, 255, .92); font: 600 13.5px var(--font); cursor: pointer; text-align: left; }
.nav-g:hover { background: rgba(255, 255, 255, .1); }
.nav-g span:first-of-type { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-g .cnt { font-size: 10.5px; font-weight: 600; color: rgba(255, 255, 255, .6); }
.nav-g > svg:last-child { width: 14px; height: 14px; transition: transform .15s; opacity: .8; }
.nav-grp:not(.open):not(.found) > .nav-g > svg:last-child { transform: rotate(-90deg); }
.nav-g.lvl1, .nav-g.lvl2 { height: 32px; font-size: 12.5px; font-weight: 600; color: rgba(255, 255, 255, .85); padding-left: 10px; }
.nav-sub { display: none; margin: 2px 0 4px 21px; padding-left: 8px; border-left: 1px solid rgba(255, 255, 255, .18); }
.nav-grp.open > .nav-sub, .nav-grp.found > .nav-sub { display: block; }
.nav-sub .nav-sub { margin-left: 10px; }
.nav-grp.has-on > .nav-g { color: #fff; }
.nav-a.lvl1, .nav-a.lvl2, .nav-a.lvl3 { height: 31px; padding: 0 10px; gap: 9px; font-size: 12.8px; font-weight: 500; color: rgba(255, 255, 255, .8); }
.nav-a .dot { width: 5px; height: 5px; border-radius: 50%; background: rgba(255, 255, 255, .45); flex: none; }
.nav-a.on .dot { background: var(--primary); }
.nav-a span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-a.soon { color: rgba(255, 255, 255, .62); }
.nav-a.soon:hover { color: #fff; }
.nav-empty { padding: 14px; color: rgba(255, 255, 255, .7); font-size: 12.5px; text-align: center; }
.side nav { padding-top: 4px; }
.ftabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: -20px -20px 18px; padding: 0 12px; position: sticky; top: -20px; background: var(--surface); z-index: 3; overflow-x: auto; scrollbar-width: none; }
.ftabs button { position: relative; height: 44px; padding: 0 14px; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; background: none; color: var(--muted); font: 500 13.5px var(--font); cursor: pointer; white-space: nowrap; }
.ftabs button:hover { color: var(--ink); }
.ftabs button.on { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.ftabs button.has-err::after { content: ""; position: absolute; top: 12px; right: 4px; width: 6px; height: 6px; border-radius: 50%; background: var(--crit); }
.dlg-b.split > form .ftabs { margin: -20px -20px 18px; }
.switch-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 20px; }
.vgrid td.in .select, .vgrid td.in .input { height: 34px; font-size: 13px; }
.vgrid td { height: 44px; }
.vgrid .input:disabled { background: var(--surface-2); color: var(--muted); border-color: var(--line); }
tr.row-err td { background: var(--crit-soft) !important; }
.btn.list-empty { color: var(--muted); border-style: dashed; }
tr.tb-g td { background: var(--surface-2); }
.balance { flex-wrap: wrap; }
.nav-a.on.lvl1, .nav-a.on.lvl2, .nav-a.on.lvl3 { color: var(--blue-700); font-weight: 600; }

/* ---------- app switcher (sidebar foot) ---------- */
.switch-apps { flex: none; padding: 10px 12px 12px; border-top: 1px solid rgba(255, 255, 255, .14); }
.switch-apps > span { display: block; font-size: 10.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: rgba(255, 255, 255, .6); margin: 0 4px 6px; }
.switch-apps > div { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.switch-apps .switch-app { margin: 0; padding: 8px 10px; gap: 8px; font-size: 13px; }
.switch-apps .switch-app svg:last-child { width: 14px; height: 14px; opacity: .7; }
.apps.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 860px) { .apps.three { grid-template-columns: minmax(0, 1fr); } }


/* ---------- coming soon ---------- */
.switch-app.soon { cursor: default; opacity: .7; border-style: dashed; }
.switch-app.soon:hover { background: rgba(255, 255, 255, .12); }
.switch-app.soon em, .dd-soon em, .app-card .soon-tag { font-style: normal; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 2px 7px; border-radius: 999px; }
.switch-app.soon em { margin-left: auto; background: rgba(255, 255, 255, .2); color: #fff; }
.dd-soon { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 7px; color: var(--muted); font: 500 13px var(--font); cursor: default; }
.dd-soon em { margin-left: auto; background: var(--surface-3); color: var(--muted); }
.app-card.off { opacity: 1; pointer-events: none; background: var(--surface-2); border-style: dashed; }
.app-card.off .a-ico { filter: grayscale(.35); opacity: .75; }
.app-card .soon-tag { align-self: flex-start; background: var(--warn-soft); color: var(--warn); }

/* ---------- top loader + busy buttons ---------- */
.toploader { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 200; pointer-events: none; opacity: 0; transition: opacity .2s; overflow: hidden; }
.toploader i { position: absolute; top: 0; bottom: 0; left: -40%; width: 40%; background: linear-gradient(90deg, transparent, #42A5F5, #1976D2, transparent); animation: loadbar 1s ease-in-out infinite; }
body.is-loading .toploader { opacity: 1; }
body.is-loading { cursor: progress; }
@keyframes loadbar { to { left: 100%; } }
.btn.is-busy { pointer-events: none; opacity: .85; }
.btn.is-busy svg { display: none; }
.btn.is-busy::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- acting-as user switch ---------- */
.acting { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 10px 0 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); cursor: pointer; font: inherit; color: var(--ink); }
.acting:hover { border-color: var(--line-2); background: var(--surface-2); }
.acting small { display: block; font-size: 10px; color: var(--muted); line-height: 1.1; text-align: left; }
.acting b { display: block; font-size: 12.5px; font-weight: 600; line-height: 1.2; white-space: nowrap; }
.role-tag { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 999px; font-size: 10.5px; font-weight: 700; letter-spacing: .03em; background: var(--primary-soft); color: var(--primary); white-space: nowrap; }
.role-tag.r-peter { background: var(--warn-soft); color: var(--warn); }
.role-tag.r-mercy { background: var(--violet-soft); color: var(--violet); }
.role-tag.r-daniel { background: var(--ok-soft); color: var(--ok); }
.role-tag.r-admin { background: var(--surface-3); color: var(--ink-2); }
.users-menu { min-width: 380px; }
.users-menu .um-h { padding: 8px 10px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.users-menu button .g { flex: 1; min-width: 0; }
.users-menu button .g b { display: block; font-size: 13px; }
.users-menu button .g span { display: block; font-size: 11.5px; color: var(--muted); font-weight: 400; white-space: normal; }

/* ---------- selection + bulk approval ---------- */
.bulkbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 16px; background: var(--blue-50); border-bottom: 1px solid var(--blue-100); }
.bulkbar b { font-size: 13px; color: var(--blue-700); margin-right: 6px; }
.bulkhint { display: flex; align-items: center; gap: 8px; padding: 8px 16px; font-size: 12.5px; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--line); }
table.t th.chk, table.t td.chk { width: 40px; padding: 0 0 0 16px; }
table.t .chk input { width: 16px; height: 16px; margin: 0; accent-color: var(--primary); cursor: pointer; }
table.t tbody tr.sel td { background: var(--blue-50); }

/* ---------- approval panel ---------- */
.appr-steps { display: flex; gap: 0; flex-wrap: wrap; margin-bottom: 14px; }
.as { display: flex; align-items: center; gap: 10px; flex: 1 1 170px; padding: 8px 12px 8px 0; position: relative; }
.as i { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 12px; font-weight: 700; border: 2px solid var(--line-2); color: var(--muted); background: var(--surface); flex: none; }
.as b { display: block; font-size: 13px; }
.as span { display: block; font-size: 11.5px; color: var(--muted); }
.as.done i { background: var(--ok); border-color: var(--ok); color: #fff; }
.as.now i { border-color: var(--primary); color: var(--primary); box-shadow: var(--ring); }
.as.now b { color: var(--primary); }
.appr-acts { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-start; }
.appr-acts .aa { display: flex; flex-direction: column; gap: 4px; max-width: 280px; }
.limit-box { display: flex; flex-direction: column; gap: 6px; padding: 10px 14px; margin-bottom: 14px; border-radius: 10px; background: var(--crit-soft); color: var(--ink); border: 1px solid rgba(208, 55, 47, .25); font-size: 13px; }
.limit-box > div, .limit-box { flex-direction: row; align-items: flex-start; gap: 8px; }
.limit-box svg { color: var(--crit); margin-top: 2px; }
.limit-box.rej { background: var(--warn-soft); border-color: rgba(178, 106, 8, .25); }
.limit-box.rej svg { color: var(--warn); }
.dlg .limit-box { margin: 0 0 16px; }
.pdf-frame { display: block; width: 100%; height: 74vh; border: 0; background: #525659; }

/* ---------- always-visible approval bar, review dialog, log ---------- */
.bulkbar { background: var(--surface-2); border-bottom: 1px solid var(--line); }
.bulkbar.has-sel { background: var(--blue-50); border-bottom-color: var(--blue-100); }
.bulkbar .bb-count { font-size: 13px; color: var(--muted); margin-right: 6px; }
.bulkbar.has-sel .bb-count { color: var(--blue-700); }
.bulkbar .btn[disabled] { opacity: .45; }
table.review td { vertical-align: top; padding-top: 9px; padding-bottom: 9px; height: auto; white-space: normal; }
tr.logrow td { background: var(--surface-2); }
.logline { font-size: 12.5px; padding: 3px 0; }
details.skipped { margin-top: 12px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--warn-soft); }
details.skipped summary { cursor: pointer; font-weight: 600; font-size: 13px; color: var(--warn); }
details.skipped div { padding: 3px 0; }
.detail-dlg { background: var(--bg); display: flex; flex-direction: column; gap: 16px; }
.detail-dlg .detail-head h1 { font-size: 19px; }
