/* ژمێرەکەم — پانێڵی ئەدمین.
   ──────────────────────────────────────────────────────────
   پێوانەیەکی تەسک و ڕوون: نووسینی بچووک، بۆشایی کەم، هێڵی
   باریک، گۆشەی کەم‌سوڕ. ڕەنگ تەنها بۆ پارە و ئاماژە بەکاردێت.
   تاریک بنەڕەتە؛ ڕووناکیش پشتگیری دەکرێت.                    */

:root {
  /* «dark light» وا دەکات وێبگەڕ هەمیشە کۆنترۆڵە ڕەسەنەکان —
     چوارگۆشەی هەڵبژاردن — بە تاریکی بکێشێت، تەنانەت لە ڕووناکیشدا:
     خانەیەکی نەگیراو دەبووە چوارگۆشەیەکی ڕەشی پڕ، کە وەک
     گیراو دەخوێندرایەوە. لەگەڵ ڕەنگی پەڕەکەدا دەگۆڕدرێت. */
  color-scheme: dark;

  /* ڕووەکان — سەرمەیی نیتاق، نەک ڕەشێکی بێلایەن. */
  --ground:      #0b1822;
  --sunken:      #0e1d29;
  --raised:      #122334;
  --raised-2:    #182c40;
  --field:       #16283a;
  --field-line:  #2b455c;
  --line:        #23394d;
  --hairline:    #1a2f42;

  /* نووسین */
  --ink:         #e6edf3;
  --ink-2:       #aebccb;
  --muted:       #7c8ea1;
  --faint:       #5a6c7e;

  /* ئاماژە — سەوزی نیتاق. */
  --accent:      #3ad68d;
  --accent-ink:  #062018;
  --accent-soft: #103026;
  --accent-line: #1c4a38;
  /* سەوزی ڕووناک — لای دووەمی ڕەنگاوڕەنگەکە. */
  --lime:        #8ae24b;

  --expense:     #e8785c;
  --expense-soft:#2a1712;
  --income:      #4ade96;
  --income-soft: #0f2c26;
  --info:        #5b9df9;
  --info-soft:   #101a2b;
  --warn:        #e0ae5a;

  --glass:       rgba(255, 255, 255, .028);
  --glass-2:     rgba(255, 255, 255, .05);
  --glass-line:  rgba(255, 255, 255, .06);

  /* گۆشە */
  --r-sm: 6px;
  --r:    8px;
  --r-lg: 11px;

  /* بۆشایی — یەک پێوانە بۆ هەموو سیستەمەکە */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 22px;
  --s6: 30px;

  --gap-page: var(--s4);   /* نێوان بەشەکانی پەڕە */
  --gap-card: var(--s3);   /* نێوان کارتەکان */
  --pad-card: 18px;        /* ناوەوەی کارت */
  --pad-side: clamp(16px, 2.4vw, 34px);

  --shadow: 0 1px 2px rgba(0, 0, 0, .28);
  --shadow-lg: 0 10px 34px -14px rgba(0, 0, 0, .6);

  --side: 200px;
  --topbar: 46px;
}

/* ڕووناکی — تەنها نیشانەکان دەگۆڕدرێن، نەک ڕیسا جێبەجێکراوەکان. */
:root:not([data-theme="dark"]) {
  @media (prefers-color-scheme: light) {
    color-scheme: light;

    --ground:      #f5f6f8;
    --sunken:      #eef1f5;
    --raised:      #ffffff;
    --raised-2:    #f7f9fb;
    --field:       #ffffff;
    --field-line:  #d7dde5;
    --line:        #e3e7ed;
    --hairline:    #ebeef2;

    --ink:         #0e2233;
    --ink-2:       #3b5064;
    --muted:       #6a7f92;
    --faint:       #96a7b6;

    --accent:      #0e8f68;
    --accent-ink:  #ffffff;
    --accent-soft: #e3f7ee;
    --accent-line: #b6e2d1;
    --lime:        #5fae2f;

    --expense:     #c2492b;
    --expense-soft:#fceeea;
    --income:      #0e7c5c;
    --income-soft: #e5f4ee;
    --info:        #1f5fb8;
    --info-soft:   #e8f0fc;
    --warn:        #8a6410;

    --glass:       rgba(16, 23, 32, .022);
    --glass-2:     rgba(16, 23, 32, .04);
    --glass-line:  rgba(16, 23, 32, .07);

    --shadow: 0 1px 2px rgba(16, 23, 32, .06);
    --shadow-lg: 0 12px 34px -16px rgba(16, 23, 32, .22);
  }
}

:root[data-theme="light"] {
  color-scheme: light;

  --ground:      #f5f6f8;
  --sunken:      #eef1f5;
  --raised:      #ffffff;
  --raised-2:    #f7f9fb;
  --field:       #ffffff;
  --field-line:  #d7dde5;
  --line:        #e3e7ed;
  --hairline:    #ebeef2;

  --ink:         #101720;
  --ink-2:       #3b4655;
  --muted:       #6d7787;
  --faint:       #98a1ae;

  --accent:      #0e8f68;
  --accent-ink:  #ffffff;
  --accent-soft: #e3f7ee;
  --accent-line: #b6e2d1;
  --lime:        #5fae2f;

  --expense:     #c2492b;
  --expense-soft:#fceeea;
  --income:      #0e7c5c;
  --income-soft: #e5f4ee;
  --info:        #1f5fb8;
  --info-soft:   #e8f0fc;
  --warn:        #8a6410;

  --glass:       rgba(16, 23, 32, .022);
  --glass-2:     rgba(16, 23, 32, .04);
  --glass-line:  rgba(16, 23, 32, .07);

  --shadow: 0 1px 2px rgba(16, 23, 32, .06);
  --shadow-lg: 0 12px 34px -16px rgba(16, 23, 32, .22);
}

/* ── بنەما ───────────────────────────────────────────────── */

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: "IBM Plex Sans Arabic", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; }
/* هێڵی ژێرەوە نا — لینکەکە ڕووناکتر دەبێت. */
a:hover { text-decoration: none; filter: brightness(1.22); }

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.005em; line-height: 1.35; }
h1 { font-size: 19px; }
h2 { font-size: 14.5px; }
h3 { font-size: 13px; }

.num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  direction: ltr;
  unicode-bidi: isolate;
  text-align: end;
}

.sub { font-size: 11.5px; line-height: 1.55; color: var(--muted); }

/* ── چوارچێوە ────────────────────────────────────────────── */

.shell {
  display: grid;
  grid-template-columns: var(--side) minmax(0, 1fr);
  min-height: 100%;
}
.shell > * { min-width: 0; }

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

.page {
  display: flex;
  flex-direction: column;
  gap: var(--gap-page);
  padding: var(--s5) var(--pad-side) 56px;
  min-width: 0;
}
.page > *:not(dialog) { margin-block: 0 !important; }

form > .card + *, form > .grid + *, form > .split + *,
form > .totals + *, form > .filters + * { margin-top: var(--gap-page); }

body.loading .main { opacity: .55; transition: opacity .12s; }
body.loading { cursor: progress; }

/* ── شریتی سەرەوە ────────────────────────────────────────── */

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: var(--s2);
  height: var(--topbar);
  padding: 0 var(--pad-side);
  background: color-mix(in srgb, var(--ground) 86%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hairline);
}

.topsearch {
  position: relative;
  flex: 1;
  max-width: 380px;
  margin-inline-start: auto;
  display: flex; align-items: center;
}
.topsearch svg {
  position: absolute; inset-inline-start: 9px;
  width: 14px; height: 14px; color: var(--faint); pointer-events: none;
}
.topsearch input {
  width: 100%; min-height: 30px; height: 30px;
  padding-inline: 28px 10px;
  font-size: 12.5px;
  background: var(--field);
  border: 1px solid var(--field-line);
  border-radius: var(--r);
  color: var(--ink);
}
.topsearch input:focus { outline: none; border-color: var(--accent); }
.topsearch:focus-within svg { color: var(--accent); }

.topbell, .theme-toggle, .nav-open {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; flex: none;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r);
  color: var(--muted);
  cursor: pointer;
}
.topbell:hover, .theme-toggle:hover, .nav-open:hover {
  background: var(--glass); color: var(--ink); border-color: var(--hairline);
}
.topbell svg, .theme-toggle svg, .nav-open svg { width: 15px; height: 15px; }
/* ژمارەکە خۆی دەردەکەوێت، نەک خاڵێکی سوور — پێویستە
   بزانرێت چەند ئاگاداری چاوەڕێیە، نەک تەنها ئەوەی هەیە. */
.topbell i {
  position: absolute; inset-block-start: -4px; inset-inline-end: -4px;
  min-width: 17px; height: 17px; padding: 0 4px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; background: var(--expense);
  color: #fff; font-size: 10.5px; font-weight: 700; font-style: normal;
  border: 2px solid var(--ground); font-variant-numeric: tabular-nums;
}

/* ── بۆکسە هەڵواسراوەکان ─────────────────────────────────── */

.pop { position: relative; display: inline-flex; }
.pop-box {
  position: absolute; inset-block-start: calc(100% + 8px); inset-inline-end: 0;
  z-index: 60; width: 300px; max-width: min(92vw, 340px);
  background: var(--raised); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: 0 18px 42px rgba(0, 0, 0, .45);
  overflow: hidden;
}
/* «alerts» بەکار نەهێندرا، چونکە پەڕەی ئاگادارییەکان
   خۆی ئەو ناوەی هەیە و `display: flex` ـی لەسەرە —
   کە `hidden` ـەکەی دەشکاند و بۆکسەکە هەمیشە کراوە دەبوو. */
.pop-box.wide { width: 340px; }
.pop-box[hidden] { display: none; }

.pop-head {
  display: flex; flex-direction: column; gap: 2px;
  padding: 10px 13px; border-bottom: 1px solid var(--hairline);
}
.pop-head strong { font-size: 13px; }
.pop-head .sub { font-size: 11px; }

.pop-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 13px; border-bottom: 1px solid var(--hairline);
  color: var(--ink); text-decoration: none;
}
.pop-row:hover { background: var(--glass-2); }
.pop-row .what { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.pop-row .what strong { font-size: 12.5px; }
.pop-row .what .sub { font-size: 10.5px; }
.pop-row .late { color: var(--expense); font-weight: 600; }
.pop-row .money { font-size: 12px; }
.pop-box .empty { padding: 18px 13px; margin: 0; font-size: 12px; }

.pop-foot {
  display: block; padding: 9px 13px; text-align: center;
  font-size: 12px; font-weight: 600; color: var(--accent); text-decoration: none;
}
.pop-foot:hover { background: var(--accent-soft); }

/* ڕیزێک چیپ — دەسەڵاتەکان و سندوقەکان لە پرۆفایلدا. */
.chip-row { display: flex; flex-wrap: wrap; gap: 5px; margin-top: var(--s2); }

/* خانەکانی فۆڕم لەسەر یەکەوە. */
.stack { display: flex; flex-direction: column; gap: var(--s2); align-items: stretch; }
.stack .field { margin: 0; }
.stack .btn { align-self: flex-start; }

.pop-out {
  display: block; width: 100%; padding: 10px 13px;
  background: transparent; border: 0; color: var(--expense);
  font: inherit; font-size: 12.5px; font-weight: 600; text-align: start; cursor: pointer;
}
.pop-out:hover { background: var(--expense-soft); }

/* دوگمەی پرۆفایل — یەکەم پیتی ناوەکە. */
.topme {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; flex: none; padding: 0;
  background: transparent; border: 0; cursor: pointer;
}
.topme .face {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent-soft); border: 1px solid var(--accent-line);
  color: var(--accent); font-size: 12.5px; font-weight: 700;
}
.topme:hover .face { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.pop.open .topme .face { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

.theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: block; }

.nav-open { display: none; }

/* ── لیستی لاوەکی ────────────────────────────────────────── */

.side {
  display: flex; flex-direction: column;
  background: var(--sunken);
  border-inline-end: 1px solid var(--hairline);
  position: sticky; top: 0;
  height: 100vh;
}

.side-top {
  display: flex; align-items: center; gap: var(--s2);
  height: var(--topbar); flex: none;
  padding: 0 var(--s3);
  border-bottom: 1px solid var(--hairline);
}

.brand {
  font-size: 13.5px; font-weight: 600; color: var(--ink);
  display: flex; align-items: center; gap: 7px;
  white-space: nowrap; overflow: hidden;
}
.brand::before {
  content: ""; width: 7px; height: 7px; border-radius: 2px;
  background: var(--accent); flex: none;
}

.side-toggle {
  margin-inline-start: auto;
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; flex: none;
  background: transparent; border: 0; border-radius: var(--r-sm);
  color: var(--faint); cursor: pointer;
}
.side-toggle:hover { background: var(--glass); color: var(--ink); }
.side-toggle svg { width: 14px; height: 14px; }

.side-nav {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: var(--s2) var(--s2) var(--s3);
  display: flex; flex-direction: column; gap: 2px;
}
.side-nav::-webkit-scrollbar { width: 6px; }
.side-nav::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }

.side-search { padding: var(--s2) var(--s2) 0; }
.side-search input {
  width: 100%; min-height: 28px; height: 28px;
  padding: 0 9px; font-size: 12px;
  background: var(--field); border: 1px solid var(--field-line);
  border-radius: var(--r-sm); color: var(--ink);
}
.side-search input::-webkit-search-cancel-button { display: none; }

.side-group { display: flex; flex-direction: column; gap: 2px; }
.side-group + .side-group { margin-top: var(--s3); }

.side-title {
  font-size: 10px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--faint);
  padding: var(--s2) 9px 3px;
}

.side-items { display: flex; flex-direction: column; gap: 1px; }

.side a {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 9px;
  border-radius: var(--r-sm);
  font-size: 12.5px;
  color: var(--ink-2);
  position: relative;
}
.side a:hover { background: var(--glass); color: var(--ink); text-decoration: none; }
.side a svg { width: 14px; height: 14px; flex: none; color: var(--faint); }
.side a:hover svg { color: var(--ink-2); }

.side a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.side a.on svg { color: var(--accent); }

.side-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.side .count {
  font-size: 10.5px; font-variant-numeric: tabular-nums;
  color: var(--faint);
  background: var(--glass); border-radius: 5px;
  padding: 0 5px; line-height: 16px; flex: none;
}
.side a.on .count { background: transparent; color: var(--accent); }

.theme-pick { display: flex; gap: 2px; background: var(--glass); border-radius: var(--r-sm); padding: 2px; }
.theme-pick button {
  flex: 1; padding: 3px 0; font: inherit; font-size: 11px;
  background: none; border: 0; border-radius: 4px;
  color: var(--muted); cursor: pointer;
}
.theme-pick button:hover { color: var(--ink); }
.theme-pick button.on { background: var(--raised); color: var(--ink); }

.side-scrim { display: none; }

