/* =====================================================================
   Fixed Assets — design system "Ledger"
   Calm, precise, numbers-first. Neutral base · one accent (deep teal) ·
   semantic colours · 8pt grid · 6 type sizes · light & dark.
   ===================================================================== */
:root {
  /* type — Inter for Latin & figures (tabular), Cairo for Arabic */
  --font: 'Inter', 'Cairo', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --fs-1: 12px;  /* caption, labels, table headers */
  --fs-2: 14px;  /* body, tables, controls */
  --fs-3: 16px;  /* card titles, dialog titles */
  --fs-4: 20px;  /* stat values */
  --fs-5: 24px;  /* page titles */
  --fs-6: 32px;  /* hero figures */
  --lh-tight: 1.25; --lh: 1.5;
  --w-regular: 400; --w-medium: 500; --w-semibold: 600;
  /* spacing — 8pt grid (4 for hairline adjustments) */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 64px;
  /* shape */
  --r-sm: 6px; --r-md: 10px; --r-lg: 14px; --r-full: 999px;
  --ctl: 40px;          /* control height (44 on touch) */
  --side-w: 256px;
  /* motion */
  --t-fast: 150ms; --t-base: 200ms; --t-slow: 300ms; --ease: cubic-bezier(.2, .8, .2, 1);
  /* colour — light */
  --bg: #f6f7f9; --surface: #ffffff; --surface-2: #f2f4f7; --surface-3: #e8ecf1; --inverse: #121a23; --on-inverse: #eef2f6;
  --border: #e3e7ec; --border-strong: #cdd4dd;
  --text: #0f1720; --text-2: #3a4652; --text-3: #5b6775;
  --accent: #0f766e; --accent-hover: #0b5f58; --accent-soft: #e5f3f1; --accent-text: #0b5f58; --on-accent: #ffffff;
  --success: #15803d; --success-soft: #e8f5ec;
  --warning: #9a5b00; --warning-soft: #fdf2df;
  --danger: #c0272d; --danger-soft: #fdecec;
  --info: #1f5fcf; --info-soft: #e9f0fc;
  --chart-muted: #d7dde4;
  --overlay: rgba(15, 23, 32, .42);
  --ring: 0 0 0 3px rgba(15, 118, 110, .32);
  --sh-1: 0 1px 2px rgba(16, 24, 40, .05);
  --sh-2: 0 4px 12px rgba(16, 24, 40, .08), 0 1px 3px rgba(16, 24, 40, .06);
  --sh-3: 0 24px 56px rgba(16, 24, 40, .20), 0 4px 12px rgba(16, 24, 40, .08);
  color-scheme: light;
}
/* dark — chosen explicitly, or following the system */
:root[data-theme=dark] {
  --bg: #0b0f13; --surface: #12171d; --surface-2: #181e26; --surface-3: #212934; --inverse: #e9eef3; --on-inverse: #121a23;
  --border: #242d38; --border-strong: #354150;
  --text: #e9eef3; --text-2: #b9c3ce; --text-3: #8d99a6;
  --accent: #2bbfab; --accent-hover: #4fd3c1; --accent-soft: rgba(43, 191, 171, .13); --accent-text: #63dccb; --on-accent: #04211d;
  --success: #4ccf7a; --success-soft: rgba(76, 207, 122, .13);
  --warning: #f2b450; --warning-soft: rgba(242, 180, 80, .13);
  --danger: #f47c7c; --danger-soft: rgba(244, 124, 124, .13);
  --info: #7fa9ff; --info-soft: rgba(127, 169, 255, .13);
  --chart-muted: #2b3542; --overlay: rgba(0, 0, 0, .62); --ring: 0 0 0 3px rgba(43, 191, 171, .4);
  --sh-1: 0 1px 2px rgba(0, 0, 0, .4); --sh-2: 0 6px 18px rgba(0, 0, 0, .45); --sh-3: 0 28px 64px rgba(0, 0, 0, .6);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) {
    --bg: #0b0f13; --surface: #12171d; --surface-2: #181e26; --surface-3: #212934; --inverse: #e9eef3; --on-inverse: #121a23;
    --border: #242d38; --border-strong: #354150;
    --text: #e9eef3; --text-2: #b9c3ce; --text-3: #8d99a6;
    --accent: #2bbfab; --accent-hover: #4fd3c1; --accent-soft: rgba(43, 191, 171, .13); --accent-text: #63dccb; --on-accent: #04211d;
    --success: #4ccf7a; --success-soft: rgba(76, 207, 122, .13);
    --warning: #f2b450; --warning-soft: rgba(242, 180, 80, .13);
    --danger: #f47c7c; --danger-soft: rgba(244, 124, 124, .13);
    --info: #7fa9ff; --info-soft: rgba(127, 169, 255, .13);
    --chart-muted: #2b3542; --overlay: rgba(0, 0, 0, .62); --ring: 0 0 0 3px rgba(43, 191, 171, .4);
    --sh-1: 0 1px 2px rgba(0, 0, 0, .4); --sh-2: 0 6px 18px rgba(0, 0, 0, .45); --sh-3: 0 28px 64px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}
