/* ==========================================================================
   Kassa Uçotu — ümumi stil
   Mobil-öncəli (mobile-first): kassir telefondan, rəhbər kompüterdən istifadə edir
   ========================================================================== */

:root {
  --bg: #f7f3ec;
  --surface: #fffdf9;
  --surface-2: #faf6ef;
  --border: #e6ded0;
  --border-strong: #cfc4b1;

  --text: #15171d;
  --text-soft: #6c665c;
  /* ≥4,6 bütün fonlarda (ag, --bg, --surface-2). Evvel #8b98a8 idi: 2,94 (olculdu,
     2026-10-07 dizayn auditi) - «solgun» yazi oxunmurdu. */
  --text-faint: #6c665c;

  --brand: #8a6828;
  /* Iri sahelerin fonu (baslıq, yan menyu). Tund temada --brand ACILIR
     (yazi oxunsun deye), fon ise QARALMALIDIR - ona gore ayrica token. */
  --brand-bg: #1b1f27;
  --brand-soft: #f7f0e4;
  --brand-text: #ffffff;

  --ok: #2f7a55;
  --ok-bg: #ebf4ee;
  --warn: #91600f; /* ≥4,8 (evvel #a86b0c: oz fonunda 4,03, olculdu) */
  --warn-bg: #f8eedb;
  --bad: #a8382e;
  --bad-bg: #f8e7e4;
  /* Yasil / qirmizi DUYMENIN yazisi. Gece rejiminde --ok / --bad acilir ve ag
     yazi oxunmurdu: 1,74 / 2,77 (olculdu, 2026-10-07) - orada tunddur. */
  --ok-text: #ffffff;
  --bad-text: #ffffff;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 4px 12px rgba(16, 24, 40, 0.06);
  --shadow-lg: 0 8px 28px rgba(16, 24, 40, 0.12);

  --serif: "Lora", Georgia, "Times New Roman", serif;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Mono", Consolas, "SF Mono", Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121419;
    --surface: #1b1f27;
    --surface-2: #20242d;
    --border: #2c313b;
    --border-strong: #3d434f;

    --text: #e9e3d8;
    --text-soft: #a7a196;
    --text-faint: #958f84; /* ≥5,2 (evvel 3,93-4,28) */

    /* ⚠️ --brand IKI IS GORUR: kecid/vurgu rengi (tund fonda ACIQ olmalidir) ve
       esas duymenin fonu. #4a7ab5 ikisinde de zeif idi: kecid 3,74, duymede ag
       yazi 4,43 (olculdu). Acildi, duymenin yazisi TUND oldu (--brand-text). */
    --brand: #d8b779;
    --brand-bg: #161920;
    --brand-soft: #2a2519;
    --brand-text: #1a140a;

    --ok: #7fd1a8;
    --ok-bg: #15291f;
    --warn: #e9b45c;
    --warn-bg: #2b2312;
    --bad: #ef8a7f;
    --bad-bg: #2c1817;
    --ok-text: #1a140a;
    --bad-text: #1a140a;

    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 12px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 8px 28px rgba(0, 0, 0, 0.45);
  }
}

/* İstifadəçi ÖZÜ «gecə»ni seçəndə sistemdən asılı olmayaraq tünd olur.
   Eyni dəyərlər yuxarıdakı media blokundadır — ikisi birlikdə dəyişməlidir. */
:root[data-theme="dark"] {
    --bg: #121419;
    --surface: #1b1f27;
    --surface-2: #20242d;
    --border: #2c313b;
    --border-strong: #3d434f;

    --text: #e9e3d8;
    --text-soft: #a7a196;
    --text-faint: #958f84; /* ≥5,2 (evvel 3,93-4,28) */

    /* ⚠️ --brand IKI IS GORUR: kecid/vurgu rengi (tund fonda ACIQ olmalidir) ve
       esas duymenin fonu. #4a7ab5 ikisinde de zeif idi: kecid 3,74, duymede ag
       yazi 4,43 (olculdu). Acildi, duymenin yazisi TUND oldu (--brand-text). */
    --brand: #d8b779;
    --brand-bg: #161920;
    --brand-soft: #2a2519;
    --brand-text: #1a140a;

    --ok: #7fd1a8;
    --ok-bg: #15291f;
    --warn: #e9b45c;
    --warn-bg: #2b2312;
    --bad: #ef8a7f;
    --bad-bg: #2c1817;
    --ok-text: #1a140a;
    --bad-text: #1a140a;

    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 12px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 8px 28px rgba(0, 0, 0, 0.45);
  }

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; font-weight: 650; line-height: 1.25; }
h1 { font-size: 1.35rem; }
h2 { font-size: 1.1rem; }
h3 { font-size: 0.95rem; }

