@font-face { font-family: 'Plex Arabic'; src: url(fonts/plex-ar-400.woff2) format('woff2'); font-weight: 400; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: 'Plex Arabic'; src: url(fonts/plex-ar-500.woff2) format('woff2'); font-weight: 500; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: 'Plex Arabic'; src: url(fonts/plex-ar-600.woff2) format('woff2'); font-weight: 600; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: 'Plex Arabic'; src: url(fonts/plex-ar-700.woff2) format('woff2'); font-weight: 700; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: 'Plex Arabic'; src: url(fonts/plex-lat-400.woff2) format('woff2'); font-weight: 400; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F, U+20AC; }
@font-face { font-family: 'Plex Arabic'; src: url(fonts/plex-lat-500.woff2) format('woff2'); font-weight: 500; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F, U+20AC; }
@font-face { font-family: 'Plex Arabic'; src: url(fonts/plex-lat-600.woff2) format('woff2'); font-weight: 600; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F, U+20AC; }
@font-face { font-family: 'Plex Arabic'; src: url(fonts/plex-lat-700.woff2) format('woff2'); font-weight: 700; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F, U+20AC; }

:root {
  color-scheme: light;
  --bg: #f4f5f7; --surface: #ffffff; --surface-2: #f8f9fb; --surface-3: #eef1f5;
  --border: #e2e6ec; --border-strong: #cdd3dc;
  --text: #14171c; --text-2: #4b5260; --text-3: #7a8291;
  --brand: #0f4c81; --brand-2: #1c5cab; --brand-soft: #e7f0fb; --brand-ink: #ffffff;
  --good: #0a7f3f; --good-soft: #e3f5ea; --bad: #c62f2f; --bad-soft: #fde8e8; --warn: #a86400; --warn-soft: #fff3dd;
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300; --s7: #6250d6; --s8: #e34948;
  --grid: #eceff3; --heat: 42, 120, 214;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .05);
  --radius: 10px; --sidebar: 268px;
  --font: 'Plex Arabic', 'Segoe UI', Tahoma, system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #111214; --surface: #1a1b1e; --surface-2: #202125; --surface-3: #2a2b30;
    --border: #2f3137; --border-strong: #42454d;
    --text: #f0efec; --text-2: #c3c2b7; --text-3: #8d8c86;
    --brand: #5598e7; --brand-2: #6da7ec; --brand-soft: #16263b; --brand-ink: #0b1420;
    --good: #3fbf72; --good-soft: #15291d; --bad: #f07070; --bad-soft: #351919; --warn: #e8a83a; --warn-soft: #33270f;
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #0ca30c; --s7: #9085e9; --s8: #e66767;
    --grid: #2a2b30; --heat: 57, 135, 229;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111214; --surface: #1a1b1e; --surface-2: #202125; --surface-3: #2a2b30;
  --border: #2f3137; --border-strong: #42454d;
  --text: #f0efec; --text-2: #c3c2b7; --text-3: #8d8c86;
  --brand: #5598e7; --brand-2: #6da7ec; --brand-soft: #16263b; --brand-ink: #0b1420;
  --good: #3fbf72; --good-soft: #15291d; --bad: #f07070; --bad-soft: #351919; --warn: #e8a83a; --warn-soft: #33270f;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #0ca30c; --s7: #9085e9; --s8: #e66767;
  --grid: #2a2b30; --heat: 57, 135, 229;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); font-size: 14px; line-height: 1.55; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.3; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.num, td.n, th.n { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- layout */
.app { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar); background: var(--surface); border-inline-start: 1px solid var(--border); position: fixed; inset-block: 0; inset-inline-start: 0; overflow-y: auto; z-index: 40; display: flex; flex-direction: column; }
.main-col { flex: 1; min-width: 0; margin-inline-start: var(--sidebar); display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; color: var(--text); text-decoration: none !important; border-bottom: 1px solid var(--border); }
.brand strong { display: block; font-size: 15px; }
.brand small { color: var(--text-3); font-size: 11.5px; letter-spacing: .3px; }
.logo-mark { width: 36px; height: 36px; border-radius: 9px; background: var(--brand); display: grid; place-items: center; }
.logo-mark svg { width: 22px; height: 22px; fill: #fff; stroke: none; }
.nav { padding: 10px 10px 30px; }
.nav-group { margin-top: 14px; }
.nav-group > span { display: block; font-size: 11.5px; font-weight: 600; color: var(--text-3); padding: 4px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--text-2); font-size: 13.5px; text-decoration: none; }
.nav a svg { width: 17px; height: 17px; color: var(--text-3); }
.nav a:hover { background: var(--surface-3); color: var(--text); }
.nav a.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.nav a.active svg { color: var(--brand); }
.topbar { position: sticky; top: 0; z-index: 30; height: 58px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 14px; padding: 0 22px; }
.top-title { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-meta { margin-inline-start: auto; color: var(--text-3); font-size: 12.5px; white-space: nowrap; }
.menu-btn { display: none; }
.user-menu { position: relative; }
.user-btn { display: flex; align-items: center; gap: 8px; background: none; border: 1px solid var(--border); border-radius: 999px; padding: 3px 4px 3px 12px; cursor: pointer; color: var(--text); font: inherit; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-weight: 600; font-size: 13px; }
.dropdown { position: absolute; inset-inline-end: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.12); min-width: 190px; padding: 6px; z-index: 50; }
.dropdown a { display: block; padding: 8px 10px; border-radius: 6px; color: var(--text); }
.dropdown a:hover { background: var(--surface-3); text-decoration: none; }
.content { padding: 22px; max-width: 1680px; width: 100%; margin: 0 auto; }
.backdrop { display: none; }