@media (pointer: coarse) { :root { --ctl: 44px; } }

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: var(--w-regular) var(--fs-2)/var(--lh) var(--font); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body { font-feature-settings: 'cv11', 'ss01'; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, p, dl, dd, ul, ol, fieldset { margin: 0; }
fieldset { border: 0; padding: 0; min-width: 0; }
legend { padding: 0; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--r-sm); }
.ic { width: 18px; height: 18px; flex: none; }
[dir=rtl] .flip { transform: scaleX(-1); }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; inset-inline-start: var(--sp-4); top: -60px; z-index: 300; background: var(--surface); color: var(--text); padding: var(--sp-2) var(--sp-4); border-radius: var(--r-md); box-shadow: var(--sh-2); }
.skip:focus { top: var(--sp-4); }
.num, .n, .num-md, .num-lg, .num-xl { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum'; }
.n { text-align: end; white-space: nowrap; }
.c { text-align: center; }
.mono { font-family: var(--mono); font-size: var(--fs-1); letter-spacing: -.01em; }
.muted { color: var(--text-3); }
.strong { font-weight: var(--w-medium); color: var(--text); }
.hint { color: var(--text-3); font-size: var(--fs-1); }
.label { color: var(--text-3); font-size: var(--fs-1); font-weight: var(--w-medium); display: flex; align-items: center; gap: var(--sp-1); }
.num-md { font-size: var(--fs-3); font-weight: var(--w-semibold); }
.num-lg { font-size: var(--fs-4); font-weight: var(--w-semibold); letter-spacing: -.01em; }
.num-xl { font-size: var(--fs-6); font-weight: var(--w-semibold); letter-spacing: -.02em; line-height: var(--lh-tight); }
.unit { font-size: var(--fs-2); color: var(--text-3); font-weight: var(--w-medium); }
.ell { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nw { white-space: nowrap; }
.boot { min-height: 100vh; display: grid; place-items: center; }
.boot .logo { width: 40px; height: 40px; animation: pulse 1.2s var(--ease) infinite alternate; }
@keyframes pulse { to { opacity: .4; } }

/* ---------- layout ---------- */
.layout { display: flex; min-height: 100vh; }
.side { width: var(--side-w); flex: none; background: var(--surface); border-inline-end: 1px solid var(--border); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 40; padding: var(--sp-4) var(--sp-3); gap: var(--sp-4); }
.side-top { display: flex; align-items: center; gap: var(--sp-2); padding: 0 var(--sp-2); font-size: var(--fs-2); font-weight: var(--w-semibold); }
.logo { width: 28px; height: 28px; flex: none; }
.logo-bg { fill: var(--accent); } .logo-fg { stroke: var(--on-accent); } .logo-fg2 { stroke: var(--on-accent); opacity: .55; }
.ws { display: flex; align-items: center; gap: var(--sp-3); width: 100%; padding: var(--sp-2); border: 1px solid var(--border); background: var(--surface); border-radius: var(--r-md); cursor: pointer; text-align: start; min-height: 52px; transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease); }
.ws:hover { background: var(--surface-2); }
.ws-av { width: 32px; height: 32px; border-radius: var(--r-sm); background: var(--accent-soft); color: var(--accent-text); display: grid; place-items: center; font-size: var(--fs-1); font-weight: var(--w-semibold); flex: none; }
.ws-av.lg { width: 40px; height: 40px; border-radius: var(--r-md); font-size: var(--fs-2); }
.ws-txt { min-width: 0; flex: 1; }
.ws-txt b { display: block; font-weight: var(--w-semibold); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-txt small { color: var(--text-3); font-size: var(--fs-1); }
.ws-chev { color: var(--text-3); }
.nav { flex: 1; display: flex; flex-direction: column; gap: 2px; overflow: auto; }
.nav-item { display: flex; align-items: center; gap: var(--sp-3); min-height: var(--ctl); padding: 0 var(--sp-3); border-radius: var(--r-md); color: var(--text-2); font-weight: var(--w-medium); transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
.nav-item:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-item.on { background: var(--accent-soft); color: var(--accent-text); }
.nav-item .ic { color: var(--text-3); } .nav-item.on .ic { color: var(--accent-text); }
.nav-sep { font-size: var(--fs-1); color: var(--text-3); font-weight: var(--w-medium); padding: var(--sp-4) var(--sp-3) var(--sp-1); }
.side-foot .ver { margin-inline-start: auto; font-variant-numeric: tabular-nums; }
.side-foot { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-2); color: var(--text-3); font-size: var(--fs-1); }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: var(--sp-2); height: 64px; padding: 0 var(--sp-6); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--border); }
.grow { flex: 1; }
.search-btn { display: flex; align-items: center; gap: var(--sp-2); height: var(--ctl); width: min(420px, 100%); padding: 0 var(--sp-3); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); color: var(--text-3); cursor: pointer; transition: border-color var(--t-fast) var(--ease); }
.search-btn:hover { border-color: var(--border-strong); }
.search-btn span { flex: 1; text-align: start; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
kbd { font: var(--w-medium) 11px/1 var(--font); color: var(--text-3); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 3px 6px; }
.pill { display: inline-flex; align-items: center; gap: var(--sp-1); height: 28px; padding: 0 var(--sp-3); border-radius: var(--r-full); background: var(--surface-2); color: var(--text-2); font-size: var(--fs-1); font-weight: var(--w-medium); white-space: nowrap; }
.pill .ic { width: 14px; height: 14px; }
.avatar-btn { border: 0; background: none; padding: 2px; border-radius: var(--r-full); cursor: pointer; min-height: var(--ctl); display: grid; place-items: center; }
.avatar { width: 32px; height: 32px; border-radius: var(--r-full); background: var(--inverse); color: var(--on-inverse); display: grid; place-items: center; font-size: var(--fs-1); font-weight: var(--w-semibold); flex: none; }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.page { width: 100%; max-width: 1320px; margin: 0 auto; padding: var(--sp-6) var(--sp-6) var(--sp-8); outline: none; }
.page-head { display: flex; align-items: flex-end; gap: var(--sp-4); flex-wrap: wrap; margin-bottom: var(--sp-5); }
.page-title { flex: 1; min-width: 260px; }
.page-title h1 { font-size: var(--fs-5); font-weight: var(--w-semibold); letter-spacing: -.02em; line-height: var(--lh-tight); }
.page-title .sub { color: var(--text-3); margin-top: var(--sp-1); display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.crumbs { display: flex; align-items: center; gap: var(--sp-1); font-size: var(--fs-1); margin-bottom: var(--sp-1); }
.crumbs a { color: var(--text-3); font-weight: var(--w-medium); } .crumbs .ic { width: 14px; height: 14px; color: var(--text-3); }
.actions { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.only-m, .icon-btn.only-m, .scrim { display: none; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2); height: var(--ctl); padding: 0 var(--sp-4); border: 1px solid transparent; border-radius: var(--r-md); font-weight: var(--w-medium); cursor: pointer; white-space: nowrap; transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease); text-decoration: none !important; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-hover); }
.btn.secondary { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.btn.secondary:hover { background: var(--surface-2); }
.btn.ghost { background: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.sm { height: 32px; padding: 0 var(--sp-3); font-size: var(--fs-1); }
.btn.lg { height: 48px; font-size: var(--fs-3); }
.btn.block { width: 100%; }
.btn.icon-only { width: var(--ctl); padding: 0; }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.btn.busy { position: relative; color: transparent !important; pointer-events: none; }
.btn.busy::after { content: ''; position: absolute; width: 16px; height: 16px; border: 2px solid currentColor; border-color: var(--on-accent) transparent var(--on-accent) var(--on-accent); border-radius: 50%; animation: spin .7s linear infinite; }
.btn.secondary.busy::after { border-color: var(--text) transparent var(--text) var(--text); }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn { display: inline-grid; place-items: center; width: var(--ctl); height: var(--ctl); border: 0; background: none; border-radius: var(--r-md); cursor: pointer; color: var(--text-3); transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.danger:hover { color: var(--danger); background: var(--danger-soft); }
.link { border: 0; background: none; color: var(--accent-text); cursor: pointer; padding: 0; font-weight: var(--w-medium); min-height: 24px; }
.lang .ic { color: var(--text-3); }

/* ---------- inputs ---------- */
input, select, textarea { width: 100%; min-width: 0; height: var(--ctl); border: 1px solid var(--border-strong); border-radius: var(--r-md); padding: 0 var(--sp-3); background: var(--surface); color: var(--text); outline: none; transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease); }
textarea { height: auto; min-height: 72px; padding: var(--sp-2) var(--sp-3); resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: var(--text-3); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: var(--ring); }
input[readonly], input:disabled, select:disabled { background: var(--surface-2); color: var(--text-3); }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; accent-color: var(--accent); padding: 0; flex: none; }
input[type=date] { font-variant-numeric: tabular-nums; }
::placeholder { color: var(--text-3); opacity: .8; }
.field { display: flex; flex-direction: column; gap: var(--sp-2); min-width: 0; }
.field > label { font-size: var(--fs-1); font-weight: var(--w-medium); color: var(--text-2); display: flex; align-items: center; gap: var(--sp-1); }
.req { color: var(--danger); margin-inline-start: 2px; }
.pair { display: flex; align-items: center; gap: var(--sp-2); }
.pair input { width: 88px; } .pair span { color: var(--text-3); font-size: var(--fs-1); }
label.inline { display: inline-flex; align-items: center; gap: var(--sp-2); color: var(--text-3); font-size: var(--fs-1); font-weight: var(--w-medium); white-space: nowrap; }
label.inline input, label.inline select { width: auto; }
label.check { display: flex; align-items: center; gap: var(--sp-2); cursor: pointer; min-height: 32px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4); }
.form-grid.one { grid-template-columns: 1fr; }
.span2 { grid-column: 1 / -1; }
fieldset > legend { font-size: var(--fs-2); font-weight: var(--w-semibold); color: var(--text); display: flex; align-items: center; gap: var(--sp-1); margin-bottom: var(--sp-3); }
.disclose { border: 1px solid var(--border); border-radius: var(--r-md); }
.disclose > summary { list-style: none; display: flex; align-items: center; gap: var(--sp-2); min-height: 44px; padding: 0 var(--sp-3); cursor: pointer; font-weight: var(--w-medium); color: var(--text-2); border-radius: var(--r-md); }
.disclose > summary::-webkit-details-marker { display: none; }
.disclose > summary:hover { background: var(--surface-2); }
.disclose .disc { transition: transform var(--t-base) var(--ease); transform: rotate(-90deg); } [dir=rtl] .disclose .disc { transform: rotate(90deg); }
.disclose[open] .disc { transform: none; }
.disclose > .form-grid, .disclose > .tbl-wrap { padding: var(--sp-2) var(--sp-4) var(--sp-4); }
.calc { color: var(--accent-text); background: var(--accent-soft); border-radius: var(--r-md); padding: var(--sp-2) var(--sp-3); font-size: var(--fs-1); font-weight: var(--w-medium); }
.calc:empty { display: none; }
.err { color: var(--danger); font-size: var(--fs-1); flex: 1; }
.err:empty { display: none; }
.form-foot { display: flex; align-items: center; justify-content: flex-end; gap: var(--sp-3); margin-top: var(--sp-5); }

