@charset "UTF-8";
/* ============================================================================
   Hesabdare — Design System
   RTL-first, Persian, light + dark. Hand-built; no framework, no build step.
   ========================================================================= */

/* ---------- Fonts ---------- */
@font-face {
  font-family: 'Vazirmatn';
  src: url('fonts/Vazirmatn-Regular.woff2') format('woff2');
  font-weight: 400; font-display: swap; font-style: normal;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('fonts/Vazirmatn-Medium.woff2') format('woff2');
  font-weight: 500; font-display: swap; font-style: normal;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('fonts/Vazirmatn-SemiBold.woff2') format('woff2');
  font-weight: 600; font-display: swap; font-style: normal;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('fonts/Vazirmatn-Bold.woff2') format('woff2');
  font-weight: 700; font-display: swap; font-style: normal;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('fonts/Vazirmatn-ExtraBold.woff2') format('woff2');
  font-weight: 800; font-display: swap; font-style: normal;
}

/* ============================================================================
   1. Tokens
   ========================================================================= */
:root {
  /* brand — deep emerald, the colour of ledger ink */
  --brand-50:  #eef7f3;
  --brand-100: #d4ece1;
  --brand-200: #a9d8c5;
  --brand-300: #74bda3;
  --brand-400: #429e81;
  --brand-500: #1e8a6e;
  --brand-600: #16705a;
  --brand-700: #115743;
  --brand-800: #0c3b2e;
  --brand-900: #07271f;
  --brand-950: #041713;

  /* accent — brass, for money and highlights */
  --gold-50:  #fdf9ee;
  --gold-100: #f7ecd0;
  --gold-200: #eed9a2;
  --gold-300: #e0c069;
  --gold-400: #d0a63f;
  --gold-500: #c29428;
  --gold-600: #a87b1c;
  --gold-700: #855f18;

  /* semantic */
  --ok:      #157f5f;   --ok-bg:      #e2f3ec;   --ok-border:      #b6e0d0;
  --warn:    #a3720c;   --warn-bg:    #fdf3dd;   --warn-border:    #f0dcab;
  --danger:  #b53d29;   --danger-bg:  #fbeae6;   --danger-border:  #f2c9bf;
  --info:    #2b5fa8;   --info-bg:    #e8f0fb;   --info-border:    #c3d7f2;

  /* surfaces */
  --bg:            #f4f5f3;
  --bg-subtle:     #eceeea;
  --surface:       #ffffff;
  --surface-2:     #fafbf9;
  --surface-hover: #f5f7f4;
  --line:          #e3e6e0;
  --line-strong:   #cfd4cb;

  /* text */
  --ink:        #16211d;
  --ink-2:      #3d4a44;
  --muted:      #6b7872;
  --muted-2:    #93a09a;
  --on-brand:   #ffffff;

  /* sidebar */
  --side-bg-a:   #07271f;
  --side-bg-b:   #0b3628;
  --side-ink:    #c3d5cd;
  --side-ink-2:  #7d998e;
  --side-active: rgba(255,255,255,.10);
  --side-line:   rgba(255,255,255,.09);

  /* geometry */
  --r-sm: 8px;  --r: 12px;  --r-lg: 16px;  --r-xl: 22px;  --r-full: 999px;

  /* elevation */
  --sh-1: 0 1px 2px rgba(16,32,26,.05);
  --sh-2: 0 1px 2px rgba(16,32,26,.05), 0 4px 12px rgba(16,32,26,.05);
  --sh-3: 0 2px 4px rgba(16,32,26,.05), 0 12px 28px rgba(16,32,26,.09);
  --sh-4: 0 8px 20px rgba(16,32,26,.10), 0 24px 60px rgba(16,32,26,.14);

  --side-w: 258px;
  --header-h: 62px;
  --ease: cubic-bezier(.4,0,.2,1);
}

[data-theme="dark"] {
  --bg:            #0d1512;
  --bg-subtle:     #111c18;
  --surface:       #14201b;
  --surface-2:     #182a23;
  --surface-hover: #1b2f27;
  --line:          #22332b;
  --line-strong:   #2f4539;

  --ink:      #e6ede9;
  --ink-2:    #bccbc4;
  --muted:    #8ba096;
  --muted-2:  #6a7d74;

  --ok:      #4bbd93;   --ok-bg:      #0f2a22;   --ok-border:      #1d4438;
  --warn:    #dfae4a;   --warn-bg:    #2b2313;   --warn-border:    #4a3d1d;
  --danger:  #e07a63;   --danger-bg:  #2d1712;   --danger-border:  #4d2a21;
  --info:    #6fa3e8;   --info-bg:    #131f30;   --info-border:    #24384f;

  --brand-50:  #0f2a22;
  --brand-100: #143529;

  --side-bg-a: #061b15;
  --side-bg-b: #08241c;
  --side-ink:  #b6cbc2;

  --sh-1: 0 1px 2px rgba(0,0,0,.30);
  --sh-2: 0 1px 2px rgba(0,0,0,.30), 0 4px 12px rgba(0,0,0,.26);
  --sh-3: 0 2px 4px rgba(0,0,0,.30), 0 12px 28px rgba(0,0,0,.36);
  --sh-4: 0 8px 20px rgba(0,0,0,.40), 0 24px 60px rgba(0,0,0,.50);
}

/* ============================================================================
   2. Reset & base
   ========================================================================= */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Vazirmatn', 'Segoe UI', Tahoma, system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'ss01';
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { max-width: 100%; display: block; }
table { border-collapse: collapse; width: 100%; }
summary { cursor: pointer; list-style: none; }
summary::-webkit-details-marker { display: none; }

h1, h2, h3, h4 { font-weight: 700; line-height: 1.45; }
h1 { font-size: 19px; } h2 { font-size: 15.5px; } h3 { font-size: 14px; }

::selection { background: var(--brand-200); color: var(--brand-900); }

:focus-visible {
  outline: 2px solid var(--brand-500);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Latin numerals stay LTR inside RTL text, and line up in columns */
.num {
  font-variant-numeric: tabular-nums;
  direction: ltr;
  unicode-bidi: isolate;
  display: inline-block;
}

.mono { font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: .92em; }

/* scrollbars */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 99px; border: 3px solid var(--bg); }
*::-webkit-scrollbar-thumb:hover { background: var(--muted-2); }