/* لیستی تەسک */
.shell:has(.side.tight) { grid-template-columns: 48px minmax(0, 1fr); }
.side.tight .brand { font-size: 0; gap: 0; }
.side.tight .side-top { justify-content: center; padding: 0; }
.side.tight .side-nav { padding-inline: 6px; }
.side.tight .side-search { display: none; }
.side.tight .side-group > summary, .side.tight .side-title { display: none; }
.side.tight .side-items { display: flex !important; }
.side.tight a { justify-content: center; padding: 7px 0; }
.side.tight .side-label, .side.tight .count { display: none; }
/* ناو و دەرچوون لە سەرەوەن، بۆیە شریتەکە هیچی خوارەوەی نییە. */

/* ── سەردێڕی پەڕە ────────────────────────────────────────── */

.head {
  display: flex; align-items: flex-start; gap: var(--s3);
  flex-wrap: wrap;
  padding-bottom: var(--s3);
  border-bottom: 1px solid var(--hairline);
}
.head p { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.head .actions, .head > .btn { margin-inline-start: auto; }

/* ── تۆڕ ─────────────────────────────────────────────────── */

.grid { display: grid; gap: var(--gap-card); }
.g2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); }
.grid.even { grid-auto-rows: 1fr; }

.split { display: grid; gap: var(--gap-card); grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }

/* ── کارت ────────────────────────────────────────────────── */

.card {
  background: var(--raised);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  padding: var(--pad-card);
}
.card.tight { padding: 0; overflow: hidden; }
/* مێنیوی ⋯ ـی ناو خشتە — کارتەکە نایبڕێت، بەتایبەتی کاتێک تەنها یەک دێڕ هەیە. */
.card.tight:has(details.pop[open]) { overflow: visible; }
.card.tight table { margin: 0; }
.card.tight .wrap-x { border-radius: inherit; }

.card h2 { margin-bottom: var(--s3); }
.card h2 + .sub { margin-top: calc(var(--s3) * -1 + 2px); margin-bottom: var(--s3); display: block; }

/* کارتی ژمارە */
.card.stat, .stat {
  display: flex; flex-direction: column; gap: 3px;
  padding: var(--s3) var(--s4);
}
.card.stat > .sub:first-child { order: -1; }
.card.stat strong {
  font-size: 18px; font-weight: 700; line-height: 1.25;
  font-variant-numeric: tabular-nums; color: var(--ink);
}
.card.stat.c { border-color: color-mix(in srgb, var(--expense) 30%, var(--hairline)); }
.card.stat.i { border-color: color-mix(in srgb, var(--info) 30%, var(--hairline)); }
.card.stat.c strong { color: var(--expense); }
.card.stat.i strong { color: var(--info); }

.label {
  font-size: 10.5px; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--faint);
}

.empty {
  color: var(--muted); font-size: 12.5px;
  text-align: center; padding: var(--s5) var(--s4); margin: 0;
}

/* ── نیشانە ──────────────────────────────────────────────── */

.chip {
  display: inline-flex; align-items: center; gap: 4px;
  height: 20px; padding: 0 7px;
  font-size: 11px; font-weight: 500;
  border-radius: var(--r-sm);
  background: var(--glass); color: var(--ink-2);
  white-space: nowrap;
}
.chip.c { background: var(--expense-soft); color: var(--expense); }
.chip.n { background: var(--glass); color: var(--muted); }
.chip.warn { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }

.coin {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 4px;
  font-size: 10.5px; font-weight: 600;
  border-radius: 5px;
  background: var(--glass); color: var(--muted);
}
.coin.lg { min-width: 22px; height: 22px; font-size: 12px; }

.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }

.money { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.money.out { color: var(--expense); }
.money.in { color: var(--income); }

/* ── دوگمە ───────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 30px; padding: 0 12px;
  font: inherit; font-size: 12.5px; font-weight: 600;
  border-radius: var(--r);
  border: 1px solid transparent;
  background: var(--accent); color: var(--accent-ink);
  cursor: pointer; white-space: nowrap;
  transition: background .12s, border-color .12s, color .12s;
}
.btn:hover { filter: brightness(1.07); text-decoration: none; }
.btn:active { transform: translateY(.5px); }

.btn.lg { height: 34px; padding: 0 16px; font-size: 13px; }
.btn.sm { height: 26px; padding: 0 9px; font-size: 11.5px; }

.btn.ghost { background: transparent; color: var(--ink-2); border-color: var(--line); }
.btn.ghost:hover { background: var(--glass); color: var(--ink); filter: none; }

.btn.danger, .btn.out { background: var(--expense); color: #fff; }
.btn.in { background: var(--income); color: var(--accent-ink); }

.btn.ghost.drop, .btn.drop { background: transparent; color: var(--expense); border-color: var(--line); }
.btn.ghost.drop:hover, .btn.drop:hover { background: var(--expense-soft); border-color: var(--expense); }

.actions { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
/* لەناو خانەی خشتەدا دوگمەکان لە یەک ڕیزدا دەمێننەوە. */
td .actions { flex-wrap: nowrap; }

/* ── خانەکانی فۆڕم ───────────────────────────────────────── */

.field { margin-bottom: var(--s4); }
.field:last-child { margin-bottom: 0; }

.field label, .field > span {
  display: block; margin-bottom: 5px;
  font-size: 11px; font-weight: 600; letter-spacing: .02em;
  color: var(--muted);
}
.field .sub { margin-top: 5px; display: block; }

input[type=text], input[type=email], input[type=password], input[type=date],
input[type=datetime-local], input[type=time], input[type=tel], input[type=url],
input[type=number], input[type=search], select, textarea {
  width: 100%;
  min-height: 32px;
  padding: 6px 10px;
  font: inherit; font-size: 13px;
  color: var(--ink);
  background: var(--field);
  border: 1px solid var(--field-line);
  border-radius: var(--r);
  transition: border-color .12s, box-shadow .12s;
}
/* گیراوەکان بە سەوزی پانێڵەکە، نەک شینی وێبگەڕ. */
input[type=checkbox], input[type=radio] { accent-color: var(--accent); }

input::placeholder, textarea::placeholder { color: var(--faint); }
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--field-line) 60%, var(--ink)); }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent);
}
input:disabled, select:disabled, textarea:disabled { opacity: .55; cursor: not-allowed; }

textarea { min-height: 64px; resize: vertical; }
input[type=color] { width: 38px; height: 30px; padding: 2px; }

select {
  appearance: none;
  padding-inline-end: 26px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237f8998' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 8px center;
  background-size: 13px;
}
:root:not([data-theme="dark"]) select {
  @media (prefers-color-scheme: light) {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236d7787' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  }
}
:root[data-theme="light"] select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236d7787' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}

input[type=file] {
  width: 100%; font-size: 12px; color: var(--muted);
  padding: 5px; border: 1px dashed var(--line); border-radius: var(--r);
  background: transparent;
}
input[type=file]:hover { border-color: var(--accent-line); }
input[type=file]::file-selector-button {
  font: inherit; font-size: 11.5px; font-weight: 600;
  margin-inline-end: 8px; padding: 4px 9px;
  border: 0; border-radius: var(--r-sm);
  background: var(--glass); color: var(--ink-2); cursor: pointer;
}
input[type=file]::file-selector-button:hover { background: var(--glass-2); color: var(--ink); }

input.soft { background: transparent; border-color: transparent; }
input.soft:focus { background: var(--field); border-color: var(--accent); }

.tick { display: inline-flex; align-items: center; gap: 7px; margin: 0; font-size: 12.5px; }
.tick input { width: auto; min-height: 0; }

/* ── خشتە ────────────────────────────────────────────────── */

.wrap-x { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: 12.5px; }

thead th {
  text-align: start; font-weight: 600; font-size: 11px;
  letter-spacing: .02em; color: var(--muted);
  padding: 10px 14px;
  background: var(--glass);
  border-bottom: 1px solid var(--hairline);
  white-space: nowrap;
}
tbody td {
  padding: 11px 14px;
  line-height: 1.5;
  border-bottom: 1px solid var(--hairline);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--glass); }
/* ژمارە و بەروار هەرگیز نابێت بشکێن — دوو دێڕی دەکەن و
   ڕیزەکە قەبە دەبێت، لەگەڵ ئەوەی خوێندنەوەشیان قورستر. */
td.num, th.num { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.num .sub { white-space: normal; }
td strong { font-weight: 600; }
td a { color: var(--ink); }
td a:hover { color: var(--accent); }
td .sub { display: block; margin-top: 2px; }

table.sortable th a { color: inherit; display: inline-flex; align-items: center; gap: 3px; }
table.sortable th a:hover { color: var(--accent); text-decoration: none; }

/* ── پەیام ───────────────────────────────────────────────── */

.note {
  padding: 9px 12px; border-radius: var(--r);
  font-size: 12.5px; border: 1px solid var(--hairline);
  background: var(--glass); color: var(--ink-2);
}
.note.ok { background: var(--income-soft); border-color: var(--accent-line); color: var(--income); }
.note.bad { background: var(--expense-soft); border-color: color-mix(in srgb, var(--expense) 34%, transparent); color: var(--expense); }
.note code { font-size: 11.5px; background: var(--glass-2); padding: 1px 4px; border-radius: 4px; }

.errors { margin: 0; padding-inline-start: 16px; font-size: 12px; color: var(--expense); }

/* ── پەڕەکردن ────────────────────────────────────────────── */

.pager { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.pager a, .pager span {
  min-width: 28px; height: 28px; padding: 0 8px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; border-radius: var(--r-sm);
  border: 1px solid var(--hairline); color: var(--ink-2);
}
.pager a:hover { border-color: var(--line); color: var(--ink); text-decoration: none; }
.pager .cur { background: var(--accent); border-color: transparent; color: var(--accent-ink); font-weight: 600; }

/* ── پاڵاوتن ─────────────────────────────────────────────── */

.filters {
  display: flex; align-items: flex-end; gap: var(--s2); flex-wrap: wrap;
  padding: var(--s3);
  background: var(--raised); border: 1px solid var(--hairline); border-radius: var(--r-lg);
}
.filters .field { margin: 0; flex: 0 1 150px; }
.filters .field.grow { flex: 1 1 200px; }
.filters .field label { font-size: 10.5px; margin-bottom: 4px; }
.filters .btn { flex: none; }

/* ── وردەکاری کراوە ──────────────────────────────────────── */

.more { border: 1px solid var(--hairline); border-radius: var(--r); background: var(--glass); }
.more > summary {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 12px; cursor: pointer;
  font-size: 12.5px; font-weight: 600; color: var(--ink-2);
  list-style: none;
}
.more > summary::-webkit-details-marker { display: none; }
.more > summary::after { content: "+"; margin-inline-start: auto; color: var(--faint); font-weight: 400; }
.more[open] > summary::after { content: "−"; }
.more > summary:hover { color: var(--ink); }
.more[open] > summary { border-bottom: 1px solid var(--hairline); }
.more > *:not(summary) { padding: var(--s3); }
.more .field:last-child { margin-bottom: 0; }

.opt { font-size: 11px; font-weight: 400; color: var(--faint); }

/* ── هێڵە ژمارەییەکان ────────────────────────────────────── */

.bars { display: flex; flex-direction: column; gap: var(--s2); }

.bar-row {
  display: grid;
  grid-template-columns: minmax(90px, 1.3fr) minmax(60px, 2fr) auto auto;
  align-items: center; gap: var(--s3);
  font-size: 12.5px;
}
.bar-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 5px; border-radius: 3px; background: var(--glass-2); overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.bar-value { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.bar-share { font-size: 11px; color: var(--faint); min-width: 34px; text-align: end; }

.meter { height: 5px; border-radius: 3px; background: var(--glass-2); overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--accent); }
.meter.warn span { background: var(--warn); }
.meter.over span { background: var(--expense); }

/* ── ڕیزی ئاگادارکردنەوە ─────────────────────────────────── */

.alert-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.7fr) minmax(90px, 1fr) auto auto;
  align-items: center; gap: var(--s3);
  padding: 9px 12px;
  font-size: 12.5px;
  background: var(--glass);
  border: 1px solid var(--hairline);
  border-radius: var(--r);
}
.alert-row:hover { border-color: var(--line); }
.alert-row > div:first-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; align-items: flex-start; }
.alert-row > div:first-child > * { min-width: 0; max-width: 100%; }
.alert-row .sub { display: block; }
.alert-row .actions { justify-content: flex-end; }