a { color: var(--brand); }

/* ---------------------------------------------------------------- Struktur */

.app-header {
  background: var(--brand-bg);
  /* --brand-text DEYIL: fon hemise tunddur, gece rejiminde duyme yazisi ise tund */
  color: #ffffff;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: var(--shadow);
}

.app-header .brand {
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.2px;
  margin-inline-end: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-header .who {
  font-size: 0.82rem;
  opacity: 0.9;
  text-align: end;
  line-height: 1.35;
}

/* AlphaTime-a kecid (common.js -> alphatimeKecidi): ikon + ad */
#alphatime-kecid { display: inline-flex; align-items: center; gap: 6px; }
/* Emoji setir hundurluyunu boyudurdu - duyme qonsularindan 3px uca idi (olculdu) */
#alphatime-kecid > span[aria-hidden] { line-height: 1; }
/* ⚠️ TELEFONDA kassirin basliginda YALNIZ IKON (WebKit-de olculdu, 375px):
   yazili duyme basliga ucuncu setir acirdi (108 -> 156px). Yalniz ikon da
   kifayet etmedi - 360-375px-de 6px catmirdi, ona gore aralar 12 -> 8px.
   Yan menyuda (rehber) ad QALIR - orada yer var. */
@media (max-width: 559px) {
  .app-header { column-gap: 8px; }
  /* min-height: yalniz ikonla duyme 30px idi, qonsulari (emojili) 36px */
  .app-header #alphatime-kecid { padding-inline: 8px; min-height: 36px; }
  .app-header #alphatime-kecid .kecid-ad { display: none; }
}

.app-nav {
  display: flex;
  gap: 4px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 12px;
  overflow-x: auto;
  position: sticky;
  top: 0;
  z-index: 15;
}

.app-nav a {
  padding: 12px 14px;
  color: var(--text-soft);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 550;
  border-bottom: 2.5px solid transparent;
  white-space: nowrap;
}
.app-nav a:hover { color: var(--text); }
/* display:flex hidden atributunu udurdu: kassirde gizledilen menyu 49px yer tuturdu (olculdu) */
.app-nav[hidden] { display: none; }
.app-nav a.active { color: var(--brand); border-bottom-color: var(--brand); }

main { padding: 16px; max-width: 1400px; margin: 0 auto; }
.narrow { max-width: 720px; }

/* ------------------------------------------------------------------ Kartlar */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  overflow: hidden;
  /* clip eyni kesir (kunc yuvarlaq qalir), amma SURUSME QABI yaratmir - hidden
     kartin icindeki her cedvelin sabit basligini karta baglayirdi (2026-10-26) */
  overflow: clip;
  display: flow-root;        /* hidden-in yaratdigi blok konteksti (ic margin karta yapismasin) clip-de yoxdur */
}

.card-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--surface-2);
}
.card-head h2 { margin-inline-end: auto; }

/* Yigila bilen bolme (Idareetme, 2026-10-07). Gizletme sinifledir, `hidden`
   ile yox - icerideki elementlerin oz `display` qaydasi onu udardi. */
.card.yigili > :not(.card-head) { display: none; }
.card.yigili > .card-head { border-bottom: 0; }
.card-yig {
  width: 28px; height: 28px; min-height: 0; padding: 0; flex: 0 0 auto;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text-soft); font-size: 0.9rem; line-height: 1;
  transition: transform 0.15s;
}
.card.yigili .card-yig { transform: rotate(-90deg); }
.card-head h2.card-yig-ad { cursor: pointer; user-select: none; margin-inline-end: 0; }
.card-say { background: var(--brand-soft); color: var(--brand); margin-inline-end: auto; }
.card-say[hidden] { display: none; }
/* Say yoxdursa (bos ve ya gizli) bas yene saga itələnsin */
.card-head h2.card-yig-ad:has(+ .card-say[hidden]) { margin-inline-end: auto; }
.yig-zolaq { display: flex; justify-content: flex-end; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.card-body { padding: 16px; }
.card-body.tight { padding: 0; }

/* -------------------------------------------------------------------- Form */

.field { margin-bottom: 14px; }

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-soft);
  margin-bottom: 5px;
}