/* ============================================================================
   3. App shell
   ========================================================================= */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--side-w);
  flex-shrink: 0;
  background: linear-gradient(170deg, var(--side-bg-a), var(--side-bg-b) 60%, var(--side-bg-a));
  color: var(--side-ink);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 40;
}

.sidebar__brand {
  display: flex; align-items: center; gap: 11px;
  padding: 17px 18px;
  border-bottom: 1px solid var(--side-line);
}
.sidebar__logo {
  width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0;
  background: linear-gradient(140deg, var(--gold-400), var(--gold-600));
  display: grid; place-items: center;
  color: #2a1e05; font-weight: 800; font-size: 19px;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.sidebar__title { min-width: 0; }
.sidebar__title b { display: block; color: #fff; font-size: 15.5px; line-height: 1.4; }
.sidebar__title span { display: block; color: var(--side-ink-2); font-size: 11px; line-height: 1.3; }

.sidebar__nav { flex: 1; overflow-y: auto; padding: 10px 10px 18px; }
.sidebar__nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-color: transparent; }

.nav-group {
  font-size: 10.5px; font-weight: 600; letter-spacing: .07em;
  color: var(--side-ink-2); text-transform: uppercase;
  padding: 15px 10px 6px;
}
.nav-group:first-child { padding-top: 6px; }

.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; margin-bottom: 1px;
  border-radius: 9px;
  font-size: 13.5px; color: var(--side-ink);
  transition: background .14s var(--ease), color .14s var(--ease);
  position: relative;
}
.nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-link.is-active { background: var(--side-active); color: #fff; font-weight: 600; }
.nav-link.is-active::before {
  content: ''; position: absolute; inset-inline-end: -10px; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 20px; border-radius: 3px 0 0 3px;
  background: var(--gold-400);
}
.nav-link__icon { width: 18px; height: 18px; flex-shrink: 0; opacity: .82; }
.nav-link.is-active .nav-link__icon { opacity: 1; }
.nav-link__badge {
  margin-inline-start: auto;
  background: var(--danger); color: #fff;
  font-size: 10.5px; font-weight: 700;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 99px; display: grid; place-items: center;
}
.nav-link__badge.is-muted { background: rgba(255,255,255,.14); color: var(--side-ink); }

.sidebar__foot { padding: 12px; border-top: 1px solid var(--side-line); }

.side-user {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 9px; border-radius: 10px;
  background: rgba(255,255,255,.05);
}
.side-user__avatar {
  width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0;
  background: linear-gradient(140deg, var(--brand-400), var(--brand-600));
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 12.5px;
}
.side-user__meta { min-width: 0; flex: 1; }
.side-user__meta b { display: block; color: #fff; font-size: 12.5px; font-weight: 600; line-height: 1.4;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user__meta span { display: block; color: var(--side-ink-2); font-size: 10.5px; line-height: 1.3; }
.side-user__out {
  background: none; border: 0; cursor: pointer; padding: 5px;
  color: var(--side-ink-2); border-radius: 7px; display: grid; place-items: center;
}
.side-user__out:hover { background: rgba(255,255,255,.09); color: #fff; }

/* main column */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: var(--header-h);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 14px;
  padding: 0 22px;
  position: sticky; top: 0; z-index: 30;
}
.topbar__title { min-width: 0; flex-shrink: 0; }
.topbar__title h1 { font-size: 16.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar__title p { font-size: 11.5px; color: var(--muted); line-height: 1.3; margin-top: -2px; }
.topbar__spacer { flex: 1; }
.topbar__actions { display: flex; align-items: center; gap: 8px; }

.icon-btn {
  width: 36px; height: 36px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface);
  display: grid; place-items: center; cursor: pointer;
  color: var(--ink-2); position: relative;
  transition: background .14s var(--ease), border-color .14s var(--ease), color .14s var(--ease);
}
.icon-btn:hover { background: var(--surface-hover); border-color: var(--line-strong); color: var(--ink); }
.icon-btn__dot {
  position: absolute; top: 6px; inset-inline-end: 6px;
  min-width: 15px; height: 15px; padding: 0 4px;
  background: var(--danger); color: #fff;
  border-radius: 99px; font-size: 9.5px; font-weight: 700;
  display: grid; place-items: center; border: 2px solid var(--surface);
  line-height: 1;
}

.menu-toggle { display: none; }

.content { flex: 1; padding: 22px; max-width: 1560px; width: 100%; }

/* ============================================================================
   4. Search
   ========================================================================= */
.search {
  position: relative; flex: 1; max-width: 400px;
}
.search input {
  width: 100%; height: 36px;
  padding: 0 36px 0 12px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg-subtle); font-size: 13px;
  transition: border-color .14s var(--ease), background .14s var(--ease);
}
.search input:focus { outline: none; border-color: var(--brand-400); background: var(--surface);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-400) 15%, transparent); }
.search__icon {
  position: absolute; inset-inline-start: 11px; top: 50%; transform: translateY(-50%);
  color: var(--muted-2); pointer-events: none; width: 16px; height: 16px;
}
.search input::placeholder { color: var(--muted-2); }