/* ---------- IFRS info + tooltip ---------- */
.ifrs { position: relative; display: inline-grid; place-items: center; width: 20px; height: 20px; padding: 0; border: 0; border-radius: var(--r-full); background: none; color: var(--text-3); cursor: help; flex: none; transition: color var(--t-fast) var(--ease); }
.ifrs::before { content: ''; position: absolute; inset: -12px; } /* 44px touch target */
.ifrs .ic { width: 15px; height: 15px; }
.ifrs:hover, .ifrs:focus-visible { color: var(--accent-text); }
.tip { position: fixed; z-index: 1000; max-width: 340px; background: var(--inverse); color: var(--on-inverse); font-size: var(--fs-1); line-height: var(--lh); padding: var(--sp-3); border-radius: var(--r-md); box-shadow: var(--sh-3); pointer-events: none; opacity: 0; transform: translateY(-2px); transition: opacity var(--t-fast) var(--ease), transform var(--t-fast) var(--ease); visibility: hidden; }
.tip.show { opacity: 1; transform: none; visibility: visible; }

/* ---------- cards & surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-1); padding: var(--sp-5); margin-bottom: var(--sp-4); min-width: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card-title { font-size: var(--fs-3); font-weight: var(--w-semibold); display: flex; align-items: center; gap: var(--sp-1); margin-bottom: var(--sp-4); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.card-head .card-title { margin: 0; }
.card-head.pad { padding: var(--sp-4) var(--sp-5) 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4); }
.grid-2-1 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: var(--sp-4); }
.grid-2 > .card, .grid-2-1 > .card { margin: 0; }
.grid-2, .grid-2-1 { margin-bottom: var(--sp-4); }
.empty { text-align: center; padding: var(--sp-7) var(--sp-5); color: var(--text-3); display: flex; flex-direction: column; align-items: center; gap: var(--sp-2); }
.empty .ic { width: 32px; height: 32px; color: var(--text-3); opacity: .6; margin-bottom: var(--sp-2); }
.empty h3 { font-size: var(--fs-3); font-weight: var(--w-semibold); color: var(--text); }
.empty p { max-width: 420px; }
.empty .btn { margin-top: var(--sp-3); }
.alert { display: flex; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); border-radius: var(--r-md); margin-top: var(--sp-4); font-size: var(--fs-2); align-items: flex-start; }
.alert ul { margin: var(--sp-1) 0 0; padding-inline-start: var(--sp-5); }
.alert.ok { background: var(--success-soft); color: var(--success); } .alert.bad { background: var(--danger-soft); color: var(--danger); }
/* skeletons */
.sk { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; border-radius: var(--r-sm); }
.sk-line { height: 12px; margin-bottom: var(--sp-4); } .w40 { width: 40%; }
.sk-num { height: 28px; width: 60%; } .sk-row { height: 36px; margin-bottom: var(--sp-2); } .sk-block { height: 220px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- badges & tags ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 var(--sp-2); border-radius: var(--r-full); font-size: var(--fs-1); font-weight: var(--w-medium); white-space: nowrap; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.success { background: var(--success-soft); color: var(--success); }
.badge.warning { background: var(--warning-soft); color: var(--warning); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.neutral { background: var(--surface-2); color: var(--text-2); }
.badge.muted { background: var(--surface-2); color: var(--text-3); }
.mtag { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-1); font-weight: var(--w-medium); color: var(--text-2); white-space: nowrap; }
.mtag::before { content: ''; width: 8px; height: 8px; border-radius: 2px; background: var(--text-3); }
.mt-addition::before { background: var(--success); } .mt-disposal::before { background: var(--danger); } .mt-transfer::before { background: var(--info); }
.mt-impairment::before { background: var(--warning); } .mt-life::before, .mt-residual::before { background: var(--accent); }
.chip { display: inline-flex; align-items: center; height: 24px; background: var(--surface-2); border-radius: var(--r-sm); padding: 0 var(--sp-2); margin: 2px; font-size: var(--fs-1); color: var(--text-2); }

/* ---------- tables ---------- */
.tbl-wrap { overflow: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: var(--fs-2); }
.tbl th { position: sticky; top: 0; z-index: 1; background: var(--surface); color: var(--text-3); font-size: var(--fs-1); font-weight: var(--w-medium); text-align: start; padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl th.n { text-align: end; }
.tbl td { padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--border); vertical-align: middle; height: 48px; white-space: nowrap; }
.tbl td.wrap { white-space: normal; min-width: 200px; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background var(--t-fast) var(--ease); }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl tr[data-href] { cursor: pointer; }
.tbl tr.sel { background: var(--accent-soft); }
.tbl tfoot td { font-weight: var(--w-semibold); background: var(--surface-2); border-top: 1px solid var(--border-strong); border-bottom: 0; }
.tbl.compact td { height: 44px; padding: var(--sp-2) var(--sp-3); }
.tbl td:first-child, .tbl th:first-child { padding-inline-start: var(--sp-5); }
.tbl td:last-child, .tbl th:last-child { padding-inline-end: var(--sp-5); }
.th-sort { display: inline-flex; align-items: center; gap: var(--sp-1); border: 0; background: none; color: inherit; font: inherit; cursor: pointer; padding: var(--sp-1) 0; min-height: 28px; }
.th-sort:hover, .th-sort.on { color: var(--text); }
.th-sort i { font-style: normal; width: 10px; }
.row-link { font-weight: var(--w-medium); color: var(--accent-text); }
.row-act { white-space: nowrap; text-align: end; }
.cell-note { display: block; color: var(--text-3); font-size: var(--fs-1); }
.asset-cell b { display: block; font-weight: var(--w-medium); max-width: 340px; }
.asset-cell .ell { max-width: 340px; }
.ell.dept { max-width: 180px; }
.who { display: flex; align-items: center; gap: var(--sp-3); }
.toolbar { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--border); }
.search { flex: 1 1 260px; display: flex; align-items: center; gap: var(--sp-2); height: var(--ctl); border: 1px solid var(--border-strong); border-radius: var(--r-md); padding: 0 var(--sp-3); background: var(--surface); transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease); }
.search:focus-within { border-color: var(--accent); box-shadow: var(--ring); }
.search input { border: 0; box-shadow: none !important; padding: 0; height: 100%; background: transparent; }
.search .ic { color: var(--text-3); }
.sel select { width: auto; max-width: 190px; color: var(--text-2); }
.sel select.on { border-color: var(--accent); color: var(--accent-text); background: var(--accent-soft); }
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 2px; background: var(--surface-2); border-radius: var(--r-md); }
.seg button { border: 0; background: none; height: 36px; padding: 0 var(--sp-3); border-radius: var(--r-sm); cursor: pointer; color: var(--text-2); font-size: var(--fs-1); font-weight: var(--w-medium); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--sh-1); }
.pager { display: flex; gap: var(--sp-3); align-items: center; justify-content: center; padding: var(--sp-4); color: var(--text-3); font-size: var(--fs-1); border-top: 1px solid var(--border); }
.matrix .ic.ok { color: var(--success); width: 16px; height: 16px; }

