/* Zaqazlar (yetkazib beruvchiga buyurtma) — mavjud dizayn tizimi ustiga */
#screen-orders .dash-sub, #screen-expenses .dash-sub { margin: 4px 0 0; color: var(--ink-2); font-size: 14px; }
.fz-bar { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.fz-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 16px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink); font-weight: 700; font-size: 14px;
}
.fz-btn:hover:not(:disabled) { border-color: #C9D7DB; background: #F6FAFA; }
.fz-btn:disabled { opacity: .45; cursor: default; }
.fz-btn.primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.fz-btn.primary:hover:not(:disabled) { background: var(--teal-deep); }
.fz-btn.danger { color: var(--coral); }
.fz-btn.sm { min-height: 34px; padding: 0 12px; font-size: 13px; }
.fz-btn svg { width: 16px; height: 16px; }
.fz-back { display: inline-flex; align-items: center; gap: 4px; margin: 0 0 6px -6px; padding: 4px 8px; border: 0; background: none; color: var(--ink-2); font-weight: 600; font-size: 13px; }
.fz-back:hover { color: var(--ink); }

/* Filtrlar */
.fz-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.fz-filters label.fz-f { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 10px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--card); font-size: 13px; color: var(--ink-2); }
.fz-filters label.fz-f b { color: var(--ink); font-weight: 700; }
.fz-filters input[type="date"], .fz-filters select { border: 0; background: transparent; font-size: 13px; font-weight: 700; color: var(--ink); outline: none; max-width: 170px; }
.fz-filters .search { flex: 1 1 200px; max-width: 320px; }

/* Jadval */
.fz-table tbody tr.fz-row { cursor: pointer; }
.fz-table tbody tr.fz-row:focus-visible { outline-offset: -2px; }
.fz-table td.num-cell { text-align: right; }
.fz-st { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; white-space: nowrap; background: var(--slate-tint); color: var(--ink-2); }
.fz-st[data-s="posted"], .fz-st[data-s="paid"] { background: var(--leaf-tint); color: #126B3B; }
.fz-st[data-s="partial"] { background: var(--amber-tint); color: #9A5300; }
.fz-st[data-s="pending"] { background: var(--brass-tint); color: var(--brass); }
.fz-st[data-s="approved"] { background: #E8E9FB; color: #4338B5; }
.fz-st[data-s="rejected"] { background: var(--coral-tint); color: var(--coral); }
.fz-muted { color: var(--ink-3); }
.fz-pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 12px; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); }
.fz-pager div { display: flex; gap: 6px; }

/* Hujjat */
.fz-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; align-items: start; }
.fz-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 16px; }
.fz-fields .span2 { grid-column: span 2; }
.fz-fields .span3 { grid-column: 1 / -1; }
.fz-inline { display: flex; gap: 6px; }
.fz-inline .control { flex: 1; min-width: 0; }
.fz-inline .fz-btn { min-height: 44px; padding: 0 12px; }
.fz-seg { display: flex; flex-wrap: wrap; gap: 6px; }
.fz-seg button { min-height: 44px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--card); font-size: 14px; }
.fz-seg button[aria-checked="true"] { background: var(--teal); border-color: var(--teal); color: #fff; font-weight: 700; }
.fz-seg button:disabled { opacity: .6; cursor: default; }
.fz-side h3 { margin: 0 0 10px; font-size: 19px; font-weight: 800; }
.fz-side dl { margin: 0; display: grid; gap: 12px; }
.fz-side dt { font-size: 13px; color: var(--ink-2); }
.fz-side dd { margin: 2px 0 0; font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
.fz-side .fz-note { margin: 14px 0 0; font-size: 14px; color: var(--ink-2); }
.fz-side .control { font-weight: 700; }
.fz-items td { padding: 6px 8px; vertical-align: top; }
.fz-items .control { min-height: 40px; padding: 0 10px; font-size: 14px; }
.fz-items td.n { width: 40px; color: var(--ink-3); padding-top: 14px; }
.fz-items td.x { width: 44px; }
.fz-items .fz-inline .control { flex: none; }
.fz-items input.q { width: 92px; text-align: right; }
.fz-items input.u { width: 66px; }
.fz-items input.p { width: 130px; text-align: right; }
.fz-items .unit { display: block; font-size: 12px; color: var(--ink-3); margin-top: 2px; text-align: right; }
.fz-items td.sum { text-align: right; padding-top: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }
.fz-items tr.bad .control { border-color: var(--coral); background: var(--coral-tint); }
.fz-ac-wrap { position: relative; }
.fz-ac { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); max-height: 260px; overflow: auto; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 18px 40px -16px rgba(15, 42, 53, .4); }
.fz-ac button { display: flex; justify-content: space-between; gap: 10px; width: 100%; padding: 9px 12px; border: 0; background: none; text-align: left; font-size: 14px; }
.fz-ac button:hover, .fz-ac button:focus-visible { background: var(--teal-tint); }
.fz-ac small { color: var(--ink-3); white-space: nowrap; }
.fz-ac p { margin: 0; padding: 10px 12px; font-size: 13px; color: var(--ink-3); }
.fz-total { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 12px; flex-wrap: wrap; }
.fz-total b { font-size: 21px; font-weight: 800; font-variant-numeric: tabular-nums; }
.fz-pick-list { display: flex; flex-direction: column; gap: 4px; max-height: 240px; overflow: auto; }
.fz-pick-list button { display: flex; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); text-align: left; font-size: 14px; }
.fz-pick-list button:hover { border-color: var(--teal); background: var(--teal-tint); }
.fz-pick-list small { color: var(--ink-3); }
.fz-modal { max-width: 460px; }
.fz-or { text-align: center; color: var(--ink-3); font-size: 12.5px; margin: 2px 0; }

