/* Donerchi-ye xas elaveler (esas dizayn app.css - Kassa «Gece qizili», 1-782-ci setirler). */

.hdr-btn { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.35); min-height: 36px; }
.hdr-btn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.6); }
.who-rol { opacity: 0.75; }
.brand-ad { font-family: var(--serif); font-size: 1.15rem; color: #d8b779; }

/* Yazma duymeleri yalniz alicida (server de 403 verir - bu yalniz gorunusdur) */
body:not(.yazar) .yalniz-yazar { display: none !important; }

.page-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.page-title h1 { margin-inline-end: auto; }

/* Dovr zolagi: flex-wrap - dar ekranda min-content tek usaga enir (qlobal qayda §5) */
.period { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 12px; }
.period .field { margin-bottom: 0; min-width: 0; flex: 1 1 140px; }
.period-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.filters .field { margin-bottom: 0; min-width: 0; flex: 1 1 160px; }
.filters select { min-width: 0; }

/* Statistika: minmax(0,1fr) - auto minimum toru ekrandan cixarir (qlobal qayda §5) */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); min-width: 0; }
.kpi .label { font-size: 0.8rem; color: var(--text-soft); font-weight: 600; }
.kpi .value { font-size: 1.45rem; font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kpi .sub { font-size: 0.78rem; color: var(--text-faint); }
.kpi.bad { border-color: var(--bad); background: var(--bad-bg); }
.kpi.bad .value { color: var(--bad); }
a.kpi { color: inherit; text-decoration: none; display: block; }

.quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 10px; margin-bottom: 16px; }
.quick .btn { white-space: normal; text-align: center; min-height: 52px; }

.list-row { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 10px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.list-row:last-child { border-bottom: 0; }
.list-row .num { font-variant-numeric: tabular-nums; font-weight: 600; }
.list-row > div { min-width: 0; }

/* Mal axtarisi teklifleri */
.picker { position: relative; }
.suggest { position: absolute; left: 0; right: 0; top: 100%; z-index: 30; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); max-height: 320px; overflow-y: auto; }
.suggest[hidden] { display: none; }
.suggest-item { display: flex; width: 100%; justify-content: flex-start; gap: 8px; border: 0; border-radius: 0; border-bottom: 1px solid var(--border); white-space: normal; text-align: start; padding: 11px 12px; }
.suggest-empty { padding: 10px 12px; color: var(--text-faint); }

/* Qaime setri formasi: telefonda kart, genisde sira */
.line-card { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; margin-bottom: 10px; background: var(--surface-2); }
.line-grid { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.line-grid .field { margin-bottom: 0; min-width: 0; }
.line-grid .wide { grid-column: 1 / -1; }
@media (min-width: 900px) {
  .line-grid { grid-template-columns: minmax(0, 3fr) minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, 1.2fr); align-items: end; }
  .line-grid .wide { grid-column: auto; }
}
.line-total { font-weight: 700; font-variant-numeric: tabular-nums; padding: 11px 0; }
.line-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }

.totals { display: grid; gap: 4px; max-width: 360px; margin-left: auto; }
.totals > div { display: flex; justify-content: space-between; gap: 12px; font-variant-numeric: tabular-nums; }
.totals .big { font-weight: 700; font-size: 1.05rem; border-top: 1px solid var(--border); padding-top: 6px; }
.totals .debt { color: var(--warn); font-weight: 700; }

.photos { display: flex; gap: 8px; flex-wrap: wrap; }
.photos a { display: block; width: 96px; height: 96px; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border); }
.photos img { width: 100%; height: 100%; object-fit: cover; display: block; }

.changes { border: 1px solid var(--warn); background: var(--warn-bg); border-radius: var(--radius-sm); padding: 10px 14px; margin-top: 12px; }
.changes h3 { color: var(--warn); margin-bottom: 4px; }
.changes ul { margin: 4px 0 8px; padding-inline-start: 18px; }
.changes-when { font-size: 0.8rem; color: var(--text-soft); }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs button.active { background: var(--brand); border-color: var(--brand); color: var(--brand-text); }
.tab-panel[hidden] { display: none; }

.shop-checks { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.shop-checks label { display: flex; align-items: center; gap: 6px; font-weight: 500; color: var(--text); margin: 0; }
.shop-checks input { width: 20px; height: 20px; }

/* Tehvil / qaytarma setri */
.dl-row { border-bottom: 1px solid var(--border); padding: 12px 16px; }
.dl-row:last-child { border-bottom: 0; }
.dl-head { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.dl-head .meta { font-size: 0.8rem; color: var(--text-soft); }
.dl-inputs { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dl-inputs .field { margin-bottom: 0; min-width: 0; }
@media (min-width: 760px) { .dl-inputs { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

td.num, th.num { text-align: end; font-variant-numeric: tabular-nums; }
td .badge { margin-inline-start: 4px; }
.clickable { cursor: pointer; }
.nowrap { white-space: nowrap; }
.sticky-actions { position: sticky; bottom: 0; background: var(--bg); padding: 10px 0; border-top: 1px solid var(--border); z-index: 10; }

/* CAP / PDF: brauzerin capi (asililiq yox). ADLI @page - adsiz qlobal olur (Kassa §6). */
@page sened { size: A4; margin: 12mm; }
@media print {
  body { background: #fff !important; color: #000 !important; }
  .app-header, .app-nav, .no-print, .yalniz-yazar, .period-btns, button { display: none !important; }
  main { padding: 0; max-width: none; page: sened; }
  .card { box-shadow: none; border-color: #999; break-inside: avoid; }
  a { color: #000; text-decoration: none; }
}

.mt-6 { margin-top: 6px; }
.mt-12 { margin-top: 12px; }
.mb-12 { margin-bottom: 12px; }
.pt-0 { padding-top: 0 !important; }

fieldset.field { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
.label-legend { display: block; font-size: 0.85rem; font-weight: 600; color: var(--text-soft); margin-bottom: 6px; padding: 0; }
label.inline-check { display: inline-flex; align-items: center; gap: 8px; color: var(--text); font-weight: 500; }
label.inline-check input { width: 20px; height: 20px; }

/* [hidden] HEMISE gizledir: .card { display: flow-root } (app.css) hidden atributunu ustelayirdi -
   alicida bos ikinci kart gorunurdu (brauzerde olculdu, 2026-11-05). */
[hidden] { display: none !important; }