/* ============================================================================
   5. Buttons
   ========================================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 15px;
  border: 1px solid transparent; border-radius: 10px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  white-space: nowrap; user-select: none;
  transition: background .14s var(--ease), border-color .14s var(--ease),
              color .14s var(--ease), box-shadow .14s var(--ease), transform .08s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn.is-disabled { opacity: .5; pointer-events: none; }
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.btn--primary { background: var(--brand-600); color: #fff; box-shadow: var(--sh-1); }
.btn--primary:hover { background: var(--brand-700); }

.btn--ghost { background: var(--surface); border-color: var(--line); color: var(--ink-2); }
.btn--ghost:hover { background: var(--surface-hover); border-color: var(--line-strong); color: var(--ink); }

.btn--subtle { background: var(--bg-subtle); color: var(--ink-2); }
.btn--subtle:hover { background: var(--line); }

.btn--gold { background: var(--gold-500); color: #2a1e05; }
.btn--gold:hover { background: var(--gold-600); color: #fff; }

.btn--danger { background: var(--danger); color: #fff; }
.btn--danger:hover { filter: brightness(.92); }

.btn--danger-ghost { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-border); }
.btn--danger-ghost:hover { background: color-mix(in srgb, var(--danger-bg) 70%, var(--danger) 12%); }

.btn--sm { height: 30px; padding: 0 11px; font-size: 12px; border-radius: 8px; }
.btn--sm svg { width: 14px; height: 14px; }
.btn--lg { height: 42px; padding: 0 22px; font-size: 14px; border-radius: 11px; }
.btn--block { width: 100%; }
.btn--icon { width: 36px; padding: 0; }
.btn--sm.btn--icon { width: 30px; }

.btn-group { display: inline-flex; gap: 6px; flex-wrap: wrap; }

/* ============================================================================
   6. Cards
   ========================================================================= */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
  overflow: hidden;
}
.card + .card, .card + .grid, .grid + .card, .grid + .grid, .card + .kpis, .kpis + .card { margin-top: 18px; }

.card__head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.card__head h2 { font-size: 14.5px; }
.card__head p { font-size: 11.5px; color: var(--muted); line-height: 1.4; }
.card__head-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 7px; flex-shrink: 0; }
.card__body { padding: 18px; }
.card__body--tight { padding: 12px 18px; }
.card__foot {
  padding: 12px 18px; border-top: 1px solid var(--line);
  background: var(--surface-2);
  display: flex; align-items: center; gap: 10px;
}

/* ============================================================================
   7. Layout grids
   ========================================================================= */
.grid { display: grid; gap: 18px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.grid--2-1 { grid-template-columns: 2fr 1fr; }
.grid--1-2 { grid-template-columns: 1fr 2fr; }
.grid--3-2 { grid-template-columns: 3fr 2fr; }

.stack { display: flex; flex-direction: column; gap: 18px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.row--end { justify-content: flex-end; }
.row--tight { gap: 6px; }

/* ============================================================================
   8. KPI tiles
   ========================================================================= */
.kpis { display: grid; gap: 14px; grid-template-columns: repeat(4, minmax(0,1fr)); }
.kpis--3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.kpis--5 { grid-template-columns: repeat(5, minmax(0,1fr)); }
.kpis--2 { grid-template-columns: repeat(2, minmax(0,1fr)); }

.kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 15px 16px;
  box-shadow: var(--sh-1);
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: 3px;
  min-height: 104px;
}
.kpi::before {
  content: ''; position: absolute; inset-block: 0; inset-inline-start: 0;
  width: 3px; background: var(--kpi-c, var(--brand-500));
}
.kpi__top { display: flex; align-items: flex-start; gap: 8px; }
.kpi__label { font-size: 12px; color: var(--muted); font-weight: 500; line-height: 1.5; }
.kpi__icon {
  margin-inline-start: auto; width: 30px; height: 30px; border-radius: 9px; flex-shrink: 0;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--kpi-c, var(--brand-500)) 12%, transparent);
  color: var(--kpi-c, var(--brand-500));
}
.kpi__icon svg { width: 16px; height: 16px; }
.kpi__value {
  font-size: 21px; font-weight: 800; line-height: 1.35; letter-spacing: -.01em;
  color: var(--ink);
}
.kpi__value small { font-size: 11.5px; font-weight: 500; color: var(--muted); margin-inline-start: 3px; }
.kpi__meta { font-size: 11.5px; color: var(--muted); margin-top: auto; display: flex; align-items: center; gap: 5px; }
.kpi__delta { font-weight: 600; font-size: 11.5px; display: inline-flex; align-items: center; gap: 2px; }
.kpi__delta.up { color: var(--ok); }
.kpi__delta.down { color: var(--danger); }
.kpi__spark { position: absolute; inset-inline-end: 0; bottom: 0; opacity: .16; pointer-events: none; }

.kpi--hero {
  background: linear-gradient(150deg, var(--brand-700), var(--brand-900));
  border-color: var(--brand-800);
  color: #fff;
}
.kpi--hero::before { background: var(--gold-400); }
.kpi--hero .kpi__label { color: var(--brand-200); }
.kpi--hero .kpi__value { color: #fff; }
.kpi--hero .kpi__value small { color: var(--brand-200); }
.kpi--hero .kpi__meta { color: var(--brand-200); }
.kpi--hero .kpi__icon { background: rgba(255,255,255,.12); color: var(--gold-300); }

/* ============================================================================
   9. Tables
   ========================================================================= */
.table-wrap { overflow-x: auto; }

table.data { font-size: 13px; }
table.data thead th {
  font-size: 11.5px; font-weight: 600; color: var(--muted);
  text-align: start; padding: 10px 14px; white-space: nowrap;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 1;
}
table.data tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr { transition: background .12s var(--ease); }
table.data tbody tr:hover td { background: var(--surface-hover); }
table.data tbody tr.is-muted td { opacity: .55; }
table.data .t-end { text-align: end; }
table.data .t-center { text-align: center; }
table.data .t-num { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data td.actions { text-align: end; white-space: nowrap; width: 1%; }

.table--compact tbody td { padding: 8px 12px; }
.table--compact thead th { padding: 8px 12px; }

.cell-main { font-weight: 600; color: var(--ink); }
.cell-sub { font-size: 11.5px; color: var(--muted); line-height: 1.5; }

.amount { font-variant-numeric: tabular-nums; font-weight: 700; direction: ltr; unicode-bidi: isolate; display: inline-block; }
.amount--in  { color: var(--ok); }
.amount--out { color: var(--danger); }
.amount--muted { color: var(--muted); font-weight: 600; }

/* ============================================================================
   10. Badges & chips
   ========================================================================= */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; font-weight: 600; line-height: 1.6;
  padding: 2px 9px; border-radius: var(--r-full);
  border: 1px solid transparent; white-space: nowrap;
}
.badge--ok     { background: var(--ok-bg);     color: var(--ok);     border-color: var(--ok-border); }
.badge--warn   { background: var(--warn-bg);   color: var(--warn);   border-color: var(--warn-border); }
.badge--danger { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-border); }
.badge--info   { background: var(--info-bg);   color: var(--info);   border-color: var(--info-border); }
.badge--gold   { background: var(--gold-100);  color: var(--gold-700); border-color: var(--gold-200); }
.badge--gray   { background: var(--bg-subtle); color: var(--muted);  border-color: var(--line); }
.badge--brand  { background: var(--brand-50);  color: var(--brand-600); border-color: var(--brand-100); }
.badge__dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px 3px 4px; border-radius: var(--r-full);
  background: var(--bg-subtle); border: 1px solid var(--line);
  font-size: 12px; font-weight: 500;
}
.chip__avatar {
  width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center; color: #fff;
  font-size: 9.5px; font-weight: 700; flex-shrink: 0;
}
.chip--remove { padding-inline-end: 4px; }
.chip__x { background: none; border: 0; cursor: pointer; color: var(--muted); display: grid; padding: 2px; border-radius: 50%; }
.chip__x:hover { background: var(--line); color: var(--ink); }