@media (max-width: 980px) {
  .fz-grid { grid-template-columns: minmax(0, 1fr); }
  .fz-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .fz-fields { grid-template-columns: minmax(0, 1fr); }
  .fz-fields .span2 { grid-column: auto; }
  .fz-bar .fz-btn { flex: 1 1 auto; }
}

/* Chop etish: faqat hujjatning o'zi */
@media print {
  #screen-expenses { max-width: none; padding: 0; }
  .fz-chk, .fz-link-hide, .no-print { display: none !important; }
  .rail, .topbar, .fz-bar, .fz-back, .fz-filters, .fz-pager, .fz-items td.x, .fz-add, .toast { display: none !important; }
  body.has-rail { padding-left: 0 !important; }
  #screen-orders { max-width: none; padding: 0; }
  .fz-grid { grid-template-columns: 1fr; }
  .panel { border: 0; padding: 0; }
  .control { border: 0 !important; background: none !important; appearance: none; padding: 0 !important; min-height: 0 !important; }
  .fz-seg button[aria-checked="false"] { display: none; }
  .fz-seg button { border: 0; background: none; color: var(--ink); padding: 0; min-height: 0; font-weight: 700; }
}

/* Provodka qilingan hujjat: o'qish rejimida matn aniq ko'rinsin */
#screen-orders .control:disabled, #screen-expenses .control:disabled { color: var(--ink); -webkit-text-fill-color: var(--ink); opacity: 1; background-color: var(--mist); }
#screen-orders .fz-seg button[aria-checked="true"]:disabled, #screen-expenses .fz-seg button[aria-checked="true"]:disabled { opacity: 1; }
.fz-items { table-layout: auto; }
.fz-items th:nth-child(2) { width: 48%; }
.fz-items input.p { width: 150px; }
@media (max-width: 760px) { .fz-items th:nth-child(2) { width: 220px; } }

/* Rasxod */
.fz-link { border: 0; background: none; padding: 0; font: inherit; font-weight: 700; color: var(--teal-deep); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; text-align: left; }
.fz-link:hover { color: var(--teal); }
.fz-link.control-like { display: flex; align-items: center; min-height: 44px; padding: 0 14px; background: var(--mist); border-radius: 12px; text-decoration: none; }
.fz-chk { width: 36px; }
.fz-chk input { width: 18px; height: 18px; accent-color: var(--teal); cursor: pointer; }
.fz-neg { color: var(--coral); font-weight: 700; }
.fz-h3 { margin: 0 0 10px; font-size: 16px; font-weight: 800; }
.fz-chipbox { display: flex; align-items: center; background: var(--mist); }
.control.r { text-align: right; }
.fz-radios { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.fz-radio { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--card); font-weight: 600; cursor: pointer; }
.fz-radio.on { background: var(--amber-tint); border-color: #E7C48A; font-weight: 800; }
.fz-radio input { accent-color: var(--teal); }
.fz-hl { background: var(--amber-tint); border-radius: 10px; padding: 8px 12px; font-size: 16px !important; }
.fz-warn { margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--coral-tint); color: var(--coral); font-size: 13.5px; font-weight: 600; }
.modal.fz-modal.wide { max-width: 560px; }

.fz-batch .fz-st { white-space: normal; text-align: center; }
.fz-batch td, .fz-batch th { padding-left: 10px; padding-right: 10px; }