/* ---------- dashboard ---------- */
.dash-top { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: var(--sp-4); margin-bottom: var(--sp-4); }
.dash-top .card { margin: 0; display: flex; flex-direction: column; gap: var(--sp-3); }
.meter { height: 8px; border-radius: var(--r-full); background: var(--warning); opacity: .9; overflow: hidden; margin: var(--sp-2) 0; }
.meter i { display: block; height: 100%; background: var(--accent); border-radius: var(--r-full); }
.split { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-4); }
.split.col { grid-template-columns: 1fr 1fr; margin-top: auto; }
.split dt { color: var(--text-3); font-size: var(--fs-1); display: flex; align-items: center; gap: var(--sp-1); }
.split dd { font-weight: var(--w-semibold); font-variant-numeric: tabular-nums; font-size: var(--fs-3); margin-top: 2px; }
.dot { width: 8px; height: 8px; border-radius: 2px; display: inline-block; } .dot.warn { background: var(--warning); } .dot.acc { background: var(--accent); }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-4); margin-bottom: var(--sp-4); }
.kpi-grid .card { margin: 0; }
.stat { display: flex; flex-direction: column; gap: var(--sp-1); padding: var(--sp-4) var(--sp-5); }
.bars { display: flex; align-items: flex-end; gap: var(--sp-2); height: 200px; }
.bar { flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: var(--sp-2); min-width: 0; }
.bar span { width: 100%; max-width: 32px; background: var(--accent); border-radius: var(--r-sm) var(--r-sm) 2px 2px; transition: opacity var(--t-fast) var(--ease); }
.bar:hover span { opacity: .8; }
.bar.fut span { background: var(--chart-muted); } .bar.now span { background: var(--accent-hover); }
.bar small { font-size: 11px; color: var(--text-3); }
.att { list-style: none; padding: 0; display: flex; flex-direction: column; gap: var(--sp-2); }
.att li { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-2) 0; border-bottom: 1px solid var(--border); }
.att li:last-child { border: 0; }
.att li > span:nth-child(2) { flex: 1; }
.att-ic { width: 32px; height: 32px; border-radius: var(--r-md); display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--text-2); }
.att-ic.warning { background: var(--warning-soft); color: var(--warning); } .att-ic.info { background: var(--info-soft); color: var(--info); }
.att-ic .ic { width: 16px; height: 16px; }
.hbars { display: flex; flex-direction: column; gap: var(--sp-3); }
.hb { display: grid; grid-template-columns: 160px 1fr 96px; gap: var(--sp-3); align-items: center; }
.hb-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.hb-v { text-align: end; font-weight: var(--w-medium); }
.hb-t { position: relative; height: 10px; border-radius: var(--r-full); overflow: hidden; }
.hb-t i { position: absolute; inset-block: 0; inset-inline-start: 0; border-radius: var(--r-full); }
.hb-t i.c { background: var(--chart-muted); } .hb-t i.n { background: var(--accent); }
.legend { display: flex; flex-wrap: wrap; gap: var(--sp-4); margin-top: var(--sp-4); font-size: var(--fs-1); color: var(--text-3); }
.legend span { display: flex; align-items: center; gap: var(--sp-2); }
.sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; } .sw.muted { background: var(--chart-muted); } .sw.acc { background: var(--accent); }
.date-pick { display: flex; align-items: center; gap: var(--sp-2); height: var(--ctl); padding-inline-start: var(--sp-3); border: 1px solid var(--border-strong); border-radius: var(--r-md); background: var(--surface); color: var(--text-3); }
.date-pick input { border: 0; color: var(--text); height: 100%; box-shadow: none !important; background: transparent; padding-inline-start: 0; }