.hint { font-size: 0.78rem; color: var(--text-faint); margin-top: 4px; font-weight: 400; }

input[type="text"], input[type="password"], input[type="number"],
input[type="date"], input[type="time"], select, textarea,
/* :where — SIFIR guc: .et-tsearch kimi sinif qaydalari onu ustelesin (evvel
   siyahiya qosulanda Etiketin dar axtaris xanasi pozulurdu). Olmasa axtaris
   xanalari brauzerin cilpaq, boz xanasi idi (Mehsullar, jurnal, olculdu). */
:where(input[type="search"]),
/* url/email/tel de (WebKit-de olculdu: Parametrlerdeki Drive linki cilpaq, 21px idi) */
:where(input[type="url"], input[type="email"], input[type="tel"]),
/* Arxiv axtarisi (2026-10-07). Umumi siyahiya `input[type="search"]` YAZILMADI:
   Etiketin `.et-tsearch` secicisi ondan ZEIFDIR ve xananin olcusu pozulardi */
.arxiv-axtar-zolaq input[type="search"] {
  width: 100%;
  padding: 11px 12px;
  font-size: 16px; /* iOS-da avtomatik zoom-un qarşısını alır */
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

input:disabled, select:disabled, textarea:disabled {
  background: var(--surface-2);
  color: var(--text-faint);
  cursor: not-allowed;
}

input.money { text-align: end; font-family: var(--mono); font-variant-numeric: tabular-nums; }

textarea { resize: vertical; min-height: 72px; }

.row { display: grid; gap: 12px; }
@media (min-width: 640px) {
  .row.cols-2 { grid-template-columns: 1fr 1fr; }
  .row.cols-3 { grid-template-columns: repeat(3, 1fr); }
  .row.cols-4 { grid-template-columns: repeat(4, 1fr); }
}

/* ------------------------------------------------------------------ Düymələr */

button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 11px 18px;
  font-size: 0.92rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
  white-space: nowrap;
}

button:hover:not(:disabled), .btn:hover { background: var(--surface-2); border-color: var(--text-faint); }
button:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--brand-text);
}
.btn-primary:hover:not(:disabled) { filter: brightness(1.12); border-color: var(--brand); background: var(--brand); }

.btn-ok { background: var(--ok); border-color: var(--ok); color: var(--ok-text); }
.btn-ok:hover:not(:disabled) { filter: brightness(1.1); background: var(--ok); }

.btn-bad { background: var(--bad); border-color: var(--bad); color: var(--bad-text); }
.btn-bad:hover:not(:disabled) { filter: brightness(1.1); background: var(--bad); }

.btn-lg { padding: 15px 26px; font-size: 1.02rem; }
.btn-sm { padding: 7px 12px; font-size: 0.82rem; }
.btn-block { width: 100%; }

.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* ------------------------------------------------------------------ Cədvəl */

/* SABIT BASLIQ (sahib, 2026-10-26: «hesablasmalar kimi yerlerde basliq xanalari
   sabit qalsin, asagi dusursen sonra bilmirsen ne nedi»).
   ⚠️ th-de «position: sticky» coxdan yazilmisdi, amma HEC VAXT ISLEMIRDI:
   overflow-x:auto qabi SURUSME QABI edir ve sticky th sehifeye yox, QABA
   yapisir - qab ise cedvel boyda idi (olculdu: Hesablasmalarda 60 setir,
   qab 2675px, 600px asagida basliq ekrandan 600px yuxarida). Ona gore qabin
   hundurluyu mehdudlasir: uzun cedvel oz icinde surusur, basliq yuxarida
   qalir. Qisa cedvele tesir etmir. overflow-x: clip olmaz - genis cedvel
   (arxiv, ay) yana surusmeli qalir. Istisnalar: telefonda kart-cedvel (basliq
   onsuz da gizlidir) ve CAP (qutu acilir - yoxsa cedvel kagizda kesilerdi). */