@media (max-width: 1000px) {
  .sidebar { transform: translateX(100%); transition: transform .2s; box-shadow: none; }
  .sidebar.open { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.25); }
  .backdrop.show { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 35; }
  .main-col { margin-inline-start: 0; }
  .menu-btn { display: grid; }
  .top-meta, .uname { display: none; }
  .content { padding: 16px; }
  .topbar { padding: 0 16px; }
}

/* ---------------------------------------------------------------- page header */
.page-head { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h1 { font-size: 21px; }
.page-head p { margin: 4px 0 0; color: var(--text-2); font-size: 13.5px; max-width: 760px; }
.page-head .sheet-tag { display: inline-block; margin-top: 6px; font-size: 12px; color: var(--text-3); }
.page-actions { margin-inline-start: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------------------------------------------------------------- controls */
.btn { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; font-size: 13.5px; font-weight: 500; cursor: pointer; white-space: nowrap; text-decoration: none !important; }
.btn svg { width: 17px; height: 17px; }
.btn:hover { background: var(--surface-3); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: var(--brand-2); }
.btn-danger { color: var(--bad); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn-block { width: 100%; justify-content: center; height: 42px; font-size: 15px; }
.icon-btn { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; border: 0; background: none; color: var(--text-2); cursor: pointer; }
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
input, select, textarea { font: inherit; color: var(--text); }
.input, select.input { height: 36px; border: 1px solid var(--border-strong); border-radius: 8px; padding: 0 10px; background: var(--surface); min-width: 0; }
.input:focus, select.input:focus, .ms-btn:focus-visible, .btn:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 1px; }
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 5px; font-weight: 500; }
.field input, .field select { width: 100%; height: 40px; border: 1px solid var(--border-strong); border-radius: 8px; padding: 0 12px; background: var(--surface); }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: var(--surface); padding: 0 12px; height: 34px; font: inherit; font-size: 13px; cursor: pointer; color: var(--text-2); }
.seg button + button { border-inline-start: 1px solid var(--border-strong); }
.seg button.on { background: var(--brand); color: var(--brand-ink); }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); cursor: pointer; }