/* ---------- asset page ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: var(--sp-3); margin-bottom: var(--sp-4); }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-1); box-shadow: var(--sh-1); }
.tile.accent { background: var(--accent-soft); border-color: transparent; } .tile.accent .num-md { color: var(--accent-text); }
.progress { height: 6px; border-radius: var(--r-full); background: var(--surface-3); overflow: hidden; margin-bottom: var(--sp-2); }
.progress i { display: block; height: 100%; background: var(--accent); border-radius: var(--r-full); }
.tabs { display: flex; gap: var(--sp-1); margin: var(--sp-5) 0 var(--sp-4); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.tabs a, .tabs button { display: inline-flex; align-items: center; gap: var(--sp-2); min-height: 44px; border: 0; background: none; padding: 0 var(--sp-3); cursor: pointer; color: var(--text-3); font-weight: var(--w-medium); border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease); text-decoration: none !important; }
.tabs a:hover, .tabs button:hover { color: var(--text); }
.tabs .on { color: var(--text); border-bottom-color: var(--accent); }
.count { background: var(--surface-2); color: var(--text-2); border-radius: var(--r-full); padding: 0 var(--sp-2); font-size: var(--fs-1); }
.kv-list { display: grid; grid-template-columns: 1fr; }
.kv { display: grid; grid-template-columns: minmax(140px, 40%) 1fr; gap: var(--sp-3); padding: var(--sp-3) 0; border-bottom: 1px solid var(--border); }
.kv:last-child { border: 0; }
.kv dt { color: var(--text-3); display: flex; align-items: center; gap: var(--sp-1); }
.kv dd { font-weight: var(--w-medium); font-variant-numeric: tabular-nums; word-break: break-word; }
.grid-sched { display: grid; gap: var(--sp-4); }
.grid-sched .card { margin: 0; }

/* ---------- movement form ---------- */
.type-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-2); }
.type-card { position: relative; display: flex; gap: var(--sp-3); align-items: flex-start; padding: var(--sp-3); border: 1px solid var(--border-strong); border-radius: var(--r-md); cursor: pointer; transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease); min-height: 64px; }
.type-card:hover { background: var(--surface-2); }
.type-card input { position: absolute; opacity: 0; pointer-events: none; }
.type-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.type-card:has(input:focus-visible) { box-shadow: var(--ring); }
.tc-ic { width: 32px; height: 32px; border-radius: var(--r-sm); display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); flex: none; }
.type-card:has(input:checked) .tc-ic { background: var(--accent); color: var(--on-accent); }
.type-card b { display: block; font-weight: var(--w-semibold); font-size: var(--fs-2); }
.type-card small { color: var(--text-3); font-size: var(--fs-1); line-height: var(--lh-tight); display: block; margin-top: 2px; }
.preview { background: var(--surface-2); border-radius: var(--r-md); padding: var(--sp-4); }
.preview h3 { font-size: var(--fs-1); font-weight: var(--w-semibold); color: var(--text-2); display: flex; align-items: center; gap: var(--sp-1); margin-bottom: var(--sp-3); }
.pv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--sp-3); }
.pv-grid dt { color: var(--text-3); font-size: var(--fs-1); }
.pv-grid dd { font-weight: var(--w-semibold); font-variant-numeric: tabular-nums; }
.pv-grid .accent dd { color: var(--accent-text); } .pv-grid .neg dd { color: var(--danger); } .pv-grid .pos dd { color: var(--success); }
.combo { position: relative; }
.combo-list { position: absolute; inset-inline: 0; top: calc(100% + 4px); z-index: 20; list-style: none; padding: var(--sp-1); margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--sh-2); max-height: 280px; overflow: auto; }
.combo-list li { display: grid; grid-template-columns: auto 1fr auto; gap: var(--sp-3); align-items: center; min-height: 40px; padding: 0 var(--sp-3); border-radius: var(--r-sm); cursor: pointer; }
.combo-list li.on, .combo-list li:hover { background: var(--accent-soft); }
.combo-list li.none { display: block; color: var(--text-3); cursor: default; padding: var(--sp-2) var(--sp-3); }