.table-wrap {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  max-height: calc(100vh - 160px);
  max-height: calc(100dvh - 160px);
}
@media print {
  .table-wrap { max-height: none; overflow: visible; }
}
/* Ekrana enine sigan cedvel: qutu acilir, basliq SEHIFEYE yapisir (yapisqan
   zolagin altina). Sinfi common.js `sabitBasliqQur()` qoyur - sebebi oradadir.
   JS yoxdursa yuxaridaki qutu rejimi qalir. */
.table-wrap.sabit-sehife, .an-cedvel-wrap.sabit-sehife { overflow: visible; max-height: none; }
.sabit-sehife > table > thead th { top: calc(var(--sabit-ust, 0px) + var(--sabit-sira, 0px)); }
.sabit-sehife.sabit-ic > table > thead th { top: var(--sabit-sira, 0px); }

table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }

th {
  text-align: start;
  padding: 11px 12px;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-soft);
  background: var(--surface-2);
  border-bottom: 1.5px solid var(--border);
  white-space: nowrap;
  position: sticky;
  top: var(--sabit-sira, 0px);   /* iki setirli baslig: ikinci setir birincinin ALTINA (common.js yazir) */
  z-index: 2;                /* yapisqan ilk sutun (td, z 1) basligin ustune cixmasin */
  box-shadow: inset 0 -1.5px 0 var(--border);   /* border-collapse-de sticky xananin border-i surusende itir */
}

td { padding: 11px 12px; border-bottom: 1px solid var(--border); }
tbody tr:hover { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: none; }

td.num, th.num {
  text-align: end;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

tr.total-row td {
  font-weight: 700;
  background: var(--surface-2);
  border-top: 2px solid var(--border-strong);
}

/* Arxiv: kohne Excel gunleri, Excel vereqi kimi (sahibin qerari, 2026-09-18).
   Qeydli xananin kuncunde Excel-deki kimi qirmizi ucbucaq; gunun qeydleri son
   sutunda (telefonda title gorunmur). Tarix surusmede yerinde qalir. */
.arxiv-secim { flex: 1 1 auto; }
/* Ay secimi bos olanda (arxivi olmayan kassa) 46px-e daralirdi */
#arxiv-ay { min-width: 160px; }
.arxiv-kec { display: flex; gap: 6px; margin-inline-start: auto; align-items: flex-end; flex-wrap: wrap; }
.arxiv-izah { margin: 0; padding: 10px 16px; }
.arxiv-cedvel { font-size: 0.84rem; }
.arxiv-cedvel th, .arxiv-cedvel td { padding-inline: 8px; }
.arxiv-cedvel th.num { white-space: normal; vertical-align: bottom; }
.arxiv-cedvel td.qeydli { position: relative; cursor: help; }
.arxiv-cedvel td.qeydli::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  border-top: 7px solid var(--bad);
  border-left: 7px solid transparent;
}
.arxiv-cedvel .arxiv-qeyd { min-width: 240px; max-width: 460px; white-space: normal; font-size: 0.8rem; color: var(--text-soft); }
.arxiv-cedvel .arxiv-qeyd div + div { margin-top: 2px; }
.arxiv-cedvel .arxiv-qeyd b { color: var(--text); font-weight: 600; }
.arxiv-cedvel th:first-child,
.arxiv-cedvel td:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); }
.arxiv-cedvel th:first-child { z-index: 3; background: var(--surface-2); }
.arxiv-cedvel tbody tr:hover td:first-child,
.arxiv-cedvel tr.total-row td:first-child { background: var(--surface-2); }
/* Kassir gun ekranindan «Arxivde bax» basanda hemin gun isiqlanir (2026-10-07).
   Ilk sutun yapisqandir (oz fonu var) — ona da eyni fon lazimdir. */
.arxiv-cedvel tbody tr.arxiv-secili td,
.arxiv-cedvel tbody tr.arxiv-secili td:first-child { background: var(--brand-soft); }
.arxiv-qalan { margin: 0; padding: 10px 16px; }
/* Arxivde axtaris (sahibin isteyi, 2026-10-07): xana kartin basinda, neticeler
   oz qutusunda surusur — vereq asagida yerinde qalir. Etiket gorunendir
   (placeholder etiket deyil). */