.avatar {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center; flex-shrink: 0;
  color: #fff; font-weight: 700; font-size: 13px;
}
.avatar--sm { width: 26px; height: 26px; border-radius: 8px; font-size: 11px; }
.avatar--lg { width: 46px; height: 46px; border-radius: 13px; font-size: 17px; }

/* ============================================================================
   11. Forms
   ========================================================================= */
.form-grid { display: grid; gap: 15px; grid-template-columns: repeat(2, minmax(0,1fr)); }
.form-grid--3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.form-grid--1 { grid-template-columns: 1fr; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.span-full { grid-column: 1 / -1; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field__label {
  font-size: 12.5px; font-weight: 600; color: var(--ink-2);
  display: flex; align-items: center; gap: 5px;
}
.field__label .req { color: var(--danger); }
.field__hint { font-size: 11.5px; color: var(--muted); line-height: 1.55; }
.field__error { font-size: 11.5px; color: var(--danger); font-weight: 500; }

.input, .select, .textarea,
.field input[type=text], .field input[type=email], .field input[type=password],
.field input[type=number], .field input[type=date], .field input[type=tel],
.field input[type=url], .field select, .field textarea {
  width: 100%; height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--ink);
  font-size: 13.5px;
  transition: border-color .14s var(--ease), box-shadow .14s var(--ease), background .14s var(--ease);
}
.textarea, .field textarea { height: auto; min-height: 84px; padding: 9px 12px; line-height: 1.75; resize: vertical; }

.input:hover, .select:hover, .field input:hover, .field select:hover { border-color: var(--line-strong); }
.input:focus, .select:focus, .textarea:focus,
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--brand-500); background: var(--surface);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-500) 14%, transparent);
}
.input::placeholder, .textarea::placeholder, .field input::placeholder, .field textarea::placeholder { color: var(--muted-2); }
.input:disabled, .select:disabled, .field input:disabled { background: var(--bg-subtle); color: var(--muted); cursor: not-allowed; }
.input.is-invalid, .select.is-invalid, .field input.is-invalid { border-color: var(--danger); }

.select, .field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7872' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 12px center;
  padding-inline-end: 12px; padding-inline-start: 32px;
}

/* money input: big, tabular, with a unit suffix */
.money-field { position: relative; }
.money-field input {
  font-size: 16px; font-weight: 700; height: 44px;
  font-variant-numeric: tabular-nums; direction: ltr; text-align: end;
  padding-inline-start: 58px;
}
.money-field__unit {
  position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%);
  font-size: 12px; color: var(--muted); font-weight: 600; pointer-events: none;
}
.money-field__words {
  font-size: 11.5px; color: var(--brand-600); font-weight: 500;
  min-height: 18px; line-height: 1.5;
}

/* Jalali date input */
.date-field { position: relative; }
.date-field input { direction: ltr; text-align: start; font-variant-numeric: tabular-nums; padding-inline-end: 36px; }
.date-field__icon {
  position: absolute; inset-inline-end: 11px; top: 50%; transform: translateY(-50%);
  color: var(--muted-2); pointer-events: none;
}