/* ---------- menus ---------- */
.dd { position: relative; }
.menu { position: absolute; top: calc(100% + 6px); z-index: 60; min-width: 220px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--sh-2); padding: var(--sp-1); opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity var(--t-fast) var(--ease), transform var(--t-fast) var(--ease), visibility var(--t-fast); }
.menu.end { inset-inline-end: 0; } .menu.start { inset-inline-start: 0; }
.menu.open { opacity: 1; visibility: visible; transform: none; }
.menu hr { border: 0; border-top: 1px solid var(--border); margin: var(--sp-1) 0; }
.menu [role=menuitem] { display: flex; align-items: center; gap: var(--sp-3); width: 100%; min-height: 40px; padding: var(--sp-2) var(--sp-3); border: 0; background: none; border-radius: var(--r-sm); color: var(--text); cursor: pointer; text-align: start; }
.menu [role=menuitem]:hover, .menu [role=menuitem]:focus-visible { background: var(--surface-2); box-shadow: none; }
.menu [role=menuitem] .ic { color: var(--text-3); }
.menu [role=menuitem] span { flex: 1; } .menu [role=menuitem] b { font-weight: var(--w-medium); display: block; }
.menu [role=menuitem] small { display: block; color: var(--text-3); font-size: var(--fs-1); }
.menu [role=menuitem].danger, .menu [role=menuitem].danger .ic { color: var(--danger); }
.menu .tick { color: var(--accent-text) !important; }
.menu [data-act=who] { cursor: default; } .menu [data-act=who]:hover { background: none; }

/* ---------- modal, command palette, toast ---------- */
.modal-bg { position: fixed; inset: 0; z-index: 100; background: var(--overlay); display: grid; place-items: center; padding: var(--sp-4); animation: fade var(--t-base) var(--ease); }
.modal-bg.out { animation: fadeOut var(--t-fast) var(--ease) forwards; }
@keyframes fade { from { opacity: 0; } } @keyframes fadeOut { to { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.modal { width: 100%; max-width: 560px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--sh-3); animation: rise var(--t-slow) var(--ease); }
.modal.sm { max-width: 420px; } .modal.md { max-width: 600px; } .modal.lg { max-width: 760px; } .modal.palette { max-width: 620px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-4); padding: var(--sp-5) var(--sp-5) var(--sp-4); }
.modal-head h2 { font-size: var(--fs-3); font-weight: var(--w-semibold); }
.modal-head p { color: var(--text-3); margin-top: var(--sp-1); }
.modal-head .icon-btn { margin: -8px; }
.modal-body { padding: 0 var(--sp-5) var(--sp-5); overflow: auto; display: flex; flex-direction: column; gap: var(--sp-4); }
.modal-body > .form-grid { gap: var(--sp-5) var(--sp-4); }
.modal-foot { display: flex; align-items: center; gap: var(--sp-2); justify-content: flex-end; padding: var(--sp-4) var(--sp-5); border-top: 1px solid var(--border); }
.confirm { font-size: var(--fs-2); color: var(--text-2); }
.modal-bg.cmdk { place-items: start center; padding-top: 12vh; }
.cmdk .modal-head { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); padding: 0; }
.cmdk .modal-foot { display: none; } .cmdk .modal-body { padding: 0; }
.cmd-in { display: flex; align-items: center; gap: var(--sp-3); padding: 0 var(--sp-5); border-bottom: 1px solid var(--border); }
.cmd-in .ic { color: var(--text-3); }
.cmd-in input { border: 0; height: 56px; font-size: var(--fs-3); padding: 0; box-shadow: none !important; background: transparent; }
.cmd-list { max-height: 50vh; overflow: auto; padding: var(--sp-2); }
.cmd-g { font-size: var(--fs-1); color: var(--text-3); font-weight: var(--w-medium); padding: var(--sp-3) var(--sp-3) var(--sp-1); }
.cmd-i { display: flex; align-items: center; gap: var(--sp-3); width: 100%; min-height: 44px; padding: 0 var(--sp-3); border: 0; background: none; border-radius: var(--r-md); cursor: pointer; text-align: start; color: var(--text); }
.cmd-i .ic { color: var(--text-3); }
.cmd-i.on { background: var(--accent-soft); } .cmd-i.on .ic { color: var(--accent-text); }
.cmd-empty { padding: var(--sp-6); text-align: center; color: var(--text-3); }
.cmd-hint { font-size: var(--fs-1); color: var(--text-3); padding: var(--sp-3) var(--sp-5); border-top: 1px solid var(--border); }
#toasts { position: fixed; bottom: var(--sp-5); inset-inline-end: var(--sp-5); z-index: 200; display: flex; flex-direction: column; gap: var(--sp-2); }
.toast { display: flex; align-items: center; gap: var(--sp-3); background: var(--inverse); color: var(--on-inverse); padding: var(--sp-3) var(--sp-4); border-radius: var(--r-md); box-shadow: var(--sh-3); max-width: 420px; animation: rise var(--t-slow) var(--ease); transition: opacity var(--t-slow) var(--ease), transform var(--t-slow) var(--ease); }
.toast.ok .ic { color: var(--accent); } .toast.bad { background: var(--danger); color: #fff; }
.toast.out { opacity: 0; transform: translateY(8px); }

/* ---------- import ---------- */
.steps { padding-inline-start: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-3); }
.steps li { padding-inline-start: var(--sp-1); } .steps li span { margin-inline-end: var(--sp-2); }
.drop { display: flex; flex-direction: column; align-items: center; gap: var(--sp-1); border: 1.5px dashed var(--border-strong); border-radius: var(--r-lg); padding: var(--sp-6); cursor: pointer; color: var(--text-3); text-align: center; transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease); }
.drop:hover, .drop:focus-within { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }
.drop input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.drop .ic { width: 28px; height: 28px; margin-bottom: var(--sp-2); }
.drop b { color: var(--text); font-weight: var(--w-medium); }