.arxiv-axtar-zolaq { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px 0; }
.arxiv-axtar-zolaq label { font-weight: 600; }
.arxiv-axtar-zolaq input { flex: 1 1 240px; min-width: 0; max-width: 420px; }
.arxiv-axtar-zolaq .hint { margin: 0; }
.arxiv-netice { margin: 10px 16px 0; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.arxiv-netice-bas { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0; padding: 8px 12px; border-bottom: 1px solid var(--border); font-size: 0.88rem; }
.arxiv-netice-bas .btn-sm { margin-left: auto; }
.arxiv-netice-bos { margin: 0; padding: 10px 12px; }
.arxiv-netice-siyahi { max-height: 300px; overflow-y: auto; }
.arxiv-netice-setir { display: flex; flex-direction: column; gap: 2px; padding: 8px 12px; border-bottom: 1px solid var(--border); cursor: pointer; }
.arxiv-netice-setir:last-child { border-bottom: 0; }
/* --surface-2 ag fonda ~1,03:1-dir: secilen setir ve klaviatura fokusu gorunmurdu */
.arxiv-netice-setir:hover { background: var(--brand-soft); }
.arxiv-netice-setir:focus-visible { background: var(--brand-soft); outline: 2px solid var(--brand); outline-offset: -2px; }
.arxiv-netice-ust { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.arxiv-netice-tap { font-size: 0.86rem; color: var(--text-soft); overflow-wrap: anywhere; }
.arxiv-netice-tap b { color: var(--text); }
/* Tapilan soz — <mark>-in defolt sarisi gece temasinda oxunmur, reng temadan */
mark.arxiv-isiq {
  background: var(--warn-bg); color: var(--warn); font-weight: 700;
  border-radius: 3px; padding: 0 2px; box-decoration-break: clone; -webkit-box-decoration-break: clone;
}
/* Arxiv gununun detali (2026-10-07): qeydler vereqin son sutunu ile eyni gorunur */
.arxiv-gun .arxiv-gun-qeyd { display: flex; flex-direction: column; gap: 4px; font-size: 0.86rem; color: var(--text-soft); overflow-wrap: anywhere; }
.arxiv-gun .arxiv-gun-qeyd b { color: var(--text); font-weight: 600; }
.arxiv-gun .arxiv-menbe { margin-top: 14px; overflow-wrap: anywhere; }
.arxiv-gun .hint .badge { margin-inline-start: 4px; }

/* «Günlər» cedveli: Excel kimi gunun butun hereketleri (sahibin iradi,
   2026-09-19: «elave pul girisi ana ekranda gorsetmir»). 13 sutun 1366-da
   sigmir - Tarix surusmede yerinde qalir, basliq iki setre dusur ki, sutunun
   eni reqemden gelsin, xana arasi bir az dardir. */
.gunler-cedvel { font-size: 0.84rem; }
.gunler-cedvel th, .gunler-cedvel td { padding-inline: 6px; }
.gunler-cedvel th:first-child, .gunler-cedvel td:first-child { padding-inline-start: 12px; }
.gunler-cedvel th:last-child, .gunler-cedvel td:last-child { padding-inline-end: 12px; }
.gunler-cedvel th.num { white-space: normal; line-height: 1.25; vertical-align: bottom; }
.gunler-cedvel th:first-child,
.gunler-cedvel td:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); }
.gunler-cedvel th:first-child { z-index: 3; background: var(--surface-2); }
.gunler-cedvel tbody tr:hover td:first-child,
.gunler-cedvel tr.total-row td:first-child { background: var(--surface-2); }
.gunler-cedvel .kassa-xana { white-space: nowrap; line-height: 1.3; }
.gunler-cedvel .kassa-xana .muted { font-size: 0.8rem; }
/* Neytral zona: geri cagirilan pul «Əlavə pul» xanasinda ikinci setirdir (ayri sutun
   yox - cedvel 1366px-de sigir); rehbere catacaq azalanda Tehvil setrinde izahi */