/* Jalali calendar popup */
.datepicker {
  position: absolute; top: calc(100% + 6px); inset-inline-start: 0; z-index: 60;
  width: 262px; padding: 11px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--sh-3);
  animation: pop-in .14s var(--ease);
}
.dp__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
.dp__head b { font-size: 13px; font-weight: 600; }
.dp__nav {
  width: 26px; height: 26px; border-radius: 7px; border: 1px solid var(--line);
  background: var(--surface); cursor: pointer; color: var(--ink-2);
  display: grid; place-items: center; font-size: 16px; line-height: 1;
}
.dp__nav:hover { background: var(--surface-hover); }
.dp__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp__dow { font-size: 10.5px; color: var(--muted); text-align: center; padding: 3px 0; font-weight: 600; }
.dp__day {
  height: 30px; border: 0; background: none; border-radius: 7px; cursor: pointer;
  font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums;
  transition: background .12s var(--ease);
}
.dp__day:hover { background: var(--bg-subtle); }
.dp__day.is-today { color: var(--brand-600); font-weight: 700; box-shadow: inset 0 0 0 1px var(--brand-300); }
.dp__day.is-sel { background: var(--brand-600); color: #fff; font-weight: 700; }
.dp__foot { display: flex; gap: 6px; margin-top: 9px; padding-top: 9px; border-top: 1px solid var(--line); }
.dp__foot .btn { flex: 1; }

/* dropdown open state */
.dropdown .popover { display: none; }
.dropdown.is-open .popover { display: block; }

.is-copied { color: var(--ok) !important; }

.input-group { display: flex; }
.input-group .input:not(:last-child), .input-group .select:not(:last-child) {
  border-start-end-radius: 0; border-end-end-radius: 0; border-inline-end: 0;
}
.input-group .input:not(:first-child), .input-group .select:not(:first-child) {
  border-start-start-radius: 0; border-end-start-radius: 0;
}
.input-group__addon {
  display: grid; place-items: center; padding: 0 12px; height: 38px;
  background: var(--bg-subtle); border: 1px solid var(--line);
  font-size: 12.5px; color: var(--muted); white-space: nowrap;
}

/* switch */
.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch__track {
  width: 38px; height: 21px; border-radius: 99px; background: var(--line-strong);
  position: relative; transition: background .18s var(--ease); flex-shrink: 0;
}
.switch__track::after {
  content: ''; position: absolute; top: 2.5px; inset-inline-start: 2.5px;
  width: 16px; height: 16px; border-radius: 50%; background: #fff;
  transition: transform .18s var(--ease); box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.switch input:checked + .switch__track { background: var(--brand-500); }
.switch input:checked + .switch__track::after { transform: translateX(-17px); }
.switch__label { font-size: 13px; }

/* radio cards — used for choosing the transaction flow */
.radio-cards { display: grid; gap: 9px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.radio-card {
  position: relative; cursor: pointer;
  border: 1.5px solid var(--line); border-radius: 12px;
  padding: 11px 13px; background: var(--surface);
  transition: border-color .14s var(--ease), background .14s var(--ease), box-shadow .14s var(--ease);
  display: flex; align-items: flex-start; gap: 10px;
}
.radio-card:hover { border-color: var(--line-strong); background: var(--surface-hover); }
.radio-card input { position: absolute; opacity: 0; }
.radio-card__icon {
  width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0;
  display: grid; place-items: center; font-size: 15px;
  background: var(--bg-subtle); color: var(--muted);
  transition: background .14s var(--ease), color .14s var(--ease);
}
.radio-card__text b { display: block; font-size: 13px; font-weight: 600; line-height: 1.5; }
.radio-card__text span { display: block; font-size: 11px; color: var(--muted); line-height: 1.5; }
.radio-card:has(input:checked) {
  border-color: var(--brand-500);
  background: var(--brand-50);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-500) 11%, transparent);
}
.radio-card:has(input:checked) .radio-card__icon { background: var(--brand-500); color: #fff; }

/* segmented control */
.segmented {
  display: inline-flex; background: var(--bg-subtle);
  border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px;
}
.segmented a, .segmented button, .segmented label {
  padding: 5px 13px; border-radius: 7px; font-size: 12.5px; font-weight: 600;
  color: var(--muted); cursor: pointer; border: 0; background: none;
  transition: background .14s var(--ease), color .14s var(--ease);
  white-space: nowrap;
}
.segmented a:hover, .segmented button:hover { color: var(--ink); }
.segmented a.is-active, .segmented button.is-active, .segmented label:has(input:checked) {
  background: var(--surface); color: var(--brand-600); box-shadow: var(--sh-1);
}
.segmented input { position: absolute; opacity: 0; }

/* file drop */
.filedrop {
  border: 1.5px dashed var(--line-strong); border-radius: 12px;
  padding: 20px; text-align: center; cursor: pointer;
  background: var(--surface-2);
  transition: border-color .14s var(--ease), background .14s var(--ease);
}
.filedrop:hover, .filedrop.is-over { border-color: var(--brand-500); background: var(--brand-50); }
.filedrop input { display: none; }
.filedrop__icon { color: var(--muted-2); margin: 0 auto 7px; }
.filedrop b { display: block; font-size: 13px; font-weight: 600; }
.filedrop span { font-size: 11.5px; color: var(--muted); }
.filedrop__list { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }

/* ============================================================================
   12. Filter bar
   ========================================================================= */
.filters {
  display: flex; flex-wrap: wrap; gap: 9px; align-items: flex-end;
  padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--surface-2);
}
.filters .field { flex: 1 1 150px; min-width: 130px; gap: 4px; }
.filters .field > label { font-size: 11px; }
.filters .input, .filters .select { height: 34px; font-size: 12.5px; }
.filters__actions { display: flex; gap: 6px; flex-shrink: 0; }

.active-filters { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 18px; border-bottom: 1px solid var(--line); }

/* ============================================================================
   13. Alerts, empty, toast
   ========================================================================= */
.alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 14px; border-radius: 11px;
  border: 1px solid transparent; font-size: 13px; line-height: 1.65;
  margin-bottom: 16px;
}
.alert svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px; }
.alert b { font-weight: 600; }
.alert--ok     { background: var(--ok-bg);     color: var(--ok);     border-color: var(--ok-border); }
.alert--warn   { background: var(--warn-bg);   color: var(--warn);   border-color: var(--warn-border); }
.alert--danger { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-border); }
.alert--info   { background: var(--info-bg);   color: var(--info);   border-color: var(--info-border); }
.alert__close { margin-inline-start: auto; background: none; border: 0; cursor: pointer; color: inherit; opacity: .6; padding: 0; }
.alert__close:hover { opacity: 1; }

.empty { padding: 44px 24px; text-align: center; }
.empty__icon {
  width: 54px; height: 54px; margin: 0 auto 12px; border-radius: 16px;
  background: var(--bg-subtle); display: grid; place-items: center; color: var(--muted-2);
}
.empty b { display: block; font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.empty p { font-size: 12.5px; color: var(--muted); max-width: 340px; margin: 0 auto 14px; line-height: 1.75; }

.toasts { position: fixed; bottom: 20px; inset-inline-start: 20px; z-index: 200; display: flex; flex-direction: column; gap: 9px; }
.toast {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--sh-3);
  padding: 11px 14px; font-size: 13px; min-width: 260px; max-width: 400px;
  display: flex; align-items: flex-start; gap: 9px;
  animation: toast-in .28s var(--ease);
}
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) } to { opacity: 1; transform: none } }
.toast--ok     { border-inline-start: 3px solid var(--ok); }
.toast--danger { border-inline-start: 3px solid var(--danger); }