/* ---------- picker, reports, settings, access ---------- */
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--sp-3); }
.pick { display: flex; align-items: center; gap: var(--sp-4); padding: var(--sp-4); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-1); cursor: pointer; text-align: start; transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease); }
.pick:hover { border-color: var(--accent); box-shadow: var(--sh-2); }
.pick.cur { border-color: var(--accent); }
.pick:disabled { opacity: .5; cursor: default; }
.pick-txt { flex: 1; min-width: 0; } .pick-txt b { display: block; font-weight: var(--w-semibold); } .pick-txt small { color: var(--text-3); }
.pick-go { color: var(--text-3); }
.rep-group { margin-bottom: var(--sp-6); }
.group-title { font-size: var(--fs-1); font-weight: var(--w-semibold); color: var(--text-3); margin-bottom: var(--sp-3); }
.rep-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--sp-3); }
.rep-card { display: flex; gap: var(--sp-4); padding: var(--sp-4); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); color: var(--text); box-shadow: var(--sh-1); transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease); text-decoration: none !important; }
.rep-card:hover { border-color: var(--accent); box-shadow: var(--sh-2); }
.rep-card b { display: block; font-weight: var(--w-semibold); margin-bottom: 2px; }
.rep-card small { color: var(--text-3); font-size: var(--fs-1); line-height: var(--lh); display: block; }
.rep-ic { width: 40px; height: 40px; border-radius: var(--r-md); background: var(--surface-2); display: grid; place-items: center; color: var(--text-2); flex: none; }
.rep-card.star { grid-column: 1 / -1; border-color: var(--accent); }
.rep-card.star .rep-ic { background: var(--accent); color: var(--on-accent); }
.params { display: flex; flex-wrap: wrap; gap: var(--sp-4); align-items: center; padding: var(--sp-3) var(--sp-4); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); margin-bottom: var(--sp-4); }
.params:empty { display: none; }
.rep-meta { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); color: var(--text-3); font-size: var(--fs-1); margin-bottom: var(--sp-3); }
.rep-meta span + span::before { content: '·'; margin-inline-end: var(--sp-4); }
.rep-toc { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-bottom: var(--sp-4); }
.rep-toc a { font-size: var(--fs-1); padding: var(--sp-1) var(--sp-3); border-radius: var(--r-full); background: var(--surface); border: 1px solid var(--border); color: var(--text-2); font-weight: var(--w-medium); }
.rep-toc a:hover { border-color: var(--accent); color: var(--accent-text); text-decoration: none; }
.rep-sec { scroll-margin-top: 88px; }
.note { display: flex; gap: var(--sp-2); align-items: flex-start; color: var(--text-2); font-size: var(--fs-1); background: var(--surface-2); border-radius: var(--r-md); padding: var(--sp-2) var(--sp-3); margin-bottom: var(--sp-4); }
.note .ic { width: 16px; height: 16px; color: var(--text-3); margin-top: 1px; }
.rt { width: 100%; border-collapse: collapse; font-size: var(--fs-2); font-variant-numeric: tabular-nums; }
.rt th { position: sticky; top: 0; background: var(--surface-2); color: var(--text-2); font-weight: var(--w-semibold); font-size: var(--fs-1); padding: var(--sp-2) var(--sp-3); text-align: start; vertical-align: bottom; border-bottom: 1px solid var(--border-strong); }
.rt th.n { text-align: end; }
.rt td { padding: var(--sp-2) var(--sp-3); border-bottom: 1px solid var(--border); white-space: nowrap; height: 40px; }
.rt td.w { min-width: 200px; white-space: normal; }
.rt tr.g td { color: var(--accent-text); font-weight: var(--w-semibold); padding-top: var(--sp-4); border-bottom-color: var(--border-strong); white-space: normal; }
.rt tr.s td { background: var(--surface-2); font-weight: var(--w-semibold); }
.rt tr.b td { font-weight: var(--w-semibold); border-top: 1px solid var(--border-strong); }
.rt tr.bad td { color: var(--danger); font-weight: var(--w-semibold); }
.rt tfoot td { font-weight: var(--w-semibold); background: var(--surface-3); border-top: 1px solid var(--text-3); border-bottom: 3px double var(--text-3); }
.rt td.neg { color: var(--danger); }
.kvt { border-collapse: collapse; width: 100%; max-width: 820px; }
.kvt th { text-align: start; color: var(--text-3); font-weight: var(--w-regular); padding: var(--sp-2) 0; width: 42%; border-bottom: 1px solid var(--border); }
.kvt td { padding: var(--sp-2) 0; border-bottom: 1px solid var(--border); font-weight: var(--w-medium); }
.kvt tr.sp td { border: 0; height: var(--sp-3); }
.policy p { margin: 0 0 var(--sp-3); line-height: 1.7; max-width: 920px; color: var(--text-2); }
.nodata { padding: var(--sp-4) 0; }
.settings .card { max-width: 920px; }
.lock-card { display: flex; gap: var(--sp-4); border-color: var(--warning-soft); }
.lock-card .lock-ic { width: 40px; height: 40px; border-radius: var(--r-md); background: var(--warning-soft); color: var(--warning); display: grid; place-items: center; flex: none; }
.lock-card .muted { margin: calc(-1 * var(--sp-2)) 0 var(--sp-4); max-width: 620px; }
.lock-card .field { max-width: 320px; }
.settings .form-foot { max-width: 920px; }
.acc-list { display: flex; flex-direction: column; gap: var(--sp-2); }
.acc { border: 1px solid var(--border); border-radius: var(--r-md); transition: border-color var(--t-fast) var(--ease); }
.acc.on { border-color: var(--accent); }
.acc-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-2) var(--sp-3); }
.acc-head .check b { font-weight: var(--w-semibold); }
.acc-perms { display: none; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-3); padding: var(--sp-2) var(--sp-3) var(--sp-3); border-top: 1px solid var(--border); }
.acc.on .acc-perms { display: grid; }
.acc-perms legend { font-size: var(--fs-1); color: var(--text-3); font-weight: var(--w-medium); margin-bottom: var(--sp-1); }
.acc-perms label.check { font-size: var(--fs-1); min-height: 28px; }
.roles-ref { padding: 0; }
.roles-ref > summary { padding: var(--sp-3) var(--sp-5); min-height: 56px; }
.roles-ref .card-title { margin: 0; }
.note.pad-x { margin: 0 var(--sp-5) var(--sp-4); }
.note.span2 { margin: 0; }