.geri-cagirilan { font-size: 0.76rem; line-height: 1.2; color: var(--brand); white-space: normal; }
.tehvil-geri { font-family: var(--font); font-size: 0.78rem; color: var(--text-faint); white-space: normal; }
/* Rehbere verilen pul 1C-den order-order (2026-10-23): saat · mebleg · Aldim / alinib */
.tehvil-setirler { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tehvil-setir { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 4px 10px; min-width: 0; }
.tehvil-setir .btn-row { margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
.tehvil-saat { font-family: var(--mono, monospace); color: var(--text-soft); min-width: 3.2em; }
.tehvil-ok { color: var(--ok); font-size: 0.85rem; white-space: normal; }
.tehvil-setir .money-bad { font-size: 0.85rem; white-space: normal; }

.clickable { cursor: pointer; }
/* Silinən mallar: malin kicik sekli (pencerede) */
.sil-sekil { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); background: var(--surface-2); display: block; }

/* ------------------------------------------------------------------ Nişanlar */

.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  white-space: nowrap;
}
.badge-ok   { background: var(--ok-bg);   color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-bad  { background: var(--bad-bg);  color: var(--bad); }
.badge-idle { background: var(--surface-2); color: var(--text-faint); border: 1px solid var(--border); }
/* Melumat nisani (meselen neytral zonadan odenen xerc) - xeberdarliq deyil */
.badge-info { background: var(--brand-soft); color: var(--brand); }

.money-ok   { color: var(--ok);   font-weight: 700; }
.money-bad  { color: var(--bad);  font-weight: 700; }
.money-warn { color: var(--warn); font-weight: 700; }

/* ------------------------------------------------------------------ Bildiriş */

.alert {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  font-size: 0.89rem;
  border: 1px solid transparent;
  display: flex;
  gap: 9px;
  align-items: flex-start;
}
.alert-ok   { background: var(--ok-bg);   color: var(--ok);   border-color: currentColor; }
.alert-bad  { background: var(--bad-bg);  color: var(--bad);  border-color: currentColor; }
.alert-warn { background: var(--warn-bg); color: var(--warn); border-color: currentColor; }
.alert-info { background: var(--brand-soft); color: var(--brand); border-color: currentColor; }
.alert ul { margin: 4px 0 0; padding-inline-start: 18px; }
.alert[hidden] { display: none; }
/* Baglama duymesi — sahibin isteyi 2026-10-07. `margin-left: auto` qutunu
   genislendirmir: oz sətrində saga yigisir, olculmus ekranlar pozulmur. */
.alert-close {
  /* Toxunma sahesi 31x32px (telefonda barmaq ucun), gorunus ise 17px-dir:
     menfi kenar elave sahəni bildirisin oz padding-inə (12/14px) qaytarir —
     qutunun olcusu deyismir. */
  margin: -7px -7px -7px auto;
  flex: 0 0 auto;
  align-self: flex-start;
  background: none;
  border: 0;
  color: inherit;
  opacity: 0.65;
  cursor: pointer;
  font-size: 1.15rem;
  line-height: 1;
  padding: 7px;
  border-radius: 6px;
}
.alert-close:hover { opacity: 1; }
.alert-close:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

/* Kassir addimlarinin ikonu — goz yaddasi (sahibin isteyi 2026-10-07).
   Sabit en: butun adlar eyni xetden baslasin; adin ICINDEDIR, setrin
   hundurluyu deyismir (bax kassa.js `ikonlariQoy`). */
.pos-ikon {
  display: inline-block;
  width: 1.5em;
  margin-inline-end: 4px;
  text-align: center;
  font-style: normal;
  font-weight: 400;
}

/* XETTI IKONLAR (2026-10-12, emoji yerine) — AlphaTime-in `.ico` uslubu:
   24×24, icsiz, rengi yazidan (`currentColor`) — gunduz ve gece ozu
   uygunlasir. Yollar common.js IKON_YOLLARI-dadir. Olcu `em` ile: yazinin
   olcusune baglidir, setrin hundurluyunu artirmir. */
.ikon {
  display: inline-block;
  flex: none;
  width: 1.15em;
  height: 1.15em;
  vertical-align: -0.2em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* Ikon + yazi (common.js ikonla): adi metnde arasi bosluq; duymeler
   inline-flex + gap-dir, orada elave bosluq lazim deyil */
.ikon.ikon-on { margin-inline-end: 0.35em; }
button > .ikon.ikon-on, .btn > .ikon.ikon-on { margin-inline-end: 0; }
/* Addim ikonu: qutu (1.5em) evvelki kimi, SVG onun ortasinda */
.pos-ikon .ikon { width: 1.2em; height: 1.2em; }
/* Yan menyu: ikon solda, ad qalan yeri tutur, sayac sagda */
.side-link .side-ikon { width: 17px; height: 17px; opacity: 0.8; }
.side-link:hover .side-ikon, .side-link.active .side-ikon { opacity: 1; }
.side-link .side-ad { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-link > :not(.side-ikon):not(.side-ad) { flex: none; }
/* Kassirin basliq duymeleri: emoji ile eyni enden genis olmasin — 360px
   telefonda bir piksel artiq da duymeni ucuncu setre atir (olculdu: 107 → 151) */
.app-header [data-ikon] { gap: 5px; }
.app-header [data-ikon] > .ikon { width: 1.05em; height: 1.05em; }
/* «⧉ Yanında aç» secimi */
.ip-secim .ip-ikon { margin-inline-end: 8px; color: var(--brand); }

/* ------------------------------------------------------------------ Statistika */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.stat .label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-faint);
  font-weight: 700;
  margin-bottom: 6px;
}
.stat .value {
  font-size: 1.32rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.stat .sub { font-size: 0.78rem; color: var(--text-faint); margin-top: 3px; }

/* Islek xana (sahibin isteyi, 2026-10-02: «bu xanalar islek olsun»).
   ⚠️ Yalniz kolge, kenar ve transform oynadilir — qutunun OLCUSU deyismir,
   yoxsa olculmus ekranlar (kassir 657px, rehber 1036px) pozulardi.
   ⚠️ Kicik ox isaresi xananin OZ kucundedir, ayrica element deyil (::after) —
   element qoysaydiq ici grid olan xanalarda setir sayi deyiserdi. */
.stat.islek { cursor: pointer; position: relative; }
.stat.islek::after {
  content: "›";
  position: absolute;
  top: 8px;
  inset-inline-end: 10px;
  color: var(--text-faint);
  font-weight: 700;
  line-height: 1;
}
.stat.islek:hover,
.stat.islek:focus-visible {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 28%, transparent);
}
.stat.islek:hover::after, .stat.islek:focus-visible::after { color: var(--brand); }

/* Bolgu pencerenin setirleri: ad solda, meblegi sagda — xanadan cixmasin */
.bolgu { width: 100%; }
.bolgu td { padding: 6px 4px; border-bottom: 1px solid var(--border); }
.bolgu td.num { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bolgu tr:last-child td { border-bottom: none; }
.bolgu .total-row td { font-weight: 700; border-top: 2px solid var(--border-strong); }

/* Emeliyyat jurnali: kod kicik qalir, detal setiri uzun ola biler */
.jurnal-kod { font-size: 0.72rem; }
/* ⚠️ Detal OXUNAN mezmundur: `--text-faint` isiqli temada 2,94 kontrast
   verirdi (hedd 2,8-e cox yaxin). `--text-soft` 5,45 verir. */
.jurnal-detal {
  max-width: 460px;
  white-space: normal;
  word-break: break-word;
  color: var(--text-soft);
}

/* ------------------------------------------------------------------ Yardımçı */

.muted { color: var(--text-faint); }
.center { text-align: center; }
.end { text-align: end; }
.nowrap { white-space: nowrap; }
.mb-0 { margin-bottom: 0; }
.mt-16 { margin-top: 16px; }
.spacer { flex: 1; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.empty {
  padding: 44px 20px;
  text-align: center;
  color: var(--text-faint);
  font-size: 0.92rem;
}

.loading { padding: 32px; text-align: center; color: var(--text-faint); }

/* ------------------------------------------------------------------ Modal */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 22, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 50;
}
.modal-backdrop[hidden] { display: none; }

.modal {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-width: 620px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
}
.modal .card-head { position: sticky; top: 0; z-index: 2; }
/* Pencerede cedvel qabi (sabit basliq) pencereden ALCAQ olmalidir: 100dvh-160 ile
   pencere (88vh) ozu de surusurdu ve yapisqan .card-head (62px) cedvelin basligini
   orturdu (olculdu, 1366x768: pencere 676, qab 608 + ustundeki 113). */
.modal .table-wrap { max-height: calc(88vh - 180px); }

/* ---------------------------------------------------------- Giriş səhifəsi */

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(160deg, var(--brand) 0%, #16293f 100%);
}

.login-box {
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 26px 28px 22px;
  width: 100%;
  max-width: 400px;
}

.login-box .logo {
  text-align: center;
  font-size: 2.2rem;
  margin-bottom: 8px;
}
.login-box h1 { text-align: center; margin-bottom: 4px; }
.login-box .subtitle {
  text-align: center;
  color: var(--text-faint);
  font-size: 0.88rem;
  margin: 0 0 24px;
}