.alerts { display: flex; flex-direction: column; gap: var(--s2); }
.alert-card {
  display: flex; align-items: center; gap: var(--s3);
  padding: var(--s3);
  background: var(--raised); border: 1px solid var(--hairline); border-radius: var(--r);
}
.alert-card.late { border-color: color-mix(in srgb, var(--expense) 34%, transparent); }
.alert-main { flex: 1; min-width: 0; }
.alert-head { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.alert-head strong { font-size: 13px; }
.alert-amount { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.alert-card .actions { flex: none; }
.alert-main .sub { display: block; }

/* لەسەر شاشەی بچووک — یان کاتێک چەند دوگمەیەکی هەیە — ڕیزەکان
   لەسەر یەکەوە دەڕۆن، ئەگەرنا دەقەکە بە وشە بە وشە دەشکێت. */
@media (max-width: 860px) {
  .alert-card { flex-wrap: wrap; align-items: flex-start; }
  .alert-main { flex: 1 1 100%; }
  .alert-card .alert-amount { margin-inline-start: auto; order: 2; }
  .alert-card .actions { flex: 1 1 100%; order: 3; }
}

/* ── مانگەکان ────────────────────────────────────────────── */

.months { display: flex; gap: var(--s2); overflow-x: auto; padding-bottom: 4px; }
.month { flex: 1 0 44px; display: flex; flex-direction: column; align-items: center; gap: 5px; }
.month-bars { display: flex; align-items: flex-end; gap: 3px; height: 76px; }
.mb { width: 9px; border-radius: 2px 2px 0 0; background: var(--glass-2); min-height: 2px; }
.mb:hover { filter: brightness(1.3); }
.mb.in { background: var(--income); }
.mb.out { background: var(--expense); }
.month-label { font-size: 10px; color: var(--faint); white-space: nowrap; }

.legend { display: flex; gap: var(--s3); font-size: 11px; color: var(--muted); }
.legend .dot { display: inline-block; margin-inline-end: 4px; }
.legend .dot.in { background: var(--income); }
.legend .dot.out { background: var(--expense); }

.quick { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.quick .sub { margin-inline-end: 2px; }
.quick .chip { cursor: pointer; }
.quick .chip.on { background: var(--accent-soft); color: var(--accent); }

.segmented { display: inline-flex; gap: 2px; padding: 2px; background: var(--glass); border-radius: var(--r); }
.segmented button {
  padding: 4px 10px; font: inherit; font-size: 11.5px;
  background: none; border: 0; border-radius: var(--r-sm);
  color: var(--muted); cursor: pointer;
}
.segmented button:hover { color: var(--ink); }
.segmented button.on { background: var(--raised); color: var(--ink); font-weight: 600; }

.fuel-chart { display: none; }
.fuel-chart.on { display: flex; }

/* ── ڕیزی دوو دەستە ─────────────────────────────────────── */

.segments { display: flex; gap: var(--s2); }
.segment { flex: 1; }
.segment input { position: absolute; opacity: 0; pointer-events: none; }
.segment span {
  display: flex; align-items: center; justify-content: center;
  height: 32px; border-radius: var(--r);
  border: 1px solid var(--line); color: var(--ink-2);
  font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.segment:hover span { border-color: var(--muted); }
.segment.out input:checked + span { background: var(--expense); border-color: transparent; color: #fff; }
.segment.in input:checked + span { background: var(--income); border-color: transparent; color: var(--accent-ink); }
.segment input:focus-visible + span { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }

/* ── هەژمارەکانی داشبۆرد ─────────────────────────────────── */

.account {
  background: var(--raised); border: 1px solid var(--hairline);
  border-radius: var(--r-lg); padding: var(--s4);
}
.account-head { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; margin-bottom: var(--s3); }
.account-head h2 { margin: 0; font-size: 14px; }
.account-head .grow { flex: 1; }
.account-head .dot { width: 8px; height: 8px; }

.balances { display: flex; flex-wrap: wrap; gap: var(--s2); }
.balance {
  flex: 1 1 170px; min-width: 0;
  display: flex; flex-direction: column; gap: 2px;
  padding: 10px 12px;
  background: var(--glass); border: 1px solid var(--hairline); border-radius: var(--r);
}
.balance .sub { font-size: 11px; }
.balance strong { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); }

/* ── قاسەکانی قەرزدان ────────────────────────────────────── */

.boxes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: var(--gap-card); }

.safe { background: var(--raised); border: 1px solid var(--hairline); border-radius: var(--r-lg); overflow: hidden; }
.safe-head {
  display: flex; align-items: center; gap: var(--s2);
  padding: var(--s3) var(--s4);
  border-bottom: 1px solid var(--hairline);
}
.safe-head h2 { margin: 0; font-size: 14px; }
.safe-head .btn { margin-inline-start: auto; }
.safe-coins { display: flex; gap: 3px; }

.safe-money { padding: var(--s3) var(--s4); }
.safe-money + .safe-money { border-top: 1px solid var(--hairline); }

.safe-total { display: flex; flex-direction: column; gap: 2px; margin-bottom: var(--s3); }
.safe-total strong { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); }

.safe-stats {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s2);
  padding: 10px 12px;
  background: var(--glass); border: 1px solid var(--hairline); border-radius: var(--r);
}
.safe-stats > div { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.safe-stats .num { font-size: 13px; font-weight: 600; text-align: start; }

.safe-move { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); margin-top: var(--s3); }
.safe-move .field { margin: 0; }
.safe-move .actions { grid-column: 1 / -1; }
.safe-move .actions .btn { flex: 1; }

.box-tabs { display: flex; gap: 5px; flex-wrap: wrap; }
.box-tab {
  display: inline-flex; align-items: center; gap: 5px;
  height: 28px; padding: 0 10px;
  font-size: 12.5px; border-radius: var(--r);
  border: 1px solid var(--hairline); color: var(--ink-2);
}
.box-tab:hover { border-color: var(--line); color: var(--ink); text-decoration: none; }
.box-tab.on { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); font-weight: 600; }
.box-tab.on .coin { background: transparent; color: var(--accent); }

.box-title { display: flex; align-items: center; gap: 7px; margin-bottom: 0; }

.money-move { display: flex; align-items: flex-end; gap: var(--s2); flex-wrap: wrap; }
.money-move .field { margin: 0; flex: 1 1 120px; }
.money-move .actions { flex: none; }

.rename { display: flex; gap: 5px; align-items: center; }
.rename input[type=text] { width: 130px; min-height: 26px; font-size: 12px; }

.new-coins { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: var(--s3); }
.new-coins > div { display: flex; flex-direction: column; gap: 6px; }
.new-coins .tick span { font-size: 12.5px; font-weight: 400; letter-spacing: 0; color: var(--ink-2); margin: 0; }
.new-coins .tick input { width: auto; min-height: 0; }

/* ── ڕۆژمێر ─────────────────────────────────────────────── */