/* ---------------------------------------------------------------- filter bar */
.filters { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; margin-bottom: 16px; box-shadow: var(--shadow); }
.filters-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filters-more { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; padding-top: 10px; border-top: 1px dashed var(--border); }
.f-label { font-size: 12px; color: var(--text-3); margin-inline-end: 2px; }
.date-range { display: inline-flex; align-items: center; gap: 6px; }
.date-range input { height: 34px; border: 1px solid var(--border-strong); border-radius: 8px; padding: 0 8px; background: var(--surface); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { display: inline-flex; align-items: center; gap: 4px; background: var(--brand-soft); color: var(--brand); border-radius: 999px; padding: 2px 4px 2px 10px; font-size: 12px; }
.chip button { border: 0; background: none; color: inherit; cursor: pointer; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; padding: 0; }
.chip button:hover { background: rgba(0,0,0,.08); }
.chip button svg { width: 12px; height: 12px; }
.cur-note { font-size: 12px; color: var(--warn); background: var(--warn-soft); padding: 4px 10px; border-radius: 6px; }

/* multi-select */
.ms { position: relative; }
.ms-btn { height: 34px; display: inline-flex; align-items: center; gap: 6px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; font-size: 13px; cursor: pointer; max-width: 240px; }
.ms-btn .lbl { color: var(--text-3); }
.ms-btn .val { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.ms-btn.has { border-color: var(--brand-2); background: var(--brand-soft); }
.ms-btn svg { width: 14px; height: 14px; color: var(--text-3); }
.ms-pop { position: absolute; top: calc(100% + 4px); inset-inline-start: 0; z-index: 60; width: 300px; max-width: calc(100vw - 32px); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 12px 30px rgba(0,0,0,.16); padding: 8px; }
.ms-pop input[type=search] { width: 100%; height: 34px; border: 1px solid var(--border-strong); border-radius: 7px; padding: 0 10px; background: var(--surface); }
.ms-tools { display: flex; gap: 6px; margin: 6px 0; font-size: 12px; }
.ms-tools button { border: 0; background: var(--surface-3); border-radius: 6px; padding: 3px 8px; cursor: pointer; font: inherit; font-size: 12px; color: var(--text-2); }
.ms-list { max-height: 280px; overflow-y: auto; }
.ms-list label { display: flex; gap: 8px; align-items: center; padding: 5px 6px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.ms-list label:hover { background: var(--surface-3); }
.ms-list .more { color: var(--text-3); font-size: 12px; padding: 6px; }

/* ---------------------------------------------------------------- cards / KPI */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px 6px; flex-wrap: wrap; }
.card-head h3 { font-size: 15px; }
.card-head .sub { color: var(--text-3); font-size: 12.5px; }
.card-head .tools { margin-inline-start: auto; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.card-body { padding: 10px 16px 16px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1100px) { .g2, .g3 { grid-template-columns: minmax(0, 1fr); } }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.kpi .k-label { color: var(--text-2); font-size: 12.5px; }
.kpi .k-value { font-size: 24px; font-weight: 600; margin-top: 2px; font-variant-numeric: tabular-nums; letter-spacing: -.2px; }
.kpi .k-unit { font-size: 13px; color: var(--text-3); font-weight: 500; margin-inline-start: 4px; }
.kpi .k-delta { font-size: 12px; margin-top: 4px; display: flex; align-items: center; gap: 4px; color: var(--text-3); }
.delta-up { color: var(--good) !important; }
.delta-down { color: var(--bad) !important; }
.chart-box { position: relative; height: 320px; }
.chart-box.tall { height: 420px; }
.chart-box.short { height: 260px; }

/* ---------------------------------------------------------------- tables */
.tbl-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.tbl-tools .search { position: relative; }
.tbl-tools .search input { height: 34px; width: 260px; max-width: 70vw; border: 1px solid var(--border-strong); border-radius: 8px; padding: 0 34px 0 10px; background: var(--surface); }
.tbl-tools .search svg { position: absolute; inset-inline-start: 9px; top: 8px; width: 17px; height: 17px; color: var(--text-3); }
.tbl-tools .count { color: var(--text-3); font-size: 12.5px; }
.tbl-tools .right { margin-inline-start: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.tbl-wrap { overflow: auto; max-height: 72vh; }
table.data { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13px; }
table.data th, table.data td { padding: 7px 12px; border-bottom: 1px solid var(--border); text-align: start; white-space: nowrap; }
table.data thead th { position: sticky; top: 0; background: var(--surface-2); z-index: 2; font-weight: 600; color: var(--text-2); font-size: 12.5px; border-bottom: 1px solid var(--border-strong); }
table.data thead tr:nth-child(2) th { top: 35px; }
table.data th.sortable { cursor: pointer; user-select: none; }
table.data th.sortable:hover { color: var(--text); }
table.data th .arrow { font-size: 10px; color: var(--brand-2); margin-inline-start: 3px; }
table.data td.n, table.data th.n { text-align: end; }
table.data th.grp { text-align: center; border-inline-start: 1px solid var(--border-strong); }
table.data td.cs, table.data th.cs { border-inline-start: 1px solid var(--border-strong); }
table.data tbody tr:hover td { background: var(--surface-3); }
table.data tr.lvl0 td { background: var(--surface-2); font-weight: 600; }
table.data tr.lvl1 td:first-child { padding-inline-start: 30px; }
table.data tr.lvl2 td:first-child { padding-inline-start: 50px; }
table.data tr.lvl3 td:first-child { padding-inline-start: 70px; }
table.data tr.total td { background: var(--surface-3); font-weight: 700; position: sticky; bottom: 0; border-top: 1px solid var(--border-strong); }
table.data td.label { max-width: 420px; overflow: hidden; text-overflow: ellipsis; }
table.data td .tog { border: 0; background: none; cursor: pointer; color: var(--text-3); padding: 0 2px; margin-inline-end: 4px; font-size: 11px; width: 16px; }
table.data td a.drill { color: inherit; }
table.data td a.drill:hover { color: var(--brand-2); }
table.data td.pos { color: var(--good); }
table.data td.neg { color: var(--bad); }
.bar-cell { position: relative; }
.bar-cell .b { position: absolute; inset-block: 6px; inset-inline-end: 0; background: var(--brand-soft); border-radius: 3px; z-index: 0; }
.bar-cell span { position: relative; z-index: 1; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; }
.b-A, .b-good { background: var(--good-soft); color: var(--good); }
.b-B, .b-warn { background: var(--warn-soft); color: var(--warn); }
.b-C, .b-bad { background: var(--bad-soft); color: var(--bad); }
.b-info { background: var(--brand-soft); color: var(--brand); }
.b-mute { background: var(--surface-3); color: var(--text-2); }
.pager { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.pager .info { color: var(--text-3); font-size: 12.5px; margin-inline-end: auto; }
.empty { padding: 40px; text-align: center; color: var(--text-3); }

/* ---------------------------------------------------------------- misc */
.alert { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 13.5px; }
.alert-error { background: var(--bad-soft); color: var(--bad); }
.alert-info { background: var(--brand-soft); color: var(--brand); }
.alert-warn { background: var(--warn-soft); color: var(--warn); }
.alert-ok { background: var(--good-soft); color: var(--good); }
.spinner { width: 26px; height: 26px; border: 3px solid var(--border); border-top-color: var(--brand-2); border-radius: 50%; display: inline-block; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-page { display: grid; place-items: center; min-height: 50vh; }
.loading { position: relative; min-height: 120px; }
.loading::after { content: ''; position: absolute; inset: 0; background: color-mix(in srgb, var(--surface) 60%, transparent); z-index: 5; }
.loading::before { content: ''; position: absolute; top: 50%; left: 50%; width: 26px; height: 26px; margin: -13px; border: 3px solid var(--border); border-top-color: var(--brand-2); border-radius: 50%; animation: spin .8s linear infinite; z-index: 6; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(20px); background: #1f2329; color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 13.5px; opacity: 0; transition: .2s; pointer-events: none; z-index: 100; max-width: 90vw; }
.toast.show { opacity: 1; transform: translateX(-50%); }
.toast.err { background: var(--bad); }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 90; display: grid; place-items: center; padding: 16px; }
.modal-card { background: var(--surface); border-radius: 12px; width: min(1100px, 100%); max-height: 90vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal-head { display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-size: 16px; }
.modal-head .icon-btn { margin-inline-start: auto; }
.modal-body { padding: 16px; overflow: auto; }
.modal-card.sm { width: min(520px, 100%); }
.progress { height: 10px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.progress > div { height: 100%; background: var(--brand-2); transition: width .3s; }
.dropzone { display: block; border: 2px dashed var(--border-strong); border-radius: 12px; padding: 40px 20px; text-align: center; background: var(--surface-2); cursor: pointer; transition: .15s; }
.dropzone:hover, .dropzone.over { border-color: var(--brand-2); background: var(--brand-soft); }
.dropzone svg { width: 40px; height: 40px; color: var(--brand-2); }
.dropzone h3 { margin-top: 8px; font-size: 16px; }
.dropzone p { color: var(--text-3); margin: 6px 0 0; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--text-2); margin-bottom: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 6px; vertical-align: -1px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 13px; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; }
.muted { color: var(--text-3); }
.small { font-size: 12.5px; }
.row-gap { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.mt { margin-top: 16px; }
.mb { margin-bottom: 16px; }

/* ---------------------------------------------------------------- login */
.login-body { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(1200px 600px at 80% -10%, var(--brand-soft), transparent), var(--bg); }
.login-wrap { width: min(420px, calc(100vw - 32px)); }
.login-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 28px; box-shadow: 0 10px 40px rgba(16,24,40,.08); }
.login-brand { display: flex; gap: 12px; align-items: center; margin-bottom: 22px; }
.login-brand .logo-mark { width: 46px; height: 46px; border-radius: 12px; }
.login-brand h1 { font-size: 19px; }
.login-brand p { margin: 2px 0 0; color: var(--text-3); font-size: 13px; }
.login-foot { text-align: center; color: var(--text-3); font-size: 12px; margin-top: 14px; }

/* ---------------------------------------------------------------- PDF stage (offscreen render target) */
.pdf-stage { position: fixed; top: 0; left: -20000px; width: 1123px; background: #fff; color: #111; z-index: -1; }
.pdf-page { width: 1123px; height: 794px; padding: 34px 38px 30px; background: #fff; color: #111; display: flex; flex-direction: column; font-family: var(--font); direction: rtl; overflow: hidden; }
.pdf-head { display: flex; align-items: flex-start; gap: 14px; border-bottom: 2px solid #0f4c81; padding-bottom: 10px; margin-bottom: 12px; }
.pdf-head h2 { font-size: 20px; color: #0f4c81; }
.pdf-head .meta { font-size: 11.5px; color: #555; margin-top: 4px; }
.pdf-head .brand-r { margin-inline-start: auto; text-align: end; font-size: 11.5px; color: #555; }
.pdf-filters { font-size: 11px; color: #444; margin-bottom: 10px; line-height: 1.6; }
.pdf-body { flex: 1; overflow: hidden; }
.pdf-body img { max-width: 100%; display: block; margin: 0 auto 10px; }
.pdf-body table { border-collapse: collapse; width: 100%; font-size: 11px; }
.pdf-body th, .pdf-body td { border: 1px solid #d5d9df; padding: 4px 7px; white-space: nowrap; text-align: start; color: #111; background: #fff; }
.pdf-body th { background: #eef2f7; font-weight: 600; }
.pdf-body td.n, .pdf-body th.n { text-align: end; }
.pdf-body tr.lvl0 td { background: #f3f5f8; font-weight: 600; }
.pdf-body tr.total td { background: #e6ebf2; font-weight: 700; }
.pdf-body td.label { max-width: 360px; overflow: hidden; text-overflow: ellipsis; }
.pdf-body .b { display: none; }
.pdf-foot { display: flex; font-size: 10.5px; color: #777; border-top: 1px solid #ddd; padding-top: 6px; margin-top: 6px; }
.pdf-foot span:last-child { margin-inline-start: auto; }

@media print {
  .sidebar, .topbar, .filters, .tbl-tools, .page-actions, .pager, .backdrop { display: none !important; }
  .main-col { margin: 0; }
  .content { padding: 0; max-width: none; }
  .tbl-wrap { max-height: none; overflow: visible; }
  .card { box-shadow: none; border: 0; }
  table.data thead th, table.data tr.total td { position: static; }
}