/* ============================================================================
   14. Modal / drawer
   ========================================================================= */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(9,20,16,.5);
  backdrop-filter: blur(3px); z-index: 100;
  display: grid; place-items: center; padding: 20px;
  animation: fade .18s var(--ease);
}
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
.modal {
  background: var(--surface); border-radius: var(--r-xl);
  box-shadow: var(--sh-4); width: 100%; max-width: 540px;
  max-height: 88vh; display: flex; flex-direction: column;
  animation: modal-in .24s var(--ease);
}
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(.98) } to { opacity: 1; transform: none } }
.modal--wide { max-width: 780px; }
.modal__head { padding: 17px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; }
.modal__head h2 { font-size: 15.5px; }
.modal__head p { font-size: 12px; color: var(--muted); }
.modal__close { margin-inline-start: auto; background: none; border: 0; cursor: pointer; color: var(--muted); padding: 4px; border-radius: 7px; }
.modal__close:hover { background: var(--bg-subtle); color: var(--ink); }
.modal__body { padding: 20px; overflow-y: auto; flex: 1; }
.modal__foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; background: var(--surface-2); }

/* ============================================================================
   15. Tabs
   ========================================================================= */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); padding: 0 18px; overflow-x: auto; }
.tabs a, .tabs button {
  padding: 11px 14px; font-size: 13px; font-weight: 600; color: var(--muted);
  border: 0; border-bottom: 2px solid transparent; background: none; cursor: pointer;
  white-space: nowrap; transition: color .14s var(--ease), border-color .14s var(--ease);
}
.tabs a:hover, .tabs button:hover { color: var(--ink); }
.tabs a.is-active, .tabs button.is-active { color: var(--brand-600); border-bottom-color: var(--brand-500); }

/* ============================================================================
   16. Pagination
   ========================================================================= */
.pagination { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.pagination a, .pagination span {
  min-width: 32px; height: 32px; padding: 0 9px;
  display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 8px;
  font-size: 12.5px; color: var(--ink-2); background: var(--surface);
  font-variant-numeric: tabular-nums;
}
.pagination a:hover { background: var(--surface-hover); border-color: var(--line-strong); }
.pagination .is-active, .pagination [aria-current] { background: var(--brand-600); color: #fff; border-color: var(--brand-600); font-weight: 600; }
.pagination .is-disabled { opacity: .4; pointer-events: none; }
.pagination svg { width: 14px; height: 14px; }
.page-info { font-size: 12px; color: var(--muted); }

/* ============================================================================
   17. Timeline
   ========================================================================= */
.timeline { position: relative; padding-inline-start: 26px; }
.timeline::before {
  content: ''; position: absolute; inset-inline-start: 7px; top: 6px; bottom: 6px;
  width: 2px; background: var(--line);
}
.timeline__item { position: relative; padding-bottom: 17px; }
.timeline__item:last-child { padding-bottom: 0; }
.timeline__dot {
  position: absolute; inset-inline-start: -26px; top: 3px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--surface); border: 2.5px solid var(--brand-400);
  z-index: 1;
}
.timeline__dot--gold   { border-color: var(--gold-500); }
.timeline__dot--danger { border-color: var(--danger); }
.timeline__dot--muted  { border-color: var(--line-strong); }
.timeline__body b { display: block; font-size: 13px; font-weight: 600; line-height: 1.6; }
.timeline__meta { font-size: 11.5px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; }

/* ============================================================================
   18. Partner settlement widget
   ========================================================================= */
.settle {
  background: linear-gradient(150deg, var(--brand-700), var(--brand-900));
  color: #fff; padding: 20px; text-align: center;
}
.settle__eyebrow { font-size: 11.5px; color: var(--brand-200); letter-spacing: .04em; }
.settle__headline { font-size: 15px; margin: 9px 0 4px; line-height: 1.7; }
.settle__amount {
  font-size: 27px; font-weight: 800; color: var(--gold-300);
  font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate;
  display: inline-block; letter-spacing: -.01em;
}
.settle__unit { font-size: 13px; color: var(--brand-200); font-weight: 500; }
.settle__flow { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 15px 0 4px; }
.settle__party { display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 76px; }
.settle__party .avatar { border: 2px solid rgba(255,255,255,.2); }
.settle__party b { font-size: 12.5px; font-weight: 600; }
.settle__party span { font-size: 10.5px; color: var(--brand-200); }
.settle__arrow { color: var(--gold-400); flex-shrink: 0; }

.settle-line {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 18px; border-bottom: 1px solid var(--line); font-size: 13px;
}
.settle-line:last-child { border-bottom: 0; }
.settle-line__label { color: var(--ink-2); flex: 1; min-width: 0; }
.settle-line__note { font-size: 11px; color: var(--muted); display: block; }
.settle-line__val { font-variant-numeric: tabular-nums; font-weight: 700; direction: ltr; unicode-bidi: isolate; }
.settle-line__val.plus  { color: var(--ok); }
.settle-line__val.minus { color: var(--danger); }
.settle-line--total { background: var(--surface-2); font-weight: 700; border-top: 2px solid var(--line); }

/* ============================================================================
   19. Service status cards
   ========================================================================= */
.svc-grid { display: grid; gap: 13px; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); }
.svc {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 15px; box-shadow: var(--sh-1);
  display: flex; flex-direction: column; gap: 10px;
  position: relative; overflow: hidden;
}
.svc--critical { border-color: var(--danger-border); background: linear-gradient(160deg, var(--danger-bg), var(--surface) 55%); }
.svc--warning  { border-color: var(--warn-border);   background: linear-gradient(160deg, var(--warn-bg), var(--surface) 55%); }
.svc__head { display: flex; align-items: flex-start; gap: 10px; }
.svc__icon {
  width: 36px; height: 36px; border-radius: 11px; flex-shrink: 0;
  background: var(--bg-subtle); display: grid; place-items: center; font-size: 17px;
}
.svc__name { flex: 1; min-width: 0; }
.svc__name b { display: block; font-size: 13.5px; font-weight: 600; line-height: 1.5;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.svc__name span { font-size: 11.5px; color: var(--muted); }
.svc__days { text-align: center; padding: 4px 0; }
.svc__days b {
  font-size: 25px; font-weight: 800; line-height: 1.25;
  font-variant-numeric: tabular-nums; display: block;
}
.svc__days span { font-size: 11.5px; color: var(--muted); }
.svc--critical .svc__days b { color: var(--danger); }
.svc--warning  .svc__days b { color: var(--warn); }
.svc__bar { height: 6px; border-radius: 99px; background: var(--bg-subtle); overflow: hidden; }
.svc__bar i { display: block; height: 100%; border-radius: 99px; background: var(--brand-500); transition: width .4s var(--ease); }
.svc--warning  .svc__bar i { background: var(--warn); }
.svc--critical .svc__bar i { background: var(--danger); }
.svc__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 11.5px; color: var(--muted); padding-top: 2px; border-top: 1px solid var(--line); }