/* ---------- auth ---------- */
.auth { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 100vh; }
.auth-intro { background: var(--surface-2); padding: var(--sp-8); display: flex; flex-direction: column; justify-content: center; gap: var(--sp-5); border-inline-end: 1px solid var(--border); }
.auth-brand { display: flex; align-items: center; gap: var(--sp-3); font-weight: var(--w-semibold); font-size: var(--fs-3); }
.auth-brand .logo { width: 36px; height: 36px; }
.auth-intro h1 { font-size: var(--fs-6); line-height: var(--lh-tight); letter-spacing: -.02em; font-weight: var(--w-semibold); max-width: 520px; }
.auth-intro ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: var(--sp-3); color: var(--text-2); }
.auth-intro li { display: flex; gap: var(--sp-3); align-items: center; }
.auth-intro li .ic { color: var(--accent); }
.auth-std { display: flex; align-items: center; gap: var(--sp-2); color: var(--text-3); font-size: var(--fs-1); }
.auth-main { display: grid; place-items: center; padding: var(--sp-6); }
.auth-card { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: var(--sp-4); }
.auth-card h2 { font-size: var(--fs-5); font-weight: var(--w-semibold); letter-spacing: -.02em; }
.auth-card .muted { margin-top: calc(-1 * var(--sp-2)); }
.diag { min-height: 100vh; } .diag .auth-top { margin-bottom: 0; }
.auth-top { display: flex; justify-content: flex-end; margin-bottom: var(--sp-6); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) { .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .dash-top, .grid-2-1 { grid-template-columns: 1fr; } .acc-perms { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) {
  .side { position: fixed; inset-block: 0; inset-inline-start: 0; transform: translateX(-100%); transition: transform var(--t-slow) var(--ease); box-shadow: var(--sh-3); }
  [dir=rtl] .side { transform: translateX(100%); }
  .nav-open .side { transform: none; }
  .nav-open .scrim { display: block; position: fixed; inset: 0; background: var(--overlay); z-index: 35; }
  .only-m, .icon-btn.only-m { display: inline-grid; }
  .top { padding: 0 var(--sp-3); }
  .search-btn span, .search-btn kbd, .pill span, .lang span { display: none; }
  .search-btn { width: var(--ctl); padding: 0; justify-content: center; }
  .page { padding: var(--sp-5) var(--sp-4) var(--sp-7); }
  .grid-2, .form-grid, .split { grid-template-columns: 1fr; }
  .type-grid { grid-template-columns: 1fr 1fr; }
  .auth { grid-template-columns: 1fr; } .auth-intro { display: none; }
  .hb { grid-template-columns: 110px 1fr 80px; }
  .modal-bg { padding: 0; place-items: end center; } .modal { max-height: 92vh; border-radius: var(--r-lg) var(--r-lg) 0 0; }
  .tbl td:first-child, .tbl th:first-child { padding-inline-start: var(--sp-4); }
}
@media (max-width: 520px) { .kpi-grid { grid-template-columns: 1fr; } .type-grid { grid-template-columns: 1fr; } .page-head .actions { width: 100%; } .page-head .actions .btn.primary { flex: 1; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; scroll-behavior: auto !important; } }

/* =====================================================================
   PDF export (browser print). Always light, fixed palette for paper.
   ===================================================================== */
#print { display: none; }
#print.measure { display: block; position: absolute; top: 0; visibility: hidden; }
@media print {
  body.printing > *:not(#print) { display: none !important; }
  body.printing { background: #fff; }
  body.printing #print { display: block; }
}
#print { font-family: var(--font); color: #0f1720; background: #fff; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
#print .ps.pb { break-before: page; }
#print .ph { display: flex; justify-content: space-between; gap: 20px; border-bottom: 2px solid #0f1720; padding-bottom: 8px; margin-bottom: 10px; }
#print .ph-co { font-size: 15px; font-weight: 700; } #print .ph-meta { font-size: 9px; color: #5b6775; }
#print .ph-t { text-align: end; } #print .ph-t h1 { font-size: 14px; color: #0f766e; margin: 0; } #print .ph-t div { font-size: 9px; color: #3a4652; }
#print .ph-t h2 { font-size: 11.5px; margin: 4px 0 0; }
#print .pn { font-size: 8.5px; color: #3a4652; margin: 0 0 8px; font-style: italic; }
#print .rt { width: 100%; border-collapse: collapse; font-size: inherit; }
#print .rt th { position: static; background: #0f1720; color: #fff; padding: 4px 5px; font-size: 1em; text-align: start; vertical-align: bottom; font-weight: 600; border: 0; }
#print .rt th.n, #print .rt td.n { text-align: end; }
#print .rt td { padding: 2.5px 5px; border-bottom: .5px solid #e3e7ec; font-size: 1em; white-space: nowrap; height: auto; }
#print .rt td.w { min-width: 0; white-space: normal; }
#print .rt thead { display: table-header-group; } #print .rt tfoot { display: table-row-group; }
#print .rt tr { break-inside: avoid; }
#print .rt tr.g td { background: #e5f3f1; color: #0b5f58; font-weight: 700; white-space: normal; padding-top: 3px; break-after: avoid; }
#print .rt tr.s td { background: #f2f4f7; font-weight: 700; white-space: normal; }
#print .rt tr.b td { font-weight: 700; border-top: .8px solid #8d99a6; }
#print .rt tfoot td { background: #e8ecf1; font-weight: 700; border-top: 1px solid #0f1720; border-bottom: 2.5px double #0f1720; }
#print .rt td.neg { color: #c0272d; }
#print .kvt { width: 100%; max-width: none; border-collapse: collapse; } #print .kvt th, #print .kvt td { padding: 4px 8px; border-bottom: .5px solid #e3e7ec; font-size: 1em; color: #0f1720; }
#print .kvt th { background: #f6f7f9; width: 40%; text-align: start; font-weight: 500; }
#print .policy p { font-size: 10px; line-height: 1.6; margin: 0 0 6px; max-width: none; color: #0f1720; }
#print .pf { margin-top: 14px; font-size: 8px; color: #8d99a6; border-top: .5px solid #e3e7ec; padding-top: 4px; }