/* Akt sverka */
.fz-act { padding: 24px 26px; }
.fz-act-title { margin: 0; text-align: center; font-size: 19px; font-weight: 800; letter-spacing: .01em; }
.fz-act-sub { margin: 6px 0 16px; text-align: center; color: var(--ink-2); font-size: 14px; }
.fz-act .fz-sum td { background: #F6FAFA; }
.fz-act-debt { margin: 16px 0 6px; font-weight: 800; font-size: 14.5px; }
.fz-sign { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 26px; color: var(--ink-2); font-size: 14px; }
.fz-h4 { margin: 18px 0 6px; font-size: 14px; font-weight: 800; }
.fz-wh { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: 14px; }
.fz-wh .fz-link { font-weight: 800; text-decoration: none; color: var(--ink); }
.fz-wh .fz-link:hover { color: var(--teal-deep); text-decoration: underline; }
.fz-chat { margin-top: 14px; }
.fz-alert { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 0 0 14px; padding: 10px 14px; border-radius: 12px; background: var(--coral-tint); color: var(--coral); font-size: 14px; }
.fz-alert .fz-link { color: var(--coral); }
.fz-filters select[aria-label="Поставщик"] { max-width: 280px; }

/* Til almashtirish va Sozlamalar */
.lang-switch { display: flex; justify-content: center; gap: 6px; margin-top: 6px; }
.lang-switch button { min-height: 34px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--ink-2); font-size: 13px; font-weight: 700; }
.lang-switch button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.set-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.lang-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.lang-card { position: relative; display: flex; flex-direction: column; gap: 2px; align-items: flex-start; padding: 16px; border: 1.5px solid var(--line); border-radius: 16px; background: var(--card); text-align: left; cursor: pointer; }
.lang-card b { font-size: 18px; font-weight: 800; }
.lang-card small { color: var(--ink-2); font-size: 13px; }
.lang-card:hover { border-color: #C9D7DB; }
.lang-card[aria-pressed="true"] { border-color: var(--teal); background: var(--teal-tint); }
.lang-card-tick { position: absolute; right: 12px; top: 12px; width: 22px; height: 22px; border-radius: 50%; display: none; place-items: center; background: var(--teal); color: #fff; }
.lang-card-tick svg { width: 14px; height: 14px; }
.lang-card[aria-pressed="true"] .lang-card-tick { display: grid; }
.set-dl { margin: 0; display: grid; gap: 12px; }
.set-dl dt { font-size: 13px; color: var(--ink-2); }
.set-dl dd { margin: 2px 0 0; font-size: 16px; font-weight: 700; }
@media (max-width: 860px) { .set-grid, .lang-cards { grid-template-columns: minmax(0, 1fr); } }

/* Telefonda pastki menyu: 8 ta bo'lim sig'ishi uchun ixcham */
@media (max-width: 700px) {
  .rail-items { gap: 2px; padding: 6px 6px; justify-content: space-between; }
  .rail-item { min-width: 0; flex: 1 1 0; padding: 6px 1px; font-size: 9.5px; letter-spacing: -.01em; }
  .rail-item span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .rail-item svg { width: 20px; height: 20px; }
}

.fz-grow { flex: 1; min-width: 0; }

/* Xarid saqlangach: Rasxod talabnomasi haqida xabar */
.receipt-expense { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px 12px; margin: 14px 0 14px; padding: 10px 14px; border-radius: 12px; background: var(--teal-tint); color: var(--teal-deep); font-size: 14px; font-weight: 600; text-align: center; }
.receipt-expense.warn { background: var(--amber-tint); color: #9A5300; }

.fz-sub { display: block; font-size: 12px; font-weight: 500; color: var(--ink-3); margin-top: 1px; }
.fz-side .fz-link { display: inline-block; margin-top: 10px; }

/* Sana maydoni: kun.oy.yil */
.dfield { display: inline-flex; flex-direction: column; gap: 4px; min-width: 0; max-width: 100%; }
.dfield-box { position: relative; display: flex; align-items: center; }
.dfield-in { width: 100%; min-width: 120px; padding-right: 38px !important; font-variant-numeric: tabular-nums; }
.dfield-in.sm { min-width: 0; width: 118px; padding-right: 30px !important; border: 0; background: transparent; font: inherit; font-size: 13px; font-weight: 700; color: var(--ink); outline: none; }
.dfield-in.bad { border-color: var(--coral) !important; box-shadow: 0 0 0 3px var(--coral-tint); }
.dfield-native { position: absolute; right: 0; bottom: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; border: 0; padding: 0; }
.dfield-cal { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-2); cursor: pointer; }
.dfield-cal:hover:not(:disabled) { background: var(--slate-tint); color: var(--teal-deep); }
.dfield-cal:disabled { opacity: .4; cursor: default; }
.dfield-cal svg { width: 18px; height: 18px; }
.dfield-hint { min-height: 0; font-size: 12px; color: var(--ink-3); }
.dfield-hint:empty { display: none; }
.dfield-hint.bad { color: var(--coral); font-weight: 700; }
.dfield-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.dfield-chip { min-height: 28px; padding: 0 10px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--card); font-size: 12.5px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.dfield-chip:hover:not(:disabled) { border-color: var(--teal); color: var(--teal-deep); }
.dfield-chip.ghost { border-style: dashed; }
.dfield-chip:disabled { opacity: .5; cursor: default; }
.fz-filters .dfield-box { border: 0; }
.fz-fields .dfield { display: flex; }
@media print { .dfield-cal, .dfield-chips, .dfield-hint { display: none !important; } .dfield-in { border: 0 !important; padding: 0 !important; background: none !important; } }

/* Muddat o'tgan (просрочено) */
.fz-due { white-space: nowrap; }
.fz-due.bad { color: var(--coral); font-weight: 700; }
.fz-due .fz-dot { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: var(--coral); vertical-align: middle; }
.fz-due small { display: block; font-size: 11.5px; font-weight: 600; color: var(--coral); }
tr.fz-over > td:first-child { box-shadow: inset 3px 0 0 var(--coral); }
.fz-tabs { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.fz-tab { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--card); font-size: 13.5px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.fz-tab b { font-variant-numeric: tabular-nums; }
.fz-tab[aria-pressed="true"] { background: var(--teal); border-color: var(--teal); color: #fff; }
.fz-tab.bad:not([aria-pressed="true"]) { border-color: var(--coral); color: var(--coral); background: var(--coral-tint); }
.fz-tab.bad[aria-pressed="true"] { background: var(--coral); border-color: var(--coral); }
.fz-tab small { font-size: 12px; font-weight: 600; opacity: .85; }

/* Pachka jadvali: ustun qo'shilgani uchun ixchamroq */
.fz-batch { font-size: 13.5px; }
.fz-batch th, .fz-batch td { padding-left: 8px; padding-right: 8px; }
.fz-batch th:first-child, .fz-batch td:first-child { padding-left: 12px; }
.fz-stat-btn { cursor: pointer; text-align: left; font: inherit; }
.fz-stat-btn:hover { box-shadow: 0 0 0 2px var(--coral-tint); }
.fz-syncinfo { font-size: 12.5px; }
.fz-syncinfo.bad { color: var(--coral); font-weight: 700; }

/* Qaytarish (vozrat) */
.fz-ret { display: inline-block; margin-left: 6px; color: var(--coral); font-size: 12px; font-weight: 700; white-space: nowrap; }
.fz-ret.fz-block { display: block; margin: 3px 0 0; }
td.num-cell .fz-ret { display: block; margin: 2px 0 0; }
.fz-items td .fz-ret { display: block; margin: 3px 0 0; }
.fz-badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin-left: 8px; padding: 0 6px; border-radius: 999px; background: var(--coral); color: #fff; font-size: 12px; font-weight: 800; }
.fz-badge.hidden { display: none; }
.fz-ret-total { justify-content: flex-end; color: var(--ink-2); font-size: 14px; padding-bottom: 0; }
.fz-ret-total.hidden { display: none; }
.fz-returns .fz-ret-line { font-size: 13.5px; line-height: 1.45; }
.fz-returns .fz-ret-line.nomatch { color: var(--ink-3); font-style: italic; }
.fz-retsum { margin: 0 0 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.fz-acts { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.fz-detail > td { padding: 0 !important; background: var(--slate-tint); }
.fz-detail-box { padding: 10px 14px; overflow-x: auto; }
.fz-ok { color: #126B3B; font-weight: 700; }
.fz-scroll { max-height: 340px; overflow: auto; }
.modal.fz-modal.xl { max-width: min(1040px, 96vw); max-height: 92vh; overflow: auto; }
.modal.fz-modal.xl .modal-actions { grid-template-columns: minmax(0, 220px); justify-content: end; }

/* ---- O'chirish (korzina): Holat ustunidan keyin kichik tugma; o'chirilgan qator mavhum, 24 soat «Восстановить» ---- */
.fz-trash-h { width: 1%; }
.fz-trash-cell { width: 1%; white-space: nowrap; text-align: right; padding-left: 4px !important; }
.fz-trash {
  display: inline-grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 1px solid transparent; border-radius: 10px;
  background: transparent; color: var(--ink-3); cursor: pointer; transition: background .15s, color .15s, border-color .15s;
}
.fz-trash svg { width: 17px; height: 17px; }
.fz-trash:hover:not(:disabled), .fz-trash:focus-visible { background: var(--coral-tint); color: var(--coral); border-color: #F5C9C5; }
.fz-trash:disabled { opacity: .35; cursor: not-allowed; }
.fz-restore {
  display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px; border: 1px solid var(--teal); border-radius: 10px;
  background: var(--card); color: var(--teal-deep); font-weight: 700; font-size: 13px; cursor: pointer; transition: background .15s, color .15s;
}
.fz-restore svg { width: 16px; height: 16px; }
.fz-restore:hover:not(:disabled), .fz-restore:focus-visible { background: var(--teal); color: #fff; }
.fz-restore:disabled { opacity: .5; cursor: default; }
.fz-table tbody tr.fz-row.is-deleted { cursor: default; background: repeating-linear-gradient(135deg, transparent 0 10px, rgba(141, 162, 170, .07) 10px 20px); }
.fz-table tbody tr.fz-row.is-deleted > td:not(.fz-trash-cell):not(.fz-st-cell) { opacity: .42; text-decoration: line-through; text-decoration-color: rgba(141, 162, 170, .7); }
.fz-table tbody tr.fz-row.is-deleted > td.fz-st-cell { opacity: 1; }
.fz-table tbody tr.fz-row.is-deleted > td .fz-st:not([data-s="deleted"]) { opacity: .6; }
.fz-st[data-s="deleted"] { background: var(--coral-tint); color: var(--coral); }
.fz-left { display: block; margin-top: 3px; font-size: 12px; font-weight: 600; color: var(--ink-3); }
.fz-confirm { max-width: 420px; align-items: center; text-align: center; }
.fz-confirm-ico { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: var(--teal-tint); color: var(--teal-deep); }
.fz-confirm-ico.danger { background: var(--coral-tint); color: var(--coral); }
.fz-confirm-ico svg { width: 26px; height: 26px; }
.fz-confirm-p { margin: 0; font-size: 14px; line-height: 1.45; color: var(--ink-2); }
.fz-confirm .modal-actions { width: 100%; margin-top: 8px; }
.cta.danger, .fz-confirm-yes.danger { background: var(--coral); }
.cta.danger:active, .fz-confirm-yes.danger:hover { background: #C2382E; }
@media (max-width: 720px) {
  .fz-trash-cell { text-align: left; }
  .fz-restore span { display: inline; }
}

/* ======================================================================
   Zaqazlar / Rasxod: keng ekranda butun kenglik, katak chiziqlari, ajralib turuvchi qatorlar
   ====================================================================== */
@media (min-width: 861px) {
  #screen-orders.screen.dash, #screen-expenses.screen.dash { max-width: min(2200px, 100%); padding-left: 28px; padding-right: 28px; }
  #screen-expenses .us-stats, #screen-orders .us-stats { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
}
#screen-orders .panel, #screen-expenses .panel { padding: 14px; }
#screen-orders .dt-wrap, #screen-expenses .dt-wrap { border: 1px solid #C9D7DB; border-radius: 12px; background: var(--card); box-shadow: 0 1px 2px rgba(15, 52, 64, .04); }
#screen-orders .fz-table, #screen-expenses .fz-table { width: 100%; min-width: 980px; font-size: 14px; }
#screen-orders .fz-table th, #screen-expenses .fz-table th {
  background: #E9F1F3; color: #3F5A63; font-size: 12px; letter-spacing: .02em; padding: 11px 12px;
  border-bottom: 2px solid #B9CBD0; border-right: 1px solid #D3E0E4;
}
#screen-orders .fz-table td, #screen-expenses .fz-table td { padding: 11px 12px; border-bottom: 1px solid #DCE6E9; border-right: 1px solid #E6EEF0; }
#screen-orders .fz-table th:last-child, #screen-orders .fz-table td:last-child,
#screen-expenses .fz-table th:last-child, #screen-expenses .fz-table td:last-child { border-right: 0; }
#screen-orders .fz-table tbody tr.fz-row:not(.is-deleted):nth-child(even) > td,
#screen-expenses .fz-table tbody tr.fz-row:not(.is-deleted):nth-child(even) > td { background: #F7FAFB; }
#screen-orders .fz-table tbody tr.fz-row:not(.is-deleted):hover > td,
#screen-expenses .fz-table tbody tr.fz-row:not(.is-deleted):hover > td { background: #E8F3F2; }
#screen-orders .fz-table tbody tr:last-child td, #screen-expenses .fz-table tbody tr:last-child td { border-bottom: 0; }
#screen-orders .fz-table td.num-cell, #screen-expenses .fz-table td.num-cell { font-variant-numeric: tabular-nums; }
#screen-orders .fz-table th.r, #screen-expenses .fz-table th.r { text-align: right; }
/* Raqam ustuni, belgi va o'chirish ustuni: tor va ajralib turadi */
#screen-orders .fz-table td.fz-trash-cell, #screen-expenses .fz-table td.fz-trash-cell { width: 1%; white-space: nowrap; text-align: center; padding: 6px 8px; background-clip: padding-box; }
#screen-orders .fz-table th.fz-trash-h, #screen-expenses .fz-table th.fz-trash-h { width: 1%; }
#screen-orders .fz-table td.fz-st-cell, #screen-expenses .fz-table td.fz-st-cell { white-space: nowrap; }
/* Eni kengayganda ma'lumotli ustunlar sig'adi, uzun nomlar qatorga o'raladi */
#screen-orders .fz-table td, #screen-expenses .fz-table td { overflow-wrap: anywhere; }
#screen-orders .fz-table td.num-cell, #screen-expenses .fz-table td.num-cell, #screen-orders .fz-table td.nowrap, #screen-expenses .fz-table td.nowrap { overflow-wrap: normal; }
@media (max-width: 860px) {
  #screen-orders .fz-table, #screen-expenses .fz-table { min-width: 0; }
}

/* Ixcham qatorlar */
#screen-orders .fz-table td, #screen-expenses .fz-table td { padding: 6px 12px; line-height: 1.3; }
#screen-orders .fz-table th, #screen-expenses .fz-table th { padding: 9px 12px; }
#screen-orders .fz-table .fz-sub, #screen-expenses .fz-table .fz-sub { display: inline; margin: 0 0 0 6px; font-size: 12px; }
#screen-orders .fz-table td.fz-trash-cell, #screen-expenses .fz-table td.fz-trash-cell { padding: 3px 8px; }
#screen-orders .fz-table .fz-trash, #screen-expenses .fz-table .fz-trash { width: 28px; height: 28px; border-radius: 8px; }
#screen-orders .fz-table .fz-trash svg, #screen-expenses .fz-table .fz-trash svg { width: 15px; height: 15px; }
#screen-orders .fz-table .fz-restore, #screen-expenses .fz-table .fz-restore { min-height: 28px; padding: 0 10px; font-size: 12.5px; }
#screen-orders .fz-table .fz-st, #screen-expenses .fz-table .fz-st { padding: 1px 9px; font-size: 12px; }
#screen-orders .fz-table .fz-left, #screen-expenses .fz-table .fz-left { margin-top: 0; font-size: 11.5px; }
#screen-orders .fz-chk input, #screen-expenses .fz-chk input { width: 16px; height: 16px; }
#screen-orders .fz-table td.fz-st-cell > .fz-st + .fz-left, #screen-expenses .fz-table td.fz-st-cell > .fz-st + .fz-left { display: inline; margin-left: 6px; }
#screen-orders .fz-table td, #screen-expenses .fz-table td { overflow-wrap: normal; word-break: normal; }
#screen-orders .fz-table .fz-sub, #screen-expenses .fz-table .fz-sub { white-space: nowrap; }
#screen-orders .fz-table td a, #screen-expenses .fz-table td a, #screen-orders .fz-table td b, #screen-expenses .fz-table td b { white-space: nowrap; }

/* ======================================================================
   KPI kartochkalar (CRM uslubi): sarlavha + ikonka, UZS va USD alohida qatorlarda
   ====================================================================== */
#screen-orders .kpis, #screen-expenses .kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(224px, 1fr)); gap: 14px; margin-bottom: 16px; align-items: stretch; }
.kpi {
  --tint: color-mix(in srgb, var(--t, var(--ink)) 11%, #fff);
  position: relative; display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 14px 16px 12px; text-align: left; font: inherit;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 1px 2px rgba(15, 52, 64, .04), 0 4px 14px rgba(15, 52, 64, .03);
  overflow: hidden; transition: box-shadow .18s, transform .18s, border-color .18s;
}
.kpi::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--t, var(--ink)); opacity: .9; }
.kpi-btn { cursor: pointer; }
.kpi-btn:hover, .kpi-btn:focus-visible { transform: translateY(-1px); border-color: color-mix(in srgb, var(--t) 40%, var(--line)); box-shadow: 0 6px 18px rgba(15, 52, 64, .09); outline: none; }
.kpi-head { display: flex; align-items: center; gap: 10px; min-height: 34px; }
.kpi-ico { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 10px; background: var(--tint); color: var(--t, var(--ink)); }
.kpi-ico svg { width: 18px; height: 18px; }
.kpi-label { font-size: 13px; font-weight: 600; line-height: 1.25; color: var(--ink-2); }
.kpi-badge { margin-left: auto; flex: none; padding: 2px 9px; border-radius: 999px; background: var(--tint); color: var(--t, var(--ink)); font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums; }
.kpi-money { display: flex; flex-direction: column; }
.kpi-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; }
.kpi-row + .kpi-row { border-top: 1px dashed var(--line); }
.kpi-cur { flex: none; padding: 2px 7px; border-radius: 6px; background: var(--slate-tint); color: var(--ink-2); font-size: 11px; font-weight: 800; letter-spacing: .05em; }
.kpi-val { min-width: 0; font-size: 21px; font-weight: 800; letter-spacing: -.01em; line-height: 1.15; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--t, var(--ink)); text-align: right; }
.kpi-row.is-zero .kpi-val { color: var(--ink-3); font-weight: 700; }
.kpi-row.is-zero .kpi-cur { opacity: .6; }
.kpi-count { display: flex; align-items: center; flex: 1; }
.kpi-big { font-size: 36px; font-weight: 800; letter-spacing: -.02em; line-height: 1; font-variant-numeric: tabular-nums; color: var(--t, var(--ink)); }
@media (max-width: 700px) {
  #screen-orders .kpis, #screen-expenses .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi-wide { grid-column: 1 / -1; }
  .kpi-big { font-size: 30px; }
}
@media (prefers-reduced-motion: reduce) { .kpi { transition: none; } }

/* ======================================================================
   Qidiruvli tanlash (filtrlar): tugma + qidiruv maydonli ochiladigan ro'yxat
   ====================================================================== */
.sx { display: inline-flex; min-width: 0; max-width: 100%; }
.sx-native { display: none !important; }
.sx-btn { display: inline-flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; max-width: 100%; padding: 0; border: 0; background: transparent; font: inherit; font-size: 13px; font-weight: 700; color: var(--ink); cursor: pointer; text-align: left; }
.sx-btn:disabled { opacity: .55; cursor: default; }
.sx-btn:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; border-radius: 6px; }
.sx-val { min-width: 0; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fz-filters label.fz-f .sx-val { max-width: 200px; }
.sx-btn svg { flex: none; width: 14px; height: 14px; color: var(--ink-3); transition: transform .15s; }
.sx-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.sx-btn.control { width: 100%; min-height: 44px; padding: 0 12px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--card); font-size: 15px; font-weight: 500; }
.sx-btn.control .sx-val { max-width: none; }
.sx-pop { position: fixed; z-index: 70; display: flex; flex-direction: column; background: var(--card); border: 1px solid #C9D7DB; border-radius: 12px; box-shadow: 0 12px 32px rgba(15, 52, 64, .18), 0 2px 6px rgba(15, 52, 64, .08); overflow: hidden; animation: sx-in .12s ease-out; }
@keyframes sx-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.sx-pop.up { animation-name: sx-in-up; }
@keyframes sx-in-up { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.sx-searchbox { display: flex; align-items: center; gap: 8px; padding: 0 12px; border-bottom: 1px solid var(--line); background: #F6FAFA; }
.sx-searchbox svg { flex: none; width: 16px; height: 16px; color: var(--ink-3); }
.sx-search { flex: 1; min-width: 0; height: 40px; border: 0; background: transparent; font: inherit; font-size: 14px; color: var(--ink); outline: none; }
.sx-list { margin: 0; padding: 4px; list-style: none; overflow-y: auto; }
.sx-opt { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 8px; font-size: 14px; line-height: 1.3; color: var(--ink); cursor: pointer; }
.sx-opt.is-active { background: var(--teal-tint); }
.sx-opt.is-sel { font-weight: 700; color: var(--teal-deep); }
.sx-opt svg { flex: none; width: 15px; height: 15px; color: var(--teal-deep); }
.sx-multi .sx-opt { justify-content: flex-start; }
.sx-box { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border: 1.5px solid #B7C8CD; border-radius: 5px; background: var(--card); transition: background .12s, border-color .12s; }
.sx-box svg { width: 12px; height: 12px; color: #fff; }
.sx-box.on { background: var(--teal-deep); border-color: var(--teal-deep); }
.sx-box.all.on { background: var(--teal-deep); }
.sx-lbl { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; }
.sx-opt.is-sel .sx-lbl { font-weight: 700; }
.sx-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 36px; padding: 0 12px; border-top: 1px solid var(--line); background: #F6FAFA; font-size: 12.5px; color: var(--ink-3); }
.sx-clear { border: 0; background: transparent; padding: 4px 6px; margin-left: auto; font: inherit; font-size: 12.5px; font-weight: 700; color: var(--teal-deep); cursor: pointer; border-radius: 6px; }
.sx-clear:hover { background: var(--teal-tint); }
.sx-btn.has-sel .sx-val { color: var(--teal-deep); }
.sx-empty { padding: 16px 12px; text-align: center; font-size: 13.5px; color: var(--ink-3); }
@media (prefers-reduced-motion: reduce) { .sx-pop { animation: none; } }

/* Saralanadigan sarlavhalar */
.fz-table th.fz-sortable { padding: 0; }
.fz-sort { display: flex; align-items: center; gap: 6px; width: 100%; padding: 10px 12px; border: 0; background: transparent; font: inherit; color: inherit; letter-spacing: inherit; text-transform: inherit; text-align: left; cursor: pointer; white-space: nowrap; }
.fz-table th.r .fz-sort { justify-content: flex-end; }
.fz-sort:hover { background: rgba(15, 128, 128, .07); color: var(--ink); }
.fz-sort:focus-visible { outline: 2px solid var(--teal); outline-offset: -2px; }
.fz-sort-ico { display: inline-flex; flex-direction: column; gap: 2px; flex: none; }
.fz-sort-ico i { display: block; width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; opacity: .35; }
.fz-sort-ico .u { border-bottom: 5px solid currentColor; }
.fz-sort-ico .d { border-top: 5px solid currentColor; }
.fz-table th.is-sorted { color: var(--teal-deep); background: #DDEEEE; }
.fz-table th.is-sorted[data-dir="asc"] .u, .fz-table th.is-sorted[data-dir="desc"] .d { opacity: 1; }
#screen-orders .fz-table th.fz-sortable, #screen-expenses .fz-table th.fz-sortable { padding: 0; }
#screen-orders .fz-sort, #screen-expenses .fz-sort { padding: 9px 12px; }
/* Rasxod: ta'minotchi katagi bo'yicha filtr */
.fz-sup-cell { cursor: pointer; }
.fz-sup { display: inline; padding: 0; border: 0; background: transparent; font: inherit; color: inherit; text-align: left; cursor: pointer; border-bottom: 1px dashed transparent; transition: color .12s, border-color .12s; }
.fz-sup-cell:hover .fz-sup, .fz-sup:focus-visible { color: var(--teal-deep); border-bottom-color: var(--teal); outline: none; }
.fz-sup.is-on { color: var(--teal-deep); font-weight: 700; border-bottom-color: var(--teal); }

/* Akt sverka: Telegram-bot paneli, svodka, jurnal */
.fz-bot .fz-mt { display: block; margin-top: 14px; }
.fz-bot .control { width: 100%; }
.fz-reps { margin: 6px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.fz-reps li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px; background: var(--mist); border-radius: 10px; font-size: 14px; }
.fz-rep-x { font-size: 20px; line-height: 1; text-decoration: none; color: var(--ink-3); padding: 0 4px; }
.fz-rep-x:hover { color: #B3261E; }
.fz-rep-add { display: grid; gap: 6px; margin-top: 8px; }
.fz-comment { margin: 6px 0 0; padding: 8px 10px; border-left: 3px solid #E0A100; background: #FFF8E5; border-radius: 0 8px 8px 0; font-size: 14px; color: var(--ink); }
.fz-extra { margin-top: 16px; padding: 18px; }
.fz-extra[hidden] { display: none; }
.fz-sum-line { margin: 0 0 12px; font-size: 16px; font-weight: 800; }
.fz-extra .fz-bar .control { width: auto; min-width: 220px; }

/* Sozlamalar: Telegram-bot */
.set-tg { margin-top: 18px; }
.set-tg[hidden] { display: none; }
.set-tg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.set-tg-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; margin-bottom: 10px; }
.set-tg-table .control { min-width: 170px; }
.set-tg-table td { vertical-align: top; }
.set-tg-link { display: grid; grid-template-columns: 190px 190px 1fr 150px auto; gap: 8px; align-items: center; }
@media (max-width: 900px) { .set-tg-link { grid-template-columns: 1fr; } }
.fz-bad { color: #B3261E; }

/* Akt sverka: 2+ guruh bo'lsa «Отправить» tugmasi guruh tanlash menyusini ochadi */
.fz-sendwrap { position: relative; display: inline-flex; }
.fz-sendwrap .fz-btn svg { width: 14px; height: 14px; margin-left: 6px; }
.fz-menu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; min-width: 260px; max-width: min(360px, 90vw); padding: 6px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); box-shadow: 0 18px 40px -16px rgba(15, 42, 53, .4); }
.fz-menu[hidden] { display: none; }
.fz-menu-h { padding: 6px 10px 8px; font-size: 12.5px; font-weight: 600; opacity: .7; }
.fz-menu-i { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; padding: 9px 10px; border: 0; border-radius: 8px; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.fz-menu-i:hover, .fz-menu-i:focus-visible { background: var(--mist); outline: none; }
.fz-menu-i small { font-size: 12px; opacity: .65; }
@media (max-width: 720px) { .fz-bar .fz-sendwrap { flex: 1 1 auto; } .fz-bar .fz-sendwrap .fz-btn { flex: 1 1 auto; } .fz-menu { right: 0; left: 0; max-width: none; } }
.set-tg-extra { margin-top: 6px; display: grid; gap: 6px; }
.set-tg-extra:empty { display: none; }
.set-tg-extra .fz-inline { align-items: center; flex-wrap: wrap; }
.fz-sendwrap .fz-btn svg { transition: transform .15s; }
.fz-sendwrap .fz-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