/* ============================================================================
   20. Account cards (where the money actually is)
   ========================================================================= */
.acct-grid { display: grid; gap: 13px; grid-template-columns: repeat(auto-fill, minmax(238px, 1fr)); }
.acct {
  border-radius: var(--r-lg); padding: 15px 16px; position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-1);
  display: flex; flex-direction: column; gap: 8px;
}
.acct::after {
  content: ''; position: absolute; inset-block: 0; inset-inline-start: 0;
  width: 3px; background: var(--acct-c, var(--brand-500));
}
.acct__head { display: flex; align-items: center; gap: 9px; }
.acct__icon {
  width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0;
  display: grid; place-items: center; color: #fff;
  background: var(--acct-c, var(--brand-500));
}
.acct__icon svg { width: 17px; height: 17px; }
.acct__name { flex: 1; min-width: 0; }
.acct__name b { display: block; font-size: 13.5px; font-weight: 600; line-height: 1.5;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acct__name span { font-size: 11px; color: var(--muted); }
.acct__balance { font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums;
  direction: ltr; unicode-bidi: isolate; display: inline-block; letter-spacing: -.01em; }
.acct__balance.is-negative { color: var(--danger); }
.acct__balance small { font-size: 11px; font-weight: 500; color: var(--muted); }
.acct__meta { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; direction: ltr;
  text-align: end; letter-spacing: .04em; }

/* ============================================================================
   21. Charts
   ========================================================================= */
.chart { width: 100%; overflow: visible; }
.chart text { font-family: 'Vazirmatn', sans-serif; font-size: 10.5px; fill: var(--muted); }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .axis { stroke: var(--line-strong); stroke-width: 1; }
.chart-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.chart-legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; margin-inline-end: 5px; }

.bar-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; }
.bar-row__label { font-size: 12.5px; min-width: 96px; flex-shrink: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-row__track { flex: 1; height: 8px; border-radius: 99px; background: var(--bg-subtle); overflow: hidden; }
.bar-row__fill { height: 100%; border-radius: 99px; transition: width .5s var(--ease); }
.bar-row__value { font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums;
  direction: ltr; min-width: 86px; text-align: end; flex-shrink: 0; }

/* ============================================================================
   22. Notification panel
   ========================================================================= */
.popover {
  position: absolute; top: calc(100% + 8px); inset-inline-end: 0;
  width: 340px; max-height: 420px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--sh-3); z-index: 50;
  animation: pop-in .16s var(--ease);
}
@keyframes pop-in { from { opacity: 0; transform: translateY(-5px) } to { opacity: 1; transform: none } }
.popover__head { padding: 12px 15px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px;
  position: sticky; top: 0; background: var(--surface); z-index: 1; }
.popover__head b { font-size: 13.5px; }
.popover__foot { padding: 9px 15px; border-top: 1px solid var(--line); text-align: center; font-size: 12px;
  position: sticky; bottom: 0; background: var(--surface); }

.notif { display: flex; gap: 10px; padding: 11px 15px; border-bottom: 1px solid var(--line); }
.notif:last-child { border-bottom: 0; }
.notif:hover { background: var(--surface-hover); }
.notif.is-unread { background: var(--brand-50); }
.notif__icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  flex-shrink: 0; font-size: 14px; background: var(--bg-subtle); }
.notif--danger .notif__icon { background: var(--danger-bg); }
.notif--warn   .notif__icon { background: var(--warn-bg); }
.notif__body { min-width: 0; flex: 1; }
.notif__body b { display: block; font-size: 12.5px; font-weight: 600; line-height: 1.55; }
.notif__body span { display: block; font-size: 11.5px; color: var(--muted); line-height: 1.55; }

.dropdown { position: relative; }

/* ============================================================================
   23. Document / attachment gallery
   ========================================================================= */