.cal { display: flex; flex-direction: column; gap: var(--s3); }
.cal-bar { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.cal-step {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: var(--r-sm);
  border: 1px solid var(--hairline); color: var(--ink-2); background: transparent;
  cursor: pointer;
}
.cal-step:hover { border-color: var(--line); color: var(--ink); text-decoration: none; }
.cal-when { display: flex; flex-direction: column; }
.cal-when strong { font-size: 14px; font-variant-numeric: tabular-nums; }
.cal-sums { margin-inline-start: auto; display: flex; gap: var(--s3); font-size: 12px; }

.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-name { font-size: 10.5px; color: var(--faint); text-align: center; padding-bottom: 2px; }

.cal-day {
  display: flex; flex-direction: column; gap: 5px;
  min-height: 66px; padding: 8px 10px 9px;
  border: 1px solid var(--hairline); border-radius: var(--r);
  background: var(--glass);
  cursor: pointer; color: inherit;
}
.cal-day:hover { border-color: var(--line); text-decoration: none; }
.cal-day.empty { background: transparent; border-color: transparent; cursor: default; }
.cal-day.ahead { opacity: .45; }
.cal-day.today { border-color: var(--accent); }
.cal-day.on { background: var(--accent-soft); border-color: var(--accent-line); }

.cal-head { display: flex; align-items: center; gap: 5px; }
.cal-no { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ئەوەی ئەم ڕۆژە چاوەڕێ دەکرێت — سلفەی گەڕاندنەوە و بەڵێن.
   خاڵێکە نەک ژمارە: هێشتا هیچ پارەیەک نەجوڵاوە. */
.cal-wait { display: inline-flex; gap: 3px; margin-inline-start: auto; }
.wait-dot { width: 6px; height: 6px; border-radius: 50%; display: block; }
.wait-dot.advance { background: var(--warn); }
.wait-dot.expected { background: var(--info); }
.legend .wait-dot { display: inline-block; margin-inline-end: 4px; vertical-align: middle; }
.cal-day.today .cal-no, .cal-day.on .cal-no { color: var(--accent); font-weight: 600; }

.cal-marks { display: flex; flex-direction: column; gap: 2px; margin-top: auto; }
.cal-in, .cal-out {
  font-size: 11px; line-height: 1.35;
  font-variant-numeric: tabular-nums;
  /* ژمارە درێژەکان دیوارەکە نابەزێنن. */
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cal-in b, .cal-out b { font-weight: 500; }
.cal-in { color: var(--income); }
.cal-out { color: var(--expense); }
/* ژمارەی تەواو لە شاشەی فراوان، کورتەکە لە تەسکەکە. */
.cal-in .short, .cal-out .short { display: none; }
.cal-more { font-size: 10px; color: var(--faint); }

.cal-rows { display: flex; flex-direction: column; }
.cal-row {
  display: flex; align-items: center; gap: var(--s2);
  padding: 8px 0; border-bottom: 1px solid var(--hairline);
}
.cal-row:last-child { border-bottom: 0; }
.cal-dot { width: 6px; height: 6px; border-radius: 50%; flex: none; }
.cal-dot.in { background: var(--income); }
.cal-dot.out { background: var(--expense); }
.cal-what { flex: 1; min-width: 0; }
.cal-what strong { font-size: 12.5px; }
.cal-what .sub { display: block; }
.cal-row .money { font-size: 12.5px; }

/* ── بەنزین ─────────────────────────────────────────────── */
/* پەڕەیەکی تەسک: کام مانگ، نرخی لیتر، پڕکردنەوەیەک، لیستەکە،
   کۆ. سندوقەکە جارێک دادەنرێت، بۆیە لە ڕێڕەوی نووسیندا نییە. */

.fuel-month {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: var(--s3); flex-wrap: wrap;
}
.fuel-month .step {
  width: 26px; height: 26px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 50%;
  color: var(--ink-2); font-size: 14px; line-height: 1; text-decoration: none;
}
.fuel-month .step:hover { border-color: var(--accent-line); color: var(--accent); }
.fuel-month .now { display: flex; align-items: center; gap: 6px; }
.fuel-month .now strong { font-size: 14px; font-weight: 700; }
.fuel-month .jump { display: flex; gap: 5px; margin-inline-start: auto; }
.fuel-month .jump select, .fuel-month .jump input { min-height: 26px; padding: 2px 7px; font-size: 11.5px; }
.fuel-month .jump input[type=number] { width: 66px; }

.fuel-fund {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  padding: 6px 12px; margin-bottom: var(--s3);
  border: 1px solid var(--hairline); border-radius: var(--r);
  background: var(--glass);
  font-size: 12px;
}
.fuel-fund strong { font-size: 12.5px; }
.fuel-fund .sub { font-size: 11px; }
.fuel-fund .btn { margin-inline-start: auto; }

.fuel-price {
  display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap;
  padding: var(--s2) var(--s3);
}
.fuel-price label { font-size: 11.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.fuel-price .amount { display: flex; align-items: center; gap: 6px; }
.fuel-price .amount input {
  width: 120px; min-height: 30px; padding: 3px 9px;
  font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.fuel-price .amount .unit { font-size: 12px; font-weight: 600; color: var(--accent); }
.fuel-price .note-field { flex: 1; min-width: 120px; min-height: 30px; font-size: 12px; }

/* دوو ستوون: خانەکان لەلایەک، ئەوەی نووسراوە لەلایەکی تر.
   لیستەکە هەمیشە بەرچاوە، بۆیە پێویست ناکات بۆ خوارەوە
   بڕۆیت بۆ ئەوەی بزانیت چیت نووسیوە. */
.fuel-work { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: var(--s3); align-items: start; }
.fuel-work.alone { grid-template-columns: minmax(0, 1fr); }
.fuel-side { display: flex; flex-direction: column; gap: var(--s2); min-width: 0; }

.fuel-add { display: flex; flex-direction: column; gap: var(--s2); padding: var(--s3); }
.fuel-add h2 { margin: 0 0 2px; font-size: 12.5px; }
.fuel-add .pick { display: flex; flex-direction: column; gap: 4px; }
.fuel-add .pick > .sub { font-size: 10px; font-weight: 600; }
.fuel-add .field { display: flex; flex-direction: column; gap: 3px; }
.fuel-add .field > span { font-size: 10px; font-weight: 600; color: var(--muted); }
.fuel-add .field input { min-height: 30px; padding: 3px 9px; font-size: 13px; }
.fuel-add .field input.big { font-size: 16px; font-weight: 700; }
.fuel-add .two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s2); }
.fuel-add .btn { width: 100%; }
.fuel-add > .sub { font-size: 10.5px; text-align: center; }

.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chips.want { outline: 1px dashed var(--expense); outline-offset: 3px; border-radius: var(--r); }
.pill {
  padding: 4px 10px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--glass); color: var(--ink-2);
  font: inherit; font-size: 11.5px; cursor: pointer;
}
.pill:hover { border-color: var(--accent-line); color: var(--ink); }
.pill.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
/* نیشانەیەک کە خۆی خانەی هەڵبژاردنە — خانەکە شاراوەیە. */
label.pill { display: inline-flex; align-items: center; }
label.pill input { position: absolute; opacity: 0; width: 0; height: 0; }
label.pill:focus-within { outline: 2px solid var(--accent-line); outline-offset: 1px; }
.pill.off { opacity: .55; pointer-events: none; }

/* جۆری بەنزینی مانگ — ڕیزێکی تەواوی خۆی، چونکە پێنج
   هەڵبژاردنە و لە پەنا نرخەکەدا جێ نابنەوە. */
.fuel-price .pick.wide { flex: 1 0 100%; display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.fuel-price .pick.wide > .sub { white-space: nowrap; font-weight: 600; }
.fuel-price .pick.wide .chips { display: flex; gap: 5px; flex-wrap: wrap; }

.fuel-list { padding: 0; }
.fuel-list .empty { padding: var(--s3); margin: 0; font-size: 12px; }

/* ڕیزکردنی لیستی پڕکردنەوەکان — ڕۆژ، پارە، ئۆتۆمبێل. */
.fuel-sort {
  display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap;
  padding: 7px 12px;
  border-bottom: 1px solid var(--hairline);
}
.fuel-sort .chips { display: flex; gap: 5px; flex-wrap: wrap; }
.fuel-sort .pill { padding: 3px 9px; font-size: 11.5px; }
/* تیرەکە بە ژمارەی لاتینی نایەت، بۆیە جیا دەکرێتەوە. */
.fuel-sort .pill .way { font-size: 10px; opacity: .85; }
.fill {
  display: flex; align-items: center; gap: var(--s2);
  padding: 6px 12px;
  border-bottom: 1px solid var(--hairline);
}
.fill:last-child { border-bottom: 0; }

/* کرتە لە ڕیزێک بۆ گۆڕینی — بۆیە دەبێت دیار بێت کە دەکرێت. */
.fuel-list:not(.locked) .fill { cursor: pointer; }
.fuel-list:not(.locked) .fill:hover { background: var(--glass); }
.fill.editing {
  background: var(--accent-soft);
  box-shadow: inset 2px 0 0 var(--accent);
}
.fill.editing .who strong { color: var(--accent); }

.fuel-do { display: flex; gap: var(--s2); }
.fuel-do .btn { flex: 1; }
.fill .no { width: 16px; flex: none; font-size: 10.5px; color: var(--faint); }
.fill .who { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; }
.fill .who strong { font-size: 12.5px; }
.fill .who .sub { font-size: 11px; }
.fill .line { font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.fill .drop, .drop-row {
  width: 22px; height: 22px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: var(--r-sm);
  background: transparent; color: var(--faint);
  font-size: 14px; line-height: 1; cursor: pointer;
}
.fill .drop:hover, .drop-row:hover { background: var(--expense-soft); color: var(--expense); }

.fuel-total {
  display: flex; align-items: center; gap: var(--s4); flex-wrap: wrap;
  padding: 8px 12px;
  border: 1px solid var(--hairline); border-radius: var(--r);
  background: var(--glass);
}
.fuel-total .nums { display: flex; gap: var(--s4); flex-wrap: wrap; align-items: baseline; }
.fuel-total .nums > div { display: flex; align-items: baseline; gap: 5px; }
.fuel-total .sub { font-size: 10.5px; }
.fuel-total .num { font-size: 12.5px; font-weight: 600; }
.fuel-total .big .num { font-size: 15px; font-weight: 700; }
.fuel-total .btn { margin-inline-start: auto; }

.fuel-post {
  display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap;
  padding: 8px 12px; margin-top: var(--s3);
  border: 1px solid var(--accent-line); border-radius: var(--r);
  background: var(--accent-soft);
}
.fuel-post strong { display: block; font-size: 12px; }
.fuel-post .sub { font-size: 11px; }
.fuel-post .btn { margin-inline-start: auto; }

@media (max-width: 820px) {
  .fuel-work { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .fuel-month .jump { width: 100%; margin-inline-start: 0; }
  .fuel-total .btn, .fuel-post .btn { margin-inline-start: 0; width: 100%; }
}

/* ── جەردکردن ───────────────────────────────────────────── */

.tally { margin-bottom: var(--s5); }
.tally:last-of-type { margin-bottom: 0; }
.tally-head { display: flex; align-items: baseline; gap: var(--s2); margin-bottom: var(--s2); }
.tally-head h3 { margin: 0; font-size: 13px; }
.tally-head .sub { margin-inline-start: auto; }

.tally-rows { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--s2); }
.tally-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) auto; gap: 6px; align-items: center; }
.tally-row input { min-height: 30px; }

.tally-sum {
  display: flex; gap: var(--s5); flex-wrap: wrap;
  padding: 10px 12px; margin-top: var(--s2);
  background: var(--glass); border-radius: var(--r);
}
.tally-sum > div { display: flex; flex-direction: column; gap: 1px; }
.tally-sum strong { font-size: 14px; font-variant-numeric: tabular-nums; }

.tally-hint { margin-top: var(--s2); }
.tally-hint:empty { display: none; }
.tally-hint .errors { margin-top: 3px; color: var(--ink-2); font-size: 12px; }

/* بەشێکی کۆیەک — جیهانێک بە کۆی خۆی و سندوقەکانی */
.world { margin-top: var(--s3); }
.world-head {
  display: flex; align-items: baseline; gap: var(--s3);
  padding-bottom: 4px; border-bottom: 1px solid var(--hairline);
}
.world-head span { font-size: 11px; font-weight: 600; letter-spacing: .03em; color: var(--muted); }
.card.stat .world-head b {
  margin-inline-start: auto; font-size: 13px; font-weight: 700;
  font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--ink);
}
.world .split { margin-top: 0; }
.world .split li:first-child { border-top: 0; }

/* لیستی سندوقەکان لەناو کارتی کۆیەکدا — ناو لەلایەک، بڕ لەلای تر */
.split {
  list-style: none; margin: var(--s2) 0 0; padding: 0;
  display: flex; flex-direction: column;
}
.split li {
  display: flex; align-items: baseline; gap: var(--s3);
  padding: 5px 0; border-top: 1px solid var(--hairline);
}
.split li:first-child { border-top: 0; padding-top: var(--s2); }
.split li > span { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.card.stat .split strong { font-size: 12px; font-weight: 600; color: var(--ink); line-height: 1.3; }
.split em { font-style: normal; font-size: 10.5px; color: var(--faint); line-height: 1.3; }
.card.stat .split b {
  margin-inline-start: auto; font-size: 12.5px; font-weight: 700;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}

/* ناونیشانی جیهانێک لەناو خشتەی سندوقەکاندا */
tr.band td {
  background: var(--glass);
  font-size: 12px; letter-spacing: .02em;
  border-top: 1px solid var(--hairline);
}
tr.band strong { color: var(--ink); }

/* ── چارتەکانی بەنزین ───────────────────────────────────── */

/* ستوونەکان — یەک بڕ بۆ هەر مانگ یان ساڵێک. */
.chart-cols {
  display: flex; align-items: flex-end; justify-content: center; gap: 4px;
  direction: rtl;
}
.chart-col {
  /* بەرزی هەیە بەڵام پانی سنووردارە — ساڵێک بە تەنها نابێت
     ببێتە بلۆکێکی پان بە درێژایی کارتەکە. */
  flex: 1 1 0; min-width: 0; max-width: 74px;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 4px 2px; border-radius: var(--r-sm);
  color: inherit; text-decoration: none;
}
a.chart-col:hover { background: var(--glass); }
.chart-bar-wrap { width: 100%; height: 104px; display: flex; align-items: flex-end; }
.chart-bar {
  display: block; width: 100%; min-height: 2px;
  border-radius: 3px 3px 0 0;
  background: var(--expense);
}
/* مانگی بەتاڵ هێڵێکی بێدەنگ دەبێت، نەک بڕێکی سوور. */
.chart-bar.none { background: var(--hairline); }
.chart-col.on .chart-bar { background: var(--accent); }
a.chart-col:hover .chart-bar { filter: brightness(1.2); }
.chart-label { font-size: 10px; color: var(--faint); }
.chart-col.on .chart-label { color: var(--accent); font-weight: 600; }

/* هێڵی نرخ. */
.chart-line svg { display: block; width: 100%; height: auto; }
.chart-ends {
  display: flex; justify-content: space-between; gap: var(--s3);
  margin-top: 4px;
}

/* ڕیزی خشتەی مانگی ئێستا. */
tbody tr.here > td { background: var(--glass); }
tbody tr.here > td:first-child { box-shadow: inset 2px 0 0 var(--accent); }

.bar-name em { display: block; font-style: normal; }

/* سلفەی دەرچوو — لە پەنا ماوەی سندوقەکەوە */
.out-note {
  display: block; margin-top: 2px;
  font-size: 10.5px; color: var(--warn); text-decoration: none;
}
a.out-note:hover { color: var(--warn); text-decoration: none; filter: brightness(1.22); }

/* ── ڕیزەکانی پسوڵە ─────────────────────────────────────── */

#itemsTable .qty { max-width: 70px; }
#itemsTable td.line { white-space: nowrap; font-variant-numeric: tabular-nums; }

.recent { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 5px; }
.recent:empty { display: none; }
.recent .pick {
  border: 1px solid var(--hairline); background: transparent;
  cursor: pointer; font: inherit; font-size: 11px;
  padding: 2px 7px; border-radius: var(--r-sm); color: var(--muted);
}
.recent .pick:hover { border-color: var(--accent); color: var(--accent); }

.line-total, .amount { font-variant-numeric: tabular-nums; }

/* ── شێوازە ئامادەکان و ئاگادارکردنەوەی سندوق ───────────── */

.templates { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.templates:empty { display: none; }
.templates .pick {
  display: inline-flex; align-items: center;
  border: 1px solid var(--hairline); border-radius: var(--r-sm);
  background: transparent; color: var(--ink-2);
  font: inherit; font-size: 11.5px;
}
.templates .pick button {
  border: 0; background: transparent; color: inherit;
  font: inherit; cursor: pointer; padding: 3px 9px;
}
.templates .save { border-color: var(--accent-line); color: var(--accent); cursor: pointer; padding: 3px 9px; }
.templates .save:hover { background: var(--accent-soft); }
.templates .pick:hover { border-color: var(--accent); }
/* شێوازێکی دراوێکی تر — نرخەکانی نایەن، بۆیە کاڵترە. */
.templates .other { opacity: .62; }
.templates .drop { padding-inline: 4px; color: var(--muted); font-size: 13px; line-height: 1; }
.templates .drop:hover { color: var(--expense); }

/* ── هەژمارە تایبەتەکان لە پەڕەی خێرادا ─────────────────── */

.side-account {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s3); flex-wrap: wrap;
  padding: var(--s3) 0;
}
.side-account + .side-account { border-top: 1px solid var(--hairline); }
.side-account .who { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.side-account .who .sub { display: flex; gap: var(--s2); flex-wrap: wrap; }

/* ── داخستنی مانگ ────────────────────────────────────────── */

.month { display: flex; flex-direction: column; gap: var(--s4); }
/* مانگێکی داخراو کاڵترە — بە یەک ڕوانین جیا دەکرێتەوە. */
.month.shut { border-color: color-mix(in srgb, var(--warn) 22%, var(--hairline)); }

.month-top {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: var(--s4); flex-wrap: wrap;
}
.month-who { display: flex; flex-direction: column; gap: var(--s2); min-width: 0; }
.month-who h2 { margin: 0; font-size: 17px; }
.month-tags { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }

.month-part {
  margin: 0 0 var(--s2); font-size: 12px; font-weight: 600;
  color: var(--muted); letter-spacing: .02em;
}
.month .note { margin: 0; }
.month .wrap-x + .month-part { margin-top: var(--s3); }

/* ── پەڕەی خێرا — پانێڵ وەک مۆبایل ──────────────────────── */

.tiles {
  display: grid; gap: var(--s3);
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.tiles .empty { grid-column: 1 / -1; }

.tile {
  display: flex; align-items: center; gap: var(--s3);
  padding: var(--s4);
  border: 1px solid var(--hairline); border-radius: var(--r-lg);
  background: var(--glass); color: var(--ink);
  text-decoration: none;
}
.tile:hover { border-color: var(--accent-line); background: var(--glass-2); }
/* قاسەی قەرزدان سەر بە هیچ هەژمارێک نییە — ڕیزی خۆی دەگرێت. */
.tile.safe { grid-column: 1 / -1; }

.tile .mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; flex: 0 0 46px;
  border-radius: 14px;
  font-size: 20px; font-weight: 700; color: #fff;
  background: linear-gradient(140deg, var(--tint), color-mix(in srgb, var(--tint) 62%, transparent));
}
.tile .mark svg { width: 20px; height: 20px; }
/* نیشانەی ژمێرەکەم تۆڕێکی ٥١٢ ـی هەیە و بۆشایی دەوروبەری تێدایە،
   بۆیە کەمێک گەورەتر دەبێت تا لەگەڵ ئایکۆنەکانی تر هاوسەنگ بێت. */
.tile .mark svg.brand { width: 28px; height: 28px; }

/* هەژمارێک کە پرسیاری بێ وەڵامی هەیە — ژمارەکە لە گۆشەکەیەتی
   و ڕووناکییەک بە دەوریدا دێت و دەڕوات، وەک ئەپەکە. */
.tile .mark { position: relative; }
.tile .mark .count {
  position: absolute; top: -7px; inset-inline-end: -7px;
  min-width: 19px; height: 19px; padding: 0 5px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; font-size: 11px; font-weight: 700;
  color: #fff; background: var(--expense);
  border: 2px solid var(--raised);
}
/* ڕووناکییەکی هەمیشەیی، لەگەڵ ئەڵقەیەک کە بڵاو دەبێتەوە و
   دەفەوتێت. بە `box-shadow` دەکێشرێت، چونکە ئەوە لە دەرەوەی
   خانەکە دەردەکەوێت بەبێ ئەوەی ڕیزبەندی چینەکان بشێوێنێت. */
.tile .mark.waiting { animation: markWaiting 1.8s ease-out infinite; }

@keyframes markWaiting {
  from {
    box-shadow: 0 0 14px 2px color-mix(in srgb, var(--expense) 45%, transparent),
                0 0 0 0 color-mix(in srgb, var(--expense) 60%, transparent);
  }
  to {
    box-shadow: 0 0 14px 2px color-mix(in srgb, var(--expense) 45%, transparent),
                0 0 0 15px transparent;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tile .mark.waiting {
    animation: none;
    box-shadow: 0 0 14px 2px color-mix(in srgb, var(--expense) 45%, transparent);
  }
}

.tile .who { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tile .who strong { font-size: 15px; }
.tile .who .sub { display: flex; gap: var(--s2); flex-wrap: wrap; }

/* دوو دوگمەی گەورە — وەک مۆبایل، یەک کرتە بۆ دەستپێکردن. */
.quick-do { display: flex; gap: var(--s3); margin: var(--s4) 0; }
.quick-do .big {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 58px; padding: 0 var(--s4);
  border-radius: var(--r-lg); border: 1px solid transparent;
  font-size: 16px; font-weight: 600; text-decoration: none;
}
.quick-do .big span { font-size: 20px; font-weight: 700; }
.quick-do .big.out { background: var(--expense-soft); border-color: color-mix(in srgb, var(--expense) 40%, transparent); color: var(--expense); }
.quick-do .big.in { background: var(--income-soft); border-color: var(--accent-line); color: var(--income); }
.quick-do .big:hover { filter: brightness(1.18); }

.pair { display: flex; }
.pair > div {
  flex: 1;
  display: flex; flex-direction: column; gap: 2px; align-items: center;
  padding: var(--s3) 0;
}
.pair > div + div { border-inline-start: 1px solid var(--line); }
.pair strong { font-size: 18px; }

/* ── هێڵکاری بچووکی شەش مانگ ─────────────────────────────
 *
 * بە دەست دەکێشرێت — بۆ دوازدە ستوونی سادە کتێبخانەیەک زیادە.
 * کۆنترین مانگ لە لای ڕاست، وەک هێڵکارییەکانی تری ئەپەکە.
 */

.spark { display: flex; gap: 5px; direction: rtl; }
.spark .col { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.spark .pair { display: flex; align-items: flex-end; gap: 1px; height: 26px; }
.spark i { display: block; width: 4px; border-radius: 1.5px; background: var(--hairline); }
.spark i.in { background: var(--income); }
.spark i.out { background: var(--expense); }
/* مانگی بەتاڵ هێڵێکی باریک دەمێنێتەوە، بۆ ئەوەی بەتاڵییەکە دیار بێت. */
.spark i[style*="height:1px"] { background: var(--hairline); }
.spark em { font-style: normal; font-size: 9.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

.note.mismatch {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 12px;
  background: color-mix(in srgb, var(--warn) 13%, transparent);
  border-color: color-mix(in srgb, var(--warn) 34%, transparent);
  color: var(--warn);
}

/* ── ڕیزی گۆڕین لەناو خشتەدا ────────────────────────────── */

.row-actions { display: flex; gap: 5px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.row-actions form { display: flex; gap: 5px; align-items: center; margin: 0; }
.row-actions input[type=text] { width: 130px; min-height: 26px; font-size: 12px; }
.row-actions input[type=color] { width: 30px; height: 26px; }
td:has(> .row-actions) { white-space: nowrap; }

tr.editor td { background: var(--glass); }

/* «pick» لە دوو شوێندا بەکاردێت: لێرە وەک لەیبڵی هەڵبژاردن،
   و لە خشتەکاندا وەک ڕیزێکی کرتەپێکراو. بەبێ ئەم چوارچێوەیە
   ڕیزی خشتەکە display:flex وەردەگرێت و خانەکانی لە ژێر
   سەردێڕەکانی خۆیان دەردەچن. */
.picks { display: flex; flex-direction: column; gap: 4px; }
.picks .pick { display: flex; align-items: center; gap: 7px; font-size: 12.5px; }
.picks .pick input { width: auto; min-height: 0; }
.picks .pick span { font-weight: 500; }
.picks .pick em { font-style: normal; color: var(--faint); font-size: 11px; }
.picks .pick:hover span { color: var(--accent); }

/* خشتەی دەسەڵات — ڕیز دەسەڵاتە، ستوون ڕۆڵە. سەردێڕەکە
   دەچەسپێت بۆ ئەوەی ناوی ڕۆڵەکان لە خوارەوەشدا دیار بن. */
.matrix th.num, .matrix td.num { text-align: center; width: 110px; }
.matrix thead th { position: sticky; top: 0; z-index: 1; background: var(--raised); }
.matrix thead th em { display: block; font-style: normal; font-weight: 400; font-size: 11px; color: var(--faint); }
.matrix tr.section th {
  background: var(--glass);
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-align: start;
  position: static;
}
.matrix tbody tr:hover td { background: var(--glass); }
.matrix .cell { display: flex; justify-content: center; cursor: pointer; }
.matrix .cell input { width: 16px; height: 16px; min-height: 0; margin: 0; }

/* تەنها بۆ خوێنەری شاشە. */
.sr {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ناوی ڕۆڵەکان — ڕیزێکی کورت بۆ هەریەکەیان. */
.roles { display: flex; flex-direction: column; gap: var(--s2); }
.role-row { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; }
.role-row input { flex: 1 1 180px; min-width: 0; }

.tags { display: flex; gap: 5px; flex-wrap: wrap; }
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; padding: 2px 7px; border-radius: var(--r-sm); background: var(--glass); }
.tag em { font-style: normal; color: var(--faint); }

.inline-add { display: flex; gap: 5px; align-items: center; }
.inline-add input { min-height: 28px; font-size: 12.5px; }

.proofs { display: flex; gap: var(--s2); flex-wrap: wrap; }
.proofs figure { margin: 0; width: 130px; }
.proofs img { width: 100%; border-radius: var(--r); border: 1px solid var(--hairline); display: block; }
.proofs figcaption { font-size: 11px; color: var(--faint); margin-top: 3px; }

.msgs { display: flex; flex-direction: column; gap: var(--s3); }
.msg > label { font-size: 11px; font-weight: 600; color: var(--muted); display: block; margin-bottom: 5px; }
.msg textarea { min-height: 78px; font-size: 12.5px; }
.msg-tokens { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 5px; }
.token {
  font-size: 11px; padding: 2px 6px; border-radius: var(--r-sm);
  background: var(--glass); color: var(--muted);
  border: 0; cursor: pointer; font-family: inherit;
}
.token:hover { color: var(--accent); }

.swatch { width: 14px; height: 14px; border-radius: 4px; display: inline-block; vertical-align: -2px; }

.hit { display: block; padding: 8px 0; border-bottom: 1px solid var(--hairline); }
.hit:last-child { border-bottom: 0; }
.hit .sub { display: block; }

.open { position: relative; }
.open .open-hint { opacity: 0; font-size: 10.5px; color: var(--faint); }
tr:hover .open .open-hint, .open:focus-visible .open-hint { opacity: 1; }
tr.pick td:first-child { position: relative; }
tr.pick.here td:first-child { box-shadow: inset 2px 0 0 var(--accent); }
tr.pick.here .open-hint { opacity: 1; color: var(--accent); }

.movers { display: inline-flex; gap: 2px; margin-inline-start: auto; }
h2:has(.movers) { display: flex; align-items: center; gap: var(--s2); }
.mover {
  width: 22px; height: 22px; border: 1px solid var(--hairline); border-radius: var(--r-sm);
  background: transparent; color: var(--faint); cursor: pointer; font-size: 11px; line-height: 1;
}
.mover:hover { border-color: var(--line); color: var(--ink); }

/* ── بۆکس ───────────────────────────────────────────────── */

dialog.box, dialog.ask {
  inset: 0; height: fit-content; margin: auto;
  padding: 0;
  background: var(--raised);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  max-height: min(86vh, 720px);
  overflow: hidden auto;
}
dialog.box { width: min(500px, calc(100vw - 24px)); }
dialog.box.wide { width: min(720px, calc(100vw - 24px)); }
dialog.ask { width: min(380px, calc(100vw - 24px)); }

/* ناوەڕۆکی بۆکسی وردەکاری */
.box-body { padding: var(--s4); display: flex; flex-direction: column; gap: var(--s4); }
.box-body h3 { margin: 0 0 4px; font-size: 12.5px; }
.box-body h3 + .sub { margin-top: -4px; }
.box-body .grid { gap: var(--s2); }
.box-body .stat { background: var(--glass); border-radius: var(--r); }

/* ناوێک کە بۆکسێک دەکاتەوە */
.link-name {
  padding: 0; border: 0; background: none; color: var(--ink);
  font: inherit; text-align: start; cursor: pointer;
}
.link-name:hover { color: var(--accent); }
.link-name:hover .opt { color: var(--accent); }

/* کام هێڵ کامەیە لە چارتی نرخەکاندا */
.chart-keys { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); margin-top: var(--s2); }
.chart-key { display: flex; align-items: center; gap: 6px; font-size: 11.5px; }
.chart-key i { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.chart-key strong { font-size: 11.5px; }
.chart-key .sub { font-variant-numeric: tabular-nums; }

/* خاڵی ڕەنگ لەناو خشتەی جۆرەکاندا */
td > .dot { display: inline-block; margin-inline-end: 5px; vertical-align: middle; }

.chart-ends strong { color: var(--ink); font-variant-numeric: tabular-nums; }
dialog.box::backdrop, dialog.ask::backdrop { background: rgb(0 0 0 / .55); backdrop-filter: blur(2px); }

.box-head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s2);
  margin: 0; padding: var(--s3) var(--s4);
  border-bottom: 1px solid var(--hairline);
  position: sticky; inset-block-start: 0; z-index: 1;
  background: var(--raised);
}
.box-head h2 { margin: 0; font-size: 14px; }

.box-add {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  align-items: end; gap: var(--s2);
  padding: var(--s3) var(--s4);
  border-bottom: 1px solid var(--hairline);
}
.box-add.one { grid-template-columns: minmax(0, 1fr) auto; }
.box-add .field { margin: 0; }

.box-list { padding: var(--s3) var(--s4); display: flex; flex-direction: column; gap: 6px; }
.box-list .empty { padding: var(--s4) 0; }

.box-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  align-items: center; gap: 6px;
  padding: 5px 8px;
  background: var(--glass); border: 1px solid var(--hairline); border-radius: var(--r-sm);
}
.box-row:hover { border-color: var(--line); }

/* خانەکان هەمیشە کراوەن. تا پەنجەیان لێ نەدرێت وەک دەق
   دەردەکەون، بۆیە لیستەکە ئارامە. */
.box-cells { display: flex; gap: 5px; min-width: 0; }
.box-cells input {
  min-width: 0; flex: 1; min-height: 26px; padding: 0 7px;
  font-size: 12.5px; font-weight: 500; color: var(--ink);
  background: transparent; border: 1px solid transparent; border-radius: var(--r-sm);
}
.box-cells input:hover { border-color: var(--hairline); }
.box-cells input:focus { outline: none; background: var(--field); border-color: var(--accent); box-shadow: none; }
.box-cells input[data-cell=plate] { flex: 0 1 30%; color: var(--muted); }
.box-cells input[data-cell=note] { flex: 0 1 34%; color: var(--faint); }

.box-row .btn.drop { border-color: transparent; }
.box-row.asking .btn.drop { background: var(--expense); border-color: transparent; color: #fff; }

.box-row.bad, .box-add.bad { position: relative; }
.box-row.bad { border-color: var(--expense); }
.box-row.bad::after, .box-add.bad::after {
  content: attr(data-note);
  position: absolute; inset-inline: 0; inset-block-start: 100%;
  margin-block-start: 2px; padding: 0 2px;
  font-size: 11px; color: var(--expense);
}

.box-danger { padding: var(--s3) var(--s4) var(--s4); border-top: 1px solid var(--hairline); }
.box-danger h3 { margin: 0 0 2px; font-size: 12.5px; color: var(--expense); }
.box-danger > .sub { margin: 0 0 var(--s3); display: block; }
.box-danger .box-add { padding: 0; border: 0; margin-bottom: var(--s2); }
.box-danger .box-add:last-child { margin-bottom: 0; }

dialog.ask form { display: flex; flex-direction: column; gap: var(--s4); padding: var(--s4); margin: 0; }
dialog.ask .ask-text { margin: 0; font-size: 13px; line-height: 1.65; color: var(--ink-2); }
.ask-buttons { display: flex; gap: var(--s2); }
.ask-buttons .btn { flex: 1; }

/* ── پەیامی کاتی ────────────────────────────────────────── */

.toasts {
  position: fixed; inset-block-end: 14px; inset-inline-start: 14px;
  z-index: 60; display: flex; flex-direction: column; gap: 6px;
  max-width: min(340px, calc(100vw - 28px));
}
.toast {
  display: flex; align-items: center; gap: var(--s2);
  padding: 9px 12px;
  background: var(--raised); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--shadow-lg);
  font-size: 12.5px;
  opacity: 0; transform: translateY(6px);
  transition: opacity .16s, transform .16s;
}
.toast.in { opacity: 1; transform: none; }
.toast::before { content: ""; width: 3px; align-self: stretch; border-radius: 2px; background: var(--accent); flex: none; }
.toast.bad::before { background: var(--expense); }
.toast-text { flex: 1; min-width: 0; }
.toast-x {
  background: none; border: 0; color: var(--faint);
  font-size: 15px; line-height: 1; cursor: pointer; padding: 0;
}
.toast-x:hover { color: var(--ink); }

/* ── چوونەژوورەوە ───────────────────────────────────────── */

.login {
  min-height: 100vh; display: grid; place-items: center;
  padding: var(--s4); background: var(--ground);
}
.login .card { width: min(340px, 100%); }
.login h1 { font-size: 17px; text-align: center; }
.login .sub { text-align: center; display: block; margin: 4px 0 var(--s4); }
.login .btn { width: 100%; }

/* ── شاشەی بچووک ────────────────────────────────────────── */

@media (max-width: 900px) {
  .shell, .shell:has(.side.tight) { grid-template-columns: minmax(0, 1fr); }

  .side {
    position: fixed; inset-block: 0; inset-inline-start: 0;
    width: 240px; z-index: 50;
    transform: translateX(100%);
    transition: transform .2s ease;
  }
  [dir="ltr"] .side { transform: translateX(-100%); }
  .side.open { transform: none; }

  .side-scrim {
    display: block; position: fixed; inset: 0; z-index: 45;
    background: rgb(0 0 0 / .45); opacity: 0; pointer-events: none;
    transition: opacity .2s;
  }
  body.side-open .side-scrim { opacity: 1; pointer-events: auto; }
  body.side-open { overflow: hidden; }

  .nav-open { display: inline-flex; }
  .side-toggle { display: none; }

  .page { padding: var(--s4) var(--s3) 44px; }
  .topbar { padding-inline: var(--s3); }

  .safe-stats { grid-template-columns: 1fr 1fr; }
  .safe-move { grid-template-columns: 1fr; }
  .alert-row { grid-template-columns: minmax(0, 1fr) auto; }
  .alert-row .meter { grid-column: 1 / -1; }
  .alert-row .actions { grid-column: 1 / -1; justify-content: flex-start; }
  .bar-row { grid-template-columns: minmax(0, 1fr) auto; }
  .bar-track { grid-column: 1 / -1; }

  .cal-day { min-height: 52px; padding: 6px 7px 7px; gap: 3px; }
  .cal-in, .cal-out { font-size: 9.5px; }
  .cal-in .full, .cal-out .full { display: none; }
  .cal-in .short, .cal-out .short { display: inline; }
}

@media (max-width: 620px) {
  :root { --pad-card: var(--s3); }

  h1 { font-size: 17px; }
  .head { flex-direction: column; align-items: stretch; }
  .head .actions, .head > .btn { margin-inline-start: 0; }

  .grid, .split, .boxes { grid-template-columns: minmax(0, 1fr); }

  .filters .field, .filters .field.grow { flex: 1 1 100%; }
  .filters > .btn, .filters .actions { width: 100%; }
  .filters > .btn { justify-content: center; }

  .box-add, .box-add.one { grid-template-columns: 1fr; }
  .box-row { grid-template-columns: minmax(0, 1fr) auto; }
  .box-cells { flex-direction: column; }
  .box-cells input[data-cell=second] { flex: 1; }

  .tally-row { grid-template-columns: minmax(0, 1fr) auto; }
  .tally-row input:nth-child(2) { grid-column: 1 / -1; }

  .safe-stats { grid-template-columns: 1fr; }
  .totals { gap: var(--s3); }
  .totals .btn { margin-inline-start: 0; width: 100%; }

  .cal-grid { gap: 2px; }
  .cal-name { font-size: 9.5px; }

  /* خشتەکان لە شاشەی بچووکدا بە ئاسۆیی دەخلیسکێن. */
  .wrap-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  /* بەرزتر لە پانی شاشەکە، بۆ ئەوەی ناوەڕۆکی خانەکان
     نەبنە کۆڵەکەیەکی باریک. */
  .card.tight table { min-width: 660px; }
}

@media print {
  .side, .topbar, .actions, .toasts, .pager { display: none !important; }
  .shell { grid-template-columns: 1fr; }
  .page { padding: 0; }
  .card { border-color: #ccc; }
}

/* خانە باریکەکانی بەنزین — ڕۆژ و نرخ کورتن. */
.f-day { max-width: 84px; }
.f-price input, .f-day input { font-variant-numeric: tabular-nums; }
.card.entry .sub { margin-bottom: var(--s3); display: block; }

/* ── هەڵبژاردنی سندوق لە جەردکردندا ──────────────────────── */

.picker-head {
  display: flex; align-items: center; gap: var(--s2);
  font-size: 11px; font-weight: 600; color: var(--muted);
  margin-bottom: 6px;
}
.picker-head .link {
  background: none; border: 0; padding: 0; margin-inline-start: auto;
  font: inherit; font-size: 11px; color: var(--accent); cursor: pointer;
}

.picker { display: flex; flex-wrap: wrap; gap: 5px; }
.picker .tick { position: relative; margin: 0; }
.picker .tick input { position: absolute; opacity: 0; pointer-events: none; }
.picker .tick > span {
  display: inline-flex; align-items: center; gap: 5px;
  height: 28px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: var(--r);
  color: var(--muted); font-size: 12.5px; cursor: pointer;
  white-space: nowrap;
}
.picker .tick > span:hover { border-color: var(--muted); color: var(--ink-2); }
.picker .tick input:checked + span {
  background: var(--accent-soft); border-color: var(--accent-line);
  color: var(--accent); font-weight: 600;
}
.picker .tick em { font-style: normal; font-size: 10.5px; opacity: .7; }
.picker .tick input:focus-visible + span { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }

/* ── نۆتەکانی هەژمار ─────────────────────────────────────── */

.note-card {
  background: var(--raised);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  padding: var(--s3) var(--s4);
}
.note-card.pinned { border-color: var(--accent-line); }

/* کاتی بیرخستنەوەکەی هاتووە — بە خەتێکی ڕەنگین لە قەراغەوە. */
.note-card.due {
  border-color: color-mix(in srgb, var(--warn) 45%, var(--hairline));
  border-inline-start: 3px solid var(--warn);
}

/* خانەی نووسین — دێڕی یەکەم گەورەترە، وەک ناونیشانێک. */
.notepad {
  min-height: 108px;
  font-size: 13px; line-height: 1.85;
  resize: vertical;
}
.notepad::first-line { font-size: 15px; font-weight: 650; color: var(--ink); }

/* کاتی بیرخستنەوە — پانی هێندەی ژمارەکە بەسە. */
.field .when { max-width: 240px; }

/* ── وەسڵی دراوێکی تر ────────────────────────────────────── */

.swap-box {
  margin-top: var(--s3);
  padding: var(--s3);
  border: 1px solid var(--hairline);
  border-radius: var(--r);
  background: var(--sunken);
  display: flex; flex-direction: column; gap: var(--s3);
}
.swap-rate { display: flex; align-items: flex-end; gap: var(--s4); flex-wrap: wrap; }
.swap-rate .field { margin-bottom: 0; }
.swap-out { display: flex; align-items: baseline; gap: 6px; }
.swap-out strong { font-size: 15px; color: var(--accent); }
.field > span em { font-weight: 400; font-style: normal; opacity: .6; }

.note-head {
  display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap;
  margin-bottom: 6px;
}
.note-head h3 { margin: 0; font-size: 13.5px; }
.note-head .sub { margin-inline-start: auto; white-space: nowrap; }
.note-head .actions { flex: none; }

.note-body {
  margin: 0 0 6px;
  font-size: 12.5px; line-height: 1.75; color: var(--ink-2);
  white-space: pre-wrap;
}

/* ── ڕەنگی نۆت ───────────────────────────────────────────── */

.note-colors {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 10px 0 4px;
    flex-wrap: wrap;
}

.note-color {
    cursor: pointer;
    line-height: 0;
}

.note-color input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.note-color span {
    display: inline-block;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--note, transparent);
    border: 2px solid transparent;
    box-shadow: 0 0 0 1px var(--line) inset;
}

.note-color.none span {
    width: auto;
    height: auto;
    border-radius: 999px;
    background: transparent;
    padding: 4px 10px;
    font-size: 12px;
    line-height: 1.6;
    color: var(--ink-muted);
}

.note-color input:checked + span {
    border-color: var(--ink);
}

/* کارتی نۆتی ڕەنگاوڕەنگ — تەنها هێڵێکی لاتەنیشت، بۆ ئەوەی
   خوێندنەوەی دەقەکە ئاسان بمێنێتەوە. */
.note-card[data-colored] {
    border-inline-start: 4px solid var(--note);
}

/* ── ئامێرەکان ───────────────────────────────────────────── */

.device-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.device-head {
    display: flex;
    align-items: flex-end;
    gap: 14px;
    flex-wrap: wrap;
}

.device-head .grow {
    flex: 1 1 220px;
}

.device-facts {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    padding-bottom: 6px;
}

.device-funds summary {
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
}

.device-funds .hint {
    margin: 6px 0 10px;
    font-size: 12px;
    color: var(--ink-muted);
}

.device-foot {
    display: flex;
    justify-content: flex-end;
}

.device-remove {
    display: flex;
    justify-content: flex-end;
    border-top: 1px solid var(--line);
    padding-top: 10px;
}

/* ── ڕاپۆرتی کۆمپانیا ───────────────────────────────────── */

.company-report section + section { margin-top: var(--s4); }
.company-report h3.title-h { font-size: 14px; margin: 0 0 var(--s2); }
.company-report tr.total td { font-weight: 700; background: var(--glass); }
.company-report td.num { text-align: center; }
details.pop > summary { list-style: none; }
details.pop > summary::-webkit-details-marker { display: none; }

/* لیستی گەڕان — select ـی درێژ (فەصڵ و مادە). */
.combo { position: relative; }
.combo input { width: 100%; }
.combo-list {
  position: absolute; inset-inline: 0; inset-block-start: calc(100% + 4px); z-index: 70;
  max-height: 300px; overflow-y: auto;
  background: var(--raised); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: 0 18px 42px rgba(0, 0, 0, .35);
}
.combo-list[hidden] { display: none; }
.combo-group { padding: 6px 12px 2px; font-size: 11px; font-weight: 600; color: var(--faint); }
.combo-item { padding: 7px 12px; font-size: 13px; cursor: pointer; }
.combo-item:hover, .combo-item.on { background: var(--accent-soft); color: var(--ink); }

/* دوگمەی گەڕانەوە لە سەرووی سەردێڕی پەڕە. */
.back-link { margin-bottom: var(--s2); align-self: flex-start; width: fit-content; }

/* پەڕەکانی کۆمپانیا — فۆرم لای ڕاست، لیست لای چەپ؛ لە شاشەی تەنگدا یەک لە دوای یەک. */
.co-split { display: grid; gap: var(--gap-card); grid-template-columns: minmax(0, 1fr); align-items: start; }
.co-list, .co-side { display: flex; flex-direction: column; gap: var(--gap-card); min-width: 0; }
.co-list > *, .co-side > * { margin: 0; }
.co-side > [hidden] { display: none; }
/* پانی شاشە، بە حسابی لیستی لای ڕاست (~٣٠٠px). نابێت `.page` بکرێتە
   container: ئەوە دەبێتە بنەمای `position: fixed` و لیستە ⋯ ـەکان
   لە شوێنی خۆیان دووردەکەونەوە. */
@media (min-width: 1180px) {
  .co-split { grid-template-columns: 330px minmax(0, 1fr); }
  .co-form { margin: 0; }
}
@media (min-width: 1560px) {
  .co-split { grid-template-columns: 370px minmax(0, 1fr); }
}

/* خشتەکانی لای چەپ — ناو یەک دێڕ، زانیاری لاوەکی بچووک و کورت. */
.co-list table td, .co-list table th { padding-inline: 12px; }
.co-list td .sub.one { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.co-list td:last-child:has(> details.pop) { width: 1%; }

/* کورتەی مانگ — ڕیزی گەڕان، پاشان چوار ژمارە بە ناونیشانی خۆیان. */
.co-month { display: flex; flex-direction: column; gap: var(--s3); }
.co-month-nav { display: flex; align-items: center; gap: 6px; }
.co-month-nav .grow { flex: 1; }
.co-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s2); }
.co-kpis > div { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 10px; background: var(--glass); min-width: 0; }
.co-kpis .sub { white-space: nowrap; }
.co-kpis strong, .co-kpis .money { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 600px) { .co-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ── ڕاپۆرتی کۆمپانیا ─────────────────────────────────────── */

/* یەک ڕیزی بچووک — مانگ، سفرەکان، چاپ، ئێکسڵ، داخستن. */
.rp-bar { display: flex; align-items: center; gap: var(--s2) var(--s4); flex-wrap: wrap; padding-block: var(--s2); }
.rp-month { display: flex; align-items: center; gap: 6px; }
.rp-month strong { min-width: 64px; text-align: center; }
.rp-actions { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; margin-inline-start: auto; }
.rp-actions form { margin: 0; }

/* دوگمەی دوو-بەشی — پیشاندان / لابردن. */
.rp-seg { display: inline-flex; align-items: center; gap: 2px; }
.rp-seg .sub { margin-inline-end: 6px; }
.rp-seg a {
  padding: 4px 10px; font-size: 12px; text-decoration: none; color: var(--muted);
  border: 1px solid var(--hairline); background: transparent;
}
.rp-seg a:first-of-type { border-start-start-radius: var(--r-sm); border-end-start-radius: var(--r-sm); }
.rp-seg a:last-of-type { border-start-end-radius: var(--r-sm); border-end-end-radius: var(--r-sm); }
.rp-seg a.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink, #04130c); font-weight: 600; }

/* کارتەکانی چارت — دوو ستوون لە شاشەی پان. */
.rp-grid { display: grid; gap: var(--gap-card); grid-template-columns: minmax(0, 1fr); margin-top: var(--gap-card); }
.rp-grid > .card { margin: 0; min-width: 0; }
@media (min-width: 900px) {
  .rp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rp-wide { grid-column: 1 / -1; }
}
.rp-head { display: flex; align-items: baseline; gap: var(--s3); flex-wrap: wrap; margin-bottom: var(--s3); }
.rp-head h2 { margin: 0; flex: 1; }
.rp-legend { display: flex; gap: var(--s3); font-size: 12px; color: var(--muted); }
.rp-legend span { display: inline-flex; align-items: center; gap: 5px; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.sw.in { background: var(--income); }
.sw.out { background: var(--expense); }

/* ستوونی دووانە — هات لای ڕاست، چوو لای چەپ؛ ٢px بۆشایی لە نێوانیاندا. */
.rp-year { justify-content: space-between; }
.rp-year .chart-col { max-width: none; }
.rp-pair { height: 140px; gap: 2px; }
.rp-b { flex: 1 1 0; min-height: 2px; border-radius: 4px 4px 0 0; }
.rp-b.in { background: var(--income); }
.rp-b.out { background: var(--expense); }
.rp-b.none { background: var(--hairline); }
.rp-year .chart-col.on { background: var(--glass); }
.rp-foot { display: flex; gap: var(--s2) var(--s4); flex-wrap: wrap; margin-top: var(--s3); padding-top: var(--s2); border-top: 1px solid var(--hairline); }

.bar-fill.rp-out { background: var(--expense); }

.rp-budget { display: flex; flex-direction: column; gap: 6px; }
.rp-budget-top { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; font-size: 12.5px; }
.rp-budget-top .bar-name { flex: 1; }
.meter.over span { background: var(--expense); }

.rp-tip {
  position: fixed; z-index: 80; pointer-events: none;
  padding: 8px 10px; font-size: 12px; line-height: 1.6;
  background: var(--raised); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .35);
}
.rp-tip strong { display: block; margin-bottom: 2px; }
.rp-tip[hidden] { display: none; }

/* ── فەصڵ و مادەکان لە ڕێکخستن — بە فەصڵ داخراو، بە گەڕان ── */
.acc-tools { display: flex; align-items: center; gap: var(--s2) var(--s3); flex-wrap: wrap; }
.acc-tools input[type=search] { flex: 1 1 260px; max-width: 420px; }
.acc-tools form { margin: 0; }
.acc-groups { display: flex; flex-direction: column; gap: var(--s2); margin-top: var(--s2); }
.acc-group > summary { display: flex; align-items: baseline; gap: var(--s3); }
.acc-rows { display: flex; flex-direction: column; }
.acc-row {
  display: grid; align-items: center; gap: var(--s2);
  grid-template-columns: auto minmax(140px, 1fr) 130px 64px auto auto;
  padding: 6px 0; border-top: 1px solid var(--hairline);
}
.acc-row:first-child { border-top: 0; }
.acc-row[hidden] { display: none; }
.acc-row.off { opacity: .55; }
.acc-row form { display: contents; }
.acc-code { display: inline-flex; align-items: center; gap: 2px; }
.acc-code input { width: 44px; padding-inline: 4px; text-align: center; }
.acc-uses { text-align: end; }
.acc-on { display: inline-flex; gap: 4px; align-items: center; white-space: nowrap; }
@media (max-width: 760px) {
  .acc-row { grid-template-columns: auto 1fr; }
  .acc-limit, .acc-uses, .acc-on, .acc-row .actions { grid-column: 2; }
}

/* ── پۆپ ئەپی وێنە ── */
.pics-link { background: none; border: 0; padding: 0; font: inherit; font-size: 12px; color: var(--accent); cursor: pointer; }
.pics-link:hover { text-decoration: none; filter: brightness(1.22); }
.zk-gallery {
  position: fixed; inset: 0; z-index: 200; display: flex; flex-direction: column;
  background: rgba(4, 10, 16, .92); backdrop-filter: blur(4px);
}
.zk-gallery[hidden] { display: none; }
.zk-g-top { display: flex; align-items: center; gap: var(--s3); padding: 12px 16px; color: #e6edf3; }
.zk-g-title { flex: 1; font-size: 15px; }
.zk-g-count { font-size: 13px; color: #9fb0c0; }
.zk-g-open { font-size: 12.5px; color: #9fb0c0; }
.zk-g-close {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid rgba(255,255,255,.15);
  background: rgba(255,255,255,.06); color: #fff; font-size: 16px; cursor: pointer;
}
.zk-g-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 0 12px; }
.zk-g-img { max-width: min(92vw, 1100px); max-height: 100%; object-fit: contain; border-radius: 8px; background: #fff; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.zk-g-nav {
  flex: none; width: 46px; height: 46px; border-radius: 50%; border: 1px solid rgba(255,255,255,.15);
  background: rgba(255,255,255,.08); color: #fff; font-size: 24px; line-height: 1; cursor: pointer;
}
.zk-g-nav[hidden] { display: none; }
.zk-g-nav:hover, .zk-g-close:hover { background: rgba(255,255,255,.16); }
.zk-g-thumbs { display: flex; justify-content: center; gap: 8px; padding: 12px; overflow-x: auto; }
.zk-g-thumbs[hidden] { display: none; }
.zk-g-thumbs button { padding: 0; border: 2px solid transparent; border-radius: 6px; background: none; cursor: pointer; opacity: .6; }
.zk-g-thumbs button.on { border-color: var(--accent); opacity: 1; }
.zk-g-thumbs img { display: block; width: 56px; height: 56px; object-fit: cover; border-radius: 4px; }
@media (max-width: 640px) { .zk-g-nav { width: 38px; height: 38px; font-size: 20px; } .zk-g-open { display: none; } }

/* ── شیکاری ─────────────────────────────────────────────── */

/* هێڵکاری — SVG ـی ناوخۆیی. */
.lc { position: relative; padding-top: 4px; }
.lc svg { display: block; width: 100%; height: 200px; overflow: visible; }
.lc-grid { stroke: var(--hairline); stroke-width: 1; vector-effect: non-scaling-stroke; }
.lc-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.lc-line.out { stroke: var(--expense); }
.lc-line.in { stroke: var(--income); }
.lc-line.prev { stroke: var(--muted); }
.lc-line.dashed { stroke-dasharray: 5 4; }
.lc-hit { fill: transparent; cursor: default; outline: none; }
.lc-hit:hover, .lc-hit:focus { fill: var(--glass); }
.lc-dot {
  position: absolute; width: 9px; height: 9px; border-radius: 50%;
  transform: translate(50%, -50%); margin-top: 4px; pointer-events: none;
  box-shadow: 0 0 0 2px var(--raised);
}
.lc-dot.out { background: var(--expense); }
.lc-dot.in { background: var(--income); }
.lc-dot.prev { background: var(--muted); }
.lc-axis { display: flex; justify-content: space-between; margin-top: 6px; font-size: 10.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.lc-scale { position: absolute; top: 0; inset-inline-end: 0; font-size: 10.5px; }
.lc-key { display: inline-block; width: 16px; height: 0; border-top: 2px solid; vertical-align: middle; }
.lc-key.out { border-color: var(--expense); }
.lc-key.in { border-color: var(--income); }
.lc-key.prev { border-color: var(--muted); }
.lc-key.dashed { border-top-style: dashed; }

.an-delta { font-size: 12px; font-weight: 600; color: var(--muted); }
.an-delta.up { color: var(--expense); }
.an-delta.down { color: var(--income); }
.an-delta .sub { font-weight: 400; }

.an-notes { margin-top: var(--gap-card); }
.an-notes h2 { margin-bottom: var(--s2); }
.an-notes ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.an-notes li { display: flex; gap: 8px; align-items: baseline; font-size: 13.5px; line-height: 1.7; }
.an-ic { flex: none; font-size: 10px; color: var(--muted); }
.an-notes li.up .an-ic { color: var(--expense); }
.an-notes li.down .an-ic { color: var(--income); }
.an-explain { margin: var(--s2) 0 0; }

/* نیشانەی هەر مانگێک: زیادە یان کورتهێنان. */
.an-net { display: flex; justify-content: space-between; margin-top: 6px; }
.an-net span { flex: 1; text-align: center; font-weight: 700; font-size: 13px; }
.an-net .in { color: var(--income); }
.an-net .out { color: var(--expense); }

/* گۆڕانی مادەکان — ستوونی دوولایەنە لە ناوەڕاستەوە. */
.an-movers { display: flex; flex-direction: column; gap: var(--s2); margin-top: var(--s2); }
.an-mover { display: grid; grid-template-columns: minmax(90px, 1.2fr) minmax(80px, 2fr) auto; align-items: center; gap: var(--s3); font-size: 12.5px; }
.an-track { display: flex; height: 10px; }
.an-half { flex: 1; display: flex; }
.an-half.neg { justify-content: flex-end; border-inline-end: 1px solid var(--line); }
.an-half.pos { justify-content: flex-start; }
.an-half i { display: block; height: 100%; }
.an-half.neg i { background: var(--income); border-radius: 0 3px 3px 0; }
.an-half.pos i { background: var(--expense); border-radius: 3px 0 0 3px; }

.an-budgets { display: grid; gap: var(--s3); grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

/* داواکردنی ئیمزا. */
.sign-ask { display: flex; align-items: center; gap: var(--s2) var(--s3); flex-wrap: wrap; border-color: color-mix(in srgb, var(--accent) 45%, var(--hairline)); color: var(--ink); }
.sign-ask form { margin: 0; }

/* ئیمزا لە مۆبایلەوە — دوگمەی گەورە بۆ پەنجە. */
.sign-phone { display: flex; flex-direction: column; gap: var(--s3); }
.sign-phone-amount { font-size: 26px; font-weight: 800; }
.sign-phone dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: 14px; }
.sign-phone dt { color: var(--muted); }
.sign-phone dd { margin: 0; }
.sign-phone-btn { width: 100%; min-height: 52px; font-size: 16px; }
.sign-phone-done { padding: 12px 14px; border-radius: var(--r); background: var(--accent-soft, rgba(58,214,141,.12)); color: var(--accent); font-weight: 600; }

/* تۆمارکردنی دووبارەیەک — بەروار و دوگمە لە یەک ڕیزدا. */
.rec-do { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
.rec-do input[type=date] { width: 140px; padding-block: 4px; }

/* ── لیستی کۆمپانیاکان — کارتی چوارگۆشە ── */
.co-mobile { display: inline-flex; align-items: center; gap: 6px; }
.co-mobile .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.co-mobile.on .dot { background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.co-new { width: 340px; padding: var(--s3); }
.co-new textarea { width: 100%; margin-top: 6px; }

.co-cards { display: grid; gap: var(--gap-card); grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); margin-top: var(--gap-card); }
.co-card {
  display: flex; flex-direction: column; gap: 4px; margin: 0;
  aspect-ratio: 1 / 1; min-height: 230px; overflow: hidden;
  text-decoration: none; color: inherit;
  transition: border-color .15s, transform .15s;
}
.co-card:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--hairline)); transform: translateY(-2px); }
.co-card.off { opacity: .6; }
.co-card-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: var(--s2); }
.co-logo { width: 44px; height: 44px; border-radius: 12px; object-fit: contain; background: var(--glass-2); }
.co-initial { display: grid; place-items: center; font-size: 20px; font-weight: 800; color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.co-badge { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--expense); color: #fff; }
.co-name { font-size: 16px; line-height: 1.4; }
.co-balance { font-size: 22px; font-weight: 800; }
.co-balance.neg { color: var(--expense); }
.co-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: var(--s2) 0 auto; padding-top: var(--s2); border-top: 1px solid var(--hairline); }
.co-facts > span { display: flex; flex-direction: column; gap: 1px; font-size: 12.5px; }
.co-note { font-size: 11.5px; line-height: 1.5; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.co-note.late { color: var(--expense); }
.co-note.soon { color: var(--warn); }
@media (max-width: 520px) { .co-card { aspect-ratio: auto; min-height: 0; } }

.co-reminders { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.co-reminders li { display: flex; gap: 8px; align-items: baseline; font-size: 13.5px; }
.co-reminders li.late > span:first-child { color: var(--expense); }
.co-reminders li.soon > span:first-child { color: var(--warn); }

/* فۆرمەکانی لای ڕاست — دوو ستوونی یەکسان: بڕ و بەروار، وەرگر و مۆبایل
   هەمان پانییان هەیە. خانەی درێژ (فەصڵ و مادە، تێبینی) هەموو ڕیزەکە دەگرێت. */
.co-side .filters, .co-form .filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3) var(--s3); align-items: end; }
/* خانەیەک کە بە تەنها لە ڕیزێکدا ماوەتەوە (پێش و دوای هەردووکیان پڕن) هەموو ڕیزەکە دەگرێت. */
.co-side .filters > .field.solo, .co-form .filters > .field.solo { grid-column: 1 / -1; }
.co-side .filters > .field, .co-form .filters > .field { min-width: 0; width: auto; flex: none !important; margin: 0; }
.co-side .filters > .field[style*="flex:2"], .co-form .filters > .field[style*="flex:2"],
.co-side .filters > .field[style*="flex:1.6"], .co-form .filters > .field[style*="flex:1.6"] { grid-column: 1 / -1; }
.co-side .filters > .btn, .co-form .filters > .btn,
.co-side .filters > label, .co-form .filters > label { grid-column: 1 / -1; justify-self: start; }
@media (max-width: 420px) {
  .co-side .filters, .co-form .filters { grid-template-columns: minmax(0, 1fr); }
}

/* ── خانەی بەروار: «2026/08/30» — لە ڕاستەوە ڕۆژ، مانگ، ساڵ ── */
/* 📅 لە ناو خانەکەدایە (لای چەپ)، بۆیە پانییەکەی وەک هەر خانەیەکی تر. */
div.zk-date { position: relative; display: block; width: 100%; }
div.zk-date > input[type=text] { width: 100%; padding-left: 38px; text-align: right; font-variant-numeric: tabular-nums; }
div.zk-date > input[type=text].bad { border-color: var(--expense); }
div.zk-date > .zk-date-pick {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  font-size: 14px; line-height: 1; opacity: .7; pointer-events: none;
}
div.zk-date > input[type=text] { cursor: pointer; }
/* خانە ڕاستەقینەکە — دیار نییە، بەڵام لە فۆرمدایە و ڕۆژژمێرەکەی لە شوێنی 📅 دەکرێتەوە. */
div.zk-date > .zk-date-iso {
  position: absolute; left: 4px; bottom: 0; width: 30px; height: 1px;
  padding: 0; margin: 0; border: 0; opacity: 0; pointer-events: none; overflow: hidden;
}
.rec-do div.zk-date { width: 160px; }


/* ── ڕۆژژمێری بچووک: تەنها ڕۆژ، مانگ بە ‹ › ── */
.zk-cal {
  position: fixed; z-index: 150; width: 268px; padding: 10px;
  background: var(--raised); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: 0 18px 42px rgba(0, 0, 0, .45);
}
.zk-cal[hidden] { display: none; }
.zk-cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.zk-cal-title { font-size: 15px; font-weight: 700; }
.zk-cal-nav {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--hairline);
  background: transparent; color: var(--ink); font-size: 18px; line-height: 1; cursor: pointer;
}
.zk-cal-nav:hover { background: var(--glass); }
.zk-cal-week, .zk-cal-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; text-align: center; }
.zk-cal-week span { font-size: 11px; color: var(--faint); padding: 2px 0; }
.zk-cal-days button {
  height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--ink);
  font: inherit; font-size: 13px; font-variant-numeric: tabular-nums; cursor: pointer;
}
.zk-cal-days button:hover { background: var(--glass-2); }
.zk-cal-days button.today { box-shadow: inset 0 0 0 1px var(--accent); color: var(--accent); font-weight: 700; }
.zk-cal-days button.on { background: var(--accent); color: var(--accent-ink, #04130c); font-weight: 700; }
.zk-cal-days button:disabled { opacity: .3; cursor: not-allowed; }
.zk-cal-foot { display: flex; justify-content: space-between; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--hairline); }
.zk-cal-foot button { border: 0; background: transparent; color: var(--accent); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; padding: 4px 6px; border-radius: 6px; }
.zk-cal-foot button:hover { background: var(--glass); }
.zk-cal-foot button[hidden] { display: none; }

/* ── ژماردنی خەزنە ── */
.cc-notes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px var(--s3); }
.cc-note { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 72px); align-items: center; gap: 6px; font-size: 13px; min-width: 0; }
.cc-note > .num { text-align: end; }
.cc-note input { min-width: 0; width: 100%; padding-inline: 6px; }
.cc-note input { text-align: center; }
.cc-result { display: flex; justify-content: space-between; gap: var(--s3); padding: 10px 12px; border-radius: var(--r); background: var(--glass); font-size: 13px; }
.cc-result[hidden] { display: none; }

/* ── پشکنینی داخستنی مانگ ── */
.cl-card { margin-top: var(--gap-card); }
.cl-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.cl-list > li { display: flex; align-items: flex-start; gap: var(--s3); padding: 10px 0; border-top: 1px solid var(--hairline); }
.cl-list > li:first-child { border-top: 0; }
.cl-mark { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 800; }
.cl-list li.ok .cl-mark { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }
.cl-list li.todo .cl-mark { background: color-mix(in srgb, var(--warn) 20%, transparent); color: var(--warn); }
.cl-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cl-list li.ok .cl-body strong { color: var(--muted); font-weight: 600; }
.cl-more summary { cursor: pointer; }
.cl-more ul { margin: 4px 0 0; padding-inline-start: 18px; }

/* ── مێژووی وەسڵ — هێڵی کات ── */
.hist { list-style: none; margin: 0; padding: 0; position: relative; }
.hist::before { content: ""; position: absolute; top: 8px; bottom: 8px; inset-inline-start: 15px; width: 2px; background: var(--hairline); }
.hist > li { position: relative; display: flex; gap: var(--s3); padding: 8px 0; }
.hist-ic { position: relative; z-index: 1; flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--raised); border: 1px solid var(--hairline); font-size: 14px; }
.hist li.in .hist-ic { border-color: color-mix(in srgb, var(--accent) 55%, var(--hairline)); color: var(--accent); }
.hist li.out .hist-ic { border-color: color-mix(in srgb, var(--expense) 55%, var(--hairline)); color: var(--expense); }
.hist-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; padding-top: 5px; }
.hist-top { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.hist-at { margin-inline-start: auto; }

/* ── کێ کۆمپانیاکە دەبینێت ── */
.acc-people { display: grid; gap: var(--s2); grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.acc-person { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--hairline); border-radius: var(--r); cursor: pointer; }
.acc-person:has(input:checked) { border-color: color-mix(in srgb, var(--accent) 55%, var(--hairline)); }
.acc-person > span { display: flex; flex-direction: column; gap: 2px; }

/* پەڕەکانی لیستی کۆمپانیا — لە ژێر خشتەکە، لە ناو هەمان کارت. */
.co-pager { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; padding: 10px 12px; border-top: 1px solid var(--hairline); }
.co-pager .pager .gap { border: 0; background: none; padding-inline: 2px; }
.co-pager .pager [aria-disabled] { opacity: .4; }

/* دوگمەکانی ڕیز — چاپ، دەستکاری، سڕینەوە دیارن؛ ئەوانی تر لە ⋯ دا. */
.co-acts { display: flex; gap: 4px; align-items: center; justify-content: flex-end; flex-wrap: nowrap; }
.co-acts form { margin: 0; display: flex; }
.co-acts .ico, .co-acts details.pop > summary.ico { display: inline-grid; place-items: center; width: 30px; height: 30px; padding: 0; border-radius: 8px;
  border: 1px solid var(--hairline); background: none; color: var(--muted); cursor: pointer; list-style: none; }
.co-acts details.pop > summary.ico::-webkit-details-marker { display: none; }
.co-acts .ico:hover, .co-acts details.pop[open] > summary.ico { color: var(--ink); border-color: var(--line); background: var(--glass); }
.co-acts .ico.del:hover { color: var(--expense); border-color: color-mix(in srgb, var(--expense) 40%, var(--hairline)); }
td:has(> .co-acts) { width: 1%; white-space: nowrap; }

/* سەردێڕی ستوونی ڕیزبەندی. */
th .th-sort { color: inherit; display: inline-flex; align-items: center; gap: 4px; text-decoration: none; }
th .th-sort span { opacity: .35; font-size: 10px; }
th .th-sort:hover, th .th-sort.on { color: var(--ink); }
th .th-sort.on span { opacity: 1; color: var(--accent); }
th.num .th-sort { flex-direction: row-reverse; }

/* دوگمەکانی ڕیز لە شاشەی تەنگدا دوو بە دوو. */
@media (max-width: 1480px) {
  .co-list .co-acts { display: grid; grid-template-columns: repeat(2, 30px); gap: 4px; }
}
.co-per { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.co-per .pager a, .co-per .pager span { min-width: 30px; font-size: 11.5px; }

/* ئیمزای من — هەموو پێکەوە. */
.sg-bulk { display: flex; align-items: center; gap: var(--s2) var(--s3); flex-wrap: wrap; }
.sg-bulk form { margin: 0; }
.sg-bulk .grow { flex: 1; }
.sg-month { display: flex; align-items: center; gap: var(--s2); }
.sg-month select { min-width: 160px; }
.sg-who { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.chip-check { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--hairline); border-radius: 999px; cursor: pointer; font-size: 12.5px; }
.chip-check:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.chip-check input { margin: 0; }

/* پێشبینینی خوارەوەی پسوڵە لە ڕێکخستن — هەمان پێوانەکانی company-receipt.css. */
.rc-prev { margin-top: var(--s3); background: #fff; color: #1d1d1f; border-radius: 10px; padding: 26px 22px 16px; display: flex; gap: 18px; align-items: flex-start; overflow: hidden; }
.rc-signers { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); gap: 10px; flex: 1; }
.rc-signers > div { text-align: center; min-width: 0; position: relative; }
.rc-signers > div[hidden] { display: none; }
.rc-signers .who { color: #2e8b67; font-weight: 800; font-size: 13px; }
.rc-signers .sig { position: relative; height: 11px; }
.rc-signers .sig img { position: absolute; bottom: 0; left: 50%; transform: translate(calc(-50% + var(--x, 0) * 3.78px), calc(var(--y, 0) * 3.78px)) rotate(var(--r, 0deg)); height: calc(53px * var(--size, 1)); max-width: none; mix-blend-mode: multiply; z-index: 2; }
.rc-signers .name { font-weight: 700; font-size: 12px; white-space: nowrap; overflow: hidden; position: relative; z-index: 1; }
.rc-party { flex: 0 0 34%; font-size: 13px; display: flex; flex-direction: column; gap: 10px; }
.rc-party span { border-bottom: 1px dotted #999; }

.sig-move { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s2); }
.sig-move .field { margin: 0; }
.sig-move label { font-size: 11px; }
.sig-move input[type=range] { width: 100%; min-width: 0; margin: 0; }

/* کارتی ئیمزاکەر — بەشی «لە پسوڵەدا»: هەر ڕێکخستنێک ڕیزێک. */
.sg-tune { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--hairline); border-radius: 12px; background: var(--glass); }
.sg-tune-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2px; }
.sg-row { display: grid; grid-template-columns: 74px minmax(0, 1fr) 52px; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted); }
.sg-row input[type=range] { width: 100%; min-width: 0; margin: 0; }
.sg-row output { text-align: end; color: var(--ink); font-size: 12px; }
.sg-row select { grid-column: 2 / -1; }
.sg-flags { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.sg-flags label { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border: 1px solid var(--hairline); border-radius: 10px; font-size: 12.5px; white-space: nowrap; cursor: pointer; }
.sg-flags label:has(input:checked) { border-color: color-mix(in srgb, var(--accent) 45%, var(--hairline)); }

/* ── وەسڵێک بە چەند پسوڵەی بچووکەوە — بە کلیک دەکرێتەوە ── */
tr.has-items { cursor: pointer; }
tr.has-items:hover > td { background: var(--glass-2); }
.items-chip { margin-inline-start: 6px; cursor: pointer; }
.items-chip .caret { display: inline-block; transition: transform .15s; font-size: 10px; }
tr.has-items.open .caret { transform: rotate(180deg); }
tr.items-detail > td { background: var(--glass); padding: 0; }
.items-box { padding: 10px 14px 14px; }
.items-box > strong { display: block; font-size: 12.5px; margin-bottom: 6px; color: var(--ink-2); }
.items-box table { background: var(--raised); border-radius: var(--r); overflow: hidden; }
.items-box tr.total td { font-weight: 700; background: var(--glass); }

/* دێڕێکی پسوڵەی بچووک — کارتێکی بچووک: ناو، جۆر، پاشان بڕ و ژمارەی کاغەز.
   فۆرمەکە لە لای ڕاستدا تەنگە، بۆیە پێنج ستوون لە یەک ڕیزدا ژمارەکانی دەبڕی. */
.item-row {
  position: relative; display: grid; grid-template-columns: 1.3fr 1fr; gap: 6px;
  padding: 8px; background: var(--glass); border: 1px solid var(--hairline); border-radius: var(--r);
}
.item-row .i-name { grid-column: 1 / -1; padding-inline-end: 34px; }
.item-row .i-type { grid-column: 1 / -1; }
.item-row .i-type .combo input, .item-row .i-type select { width: 100%; }
.item-row .i-x { position: absolute; top: 10px; inset-inline-end: 10px; padding: 0 7px; min-height: 26px; }

.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }


/* ── داهات و خەرجی جیا — هێڵی لای ڕیز و نیشانەی +/− ─────────── */
/* هێڵی لای ڕاستی ڕیز — `border-right` چونکە خانەی ژمارە ltr ـە و inline-start دەچێتە لای چەپ. */
tr.en > td:first-child { border-right: 3px solid transparent; }
tr.en-in > td:first-child { border-right-color: var(--income); }
tr.en-out > td:first-child { border-right-color: var(--expense); }
tr.en-in > td { background: color-mix(in srgb, var(--income-soft) 55%, transparent); }
tr.en-in:hover > td, tr.en-out:hover > td { filter: brightness(1.15); }
.money .sgn { margin-inline-end: 2px; font-weight: 700; }
.kind-tag { display: inline-block; margin-top: 3px; padding: 1px 7px; border-radius: 999px; font-size: 10.5px; font-weight: 600; }
.kind-tag.in { background: var(--income-soft); color: var(--income); border: 1px solid color-mix(in srgb, var(--income) 35%, transparent); }
.kind-tag.out { background: var(--expense-soft); color: var(--expense); border: 1px solid color-mix(in srgb, var(--expense) 35%, transparent); }

/* ── ژوورەکان — هەر ژوورێک ڕەنگی خۆی (--dept)، ڕیزی وەسڵەکانی بە کاڵی ─── */
/* ژوور تەنها بە هایلایتی ڕیزەکە جیا دەکرێتەوە — نووسینەکان (ناو، بڕ، نیشانە) ڕەنگی ئاسایی خۆیان دەمێنن. */
tr.en-dept > td { background: color-mix(in srgb, var(--dept) 16%, transparent); }
tr.en-dept > td:first-child { border-right-color: var(--dept); }
.dept-tag { display: inline-block; margin-inline-end: 6px; padding: 0 7px; border-radius: 999px; font-size: 10.5px; font-weight: 600; text-decoration: none;
  color: var(--ink); background: color-mix(in srgb, var(--dept, var(--accent)) 28%, transparent); border: 1px solid color-mix(in srgb, var(--dept, var(--accent)) 40%, transparent); }