.doc-grid { display: grid; gap: 13px; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); }
.doc {
  border: 1px solid var(--line); border-radius: var(--r); overflow: hidden;
  background: var(--surface); transition: box-shadow .16s var(--ease), border-color .16s var(--ease);
}
.doc:hover { box-shadow: var(--sh-2); border-color: var(--line-strong); }
.doc__thumb {
  height: 112px; background: var(--bg-subtle);
  display: grid; place-items: center; font-size: 30px; color: var(--muted-2);
  overflow: hidden; position: relative;
}
.doc__thumb img { width: 100%; height: 100%; object-fit: cover; }
.doc__body { padding: 9px 11px; }
.doc__body b { display: block; font-size: 12px; font-weight: 600; line-height: 1.5;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc__body span { font-size: 10.5px; color: var(--muted); }
.doc__actions { display: flex; gap: 4px; padding: 0 9px 9px; }

/* ============================================================================
   24. Journal entry view
   ========================================================================= */
.journal {
  border: 1px solid var(--line); border-radius: var(--r); overflow: hidden;
  font-variant-numeric: tabular-nums;
}
.journal__head {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  background: var(--surface-2); border-bottom: 1px solid var(--line); font-size: 12.5px;
}
.journal__no { font-weight: 700; color: var(--brand-600); }
.journal table { font-size: 12.5px; }
.journal td { padding: 8px 14px; border-bottom: 1px solid var(--line); }
.journal tr:last-child td { border-bottom: 0; }
.journal .acc-code { color: var(--muted); font-size: 11.5px; }
.journal .dr { text-align: end; color: var(--info); font-weight: 600; }
.journal .cr { text-align: end; color: var(--gold-600); font-weight: 600; }
.journal tfoot td { background: var(--surface-2); font-weight: 700; border-top: 1.5px solid var(--line-strong); }

/* ============================================================================
   25. Auth
   ========================================================================= */
.auth {
  min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr;
  background: var(--bg);
}
.auth__aside {
  background: linear-gradient(155deg, var(--brand-800), var(--brand-950));
  color: #fff; padding: 46px; display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
}
.auth__aside::before {
  content: ''; position: absolute; width: 460px; height: 460px; border-radius: 50%;
  background: radial-gradient(circle, rgba(194,148,40,.16), transparent 68%);
  top: -140px; inset-inline-start: -140px;
}
.auth__aside::after {
  content: ''; position: absolute; width: 340px; height: 340px; border-radius: 50%;
  background: radial-gradient(circle, rgba(30,138,110,.28), transparent 68%);
  bottom: -110px; inset-inline-end: -90px;
}
.auth__brand { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.auth__pitch { position: relative; z-index: 1; max-width: 400px; }
.auth__pitch h2 { font-size: 27px; line-height: 1.6; margin-bottom: 13px; }
.auth__pitch p { color: var(--brand-200); font-size: 14px; line-height: 2; }
.auth__features { display: flex; flex-direction: column; gap: 11px; margin-top: 26px; }
.auth__feature { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--brand-100); }
.auth__feature svg { color: var(--gold-400); flex-shrink: 0; }
.auth__foot { position: relative; z-index: 1; font-size: 11.5px; color: var(--brand-300); }

.auth__main { display: grid; place-items: center; padding: 32px; }
.auth__card { width: 100%; max-width: 386px; }
.auth__card h1 { font-size: 22px; margin-bottom: 6px; }
.auth__card > p { color: var(--muted); font-size: 13px; margin-bottom: 26px; }
.auth__mode {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px;
  border-radius: 99px; font-size: 11.5px; font-weight: 600; margin-bottom: 16px;
}

/* ============================================================================
   26. Utilities
   ========================================================================= */
.muted { color: var(--muted); }
.small { font-size: 12px; }
.xs    { font-size: 11px; }
.b     { font-weight: 600; }
.bb    { font-weight: 700; }
.center{ text-align: center; }
.end   { text-align: end; }
.nowrap{ white-space: nowrap; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ok     { color: var(--ok); }
.danger { color: var(--danger); }
.warn   { color: var(--warn); }
.gold   { color: var(--gold-600); }
.brand  { color: var(--brand-600); }
.hidden { display: none !important; }
.mt-0{margin-top:0} .mt-1{margin-top:6px} .mt-2{margin-top:12px} .mt-3{margin-top:18px} .mt-4{margin-top:24px}
.mb-0{margin-bottom:0} .mb-1{margin-bottom:6px} .mb-2{margin-bottom:12px} .mb-3{margin-bottom:18px}
.gap-1{gap:6px} .gap-2{gap:12px} .gap-3{gap:18px}
.flex{display:flex} .flex-col{flex-direction:column} .items-center{align-items:center}
.justify-between{justify-content:space-between} .flex-1{flex:1} .flex-wrap{flex-wrap:wrap}
.w-full{width:100%}
.divider { height: 1px; background: var(--line); margin: 16px 0; border: 0; }

.skeleton {
  background: linear-gradient(90deg, var(--bg-subtle) 25%, var(--line) 37%, var(--bg-subtle) 63%);
  background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: 6px;
}
@keyframes shimmer { 0% { background-position: 100% 0 } 100% { background-position: -100% 0 } }

/* ============================================================================
   27. Responsive
   ========================================================================= */
@media (max-width: 1280px) {
  .kpis, .kpis--5 { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .grid--4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 1080px) {
  .grid--2, .grid--3, .grid--2-1, .grid--1-2, .grid--3-2 { grid-template-columns: 1fr; }
  .kpis, .kpis--3, .kpis--5 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .form-grid, .form-grid--3 { grid-template-columns: 1fr; }
  .span-2, .span-3 { grid-column: span 1; }
  .auth { grid-template-columns: 1fr; }
  .auth__aside { display: none; }
}

@media (max-width: 820px) {
  :root { --header-h: 56px; }

  /* Off-canvas drawer. `inset-inline-start` anchors it to the reading-start
     edge (right in RTL, left in LTR); the transform is physical, so each
     direction needs its own sign to push it fully off that same edge. */
  .sidebar {
    position: fixed; inset-block: 0;
    inset-inline-start: 0; inset-inline-end: auto;
    transform: translateX(100%); transition: transform .26s var(--ease);
    box-shadow: var(--sh-4);
  }
  [dir="ltr"] .sidebar { transform: translateX(-100%); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open::after {
    content: ''; position: fixed; inset: 0; background: rgba(9,20,16,.45); z-index: 35;
    animation: fade .2s var(--ease);
  }
  .menu-toggle { display: grid; }
  .content { padding: 15px; }
  .topbar { padding: 0 14px; gap: 9px; }
  .topbar__title h1 { font-size: 15px; }
  .topbar__title p { display: none; }
  .search { display: none; }
  .kpis, .kpis--3, .kpis--5, .kpis--2 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 12px 13px; min-height: 92px; }
  .kpi__value { font-size: 17.5px; }
  .svc-grid, .acct-grid { grid-template-columns: 1fr; }
  .doc-grid { grid-template-columns: repeat(2, 1fr); }
  .card__head { padding: 12px 14px; flex-wrap: wrap; }
  .card__body { padding: 14px; }
  .filters { padding: 12px 14px; }
  .filters .field { flex: 1 1 100%; }
  table.data thead th, table.data tbody td { padding: 9px 11px; }
  .popover { width: calc(100vw - 28px); inset-inline-end: -8px; }
  .settle__amount { font-size: 23px; }
  .modal { max-width: 100%; }
}

@media (max-width: 480px) {
  .kpis, .kpis--3, .kpis--5, .kpis--2 { grid-template-columns: 1fr; }
  .doc-grid { grid-template-columns: 1fr; }
  .btn { padding: 0 12px; }
  .hide-xs { display: none !important; }
}

/* ---------- Print ---------- */
@media print {
  .sidebar, .topbar, .btn, .filters, .pagination, .no-print { display: none !important; }
  body { background: #fff; font-size: 11pt; }
  .card { box-shadow: none; border-color: #ccc; break-inside: avoid; }
  .content { padding: 0; max-width: none; }
  .app { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