.dept-tag:hover { text-decoration: none; filter: brightness(1.15); }
.dept-strip { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: var(--s2); }
.dept-chip { display: inline-flex; gap: 6px; align-items: center; padding: 4px 10px; border-radius: 999px; font-size: 12px; color: var(--ink); text-decoration: none;
  background: color-mix(in srgb, var(--dept, var(--accent)) 10%, transparent); border: 1px solid color-mix(in srgb, var(--dept, var(--accent)) 40%, transparent); }
.dept-chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--dept, var(--accent)); }
.dept-chip .num { font-size: 10.5px; padding: 0 6px; border-radius: 999px; background: color-mix(in srgb, var(--dept, var(--accent)) 25%, transparent); }
.dept-chip:hover { text-decoration: none; background: color-mix(in srgb, var(--dept, var(--accent)) 20%, transparent); }
.dept-chip.on { background: var(--dept, var(--accent)); color: #0b1620; border-color: var(--dept, var(--accent)); font-weight: 600; }
.dept-chip.on::before { background: #0b1620; }
.dept-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--gap-card, 12px); }
.dept-card { display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: var(--ink); border-top: 3px solid var(--dept);
  background: linear-gradient(color-mix(in srgb, var(--dept) 9%, transparent), transparent 70%), var(--raised); }
.dept-card:hover { text-decoration: none; border-color: var(--dept); }
.dept-card-head { display: flex; gap: 8px; align-items: center; }
.dept-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--dept); }
.dept-figs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 0; }
.dept-figs dt { font-size: 10.5px; color: var(--muted); }
.dept-figs dd { margin: 2px 0 0; font-weight: 600; font-size: 13px; }
.dept-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.dept-pick .dept-chip { cursor: pointer; margin: 0; position: relative; }
.dept-pick .dept-chip input { position: absolute; opacity: 0; pointer-events: none; }
.dept-pick .dept-chip:has(input:checked) { background: var(--dept); color: #0b1620; border-color: var(--dept); font-weight: 600; }
.dept-pick .dept-chip:has(input:checked)::before { background: #0b1620; }
.dept-pick .dept-chip:has(input:focus-visible) { outline: 2px solid var(--dept); outline-offset: 2px; }
.dept-chip.off:not(.on) { opacity: .5; border-style: dashed; }
.dept-card.off { opacity: .6; border-top-style: dashed; }
a.dept-card-head { text-decoration: none; color: var(--ink); }
a.dept-card-head:hover { text-decoration: none; color: var(--dept); }

/* `hidden` هەمیشە دەشارێتەوە — پێشتر `.btn { display: inline-flex }` دەیبەزاند و دوگمەی شاراوە دەردەکەوت. */
[hidden] { display: none !important; }

/* ── شریتی بەشەکانی کۆمپانیا — یەک هێڵ ─────────────────────── */
.co-nav { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; justify-content: space-between; margin-bottom: var(--s3);
  padding: 4px; background: var(--glass); border: 1px solid var(--hairline); border-radius: 12px; }
.co-nav-tabs, .co-nav-end { display: flex; gap: 2px; align-items: center; flex-wrap: wrap; }
.co-nav-end { gap: 6px; }
.co-tab { display: inline-flex; gap: 6px; align-items: center; padding: 7px 12px; border-radius: 9px; font-size: 12.5px; font-weight: 500;
  color: var(--muted); text-decoration: none; white-space: nowrap; cursor: pointer; list-style: none; }
.co-tab::-webkit-details-marker { display: none; }
.co-tab:hover { color: var(--ink); background: var(--accent-soft); text-decoration: none; }
.co-tab.on { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.co-badge { font-size: 10px; font-weight: 700; padding: 0 6px; border-radius: 999px; background: color-mix(in srgb, var(--warn, #f59e0b) 22%, transparent); color: var(--warn, #f59e0b); }
.co-badge.warn { background: color-mix(in srgb, var(--expense) 22%, transparent); color: var(--expense); }
.co-tab.on .co-badge { background: var(--accent-ink); color: var(--accent); }
.co-more { position: relative; }
.co-more-menu { position: absolute; inset-inline-start: 0; top: calc(100% + 6px); z-index: 40; min-width: 190px; padding: 6px;
  background: var(--raised); border: 1px solid var(--hairline); border-radius: 12px; box-shadow: 0 12px 30px rgba(0,0,0,.35); display: flex; flex-direction: column; }
.co-more-menu a { padding: 8px 12px; border-radius: 8px; font-size: 12.5px; color: var(--ink); text-decoration: none; }
.co-more-menu a:hover { background: var(--accent-soft); text-decoration: none; }
.co-more-menu a.on { color: var(--accent); font-weight: 600; }
.co-pill { display: inline-flex; gap: 6px; align-items: center; padding: 5px 11px; border-radius: 999px; font-size: 12px; text-decoration: none; white-space: nowrap;
  color: var(--warn, #f59e0b); background: color-mix(in srgb, var(--warn, #f59e0b) 12%, transparent); border: 1px solid color-mix(in srgb, var(--warn, #f59e0b) 35%, transparent); }
.co-pill.bad { color: var(--expense); background: color-mix(in srgb, var(--expense) 12%, transparent); border-color: color-mix(in srgb, var(--expense) 35%, transparent); }
.co-pill:hover, .co-pill.on { text-decoration: none; filter: brightness(1.2); }
@media (max-width: 720px) {
  .co-nav { flex-wrap: nowrap; overflow-x: auto; }
  .co-nav-tabs, .co-nav-end { flex-wrap: nowrap; }
  .co-more-menu { position: fixed; inset-inline: 12px; top: auto; }
}

/* ── فۆرمی لاتەنیشت — خشتە هەموو پانییەکە دەگرێت، فۆرم لە لای چەپەوە دێت ── */
.co-split.co-drawer-ready { display: block; }
.co-split.co-drawer-ready > .co-side, .co-split.co-drawer-ready > .co-form {
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 70; width: min(470px, 100vw); margin: 0; overflow-y: auto;
  padding: 44px 14px 18px; background: var(--raised); border-inline-start: 1px solid var(--hairline); box-shadow: 0 0 40px rgba(0,0,0,.5);
  transform: translateX(-105%); visibility: hidden; transition: transform .22s ease, visibility 0s .22s; border-radius: 0; }
.co-split.co-drawer-ready.drawer-open > .co-side, .co-split.co-drawer-ready.drawer-open > .co-form { transform: none; visibility: visible; transition: transform .22s ease; }
.co-split.co-drawer-ready > .co-form { background: var(--raised); }
.co-drawer-close { position: absolute; top: 8px; inset-inline-end: 10px; width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--hairline);
  background: var(--glass); color: var(--ink); font-size: 20px; line-height: 1; cursor: pointer; }
.co-backdrop { position: fixed; inset: 0; z-index: 69; background: rgba(0,0,0,.55); backdrop-filter: blur(3px); }
html.co-locked { overflow: hidden; }

/* ── دوگمەکانی ڕیز — کاڵ، بە ماوس ڕوون دەبنەوە (لە مۆبایل هەمیشە ڕوون) ── */
@media (hover: hover) {
  .co-list tbody tr .co-acts { opacity: .3; transition: opacity .15s; }
  .co-list tbody tr:hover .co-acts, .co-list tbody tr:focus-within .co-acts { opacity: 1; }
}

/* ── بیرخستنەوە — تەنها بە کرتە لە ئاگادارییە بچووکەکە دەکرێتەوە ── */
details.co-reminders:not([open]) { display: none; }
details.co-reminders > summary { display: none; }

/* ── ڕێکخستن — تابی ستوونی ── */
.st-layout { display: grid; gap: var(--gap-card); grid-template-columns: minmax(0, 1fr); align-items: start; }
.st-nav { display: flex; gap: 4px; overflow-x: auto; padding: 6px; background: var(--glass); border: 1px solid var(--hairline); border-radius: 12px; }
.st-nav button { flex: none; text-align: start; padding: 9px 12px; border-radius: 9px; border: 1px solid transparent; background: none; color: var(--muted); font: inherit; font-size: 12.5px; cursor: pointer; }
.st-nav button:hover { color: var(--ink); background: var(--accent-soft); }
.st-nav button.on { color: var(--accent); background: var(--accent-soft); border-color: var(--accent-line); font-weight: 600; }
.st-body { display: flex; flex-direction: column; gap: var(--gap-card); min-width: 0; }
.st-body > .st-sec { display: flex; flex-direction: column; gap: var(--gap-card); }
.st-ready .st-sec:not(.on) { display: none !important; }
@media (min-width: 900px) {
  .st-layout { grid-template-columns: 230px minmax(0, 1fr); }
  .st-nav { flex-direction: column; position: sticky; top: 12px; }
}
