/* T-041 / T-045 1-bosqich: dizayn tokenlari (docs/design/T-041/spec.md 3.2). */
:root {
  /* — Neytral — */
  --bg: #f5f6fa;            /* sahifa foni */
  --surface: #ffffff;       /* karta, jadval, panel */
  --surface-2: #f3f4f8;     /* hover, ikkilamchi blok, qidiruv foni */
  --surface-3: #e9ebf1;     /* bosilgan holat, skeleton, progress izi (matn uchun EMAS) */
  --border: #e3e6ed;        /* karta/input chegarasi */
  --border-strong: #cfd3dd; /* input/chip hover */
  --border-soft: #eef0f4;   /* jadval qatorlari orasida */
  --text: #0f1222;          /* asosiy — oqda 18.6:1 */
  --text-2: #4a5068;        /* ikkilamchi, jadval sarlavhasi — oqda 8.0, surface-2 da 7.3 */
  --text-3: #5f6580;        /* meta: sana, izoh, hisoblagich — oq 5.7 · bg 5.3 · surface-2 5.2 · primary-bg 5.1 */
  --text-placeholder: #7f859b; /* placeholder, chevron, ajratgich «·» — oq 3.7 · surface-2 3.3 */

  /* — Brend (faqat harakat va tanlov) — */
  --primary: #4f46e5; --primary-hover: #4338ca; --primary-bg: #eef2ff;
  --primary-border: #c7d0ff; --primary-text: #4338ca;

  /* — Holat — */
  --success: #10b981; --success-bg: #ecfdf3; --success-border: #bfe9d2; --success-text: #027a48;
  --warning: #f59e0b; --warning-bg: #fffaeb; --warning-border: #fde9be; --warning-text: #b54708;
  --danger:  #ef4444; --danger-bg:  #fef3f2; --danger-border:  #fbd5d2; --danger-text:  #b42318;
  --danger-hover: #912018;

  /* — Suhbat so'zlovchilari (yangi tus emas) — */
  --speaker-seller: #4f46e5;
  --speaker-client: #475467;

  /* — Tipografika — */
  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --fs-xs: 12px;   /* eng kichik matn: badge, jadval sarlavhasi, pastki panel yorlig'i */
  --fs-sm: 13px;   /* meta qator, kichik tugma, KPI farqi */
  --fs-md: 14px;   /* asosiy matn, jadval katagi, tugma */
  --fs-lg: 16px;   /* bo'lim sarlavhasi; mobilda input (iOS zoom qilmasligi uchun) */
  --fs-xl: 20px;   /* sahifa/panel sarlavhasi (mobilda ham) */
  --fs-2xl: 28px;  /* KPI raqami (mobilda ham) */
  --fs-read: 15px; /* uzun o'qiladigan matn: suhbat, izoh, AI tahlil */
  --lh-tight: 1.25; --lh: 1.5; --lh-read: 1.65;
  --fw-regular: 500; --fw-medium: 600; --fw-bold: 700; --fw-heavy: 800; /* 800 — faqat KPI */

  /* — Oraliq (4px qadam) — */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px;
  --sp-6: 24px; --sp-8: 32px; --sp-10: 40px;

  /* — Radius — */
  --r-sm: 6px; --r-md: 10px; --r-lg: 14px; --r-full: 999px;

  /* — Soya: faqat suzuvchi qatlamlar — */
  --sh-pop: 0 8px 24px rgba(15,18,34,.12), 0 2px 6px rgba(15,18,34,.06);
  --sh-modal: 0 24px 64px rgba(15,18,34,.22);
  --focus-ring: 0 0 0 3px rgba(79,70,229,.28);
  --overlay: rgba(15,18,34,.45);

  /* — O'lchamlar — */
  --h-control: 40px; --h-control-sm: 32px; --h-touch: 44px;
  --row-h: 40px;        /* jadval qatori (Q2) */
  --row-h-dense: 36px;  /* Target/Ads/Kreativlar jadvallari */
  --topbar-h: 56px; --sidebar-w: 232px; --bottomnav-h: 60px;
  --panel-w: clamp(480px, 40vw, 860px); /* lead paneli: 1440 → 576px, 1920 → 768px */
  --dur: .16s; --ease: cubic-bezier(.2,.7,.3,1);
}
/* Teginish qurilmalari va telefon: HAR interaktiv element ≥44px (PM qarori) */
@media (max-width: 768px), (pointer: coarse) {
  :root { --h-control: 44px; --h-control-sm: 44px; --row-h: 44px; } /* iPad'da bosiladigan jadval qatori ham 44px */
}
@media (max-width: 768px) { :root{ --topbar-h: 52px; } }

/* z-index jadvali (spec 4.8) — bitta joyda. Qatlamlar: 50 + 10 × chuqurlik (openLayer). */
:root { --z-sticky: 1; --z-split: 10; --z-topbar: 30; --z-actionbar: 35; --z-bottomnav: 40;
  --z-popover: 45; --z-layer: 50; --z-toast: 90; }

*{ box-sizing: border-box; }
[hidden], .hidden { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-md);
  font-weight: var(--fw-regular);
  line-height: var(--lh);
}

/* Fokus halqasi — faqat klaviatura bilan (spec 3.2 --focus-ring) */
:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.topbar-search:focus-within { border-color: var(--primary); box-shadow: var(--focus-ring); }
.topbar-search input:focus-visible { box-shadow: none; }

a{ color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); text-decoration: underline; }
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); }

/* ------------------------------------ shell ---------------------------------- */

.shell { display: flex; min-height: 100dvh; }

.sidebar {
  width: var(--sidebar-w); flex-shrink: 0; background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 0 0 var(--sp-4);
  position: sticky; top: 0; height: 100dvh; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 12px; height: var(--topbar-h); flex-shrink: 0; padding: 0 var(--sp-5); border-bottom: 1px solid var(--border); }
.brand-mark {
  width: 36px; height: 36px; border-radius: 11px; background: var(--primary); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.brand-name { font-weight: 800; font-size: 16px; letter-spacing: .1px; }

.nav { display: flex; flex-direction: column; gap: 2px; padding: var(--sp-1) var(--sp-3); }
.nav-group-title { font-size: var(--fs-xs); font-weight: var(--fw-medium); color: var(--text-3); padding: var(--sp-4) var(--sp-3) var(--sp-1); }
.nav-group-title[hidden] { display: none; }
.nav-item {
  display: flex; align-items: center; gap: var(--sp-3); height: 40px; padding: 0 var(--sp-3); border-radius: var(--r-md);
  font: inherit; font-weight: var(--fw-medium); font-size: var(--fs-md); color: var(--text-2);
  border: 0; background: transparent; cursor: pointer; text-align: left; width: 100%;
  transition: background-color .14s, color .14s;
}
.nav-item svg { flex-shrink: 0; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.is-active { background: var(--primary-bg); color: var(--primary); font-weight: 700; }
.nav-item.is-active svg { stroke: var(--primary); }
.sidebar-foot { margin-top: auto; padding: 12px 12px 0; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px 12px; margin-bottom: 4px; font-size: 12.5px; color: var(--text-3); font-weight: 600; }
.avatar-chip {
  width: 30px; height: 30px; flex-shrink: 0; border-radius: 10px; background: var(--surface-2); color: var(--text-3);
  font-size: 12px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center;
}
.avatar-chip.is-admin { background: var(--primary-bg); color: var(--primary); }

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

.dash-banner {
  background: var(--warning-bg); border-bottom: 1px solid var(--warning-border); color: var(--warning-text);
  padding: 9px 24px; font-size: 12.5px; font-weight: 600; text-align: center;
}

.topbar {
  height: var(--topbar-h); flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  padding: 0 var(--sp-5); border-bottom: 1px solid var(--border); background: rgba(255,255,255,.92); backdrop-filter: blur(6px);
  position: sticky; top: 0; z-index: var(--z-topbar);
}
.topbar-heading { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.topbar-title { font-size: 20px; font-weight: 800; letter-spacing: -.3px; white-space: nowrap; }
.topbar-subtitle { font-size: 13px; font-weight: 500; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-3); font-weight: 600; }

.topbar-search {
  display: flex; align-items: center; gap: 8px; width: 300px; max-width: 40vw;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 0 12px; height: 38px; color: var(--text-3);
}
.topbar-search input {
  border: 0; background: transparent; outline: none; font: inherit; color: var(--text); flex: 1; min-width: 0;
}
.topbar-search input::placeholder { color: var(--text-3); }
.topbar-search kbd {
  font: inherit; font-size: 12px; font-weight: 700; color: var(--text-3); background: var(--surface);
  border: 1px solid var(--border); border-radius: 6px; padding: 2px 6px; flex-shrink: 0;
}

/* Q1: kontent kengligi cheklanmaydi (max-width yo'q), Q6: telefonda 12px */
main { flex: 1; padding: var(--sp-4) var(--sp-5) var(--sp-10); width: 100%; max-width: none; margin: 0; }
.view { display: none; }
.view.is-active { display: block; }

/* ------------------------------------ card ------------------------------------ */

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--sp-4); margin: 0; }
.card legend { font-weight: 700; padding: 0 6px; }
.hint { color: var(--text-3); font-size: 12.5px; margin: 0 0 14px; }

.field { display: grid; gap: 5px; margin-bottom: 14px; }
.field > span { font-size: 13px; font-weight: 600; }
.field small { color: var(--text-3); font-size: 12px; }
.check { display: flex; gap: 9px; align-items: center; margin-bottom: 14px; font-size: 13.5px; }

.input { height: var(--h-control); width: 100%; padding: 0 var(--sp-3); font: inherit; font-size: var(--fs-md);
  color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  transition: border-color var(--dur), box-shadow var(--dur); }
input.input[type="file"] { height: auto; padding: var(--sp-2) var(--sp-3); }
textarea.input { height: auto; padding: var(--sp-2) var(--sp-3); line-height: var(--lh); }
.input::placeholder { color: var(--text-placeholder); }
.input:hover { border-color: var(--border-strong); }
.input:focus { outline: none; border-color: var(--primary); box-shadow: var(--focus-ring); }
.input.is-invalid { border-color: var(--danger); }
.field-error { font-size: var(--fs-sm); color: var(--danger-text); margin-top: var(--sp-1); }
select.input { appearance: none; -webkit-appearance: none; padding-right: 32px; cursor: pointer;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235f6580' stroke-width='2.4' stroke-linecap='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 12px center; }
select.input[multiple] { background-image: none; padding-right: var(--sp-3); height: auto; }

.search { max-width: 280px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  height: var(--h-control); padding: 0 var(--sp-4); border-radius: var(--r-md); border: 1px solid transparent;
  font: inherit; font-size: var(--fs-md); font-weight: var(--fw-bold); white-space: nowrap; cursor: pointer;
  text-decoration: none; transition: background-color var(--dur), border-color var(--dur), color var(--dur); }
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); color: #fff; text-decoration: none; }
.btn-secondary { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-secondary:hover { background: var(--surface-2); text-decoration: none; }
.btn-text { background: transparent; color: var(--primary-text); padding: 0 var(--sp-2); }
.btn-text:hover { background: var(--primary-bg); }
.btn-danger { background: var(--danger-text); color: #fff; }
.btn-danger:hover { background: var(--danger-hover); }
/* T-029, 2-band: toolbar ichidagi kichik tugma (.btn-compact = .btn-sm alias) */
.btn-sm { height: var(--h-control-sm); padding: 0 var(--sp-3); font-size: var(--fs-sm); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn.is-loading { color: transparent; position: relative; pointer-events: none; }
.btn.is-loading::after { content: ''; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.5); border-top-color: #fff; animation: spin .7s linear infinite; }
.btn-secondary.is-loading::after { border-color: var(--surface-3); border-top-color: var(--primary); }
@keyframes spin { to { transform: rotate(360deg); } }

.test-result { font-size: 12.5px; margin-left: 8px; }
.test-result.ok { color: var(--success-text); }
.test-result.err { color: var(--danger-text); }
.save-row { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }

.empty { padding: 30px 20px; text-align: center; color: var(--text-3); font-size: 13.5px; }
code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; font-size: 12.5px; }
.redirect-uri { display: block; margin: 0 0 14px; padding: 8px 10px; word-break: break-all; }
.amo-status { font-size: 13px; color: var(--text-3); margin: 10px 0; }
.amo-status.ok { color: var(--success-text); font-weight: 600; }
.amo-status.err { color: var(--danger-text); font-weight: 600; }

/* T-016/T-018: Meta (Facebook) — sahifa/kabinet tanlash */
.picker-box { display: flex; flex-wrap: wrap; gap: 6px; border: 1px solid var(--border); border-radius: 10px; padding: 12px; background: var(--surface-2); }
.picker-box .btn { padding: 6px 12px; height: auto; font-size: 12.5px; }

/* --------------------------------- leadlar --------------------------------- */

.filters-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 10px 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 18px;
}
/* T-062 (T-058 spec 1-band): Target/Ads/Kreativlar filtr qatori desktopda BITTA
   qator (Leadlar naqshi: sana → select → qidiruv → spacer → amallar). `overflow`
   ataylab `visible` — `overflow-x:auto` sana kalendari va «Ustunlar» panelini
   (absolute popup) kesib qo'yadi; o'rniga qidiruv va daraja chipi qisqaradi, «bugungi
   kun» izohi jadval ostidagi .hint'da.
   ≤768px — avvalgidek o'raladi (D-019, mobil ikkilamchi). */
.filters-card .spacer { flex: 1 1 0; min-width: 0; }
.filters-card .meta-line { margin: 0; flex-wrap: nowrap; white-space: nowrap; font-size: 12.5px; color: var(--text-3); }
.filters-card .meta-line strong { color: var(--text); }
.filters-card .inline-form { flex-wrap: nowrap; }
.filters-card .inline-label { white-space: nowrap; }
@media (min-width: 769px) {
  .filters-card { flex-wrap: nowrap; }
  .filters-card > * { flex-shrink: 0; }
  .filters-card > .input.search { flex: 0 1 240px; min-width: 120px; }
  .filters-card > .meta-line { flex-shrink: 1; min-width: 0; }
  .filters-card .level-chip { max-width: 220px; overflow: hidden; }
  .filters-card .level-chip strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
}
/* T-029, 4-band: toolbar ichidagi sana tanlagich/qidiruv — ixchamroq. */
.input-compact { height: var(--h-control-sm); padding: 0 10px; font-size: var(--fs-sm); }
select.input.input-compact { padding-right: 30px; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: var(--r-md); padding: 3px; gap: 2px; }
.seg-btn { height: 30px; padding: 0 var(--sp-3); border: 0; border-radius: 8px; background: transparent; font: inherit;
  font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--text-2); cursor: pointer; white-space: nowrap; }
.seg-btn:hover { color: var(--text); }
.seg-btn.is-active { background: var(--surface); color: var(--text); font-weight: var(--fw-bold); box-shadow: 0 1px 2px rgba(15,18,34,.08); }

/* ------------------------------ sana oralig'i tanlagichi ----------------------- */

.date-range-picker { position: relative; }
.date-range-trigger { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; color: var(--text); white-space: nowrap; }
.date-range-trigger svg { color: var(--text-3); flex-shrink: 0; }
.date-range-popup {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: var(--z-popover); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: 0 12px 32px rgba(15,18,34,.14);
  padding: 14px; width: 280px;
}
.cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-title { font-weight: 700; font-size: 13.5px; text-transform: capitalize; }
.cal-nav { border: 1px solid var(--border); background: var(--surface); border-radius: 8px; width: 26px; height: 26px; cursor: pointer; color: var(--text-3); font-size: 15px; line-height: 1; }
.cal-nav:hover { background: var(--surface-2); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-wd { font-size: 12px; font-weight: 700; color: var(--text-2); text-align: center; padding: 4px 0; }
.cal-day { border: 0; background: transparent; font: inherit; font-size: 12.5px; padding: 7px 0; border-radius: 8px; cursor: pointer; color: var(--text); }
.cal-day:hover:not(.empty) { background: var(--surface-2); }
.cal-day.in-range { background: var(--primary-bg); border-radius: 0; }
.cal-day.selected { background: var(--primary); color: #fff; font-weight: 700; }
.cal-day.empty { cursor: default; }
.cal-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.cal-footer .btn { padding: 6px 12px; height: auto; font-size: 12.5px; }

.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }

.col-check { width: 40px; }
.col-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }

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

.load-sentinel { height: 1px; }

table.calls { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.calls th { text-align: left; font-size: 12px; font-weight: 600; color: var(--text-2); padding: 6px 10px; }
table.calls td { padding: 7px 10px; border-bottom: 1px solid var(--border-soft); }
table.calls tr:last-child td { border-bottom: 0; }

.link-btn { border: 0; background: transparent; color: var(--primary-text); font: inherit; font-weight: 700; font-size: var(--fs-sm); cursor: pointer; padding: 0; }
.link-btn:hover { text-decoration: underline; }

.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px;
  border-radius: var(--r-md); border: 1px solid transparent; background: transparent; color: var(--text-2);
  cursor: pointer; padding: 0; flex-shrink: 0; transition: background-color var(--dur), color var(--dur); }
.icon-btn.is-bordered { border-color: var(--border); }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn:disabled { opacity: .4; cursor: not-allowed; }
.icon-btn svg { pointer-events: none; }

.actionbar {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%);
  display: flex; gap: 16px; align-items: center; background: var(--text); color: #fff;
  box-shadow: var(--sh-pop); border-radius: var(--r-full); padding: 10px 10px 10px 20px;
  font-weight: 600; font-size: 13.5px; z-index: var(--z-actionbar);
}
.actionbar[hidden] { display: none; }

/* ------------------------------ yuklab olish navbati -------------------------- */

.download-queue {
  position: fixed; right: 20px; bottom: 20px; z-index: 40;
  display: flex; flex-direction: column; gap: 8px; width: 300px; max-width: calc(100vw - 40px);
}
.dq-item {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  box-shadow: 0 10px 30px rgba(16,24,38,.14); padding: 12px 14px; display: flex; align-items: center; gap: 10px;
  font-size: 13px; animation: dq-in .18s ease;
}
@keyframes dq-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.dq-icon { flex-shrink: 0; width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; }
.dq-spinner {
  width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border); border-top-color: var(--primary);
  animation: dq-spin .7s linear infinite;
}
@keyframes dq-spin { to { transform: rotate(360deg); } }
.dq-icon.ok { color: var(--success); font-weight: 800; }
.dq-icon.err { color: var(--danger); font-weight: 800; }
.dq-icon.queued { color: var(--text-3); }
.dq-body { flex: 1; min-width: 0; }
.dq-label { font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dq-status { font-size: 12px; color: var(--text-3); margin-top: 1px; }
.dq-status.err { color: var(--danger-text); }
/* Jarayon indikatori — qaysi bosqichda va necha foiz bajarilgani. */
.dq-bar { height: 4px; border-radius: 99px; background: var(--primary-bg); margin-top: 6px; overflow: hidden; }
.dq-bar > span { display: block; height: 100%; border-radius: 99px; background: var(--primary); transition: width .4s ease; }

/* ------------------------------ fayllar (vazifalar) --------------------------- */
/* Jadval o'rniga kartochkalar: bitta qatorda uzunligi juda har xil ma'lumot
   (lead nomlari, bosqich matni, progress) bo'lgani uchun jadval ustunlari
   siqilib, o'qilishi qiyin bo'lardi. */

.job-list { display: flex; flex-direction: column; gap: 10px; }
.job-card {
  display: grid; grid-template-columns: 36px 1fr auto; gap: 14px; align-items: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 14px 16px;
}
.job-card.is-done { border-color: var(--success-border); }
.job-card.is-error { background: var(--danger-bg); border-color: var(--danger-border); }

.job-icon {
  width: 36px; height: 36px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary-bg); color: var(--primary); font-size: 15px; font-weight: 700;
}
.job-icon.ok { background: var(--success-bg); color: var(--success-text); }
.job-icon.err { background: var(--danger-bg); color: var(--danger-text); }

.job-title { font-weight: 700; font-size: 14px; line-height: 1.3; }
.job-leads {
  margin-top: 2px; color: var(--text-3); font-size: 12.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 560px;
}
.job-meta { margin-top: 5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--text-3); }
.job-stage { color: var(--text-3); font-weight: 600; }
.job-stage.err { color: var(--danger-text); font-weight: 600; }
.job-bar { height: 5px; border-radius: 99px; background: var(--surface-2); margin-top: 8px; max-width: 420px; overflow: hidden; }
.job-bar > span { display: block; height: 100%; border-radius: 99px; background: var(--primary); transition: width .4s ease; }
.job-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--text-3); display: inline-block; }

/* ============================================================================
   T-071 — Dataset sahifasi (admin), docs/design/T-071/spec.md 3-band.
   ============================================================================ */
.dataset-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(480px, 1fr)); gap: var(--sp-4); }
.dataset-params { display: flex; align-items: flex-end; gap: var(--sp-3); flex-wrap: wrap; padding-bottom: var(--sp-4); margin-bottom: var(--sp-4); border-bottom: 1px solid var(--border-soft); }
.dataset-params .field { margin-bottom: 0; }
.dataset-params .field.status { width: 150px; }
.dataset-params .field.n { width: 96px; }
.dataset-params .field.stage { min-width: 220px; }
.dataset-params .field.hist { min-width: 200px; }
.dataset-params .field.date { width: 150px; }
.dataset-params .btn { margin-left: auto; }
.dataset-params-hint { margin-top: calc(-1 * var(--sp-3)); margin-bottom: var(--sp-3); }
/* T-083: "Muxlisa'da yo'q matnlarni o'girish" checkbox + taxmin qatori — filtrlar
   qatoridan pastda, alohida to'liq kenglikdagi qator. */
.field.mux-check { display: flex; align-items: center; gap: var(--sp-2); font-size: 13px; font-weight: 400; margin: 0 0 var(--sp-2); }
.dataset-mux-estimate { margin: 0 0 var(--sp-3); }
/* T-080d: «Oldingi yurishlar» jadvalida ikkita yuklab olish tugmasi (Voice AI + Muxlisa) */
.ds-history-dl { display: flex; gap: var(--sp-2); justify-content: flex-end; flex-wrap: wrap; }
.ds-progress-text { font-size: var(--fs-sm); color: var(--text-3); font-weight: var(--fw-medium); margin-top: 6px; }
.ds-history-head { display: flex; align-items: center; justify-content: space-between; margin: var(--sp-4) 0 var(--sp-2); }
.ds-history-head h3 { font-size: var(--fs-sm); font-weight: var(--fw-bold); color: var(--text-2); margin: 0; }
.job-meta.err { color: var(--danger-text); font-weight: 600; }
.job-card.is-expired { background: var(--surface-2); border-color: var(--border); opacity: .85; }
.job-card.is-expired .job-icon { background: var(--surface-3); color: var(--text-3); }
.job-expired-text { font-size: var(--fs-sm); color: var(--text-3); font-weight: var(--fw-medium); white-space: nowrap; }
.data-table td.params { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* -------------------------------- dashboard ---------------------------------- */

@media (max-width: 720px) {
  .job-card { grid-template-columns: 30px 1fr; row-gap: 10px; }
  .job-card > .job-action { grid-column: 2; justify-self: start; }
  .job-leads { max-width: 100%; }
}

/* ------------------------------ lead sahifasi -------------------------------- */

.section-title { font-size: 14px; font-weight: 700; margin: 0 0 12px; }

/* ------------------------ lead sahifasi: tab + yon panel ----------------------- */

.side-card { padding: 16px 18px; }

/* T-016/T-018: lead modali — "Reklama (Meta)" bloki */
.meta-creative { width: 100%; aspect-ratio: 1.9 / 1; border-radius: var(--r-md); overflow: hidden; background: var(--surface-2); margin-bottom: 10px; display: flex; align-items: center; justify-content: center; color: var(--text-3); font-size: 12px; font-weight: 600; text-align: center; padding: 10px; }
.meta-creative img { width: 100%; height: 100%; object-fit: cover; display: block; }

.tab-bar { display: flex; flex-wrap: wrap; gap: var(--sp-1); border-bottom: 1px solid var(--border); margin-bottom: var(--sp-4); }
.tab-bar.is-scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.tab-btn { display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 var(--sp-3); border: 0; background: none;
  font: inherit; font-size: var(--fs-md); font-weight: var(--fw-medium); color: var(--text-2); white-space: nowrap; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px; flex-shrink: 0; }
.tab-btn:hover { color: var(--text); }
.tab-btn.is-active { color: var(--primary); border-bottom-color: var(--primary); font-weight: var(--fw-bold); }
.tab-count, .tab-btn .tab-count { font-size: var(--fs-xs); font-weight: var(--fw-bold); background: var(--surface-2); color: var(--text-2); border-radius: var(--r-full); padding: 1px 7px; min-width: 22px; text-align: center; }
.tab-btn.is-active .tab-count { background: var(--primary-bg); color: var(--primary-text); }
.tab-count.is-pending { color: var(--text-3); }
.tab-btn.is-empty { color: var(--text-3); }

/* ---------------------- T-013: Target benchmark tabi -------------------------- */
/* Manba: docs/design/T-011/spec.md 12-band, docs/design/T-011/mockup.html — mavjud
   tokenlardan (yangi rang/radius/soya yo'q). */

/* T-062: `#dashFilters` ichidagi Target guruhi — `display:contents`, ya'ni
   select / spacer / Kurs / Normani tahrirlash to'g'ridan-to'g'ri filtr qatorining
   elementlari (eski `margin-left:auto` 2-qatorga tushish sababi edi). */
.target-toolbar-right { display: contents; }
.rate-chip { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-3); font-weight: 600; white-space: nowrap; }
.rate-chip strong { color: var(--text); font-weight: 800; font-variant-numeric: tabular-nums; }


/* Norma/Natija/Kunlik uchun umumiy jadval ko'rinishi — table.leads bilan bir xil uslub, faqat generic nom */
table.metrics { width: 100%; border-collapse: collapse; }
table.metrics th { text-align: left; font-size: 12px; font-weight: 600; color: var(--text-2); padding: 6px 10px; background: transparent; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.metrics td { height: var(--row-h-dense); padding: 4px 10px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; font-size: 13px; cursor: default; }
table.metrics tr:last-child > td { border-bottom: 0; }
table.metrics td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.metrics td.is-computed { color: var(--text-3); }
table.metrics tfoot td, table.metrics tr.is-total td { font-weight: 800; background: var(--surface-2); }
table.metrics td.is-warn { background: var(--warning-bg); }
table.metrics .warn-flag { color: var(--warning-text); font-weight: 800; margin-left: 5px; cursor: help; }

table.metrics .stage-label { font-weight: 700; }
table.metrics .stage-sub { display: block; font-size: 12px; color: var(--text-3); font-weight: 500; margin-top: 1px; }
/* T-069: Sotildi/Gaplashuv ostidagi ±% — kpi-delta bilan bir xil tokenlar */
table.metrics .stage-sub.is-up { color: var(--success-text); }
table.metrics .stage-sub.is-down { color: var(--danger-text); }

/* T-069: Plan % — mini progress, dq-bar/job-bar naqshi, jadval katagiga moslashtirilgan */
.plan-bar { display: inline-block; width: 40px; height: 4px; border-radius: 99px; background: var(--surface-3); vertical-align: middle; margin-right: 6px; overflow: hidden; }
.plan-bar > span { display: block; height: 100%; border-radius: 99px; background: var(--primary); }
.plan-bar.is-ok > span { background: var(--success); }
.plan-bar.is-bad > span { background: var(--danger); }

/* 22 ustunli "Kunlik" jadval uchun — sahifa emas, jadval o'zi suriladi (TZ-001 13-talab) */
.table-wrap.is-scroll-x { overflow-x: auto; overflow-y: hidden; }
.table-wrap.is-scroll-x table.metrics { min-width: 1180px; }
/* T-062 (T-058 spec 3-band): Bosqichlar jadvali to'liq kenglik — 6 ustun o'z
   kengligida, qolgan joyni oxirgi bo'sh `.c-fill` ustuni oladi (o'ngda bo'sh karta
   yo'q, qiymatlar cho'zilmaydi). Mobilda gorizontal skroll (T-030 topilmasi). */
table.metrics.stages-table .c-fill { padding: 0; width: 100%; }
table.metrics.stages-table td, table.metrics.stages-table th { white-space: nowrap; }
@media (max-width: 640px) {
  .table-wrap.stages-wrap { overflow-x: auto; }
}
.stage-head { margin-bottom: var(--sp-3); }
.stage-head-right { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }
/* Kunlik statistika — karta EMAS, Bosqichlar ostida bezaksiz (faqat ajratgich chiziq). */
.daily-section { margin-top: var(--sp-5); }
.table-wrap.is-plain { background: transparent; border: 0; border-radius: 0; border-top: 1px solid var(--border-soft); padding-top: var(--sp-3); overflow-x: auto; }

/* Norma tahrirlash modalidagi min/max forma */
.bm-form-table { width: 100%; border-collapse: collapse; }
.bm-form-table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--text-2); padding: 5px 8px; }
.bm-form-table td { padding: 6px 8px; vertical-align: middle; }
.bm-form-table .input { height: var(--h-control-sm); padding: 0 9px; font-size: 12.5px; width: 100%; }
/* Modal tor ekranda (375px) ham hamma ustunni ko'rsatishi uchun — sahifa emas,
   forma o'zi suriladi (mavjud .is-scroll-x naqshi bilan bir xil g'oya). */
.bm-form-scroll { overflow-x: auto; }
.bm-form-scroll .bm-form-table { min-width: 560px; }

/* --------------------------------- modal ------------------------------------- */

.modal-overlay {
  position: fixed; inset: 0; background: var(--overlay); display: flex; align-items: center;
  justify-content: center; z-index: var(--layer-z, 50); padding: 20px; animation: fade var(--dur) var(--ease);
}
.modal { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--sh-modal); width: 100%; max-width: 620px; max-height: 86vh; display: flex; flex-direction: column; overflow: hidden; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--border); }
.modal-head strong { font-size: var(--fs-lg); }
.modal-close { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; flex-shrink: 0;
  border: 0; border-radius: var(--r-md); background: transparent; font-size: 20px; line-height: 1; cursor: pointer; color: var(--text-2); padding: 0; }
.modal-close:hover { background: var(--surface-2); color: var(--text); }
.modal-body { padding: var(--sp-4); overflow-y: auto; }
@media (max-width: 768px) { .modal-overlay{ padding: var(--sp-3); } }
.modal-meta { font-size: 12.5px; color: var(--text-3); margin-bottom: 14px; display: flex; gap: 12px; flex-wrap: wrap; }
.modal-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }

/* suhbat: sotuvchi chapda, mijoz o'ngda */
.turn { display: grid; grid-template-columns: 46px 1fr; gap: 10px; margin-bottom: 8px; align-items: start; }

.who { font-size: 12px; font-weight: 700; margin-bottom: 2px; }
.turn.sotuvchi .who { color: var(--primary); }
.turn.mijoz .who { color: var(--text-3); text-align: right; }
.time { font-size: 12px; color: var(--text-3); padding-top: 10px; white-space: nowrap; text-align: right; }

.analysis { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 14px 16px; margin-top: 14px; white-space: pre-wrap; font-size: 13px; }

/* ------------------------------ voronka quruvchisi ---------------------------- */

.color-swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; }
.color-swatch.is-active { border-color: var(--text); box-shadow: 0 0 0 2px var(--surface); }
.stage-order-btn { border: 1px solid var(--border); background: var(--surface); border-radius: 8px; width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text-3); padding: 0; }
.stage-order-btn:disabled { opacity: .3; cursor: not-allowed; }

.funnel-stage-dots { display: flex; align-items: center; gap: 5px; margin-top: 6px; flex-wrap: wrap; }

.funnel-stage-dots .dot { width: 7px; height: 7px; border-radius: 50%; }

/* T-016/T-018: "Sifatli leadlar" bosqichi belgisi (voronka quruvchisi) */
.survey-pick { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--text-3); cursor: pointer; white-space: nowrap; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); flex-shrink: 0; }
.survey-pick input { accent-color: var(--primary); width: 14px; height: 14px; cursor: pointer; margin: 0; }
.survey-pick.is-active { color: var(--primary); border-color: var(--primary-border); background: var(--primary-bg); }

/* --------------------------------- foydalanuvchilar --------------------------- */

.inline-form { display: flex; align-items: center; gap: 6px; }
.inline-form .input { max-width: 170px; height: var(--h-control-sm); padding: 0 8px; font-size: 12px; }
.pipeline-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.pipeline-picker .btn { padding: 5px 10px; height: auto; font-size: 12px; }

/* ------------------------------------ misc ------------------------------------ */

@media (max-width: 640px) {
  
  
  .turn { grid-template-columns: 34px 1fr; }
  .actionbar { left: 12px; right: 12px; transform: none; justify-content: space-between; }
  .actionbar, .download-queue { bottom: calc(var(--bottomnav-h) + 12px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: no-preference) {
  .btn, .nav-item, .seg-btn { transition: background-color .12s ease; }
}

/* ------------------------------------ kirish ----------------------------------- */

.gate { min-height: 100dvh; display: grid; place-items: center; padding: 20px; background: linear-gradient(160deg, #12122b 0%, #1f1f45 100%); }
.gate-card { background: var(--surface); border-radius: 16px; padding: 30px; width: 100%; max-width: 360px; display: grid; gap: 12px; justify-items: start; }
.gate-card h1 { font-size: 20px; margin: 4px 0 0; }
.gate-card .hint { margin: 0; }
.gate-card .input, .gate-card .btn { width: 100%; }
.gate-card .brand-mark { margin-bottom: 4px; }

/* ------------------------- dashboard: voronka oqimi ------------------------ */
/* Maket TZ prezentatsiyasidan: uch qavat — filtrlar, uchta karta, voronka. */

/* T-048 (spec 6.1): `auto-fit minmax(210px)` saqlanadi — Target/Ads/Kreativlar 5 kartasi (T-030) buzilmaydi. */
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: var(--sp-3); margin-bottom: var(--sp-3); }
.kpi-row.is-4 { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); } /* Sotuv voronkasi: 4 karta 1024px'da ham bitta qatorda (bo'sh joy yo'q) */
.kpi-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--sp-4) var(--sp-5); min-width: 0; }
/* Konversiya kartasi — ekrandagi YAGONA urg'u. */
.kpi-card.is-accent { background: var(--primary-bg); border-color: var(--primary-border); }
.kpi-label { font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--text-2); margin-bottom: var(--sp-2); }
.kpi-card.is-accent .kpi-label { color: var(--primary-text); }
.kpi-value { font-size: var(--fs-2xl); font-weight: var(--fw-heavy); letter-spacing: -.5px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi-card.is-accent .kpi-value { color: var(--primary); }
.kpi-sub { font-size: var(--fs-xs); color: var(--text-3); margin-top: var(--sp-2); }
.kpi-card.is-accent .kpi-sub { color: var(--primary-text); }
.kpi-note { display: block; font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--text-3); margin-top: 2px; }
.kpi-delta { margin-top: var(--sp-2); font-size: var(--fs-sm); color: var(--text-3); }
/* T-062 (T-058 spec 2-band): ixcham KPI (Target/Ads/Kreativlar) — label va qiymat
   bir qatorda, ≈44–52px. Qiymat sig'masa qator ostiga tushadi (row-gap 0, ≤64px).
   Accent sub-matn desktopda `title=` tooltipda, mobilda ko'rinadigan qator. */
.kpi-card.is-compact { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap;
  align-content: center; column-gap: var(--sp-2); row-gap: 0; padding: var(--sp-2) var(--sp-3); }
.kpi-card.is-compact .kpi-label { margin: 0; font-size: var(--fs-xs); line-height: var(--lh-tight); white-space: nowrap; }
.kpi-card.is-compact .kpi-sub { display: none; width: 100%; margin-top: 2px; }
@media (min-width: 769px) { .kpi-card.is-compact .kpi-value { white-space: nowrap; } }
.kpi-card.is-compact .kpi-unit { margin-left: var(--sp-1); font-size: var(--fs-md); font-weight: var(--fw-bold); letter-spacing: 0; }
@media (max-width: 768px) {
  .kpi-card.is-compact { padding: var(--sp-2) var(--sp-3); }
  .kpi-card.is-compact .kpi-sub { display: block; }
}
.kpi-delta b.up { color: var(--success-text); }
.kpi-delta b.down { color: var(--danger-text); }
.summary-line { font-size: var(--fs-md); color: var(--text-2); margin: 0; min-width: 0; }
.summary-line b { color: var(--text); }
.summary-line[hidden] { display: none; }
.dash-hint { font-size: var(--fs-sm); color: var(--text-2); margin: calc(-1 * var(--sp-1)) 0 var(--sp-3); }
#dashboardBody.is-stale > * { opacity: .6; transition: opacity .15s ease; }
/* KPI ostida darhol voronka + sotuvchilar (Q3), ≥1280px yonma-yon. */
.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-3); align-items: start; }
@media (min-width: 1280px) { .dash-grid:not(.is-single){ grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); } }
@media (max-width: 1279px) { #dashFilters .summary-line{ flex-basis: 100%; order: 10; } #dashSpacer{ display: none; } }
@media (min-width: 1280px) { #dashFilters .summary-line{ text-align: right; flex: 1 1 320px; } }
.card-foot { padding: var(--sp-2) var(--sp-4); font-size: var(--fs-sm); color: var(--text-3); border-top: 1px solid var(--border-soft); }
.dash-sellers .table-wrap { border: 0; border-radius: 0; }
.sellers-wrap { container-type: inline-size; container-name: sellers; }
/* T-069: torayish ustuvorligi — eng kerak kamrog'i (c-opt2) birinchi ketadi. */
@container sellers (max-width: 1100px) { .sellers-wrap .c-opt2 { display: none; } }
@container sellers (max-width: 950px)  { .sellers-wrap .c-opt1 { display: none; } }
@container sellers (max-width: 820px)  { .sellers-wrap .c-opt0 { display: none; } }
.dash-sellers table.metrics.sellers-table td.t { max-width: 220px; }
.seller-name { display: inline-flex; align-items: center; gap: var(--sp-2); min-width: 0; }
.seller-name .avatar-chip { width: 28px; height: 28px; font-size: var(--fs-xs); flex-shrink: 0; }
.dash-sellers .list-card { width: 100%; border: 0; border-bottom: 1px solid var(--border-soft); background: transparent; font: inherit; text-align: left; color: inherit; cursor: pointer; }
.dash-sellers .list-card .m { grid-column: 1 / -1; white-space: normal; }
.dash-sellers-err { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }
.dash-sellers-err span { color: var(--text-2); flex: 1; min-width: 180px; }
@media (max-width: 768px) {
  .kpi-row { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--sp-2); }
  .kpi-row > .kpi-card:last-child:nth-child(odd) { grid-column: 1 / -1; } /* 5 karta (T-030): 2+2+1 */
  .kpi-card { padding: var(--sp-3) var(--sp-4); }
  #dashFilters.filter-bar { flex-wrap: wrap; overflow: visible; }
  .dash-sellers .card-head { padding: var(--sp-2) var(--sp-3); }
}
.sk-row.sk-seller { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: var(--sp-4); align-items: center; padding: 0 var(--sp-4); min-height: var(--row-h); border-bottom: 1px solid var(--border-soft); }

.funnel-card { padding: 0; overflow: hidden; }
/* T-060: ustunlar torayishi KARTA kengligiga bog'liq (viewport emas) — ≥1280px'da `.dash-grid`
   ikkiga bo'linib karta ~650–700px bo'ladi; `@media` bu holatni «desktop» deb 6 ustunni kesardi. */
.funnel-card { container-type: inline-size; container-name: funnel; }

.funnel-legend { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* Ustunlar: #, bosqich, ulush, leadlar, oldingisidan, o'rtacha vaqt (T-067), o'rtacha suhbat (T-087), «… ga nisbatan» (T-060) */
.funnel-grid { display: flex; flex-direction: column; }
.funnel-hrow, .funnel-row {
  display: grid; grid-template-columns: 40px minmax(150px, 1.25fr) minmax(64px, 1fr) 72px 104px 76px 92px 172px 96px;
  align-items: center; gap: var(--sp-3); padding: 0 var(--sp-4);
}
.funnel-hrow { min-height: 40px; padding: var(--sp-1) var(--sp-4); background: var(--surface); border-bottom: 1px solid var(--border);
  font-size: var(--fs-xs); font-weight: var(--fw-medium); color: var(--text-2); }
/* T-060: sarlavhadagi baza-select (karta >900px); torroq kartada select `.funnel-base-bar`ga ko'chadi. */
.funnel-base-head { display: flex; align-items: center; justify-content: flex-end; gap: var(--sp-2); flex-wrap: wrap; }
.funnel-base-head select { max-width: 128px; }
.funnel-base-label-compact { display: none; }
.funnel-base-bar { display: none; }
/* T-067: «O'rtacha vaqt» — neytral matn (badge emas); eng sekin o'tish — shu katakning o'zida ⏱ + warning. */
.funnel-avg { font-size: var(--fs-xs); color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; cursor: default; }
.funnel-avg.is-slow { color: var(--warning-text); font-weight: var(--fw-bold); }
.funnel-avg-lab { display: none; }
.funnel-avg-head { display: flex; justify-content: flex-end; }
.funnel-avg-label-compact { display: none; }
.funnel-row { min-height: var(--row-h); border-bottom: 1px solid var(--border-soft); }
.funnel-row.is-drop { box-shadow: inset 3px 0 0 var(--warning); }
.funnel-row .funnel-stage { flex-wrap: nowrap; }
.funnel-row .funnel-name { flex: 0 1 auto; }
.funnel-row .funnel-tag { flex-shrink: 0; }
.funnel-row:last-child { border-bottom: 0; }
/* Yo'qotish bosqichi zanjirdan vizual ajratilgan. */
.funnel-row.is-lost { background: var(--border-soft); }

.funnel-idx { font-size: 12.5px; font-weight: 700; color: var(--text-3); font-variant-numeric: tabular-nums; }
/* Tor ekranda bosqich NOMI emas, teg pastga tushsin — nom bo'linib ketmasin. */
.funnel-stage { display: flex; align-items: center; gap: 9px; min-width: 0; flex-wrap: wrap; }
.funnel-name { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 700;
  min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.funnel-name .stage-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(15, 18, 34, .14); }
.funnel-tag { font-size: 12px; font-weight: 700;
  color: var(--text-3); background: var(--surface-2); border-radius: 6px; padding: 2px 7px; white-space: nowrap; }
.funnel-bar { display: block; height: 7px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.funnel-bar > i { display: block; height: 100%; border-radius: 99px; }
.funnel-count { text-align: right; font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ta-r { text-align: right; }

/* Holatlar: bo'sh, sozlanmagan, xato, ruxsat yo'q — spec 4.5 `.state` (renderState). */
.state { text-align: center; padding: var(--sp-10) var(--sp-6); }
.state.is-inline { padding: var(--sp-6) var(--sp-4); }
.state-icon { width: 44px; height: 44px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: var(--sp-3); background: var(--surface-2); color: var(--text-3); font-size: 18px; font-weight: 800; }
.state-icon.is-warn { background: var(--warning-bg); color: var(--warning-text); }
.state-icon.is-error { background: var(--danger-bg); color: var(--danger-text); }
.state-title { font-size: var(--fs-lg); font-weight: var(--fw-bold); margin-bottom: var(--sp-1); }
.state-text { font-size: var(--fs-md); color: var(--text-2); max-width: 420px; margin: 0 auto var(--sp-4); line-height: var(--lh); }
.state-actions { display: flex; gap: var(--sp-2); justify-content: center; flex-wrap: wrap; }
.state details { margin-top: var(--sp-3); font-size: var(--fs-sm); color: var(--text-3); }

/* Skeleton — blok balandligi oldindan ma'lum, sahifa sakramaydi */
.sk { display: block; border-radius: var(--r-sm); background: var(--surface-3); }
@media (prefers-reduced-motion: no-preference) {
  .sk { animation: sk-pulse 1.3s ease-in-out infinite; }
  @keyframes sk-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }
}
/* T-044: jadval yuklanmoqda — ustida yupqa progress, eski qatorlar xiralashadi */
.table-wrap.is-loading { position: relative; }
.table-wrap.is-loading::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; z-index: 2;
  background: linear-gradient(90deg, transparent, var(--primary), transparent) no-repeat; background-size: 40% 100%; }
.table-wrap.is-loading tbody:not(:has(.sk-tr)) { opacity: .5; }
@media (prefers-reduced-motion: no-preference) {
  .table-wrap.is-loading::before { animation: tbl-bar 1s linear infinite; }
  @keyframes tbl-bar { from { background-position: -40% 0; } to { background-position: 140% 0; } }
  .table-wrap tbody { transition: opacity .15s ease; }
}
.sk-cell { width: 70%; height: 12px; }
.sk-lab { width: 120px; height: 12px; }
.sk-big { width: 92px; height: 34px; margin: 12px 0 10px; }
.sk-sub { width: 150px; height: 10px; }
.sk-i { width: 16px; height: 12px; }
.sk-name { width: 70%; height: 13px; }
.sk-bar { width: 100%; height: 7px; }
.sk-n { width: 100%; height: 15px; }
.sk-badge { width: 100%; height: 22px; border-radius: 8px; }
.sk-t { width: 70%; height: 12px; margin-left: auto; }
.funnel-card .sk-row { display: grid; grid-template-columns: 40px minmax(150px, 1.25fr) minmax(64px, 1fr) 72px 104px 76px 92px 172px 96px;
  align-items: center; gap: var(--sp-3); padding: 0 var(--sp-4); min-height: var(--row-h); border-bottom: 1px solid var(--border-soft); }

/* T-060: karta ≤900px (650–700px split ham shu yerda) — ixcham grid, select sarlavhadan bar'ga. */
@container funnel (max-width: 900px) {
  .funnel-hrow, .funnel-row, .funnel-card .sk-row { grid-template-columns: 28px 1.05fr .65fr 52px 76px 52px 64px 88px 72px; gap: var(--sp-2); padding: 0 var(--sp-3); }
  .funnel-hrow { padding: var(--sp-1) var(--sp-3); }
  .funnel-row .funnel-tag { display: none; } /* .badge (keyinroq e'lon qilingan) display'ini yengish uchun .funnel-row bilan */
  .funnel-base-head select, .funnel-base-head .funnel-base-suffix { display: none; }
  .funnel-base-label-compact { display: inline; }
  .funnel-base-bar { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-2) var(--sp-3);
    border-bottom: 1px solid var(--border-soft); font-size: var(--fs-sm); color: var(--text-2); }
  .funnel-base-bar select { flex: 1; max-width: 220px; }
  .funnel-avg-label-full { display: none; }
  .funnel-avg-label-compact { display: inline; }
}
/* T-048/T-060 (telefon, karta ≤480px): har bosqich 2 qatorli — nom + son + ikki foiz yonma-yon, ostida chiziq. */
@container funnel (max-width: 480px) {
  .funnel-hrow { display: none; }
  .funnel-row { grid-template-columns: 18px minmax(0, 1fr) auto auto auto; grid-template-areas: "i n c v w" ". b b b b" ". t t t t";
    gap: var(--sp-1) var(--sp-2); padding: var(--sp-2) var(--sp-3); }
  .funnel-row .funnel-idx { grid-area: i; }
  .funnel-row .funnel-stage { grid-area: n; }
  .funnel-row .funnel-bar { grid-area: b; }
  .funnel-row .funnel-count { grid-area: c; font-size: var(--fs-md); }
  .funnel-row .funnel-conv { grid-area: v; }
  .funnel-row .funnel-base-val { grid-area: w; }
  .funnel-row .funnel-avg-cell { grid-area: t; text-align: left; }
  .funnel-row .funnel-avg-cell .funnel-avg-lab { display: inline; color: var(--text-3); margin-right: var(--sp-1); }
  /* T-078: «Bazadan» ustuni juda tor telefon kartasida ko'rinmaydi (D-019 — mobil
     ikkinchi darajali); grid-template-areas'da joy yo'q, shuning uchun yashiriladi. */
  .funnel-hrow .funnel-frombase-head, .funnel-row .funnel-frombase-val { display: none; }
  /* T-087: «O'rtacha suhbat» ham shu sababga ko'ra tor telefon kartasida yashiriladi. */
  .funnel-hrow .funnel-callavg-head, .funnel-row .funnel-callavg-cell { display: none; }
}

/* ------------------ ikki STT provayderi (lead modalida) -------------------- */

/* ============================================================================
   T-021/T-022 — Dashboard 3-tab «Ads manager» (docs/design/T-021/spec.md).
   Mavjud tokenlardan, yangi rang/radius/soya yo'q.
   ============================================================================ */

/* Daraja tanlovi chipi: «Tanlandi: 2 kampaniya ×» — Kampaniyalar/Ad setlar/
   E'lonlar orasida tanlab o'tilganda pastki tab yonida ko'rinadi. */
.level-chip { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; color: var(--primary-text); background: var(--primary-bg); border: 1px solid var(--primary-border); border-radius: 99px; padding: 5px 8px 5px 12px; }
.level-chip button { border: 0; background: transparent; color: var(--primary-text); font-size: 15px; line-height: 1; cursor: pointer; padding: 0 2px; }
.level-chip button:hover { color: var(--primary-hover); }

/* Jadval sarlavhasida saralash ↑↓ */
.sortable-th { cursor: pointer; user-select: none; white-space: nowrap; }
/* T-062 (T-058 spec 4-band, egasi so'rovi): Ads/Kreativlar raqamli ustun sarlavhasi
   VERTIKAL — ustun kengligi raqam kengligiga teng, 17 ustun 1440px'da sig'adi.
   Yorliq pastdan yuqoriga o'qiladi, 104px'dan uzuni kesiladi (ellipsissiz —
   Safari'da vertikal ellipsis beqaror), to'liq nom `title=`da. Strelka pastda. */
table.metrics.ads-table thead th, table.metrics.creatives-table thead th, table.metrics.sellers-table thead th { height: 104px; vertical-align: bottom; }
table.metrics thead th.th-vert { padding: var(--sp-2) var(--sp-1) var(--sp-1); text-align: right; }
.th-v { display: inline-flex; align-items: flex-end; gap: 2px; }
.th-v-label { writing-mode: vertical-rl; transform: rotate(180deg); white-space: normal; overflow-wrap: normal; max-height: 112px; max-width: calc(2 * 1.25em); overflow: hidden; line-height: 1.25; text-align: left; } /* sig`masa 2 qator (egasi, 2026-09-30) */
.th-vert .sort-arrow { margin-left: 0; line-height: 1.25; }
table.metrics.ads-table td.col-num, table.metrics.creatives-table td.col-num, table.metrics.sellers-table td.col-num { padding-left: var(--sp-1); padding-right: var(--sp-1); }
table.metrics.ads-table .col-check, table.metrics.ads-table td.col-status { padding-left: 6px; padding-right: 6px; }
table.metrics.ads-table td.col-wrap, table.metrics.creatives-table td.col-wrap { white-space: normal; min-width: 76px; line-height: var(--lh-tight); }
@media (max-width: 1599px) { table.metrics.ads-table .ads-name-text { max-width: 140px; } }
.sortable-th .sort-arrow { margin-left: 4px; color: var(--text-3); font-size: 12px; }
.sortable-th.is-sorted { color: var(--text); }
.sortable-th.is-sorted .sort-arrow { color: var(--primary); }

/* «Ustunlar» paneli — qidiruv, guruhlar, belgilash, sudrab tartiblash */
.col-picker-wrap { position: relative; }
.col-picker-popup { position: absolute; top: calc(100% + 6px); right: 0; z-index: var(--z-popover); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: 0 12px 32px rgba(15,18,34,.14); width: 320px; max-height: 440px; display: flex; flex-direction: column; }
.col-picker-head { padding: 12px 14px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.col-picker-list { overflow-y: auto; padding: 6px; flex: 1; }
.col-group-title { font-size: 12px; font-weight: 600; color: var(--text-2); padding: 10px 8px 4px; }
.col-item { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 8px; font-size: 13px; cursor: grab; }
.col-item:hover { background: var(--surface-2); }
.col-item.is-dragging { opacity: .45; }
.col-item .col-drag { color: var(--text-3); flex-shrink: 0; }
.col-item .col-name { flex: 1; }
.col-item.is-locked { cursor: default; opacity: .55; }
.col-picker-foot { padding: 10px 14px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; gap: 8px; }

/* «Nomi» ustuni qotib turadi — 375px'da ham nom ko'rinadi (spec 7/10-band:
   checkbox ATAYLAB sticky EMAS — tor ekranda ko'p joy egallaydi, mobil-band
   shuni aniq aytadi). Jadvalda «Nomi» 2-ustun (1-ustun — checkbox), shuning
   uchun `nth-child(2)`, mockup CSS'idagi `:first-child` (checkbox'ni
   sticky qiladi) EMAS — real jadval tuzilishiga moslab tuzatildi: checkbox
   ustuni kenglik jihatdan `table-layout:auto`da aniq bashorat qilib
   bo'lmaydi (piksel bilan ikkinchi ustunni surish xato natija berardi). */
.table-wrap.is-scroll-x table.metrics.ads-table th:nth-child(2),
.table-wrap.is-scroll-x table.metrics.ads-table td:nth-child(2) { position: sticky; left: 0; z-index: 1; background: var(--surface); box-shadow: 1px 0 0 var(--border); }
.table-wrap.is-scroll-x table.metrics.ads-table thead th:nth-child(2) { z-index: 2; }
.table-wrap.is-scroll-x table.metrics.ads-table tr.is-total td:nth-child(2) { background: var(--surface-2); }
.table-wrap.is-scroll-x table.metrics.ads-table tr.is-unmatched td:nth-child(2) { background: var(--border-soft); }

/* E'lonlar darajasida nom yonida creative rasmi (Q-2) */
.ads-name-cell { display: flex; align-items: center; gap: 10px; min-width: 200px; }
.ads-thumb { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; flex-shrink: 0; background: var(--surface-2); }
/* T-029, 5-band: uzun kampaniya/ad-set/e'lon nomi bitta qatorda kesiladi,
   hover'da to'liq matn (title). */
.ads-name-text { display: inline-block; max-width: 230px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }

/* «E'loni aniqlanmagan» qatori — vizual ajratilgan, hech qachon yashirilmaydi */
tr.is-unmatched td { color: var(--text-3); font-style: italic; background: var(--border-soft); }
tr.is-unmatched td.col-num { font-style: normal; }

/* ============================================================================
   T-039/T-037 — Dashboard 4-tab «Kreativlar» (docs/design/T-037/spec.md).
   Ads manager komponentlari qayta ishlatiladi, faqat shu bo'limdagi klasslar
   YANGI (spec 10-band, «yangi token yo'q»).
   ============================================================================ */

/* Modal kenglik modifikatorlari — mavjud `.modal`dan (620px), yangi rang/
   radius yo'q. is-wide — e'lonlar ro'yxati (ko'p ustunli), is-preview —
   rasm/video kattalashtirish (o'rtacha, faqat bitta media + qisqa matn). */
.modal.is-wide { max-width: 760px; }
.modal.is-preview { max-width: 520px; }

/* Kreativlar jadvalida 1-ustun (creative — checkbox yo'q, drill-down yo'q)
   qotib turadi — Ads manager naqshi bilan bir xil, faqat `:first-child`
   (bu jadvalda checkbox ustuni umuman yo'q). */
/* T-062: vertikal sarlavha bilan majburiy min-width kerak emas — jadval 100%
   (o'ngda bo'sh joy yo'q), sig'masa `.is-scroll-x` skroll. */
.table-wrap.is-scroll-x table.metrics.ads-table,
.table-wrap.is-scroll-x table.metrics.creatives-table,
.table-wrap.is-scroll-x table.metrics.sellers-table { min-width: 0; }
.table-wrap.is-scroll-x table.metrics.creatives-table th:first-child,
.table-wrap.is-scroll-x table.metrics.creatives-table td:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); box-shadow: 1px 0 0 var(--border); }
.table-wrap.is-scroll-x table.metrics.creatives-table thead th:first-child { z-index: 2; }
.table-wrap.is-scroll-x table.metrics.creatives-table tr.is-total td:first-child { background: var(--surface-2); }
.table-wrap.is-scroll-x table.metrics.creatives-table tr.is-unmatched td:first-child { background: var(--border-soft); }

/* T-069: Sotuvchi ustuni qotib turadi (creatives-table naqshi bilan bir xil). */
.table-wrap.is-scroll-x table.metrics.sellers-table th:first-child,
.table-wrap.is-scroll-x table.metrics.sellers-table td:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); box-shadow: 1px 0 0 var(--border); }
.table-wrap.is-scroll-x table.metrics.sellers-table thead th:first-child { z-index: 2; }
.table-wrap.is-scroll-x table.metrics.sellers-table tr.is-total td:first-child { background: var(--surface-2); }
/* `.data-table tbody tr.is-clickable/.is-current` bilan bir xil, `table.metrics` uchun (bu jadval endi .data-table emas). */
table.metrics.sellers-table tbody tr.is-clickable { cursor: pointer; }
table.metrics.sellers-table tbody tr.is-clickable:hover td { background: var(--surface-2); }
table.metrics.sellers-table tbody tr.is-current td { background: var(--primary-bg); }
table.metrics.sellers-table tbody tr.is-current td:first-child { box-shadow: inset 3px 0 0 var(--primary); }

/* ============================================================================
   T-065/T-066 — Dashboard «Bekor bo'lishlar» matritsasi (docs/design/T-065/spec.md).
   ============================================================================ */
table.metrics.lost-matrix-table th, table.metrics.lost-matrix-table td { height: var(--row-h); text-align: right; }
table.metrics.lost-matrix-table th:first-child, table.metrics.lost-matrix-table td:first-child { text-align: left; }
.table-wrap.is-scroll-x table.metrics.lost-matrix-table { width: auto; min-width: 0; }
table.metrics.lost-matrix-table th:first-child, table.metrics.lost-matrix-table td:first-child { min-width: 200px; }
table.metrics.lost-matrix-table th:not(:first-child):not(:last-child) { min-width: 120px; }
table.metrics.lost-matrix-table th:last-child, table.metrics.lost-matrix-table td:last-child { min-width: 108px; }
table.metrics.lost-matrix-table td.mtx-cell { min-width: 52px; text-align: center; }
table.metrics.lost-matrix-table th.th-vert { min-width: 40px !important; }
.mtx-n { font-variant-numeric: tabular-nums; }
.mtx-pct { display: block; font-size: var(--fs-xs); color: var(--text-3); font-weight: var(--fw-regular); line-height: 1.2; margin-top: 1px; }
.mtx-empty { color: var(--text-placeholder); }
.th-clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis; }
/* Heatmap — yangi tus emas, --danger + --surface color-mix, 3 aniq daraja (eng to'qda ham matn kontrasti ≈10.8:1). */
.heat-1 { background: color-mix(in srgb, var(--danger) 12%, var(--surface)); }
.heat-2 { background: color-mix(in srgb, var(--danger) 24%, var(--surface)); }
.heat-3 { background: color-mix(in srgb, var(--danger) 40%, var(--surface)); }
.heat-legend { display: inline-flex; align-items: center; gap: 6px; }
.heat-swatch { width: 12px; height: 12px; border-radius: var(--r-sm); display: inline-block; box-shadow: inset 0 0 0 1px rgba(15,18,34,.08); }
.stage-share { color: var(--text-3); font-weight: var(--fw-regular); }
table.metrics.lost-matrix-table tr.is-total td,
table.metrics.lost-matrix-table td.is-total-col { background: var(--surface-2); font-weight: var(--fw-medium); }
.table-wrap.is-scroll-x table.metrics.lost-matrix-table th:first-child,
.table-wrap.is-scroll-x table.metrics.lost-matrix-table td:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); box-shadow: 1px 0 0 var(--border); }
.table-wrap.is-scroll-x table.metrics.lost-matrix-table thead th:first-child { z-index: 2; }
.table-wrap.is-scroll-x table.metrics.lost-matrix-table tr.is-total td:first-child { background: var(--surface-2); }
.mtx-sk-row { display: grid; grid-template-columns: 180px repeat(5, 1fr) 90px; gap: var(--sp-3); align-items: center; padding: 0 var(--sp-4); height: var(--row-h); border-bottom: 1px solid var(--border-soft); }
.mtx-sk-row span { height: 11px; }

/* Creative nomi katakchasi — Ads manager `.ads-name-cell`/`.ads-thumb`ning
   kattaroq, bosiladigan versiyasi: thumbnail o'zi asosiy identifikator
   (56×56), bosilsa preview kattalashadi, video/dinamik belgisi bilan. */
.creative-name-cell { display: flex; align-items: center; gap: 12px; min-width: 260px; }
.creative-thumb-wrap { position: relative; width: 56px; height: 56px; flex-shrink: 0; border: 0; padding: 0; background: none; cursor: pointer; border-radius: var(--r-md); }
.creative-thumb-wrap:hover .creative-thumb, .creative-thumb-wrap:hover .creative-thumb-empty { outline: 2px solid var(--primary); outline-offset: 1px; }
.creative-thumb { width: 56px; height: 56px; border-radius: var(--r-md); object-fit: cover; display: block; background: var(--surface-2); }
.creative-thumb-empty { width: 56px; height: 56px; border-radius: var(--r-md); background: var(--surface-2); display: flex; align-items: center; justify-content: center; color: var(--text-3); padding: 0; }
.creative-thumb-badge { position: absolute; right: -4px; bottom: -4px; width: 20px; height: 20px; border-radius: 50%; background: var(--text); display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 2px #fff; }
.creative-name-text { display: block; max-width: 230px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; margin-bottom: 5px; }
.creative-legend { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border-soft); font-size: 12px; color: var(--text-3); }
.creative-legend-item { display: flex; align-items: center; gap: 8px; }

/* Preview kattalashtirish modali ichi — T-016'dagi `.meta-creative`
   prinsipi (aspect-ratio quti, qora fon — Meta banner nisbatlari turlicha
   bo'lgani uchun kesilib qolmasin), faqat interaktiv/katta. */
.creative-preview-box { width: 100%; aspect-ratio: 1.5 / 1; border-radius: var(--r-md); overflow: hidden; background: #10121c; display: flex; align-items: center; justify-content: center; }
.creative-preview-box img, .creative-preview-box video { width: 100%; height: 100%; object-fit: contain; display: block; }
.creative-preview-title { font-weight: 700; font-size: 13.5px; margin: 12px 0 3px; }
.creative-preview-body { font-size: 12.5px; color: var(--text-3); }

@media (max-width: 640px) {
  .creative-thumb-wrap, .creative-thumb, .creative-thumb-empty { width: 44px; height: 44px; }
  .creative-name-cell { min-width: 0; }
}

/* iOS Safari fokusda zoom qilmasligi uchun mobil input 16px (T-041 1-bosqich) */
@media (max-width: 768px) { .input, .input-compact{ font-size: var(--fs-lg); } }

/* =============================================================================
   T-045 2-bosqich — komponentlar (docs/design/T-041/spec.md 4.3–4.9)
   ============================================================================= */

/* 4.3 filtr qatori va chip */
.filter-bar { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; margin-bottom: var(--sp-4); }
.filter-bar .spacer { flex: 1; }
.chip-row { position: relative; display: flex; gap: var(--sp-2); overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chip-row::-webkit-scrollbar { display: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: var(--h-control-sm); padding: 0 var(--sp-3);
  border: 1px solid var(--border); border-radius: var(--r-full); background: var(--surface); color: var(--text-2);
  font: inherit; font-size: var(--fs-sm); font-weight: var(--fw-medium); white-space: nowrap; cursor: pointer; flex-shrink: 0; }
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip.is-active { background: var(--primary-bg); border-color: var(--primary-border); color: var(--primary-text); }
.chip .count { font-weight: var(--fw-bold); color: var(--text); font-variant-numeric: tabular-nums; }
.chip.is-active .count { color: var(--primary-text); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(15,18,34,.14); }

/* 4.4 badge va bosqich belgisi */
.badge { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: var(--r-sm);
  font-size: var(--fs-xs); font-weight: var(--fw-bold); white-space: nowrap; }
.badge.neutral { background: var(--surface-2); color: var(--text-2); }
.badge.primary { background: var(--primary-bg); color: var(--primary-text); }
.badge.ok { background: var(--success-bg); color: var(--success-text); }
.badge.mid { background: var(--warning-bg); color: var(--warning-text); }
.badge.bad { background: var(--danger-bg);  color: var(--danger-text); }
.stage-badge { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--text); white-space: nowrap; }
.stage-badge .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; box-shadow: inset 0 0 0 1px rgba(15,18,34,.14); }
.meta { font-size: var(--fs-xs); color: var(--text-3); }

/* 4.5 karta sarlavhasi */
.card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap;
  padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--border-soft); }
.card-title { font-size: var(--fs-lg); font-weight: var(--fw-bold); margin: 0; }
.card-sub { font-size: var(--fs-sm); color: var(--text-3); }
.card.flush { padding: 0; overflow: hidden; }
@media (max-width: 768px) { .card{ padding: var(--sp-3); } .card-head{ padding: var(--sp-2) var(--sp-3); } }

/* 4.6 jadval (desktop) va ro'yxat kartasi (mobil) — 5-bosqichda Leadlar shunga o'tadi */
.data-table { width: 100%; border-collapse: collapse; font-size: var(--fs-md); }
.data-table th { background: var(--surface); text-align: left; white-space: nowrap;
  font-size: var(--fs-xs); font-weight: var(--fw-medium); color: var(--text-2); height: 36px; padding: 0 var(--sp-3); border-bottom: 1px solid var(--border); }
.data-table td { height: var(--row-h); padding: 0 var(--sp-3); border-bottom: 1px solid var(--border-soft); vertical-align: middle; white-space: nowrap; }
.data-table td.t { max-width: 320px; overflow: hidden; text-overflow: ellipsis; font-weight: var(--fw-bold); }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr.is-clickable { cursor: pointer; }
.data-table tbody tr.is-clickable:hover td { background: var(--surface-2); }
.data-table tbody tr.is-current td { background: var(--primary-bg); }
.data-table tbody tr.is-current td:first-child { box-shadow: inset 3px 0 0 var(--primary); }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.data-table .col-check { width: 44px; }
.data-table .c-fill { padding: 0; }
.table-wrap.is-list { container-type: inline-size; container-name: list; overflow-x: auto; }
@container list (max-width: 1100px) { .data-table .c-opt2{ display: none; } }
@container list (max-width: 760px)  { .data-table .c-opt1{ display: none; }
  .data-table th, .data-table td { padding: 0 var(--sp-2); } .data-table td.t{ max-width: 180px; } }
@container list (max-width: 560px)  { .data-table .c-opt0{ display: none; } }
@container list (min-width: 1900px) { .data-table .c-fill{ width: 100%; } }
.table-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4); border-top: 1px solid var(--border-soft); font-size: var(--fs-sm); color: var(--text-3); }
.list-cards { display: none; }
@media (max-width: 768px) {
  .table-wrap.has-cards .data-table, .table-wrap.has-cards table.metrics { display: none; }
  .list-cards { display: flex; flex-direction: column; }
  .list-card { display: grid; grid-template-columns: 1fr auto; gap: 2px var(--sp-3); padding: var(--sp-2) var(--sp-3);
    border-bottom: 1px solid var(--border-soft); min-height: 56px; cursor: pointer; }
  .list-card:active { background: var(--surface-2); }
  .list-card.is-current { background: var(--primary-bg); box-shadow: inset 3px 0 0 var(--primary); }
  .list-card .t { font-weight: var(--fw-bold); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .list-card .r { text-align: right; font-variant-numeric: tabular-nums; font-weight: var(--fw-medium); white-space: nowrap; }
  .list-card .m { font-size: var(--fs-sm); color: var(--text-3); display: flex; gap: 6px; align-items: center; min-width: 0; overflow: hidden; white-space: nowrap; }
}

/* 4.8 qatlamlar: overlay, drawer, dialog (z = --layer-z, openLayer() beradi) */
body.has-layer { overflow: hidden; }
.overlay { position: fixed; inset: 0; background: var(--overlay); z-index: var(--layer-z, 50); animation: fade var(--dur) var(--ease); }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: calc(var(--layer-z, 50) + 1);
  width: min(720px, calc(100vw - 48px)); background: var(--surface); box-shadow: var(--sh-modal);
  display: flex; flex-direction: column; animation: slide-in .2s var(--ease); container-type: inline-size; container-name: panel; }
.panel-head { padding: var(--sp-2) var(--sp-4) var(--sp-3); border-bottom: 1px solid var(--border); }
.panel-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.panel-foot { padding: var(--sp-1) var(--sp-4); border-top: 1px solid var(--border-soft); font-size: var(--fs-xs); color: var(--text-3); }
.dialog { position: fixed; z-index: calc(var(--layer-z, 50) + 1); left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(480px, calc(100vw - 32px)); max-height: 86vh; background: var(--surface); border-radius: var(--r-lg);
  box-shadow: var(--sh-modal); display: flex; flex-direction: column; }
.dialog-body { padding: var(--sp-5) var(--sp-5) var(--sp-3); overflow-y: auto; }
.dialog-title { font-size: var(--fs-lg); font-weight: var(--fw-bold); margin-bottom: var(--sp-2); }
.dialog-text { margin: 0; color: var(--text-2); line-height: var(--lh); }
.dialog-actions { display: flex; justify-content: flex-end; gap: var(--sp-2); padding: var(--sp-3) var(--sp-5) var(--sp-5); }
@media (max-width: 768px) {
  .drawer { width: 100vw; animation: slide-up .22s var(--ease); }
  .panel-head { padding: var(--sp-1) var(--sp-3) var(--sp-2); }
  .panel-foot { display: none; }
  .dialog { top: auto; bottom: 0; left: 0; transform: none; width: 100vw; border-radius: var(--r-lg) var(--r-lg) 0 0;
    padding-bottom: env(safe-area-inset-bottom); animation: slide-up .22s var(--ease); }
  .dialog-actions .btn { flex: 1; }
}
@keyframes fade { from { opacity: 0; } }
@keyframes slide-in { from { transform: translateX(24px); opacity: 0; } }
@keyframes slide-up { from { transform: translateY(24px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .overlay, .drawer, .dialog, .modal-overlay, .toast{ animation: none; } }

/* 4.9 toast va banner */
.toast-stack { position: fixed; z-index: var(--z-toast); right: var(--sp-5); bottom: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-2); width: min(360px, calc(100vw - 32px)); }
.toast { display: flex; align-items: center; gap: var(--sp-3); min-height: var(--h-touch); padding: var(--sp-2) var(--sp-2) var(--sp-2) var(--sp-4);
  background: var(--text); color: #fff; border-radius: var(--r-md); box-shadow: var(--sh-pop); font-size: var(--fs-md); animation: slide-up .2s var(--ease); }
.toast-text { flex: 1; min-width: 0; }
.toast .btn-text { color: var(--primary-border); margin-left: auto; }
.toast .toast-close { color: #fff; font-size: 18px; }
.toast .toast-close:hover { background: rgba(255,255,255,.12); color: #fff; }
.toast.is-error { background: var(--danger-text); }
.banner { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); border-radius: var(--r-md); border: 1px solid; font-size: var(--fs-md); margin-bottom: var(--sp-4); }
.banner.info { background: var(--primary-bg); border-color: var(--primary-border); color: var(--primary-text); }
.banner.warn { background: var(--warning-bg); border-color: var(--warning-border); color: var(--warning-text); }
.banner.error { background: var(--danger-bg); border-color: var(--danger-border); color: var(--danger-text); }
.banner .btn { margin-left: auto; }
.banner[hidden] { display: none; }
.gate-card .hint.banner { margin: 0; width: 100%; }

/* «Rasm yo'q» ikonasi (spec 3.4) */
.creative-thumb-empty svg { width: 20px; height: 20px; }

/* Teginish qurilmalari va telefon: HAR interaktiv element ≥44px (spec 3.2, qabul mezoni 5).
   .btn / .btn-sm / .chip / .input — --h-control* orqali avtomatik. */
@media (max-width: 768px), (pointer: coarse) {
  .icon-btn, .modal-close, .cal-nav { width: var(--h-touch); height: var(--h-touch); }
  .seg-btn { height: var(--h-touch); }
  .nav-item { min-height: var(--h-touch); }
  .link-btn, .survey-pick, .level-chip button { min-height: var(--h-touch); }
   .survey-pick { display: inline-flex; align-items: center; }
  .link-btn, .level-chip button { min-width: var(--h-touch); }
  .stage-order-btn, .color-swatch { width: var(--h-touch); height: var(--h-touch); }
  
  .cal-day { min-height: var(--h-touch); padding: 0; }
  .cal-grid { gap: 0; }
  .date-range-popup { width: min(348px, calc(100vw - 24px)); }
  input[type="checkbox"] { width: 22px; height: 22px; }
}
@media (max-width: 768px) {
  .toast-stack { left: 16px; right: 16px; width: auto; }
  .date-range-popup { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); }
}

/* =============================================================================
   T-045 3-bosqich — qobiq va navigatsiya (spec 2.1, 2.2, 4.10)
   ============================================================================= */
.topbar-search { width: 320px; max-width: 36vw; height: var(--h-control-sm); background: var(--surface-2); border-color: transparent; color: var(--text-3); }
.topbar-search:focus-within { background: var(--surface); }
.topbar-search input::placeholder { color: var(--text-placeholder); }
.topbar-search input::-webkit-search-cancel-button { display: none; }
.topbar-search-toggle, .topbar-search-close { display: none; }
.topbar-right { gap: var(--sp-2); }

/* «Yuklab olishlar»: tugma + panel (eski «Fayllar» bo'limi) */
.dl-wrap { position: relative; }
.dl-btn { position: relative; }
.dl-badge { height: 18px; min-width: 18px; padding: 0 5px; justify-content: center; border-radius: var(--r-full); }
.dl-badge[hidden] { display: none; }
.dl-panel { position: absolute; right: 0; top: calc(100% + var(--sp-2)); z-index: var(--z-popover);
  width: 440px; max-height: min(72vh, 600px); overflow-y: auto; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-pop); padding: var(--sp-2) var(--sp-4) var(--sp-4); }
.dl-panel[hidden] { display: none; }
.dl-panel-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); }
.dl-panel-head strong { font-size: var(--fs-lg); }
.dl-panel-hint { margin: 0 0 var(--sp-3); font-size: var(--fs-sm); color: var(--text-3); }

/* Pastki panel va «Menyu» varag'i — faqat telefonda */
.bottom-nav { display: none; }
.menu-sheet-body { display: flex; flex-direction: column; gap: 2px; padding: var(--sp-2) var(--sp-3) var(--sp-3); overflow-y: auto; }
.menu-sheet-body .nav-item { justify-content: space-between; }
.menu-sheet-body .nav-item[hidden] { display: none; }
.menu-sheet-user { padding: var(--sp-3) var(--sp-3) var(--sp-1); margin-top: var(--sp-2); border-top: 1px solid var(--border-soft); font-size: var(--fs-sm); color: var(--text-3); }

/* Planshet (769–1023px): sidebar 72px, faqat ikon + title tooltip */
@media (min-width: 769px) and (max-width: 1023px) {
  .sidebar { width: 72px; }
  .brand { padding: 0; justify-content: center; }
  .brand-name, .nav-item span, .nav-group-title, .user-chip #userName { display: none; }
  .nav { padding: var(--sp-2); }
  .nav-item { justify-content: center; padding: 0; }
  .user-chip { justify-content: center; padding: var(--sp-2) 0; }
  .sidebar-foot { padding: var(--sp-2) var(--sp-2) 0; }
}

/* Telefon (≤768px): sidebar yo'q, pastki panel 4 tugma, topbar 52px */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .topbar { padding: 0 var(--sp-3); }
  .topbar-title { font-size: var(--fs-xl); }
  .topbar-subtitle { display: none; }
  .topbar-search { display: none; }
  .topbar-search-toggle { display: inline-flex; }
  .dl-btn { width: var(--h-touch); padding: 0; }
  .dl-btn-label { display: none; }
  .dl-badge { position: absolute; top: 2px; right: 2px; }
  .topbar.is-searching .topbar-heading, .topbar.is-searching .topbar-search-toggle, .topbar.is-searching .dl-wrap { display: none; }
  .topbar.is-searching .topbar-right { flex: 1; min-width: 0; }
  .topbar.is-searching .topbar-search { display: flex; width: 100%; max-width: none; height: var(--h-touch); }
  .topbar.is-searching .topbar-search-close { display: inline-flex; margin-right: -8px; }
  .topbar-search kbd { display: none; }
  .dl-panel { position: fixed; left: var(--sp-3); right: var(--sp-3); top: calc(var(--topbar-h) + var(--sp-2)); width: auto;
    max-height: calc(100dvh - var(--topbar-h) - var(--bottomnav-h) - 32px - env(safe-area-inset-bottom)); }
  main { padding: var(--sp-3) var(--sp-3) calc(var(--bottomnav-h) + var(--sp-4) + env(safe-area-inset-bottom)); }
  .bottom-nav { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-bottomnav);
    height: calc(var(--bottomnav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: var(--surface); border-top: 1px solid var(--border); }
  .bottom-nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 0; background: none;
    font: inherit; font-size: var(--fs-xs); font-weight: var(--fw-medium); color: var(--text-3); cursor: pointer; min-width: 0; min-height: var(--h-touch); }
  .bottom-nav button span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .bottom-nav button.is-active { color: var(--primary); font-weight: var(--fw-bold); }
  .toast-stack { bottom: calc(var(--bottomnav-h) + 12px + env(safe-area-inset-bottom)); }
  .menu-sheet { max-height: 80dvh; }
}
/* Panel tor (440px) — kartalar ichidagi uzun nomlar kesiladi, gorizontal toshish yo'q */
.dl-panel .job-card { grid-template-columns: 30px minmax(0, 1fr) auto; gap: var(--sp-3); padding: var(--sp-3); }
.dl-panel .job-leads { max-width: 100%; }
@media (max-width: 480px) {
  .dl-panel .job-card { grid-template-columns: 30px minmax(0, 1fr); }
  .dl-panel .job-card > .job-action { grid-column: 2; justify-self: start; }
}

/* =============================================================================
   T-041 4-bosqich — filtr qatori, davr tanlagichi, varaq (spec 4.3, 5)
   ============================================================================= */
.only-m { display: none !important; }
.filter-bar .input { width: auto; max-width: 220px; }
.filter-bar .btn-text[hidden] { display: none; }
.period { display: inline-flex; align-items: center; }
.period .seg-btn { display: inline-flex; align-items: center; gap: 6px; }
.period .seg-btn svg { flex-shrink: 0; }
.period-m { gap: 6px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-2) var(--sp-2) var(--sp-2) var(--sp-4); border-bottom: 1px solid var(--border-soft); }
.sheet-body { padding: var(--sp-2) var(--sp-3) var(--sp-4); overflow-y: auto; display: flex; flex-direction: column; gap: var(--sp-2); }
.sheet-list { display: flex; flex-direction: column; gap: 2px; }
.sheet-sub { font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--text-3); margin-top: var(--sp-2); }
.sheet-body .seg { align-self: flex-start; }
@media (max-width: 768px) {
  .only-d { display: none !important; }
  .only-m { display: inline-flex !important; }
  .only-m[hidden] { display: none !important; }
  .filter-bar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-bottom: var(--sp-2); }
  .filter-bar::-webkit-scrollbar { display: none; }
  .filter-bar > * { flex-shrink: 0; }
  .sheet { max-height: 85dvh; }
}

/* =============================================================================
   T-041 5-bosqich — Leadlar ro'yxati (spec 6.2, 4.6)
   ============================================================================= */
.chip-wrap { position: relative; margin-bottom: var(--sp-2); }
.chip-wrap[hidden] { display: none; }
.chip-wrap::after { content: ''; position: absolute; top: 0; right: 0; bottom: 2px; width: 24px; pointer-events: none;
  background: linear-gradient(90deg, rgba(245,246,250,0), var(--bg)); }
.chip-row .chip-funnel { align-self: center; flex-shrink: 0; white-space: nowrap; margin-right: var(--sp-1); }
.sk-chip { width: 96px; height: var(--h-control-sm); border-radius: var(--r-full); flex-shrink: 0; }
#leadsFilterBar { margin-bottom: var(--sp-3); }
.filter-note { font-size: var(--fs-sm); color: var(--text-3); white-space: nowrap; }
.age { font-size: var(--fs-sm); color: var(--text-2); white-space: nowrap; }
.age.is-stale { color: var(--warning-text); font-weight: var(--fw-bold); }
.age.is-stale b { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; margin-right: 2px;
  border-radius: 50%; background: var(--warning-bg); border: 1px solid var(--warning-border); font-size: var(--fs-xs); line-height: 1; }
.data-table .m { color: var(--text-2); font-variant-numeric: tabular-nums; }
.data-table.no-seller .col-seller, .data-table.no-phone .col-phone { display: none; }
.data-table tbody tr.is-picked td { background: var(--primary-bg); }
.data-table tbody tr:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.data-table[hidden], .list-cards[hidden], #leadsState[hidden], .table-foot[hidden], .table-foot .btn[hidden] { display: none !important; }
.table-wrap.is-loading .list-cards:not(:has(.sk-card)) { opacity: .5; }
.list-card .lc-check { display: none; }
@media (max-width: 768px) {
  #leadsTableWrap { margin: 0 calc(-1 * var(--sp-3)); border-radius: 0; border-left: 0; border-right: 0; }
  .chip-wrap { margin: 0 calc(-1 * var(--sp-3)) var(--sp-2); }
  .chip-wrap .chip-row { padding: 0 var(--sp-3) 2px; }
  .list-card .mr { font-size: var(--fs-sm); color: var(--text-3); text-align: right; white-space: nowrap; }
  .list-card .m .dot, .list-card .m i.dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
  .list-card.is-picked { background: var(--primary-bg); }
  .list-card:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
  .list-cards.is-selecting .list-card { grid-template-columns: 44px minmax(0, 1fr) auto; }
  .list-cards.is-selecting .lc-check { display: flex; align-items: center; justify-content: center; grid-row: 1 / span 2;
    width: 44px; min-height: 44px; margin-left: calc(-1 * var(--sp-2)); cursor: pointer; }
  .list-card.sk-card { align-items: center; }
  .list-card.sk-card .sk-name { width: 60%; }
  #leadsSelectBtn.is-active { background: var(--primary-bg); border-color: var(--primary-border); color: var(--primary-text); }
}
@media (max-width: 1599px) { .filter-note{ display: none; } }
@media (max-width: 768px) { #leadsFilterBar{ margin-bottom: var(--sp-2); } }

/* =============================================================================
   T-041 6a-bosqich — lead paneli: split / drawer (spec 4.8, 6.3)
   ============================================================================= */
.split { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-3); align-items: start; }
.split.has-panel { grid-template-columns: minmax(0, 1fr) var(--panel-w); }
.lead-panel { background: var(--surface); display: flex; flex-direction: column; overflow: hidden;
  container-type: inline-size; container-name: panel; position: relative; }
.lead-panel[hidden] { display: none; }
.lead-panel.is-split { position: sticky; top: calc(var(--topbar-h) + var(--sp-3)); z-index: var(--z-split);
  height: calc(100dvh - var(--topbar-h) - var(--sp-3) * 2); border: 1px solid var(--border); border-radius: var(--r-lg); }
.lead-panel.drawer { position: fixed; }
.panel-tabs { padding: 0 var(--sp-4); flex-shrink: 0; }
.panel-tabs .tab-bar { margin-bottom: 0; }
.panel-tabs .tab-bar::-webkit-scrollbar { display: none; }
.panel-head { flex-shrink: 0; }
.panel-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-4); padding: var(--sp-3) var(--sp-4) var(--sp-4); align-items: start; }
.panel-main { min-width: 0; }
.tab-info { display: inline-flex; }
@container panel (min-width: 760px) { .panel-grid{ grid-template-columns: minmax(0, 1fr) 248px; } .tab-info{ display: none; } }
@container panel (max-width: 759px) { .side-col{ display: none; } }
.lp-tab[hidden] { display: none; }
.lp-tab-head { display: flex; justify-content: flex-end; margin-bottom: var(--sp-1); }
.lp-sk { display: flex; flex-direction: column; gap: var(--sp-3); padding: var(--sp-2) 0; }
.sk-row-lg { width: 100%; height: 44px; border-radius: var(--r-lg); }
.panel-foot kbd { font: inherit; font-weight: var(--fw-bold); color: var(--text-2); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 0 5px; background: var(--surface-2); }
.lead-panel.drawer .panel-foot { display: block; }

/* sarlavha (Q5: ≤2 qator) */
.dh-row { display: flex; align-items: center; gap: var(--sp-2); min-height: 44px; }
.dh-nav { display: flex; align-items: center; gap: var(--sp-1); flex-shrink: 0; }
.dh-pos { font-size: var(--fs-sm); color: var(--text-3); font-variant-numeric: tabular-nums; margin: 0 var(--sp-1); white-space: nowrap; }
.dh-title { flex: 1; min-width: 0; font-size: var(--fs-xl); font-weight: var(--fw-bold); line-height: 1.3; margin: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dh-title:focus { outline: none; }
.dh-title:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: var(--r-sm); }
.dh-title .sk { width: 60%; height: 18px; }
.dh-actions { display: flex; gap: var(--sp-2); flex-shrink: 0; align-items: center; }
.dh-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px var(--sp-2); font-size: var(--fs-sm); color: var(--text-2); }
.dh-meta .sep { color: var(--text-placeholder); }
.dh-meta .sk { width: 240px; height: 12px; }
.m-back { display: none; }
.m-actions { display: none; }
@container panel (max-width: 620px) { .dh-actions .lbl{ display: none; } .dh-actions .btn{ padding: 0 var(--sp-2); } }

/* ⋯ menyu (panel ichidagi popover — qatlam z+5) */
.lp-menu { position: absolute; z-index: 5; min-width: 220px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); box-shadow: var(--sh-pop); padding: var(--sp-1); display: flex; flex-direction: column; }
.lp-menu[hidden] { display: none; }
.lp-menu-item { display: flex; align-items: center; min-height: 40px; padding: 0 var(--sp-3); border: 0; background: none; font: inherit;
  font-size: var(--fs-md); color: var(--text); text-align: left; border-radius: var(--r-sm); cursor: pointer; text-decoration: none; }
.lp-menu-item:hover, .lp-menu-item:focus-visible { background: var(--surface-2); color: var(--text); text-decoration: none; }

/* o'ng ustun / «Ma'lumot» */
.side { display: flex; flex-direction: column; gap: var(--sp-2); }
.side:empty { display: none; }
.side-card { border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--sp-2) var(--sp-3); background: var(--surface); }
.side-title { font-size: var(--fs-sm); font-weight: var(--fw-bold); margin: 0 0 var(--sp-1); }
.side-sub { font-size: var(--fs-xs); color: var(--text-3); margin-top: var(--sp-2); }
.side-strong { font-weight: var(--fw-bold); font-size: var(--fs-sm); margin: var(--sp-1) 0 2px; }
.side-text { font-size: var(--fs-sm); color: var(--text-2); margin-bottom: var(--sp-1); }
.kv { display: flex; justify-content: space-between; gap: var(--sp-3); padding: 5px 0; border-bottom: 1px solid var(--border-soft); font-size: var(--fs-sm); }
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--text-3); flex-shrink: 0; }
.kv .v { font-weight: var(--fw-medium); text-align: right; min-width: 0; overflow-wrap: anywhere; }
.side-card .meta-creative { margin: var(--sp-2) 0; }
.side-card .meta-creative img { width: 100%; border-radius: var(--r-md); display: block; }

/* izoh, vazifa, tarix */
.note { padding: var(--sp-2) 0; border-bottom: 1px solid var(--border-soft); }
.note:last-child { border-bottom: 0; }
.note-text { font-size: var(--fs-read); line-height: var(--lh-read); max-width: 80ch; white-space: pre-wrap; overflow-wrap: anywhere; }
.note-text.is-clamped { display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.note-meta { display: flex; gap: var(--sp-2); align-items: center; flex-wrap: wrap; font-size: var(--fs-sm); color: var(--text-3); margin-top: 2px; }
.task { display: flex; gap: var(--sp-3); align-items: flex-start; padding: var(--sp-2) 0; border-bottom: 1px solid var(--border-soft); }
.task:last-child { border-bottom: 0; }
.task-check { width: 20px; height: 20px; border-radius: var(--r-sm); border: 2px solid var(--border-strong); flex-shrink: 0; margin-top: 1px; }
.task.is-done .task-check { background: var(--success); border-color: var(--success); }
.task-text { font-weight: var(--fw-medium); }
.task.is-done .task-text { color: var(--text-2); }
.lp-hist-chips { margin-bottom: var(--sp-2); }
.lp-hist-warn { margin: 0 0 var(--sp-2); font-size: var(--fs-sm); padding: var(--sp-2) var(--sp-3); }
.tl-item { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; gap: var(--sp-3); padding: var(--sp-2) 0; border-bottom: 1px solid var(--border-soft); align-items: start; }
.tl-item:last-child { border-bottom: 0; }
.tl-item .dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; display: inline-block; }
.tl-t { font-weight: var(--fw-medium); overflow-wrap: anywhere; }
.tl-x { font-size: var(--fs-sm); color: var(--text-2); overflow-wrap: anywhere; }
.tl-d { font-size: var(--fs-sm); color: var(--text-3); white-space: nowrap; font-variant-numeric: tabular-nums; }

.call-meta { font-size: var(--fs-sm); color: var(--text-3); margin-left: var(--sp-2); }

@media (max-width: 768px) {
  .lead-panel.drawer .panel-head { padding: var(--sp-1) var(--sp-3) var(--sp-2); }
  .dh-nav, .dh-actions, .dh-close, .lead-panel .panel-foot, .lead-panel.drawer .panel-foot { display: none; }
  .m-back { display: inline-flex; margin-left: calc(-1 * var(--sp-2)); min-height: var(--h-touch); }
  .dh-row { flex-wrap: wrap; gap: 0; }
  .dh-title { flex-basis: 100%; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .panel-tabs { padding: 0 var(--sp-1); }
  .panel-grid { padding: var(--sp-2) var(--sp-3) var(--sp-4); }
  .m-actions { display: grid; grid-template-columns: 44px 1fr 44px 44px; gap: var(--sp-2); flex-shrink: 0;
    padding: var(--sp-2) var(--sp-3) calc(var(--sp-2) + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--border); }
  .m-actions .btn, .m-actions .icon-btn { height: var(--h-touch); width: auto; min-width: var(--h-touch); }
  .m-actions .btn svg { width: 16px; height: 16px; }
}
@container panel (max-width: 759px) { .panel-grid .side-col{ display: none; } }

/* =============================================================================
   T-050 — lead to'liq sahifasi (`#view-lead`, egasi qarori 2026-09-30: L-1 bekor).
   Panel komponenti qayta ishlatiladi; sahifa hujjat bo'ylab scroll qiladi (ichki scroll yo'q).
   ≥1024px ikki ustun (asosiy + kontakt/bitim kartalari), kichikroqda bitta ustun.
   ============================================================================= */
#leadPageHost { min-width: 0; }
.lead-panel.is-page { overflow: visible; border: 1px solid var(--border); border-radius: var(--r-lg); }
.lead-panel.is-page .panel-body { overflow: visible; flex: none; }
.lead-panel.is-page .panel-head { position: sticky; top: var(--topbar-h); z-index: 3; background: var(--surface);
  border-radius: var(--r-lg) var(--r-lg) 0 0; }
.lead-panel.is-page .m-back { display: inline-flex; margin-left: calc(-1 * var(--sp-2)); flex-shrink: 0; }
.lead-panel.is-page .dh-close, .lead-panel.is-page .panel-foot { display: none; }
.lead-panel.is-page .side-col { display: none; }
@media (min-width: 1024px) {
  .lead-panel.is-page .panel-grid { grid-template-columns: minmax(0, 1fr) 280px; gap: var(--sp-4); }
  .lead-panel.is-page .panel-grid .side-col { display: flex; }
  .lead-panel.is-page .tab-info { display: none; }
}
@media (min-width: 1280px) { .lead-panel.is-page .panel-grid { grid-template-columns: minmax(0, 1fr) 320px; } }
@media (min-width: 1440px) { .lead-panel.is-page .panel-grid { grid-template-columns: minmax(0, 1fr) 360px; } }
@media (max-width: 1023px) {
  .lead-panel.is-page .panel-grid { grid-template-columns: minmax(0, 1fr); }
  .lead-panel.is-page .tab-info { display: inline-flex; }
}
@media (max-width: 768px) {
  .lead-panel.is-page { border: 0; border-radius: 0; margin: calc(-1 * var(--sp-3)) calc(-1 * var(--sp-3)) 0; }
  .lead-panel.is-page .panel-head { top: var(--topbar-h); border-radius: 0; }
  .lead-panel.is-page .m-actions { position: sticky; bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom)); z-index: 3; }
}

/* =============================================================================
   T-041 6b-bosqich — qo'ng'iroq elementi, inline pleer, «ssenariy» matn (spec 6.3, L-2 = B)
   ============================================================================= */
.call-item { border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); margin-bottom: var(--sp-2); }
.call-item-head { display: flex; align-items: center; gap: var(--sp-3); width: 100%; min-height: 48px; padding: var(--sp-1) var(--sp-3);
  border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; border-radius: var(--r-lg); }
.call-item-head:hover { background: var(--surface-2); }
.call-item.is-open { border-color: var(--primary-border); }
.call-item.is-open .call-item-head { border-bottom: 1px solid var(--border-soft); border-radius: var(--r-lg) var(--r-lg) 0 0; }
.call-item.is-disabled .call-item-head { cursor: default; }
.call-item.is-disabled .call-item-head:hover { background: none; }
.call-dir { width: 28px; height: 28px; border-radius: var(--r-full); background: var(--surface-2); color: var(--text-2); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.call-main { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.call-title { font-weight: var(--fw-bold); }
.call-badge { display: inline-flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.call-badge:empty { display: none; }
.call-chev { color: var(--text-3); transition: transform var(--dur); flex-shrink: 0; }
.call-chev-sp { width: 18px; flex-shrink: 0; }
.call-item.is-open .call-chev { transform: rotate(180deg); }
.call-item-body { padding: var(--sp-3); }
.call-item-body[hidden] { display: none; }
.player { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-1) var(--sp-3); background: var(--surface-2); border-radius: var(--r-md); margin-bottom: var(--sp-3); }
.player .play { width: 40px; height: 40px; border-radius: var(--r-full); background: var(--primary); color: #fff; border: 0; cursor: pointer; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center; }
.player .play:hover { background: var(--primary-hover); }
.player-track { flex: 1; height: 4px; border-radius: var(--r-full); background: var(--surface-3); position: relative; cursor: pointer; min-width: 60px; }
.player-track::before { content: ''; position: absolute; left: 0; right: 0; top: -20px; bottom: -20px; } /* 44px teginish zonasi */
.player-track > i { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--primary); border-radius: var(--r-full); }
.player-time { font-size: var(--fs-sm); color: var(--text-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.player audio { display: none; }
.tr-tools { display: flex; align-items: center; gap: var(--sp-1); flex-wrap: wrap; margin-bottom: var(--sp-2); }
.tr-tools .spacer { flex: 1; }
.tr-tools .tr-prov { width: auto; max-width: 240px; }
.call-note { font-size: var(--fs-sm); color: var(--text-3); margin-top: var(--sp-2); }
.lead-panel .transcript { display: flex; flex-direction: column; }
.lead-panel .turn { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: var(--sp-3); padding: var(--sp-1) 0; margin: 0; align-items: start; }
.lead-panel .turn-time { font: inherit; font-size: var(--fs-xs); color: var(--text-3); padding: 3px 0 0; font-variant-numeric: tabular-nums; background: none; border: 0;
  text-align: left; cursor: pointer; align-self: start; min-height: 32px; }
.lead-panel .turn-time:hover { color: var(--primary); }
.lead-panel .turn-body { border-left: 3px solid var(--speaker-client); padding-left: var(--sp-3); min-width: 0; }
.lead-panel .turn.sotuvchi .turn-body { border-left-color: var(--speaker-seller); }
.lead-panel .turn.nomalum .turn-body { border-left-color: var(--border); }
.lead-panel .turn-who { font-size: var(--fs-xs); font-weight: var(--fw-bold); color: var(--speaker-client); margin-bottom: 2px; }
.lead-panel .turn.sotuvchi .turn-who { color: var(--speaker-seller); }
.lead-panel .turn-text { font-size: var(--fs-read); line-height: var(--lh-read); color: var(--text); max-width: 80ch; overflow-wrap: anywhere; }
.lead-panel .turn.is-cont { padding-top: 0; }
.lead-panel .turn.is-cont .turn-who { display: none; }
.lead-panel .turn.is-playing .turn-text { background: var(--primary-bg); border-radius: var(--r-sm); box-shadow: 0 0 0 4px var(--primary-bg); }
.tr-more { margin-top: var(--sp-2); }
.tr-analysis { margin-top: var(--sp-3); padding: var(--sp-3) var(--sp-4); font-size: var(--fs-read); line-height: var(--lh-read); white-space: pre-wrap; max-width: 80ch; }
.tr-analysis .sk { margin-bottom: var(--sp-2); }
.tr-analysis.is-error { color: var(--danger-text); }
@media (max-width: 768px), (pointer: coarse) {
  .player .play { width: var(--h-touch); height: var(--h-touch); }
  .player-rate { min-width: var(--h-touch); }
  .lead-panel .turn { grid-template-columns: 44px minmax(0, 1fr); gap: var(--sp-2); }
  .lead-panel .turn-time { min-width: 44px; min-height: 44px; padding-top: 4px; }
}
@media (max-width: 768px) {
  .call-item-head { min-height: 56px; }
  .call-item-body { padding: var(--sp-2); }
  .call-main { white-space: normal; }
  .call-main .call-meta { display: block; margin-left: 0; }
  .tr-tools .btn-text .lbl { display: none; }
  .tr-tools .btn-text { min-width: var(--h-touch); }
}

/* ---------------- T-048 (spec 6.4): Qo'ng'iroqlar — bir satrli jadval, inline pleer ---------------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* T-053 v3: yo'nalish bo'yicha statistika (.stat-strip o'rniga) — docs/design/T-053/spec.md */
.dir-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-3); margin-bottom: var(--sp-3); }
.dir-stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--sp-3) var(--sp-4); min-width: 0; }
.dir-stat-card.is-active { border-color: var(--primary); }
/* Egasi tuzatishi (T-053 spec oxiri): ulush foizi o'ng chetda emas — sarlavha matni yonida, 6px oraliq. */
.dir-stat-head { display: flex; align-items: center; justify-content: flex-start; gap: 6px; margin-bottom: var(--sp-2); }
.dir-stat-head-lab { display: flex; align-items: center; gap: 6px; height: 16px; line-height: 1; font-family: inherit; font-size: var(--fs-xs); font-weight: var(--fw-bold); color: var(--text-2); background: none; border: 0; padding: 0; cursor: pointer; border-radius: var(--r-sm); }
.dir-stat-head-lab svg { width: 14px; height: 14px; }
.dir-stat-card.is-active .dir-stat-head-lab { color: var(--primary-text); }
.dir-stat-head-share { font-size: var(--fs-xs); color: var(--text-3); font-variant-numeric: tabular-nums; }
.dir-stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-3); }
.dstat-cell { position: relative; display: flex; flex-direction: column; gap: var(--sp-1); border: 0; background: none; padding: 0; text-align: left; cursor: pointer; color: inherit; font: inherit; }
.dstat-cell::after { content: ''; position: absolute; left: 0; right: 10px; bottom: -8px; height: 2px; border-radius: 1px; background: transparent; }
.dstat-cell.is-active::after { background: var(--primary); }
.dstat-top { display: flex; align-items: center; gap: 6px; min-height: 22px; }
.dstat-num { font-size: var(--fs-xl); font-weight: var(--fw-medium); color: var(--text); line-height: 1; font-variant-numeric: tabular-nums; }
.dstat-cell.is-active:not(.is-bad) .dstat-num { color: var(--primary); }
.dstat-cell.is-bad .dstat-num { color: var(--danger-text); }
.dstat-pct { font-size: var(--fs-xs); font-weight: var(--fw-medium); color: var(--text-3); }
.dstat-lab { font-size: var(--fs-xs); line-height: 1; color: var(--text-3); }
.dir-stat-head-lab:focus-visible, .dstat-cell:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.dir-stat-card .sk-dhead { width: 70px; height: 12px; }
.dstat-cell .sk-b { width: 34px; height: 20px; margin-bottom: 3px; }
.dstat-cell .sk-i2 { width: 44px; height: 10px; }
#callsStats .banner { margin-bottom: var(--sp-3); }
@media (max-width: 768px), (pointer: coarse) {
  .dir-stats { grid-template-columns: 1fr; gap: var(--sp-2); }
  .dir-stat-grid { grid-template-columns: repeat(2, 1fr); row-gap: var(--sp-4); column-gap: var(--sp-3); }
  /* DESIGN-SYSTEM Taqiq 8 / 5.6: mobilda har interaktiv element >=44x44px. */
  .dstat-cell, .dir-stat-head-lab { min-height: 44px; justify-content: center; }
}
.calls-table .col-play { width: 52px; padding-right: 0; }
.calls-table .col-dir { width: 32px; padding: 0 var(--sp-1); }
.play-sq { width: 32px; height: 32px; border-radius: var(--r-full); border: 1px solid var(--border); background: var(--surface); color: var(--primary);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.play-sq:hover { border-color: var(--primary-border); background: var(--primary-bg); }
.play-sq.is-open { background: var(--primary); border-color: var(--primary); color: #fff; }
.play-sq.is-empty { border: 0; background: transparent; cursor: default; }
.dir-ic { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; vertical-align: middle; }
.dir-ic svg { width: 16px; height: 16px; }
.dir-ic.is-out { color: var(--primary-text); }
.dir-ic.is-in { color: var(--success-text); }
.link-cell { border: 0; background: transparent; padding: 0; font: inherit; font-weight: var(--fw-bold); color: var(--text); cursor: pointer; text-align: left;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-cell:hover { color: var(--primary-text); text-decoration: underline; }
.calls-table tr.player-row td { height: auto; padding: var(--sp-2) var(--sp-3); background: var(--surface-2); }
.calls-table tr.player-row .player { margin: 0; background: var(--surface); min-width: 0; }
.player-card { padding: var(--sp-2) var(--sp-3); border-bottom: 1px solid var(--border-soft); background: var(--surface-2); }
.player-card .player { margin: 0; background: var(--surface); }
@media (max-width: 768px), (pointer: coarse) {
  .play-sq { width: var(--h-touch); height: var(--h-touch); }
}
@media (max-width: 768px) {
  .list-card.call-card { grid-template-columns: minmax(0, 1fr) auto; }
  .call-card .t { display: flex; align-items: center; gap: 6px; grid-column: 1; grid-row: 1; }
  .call-card .m { grid-column: 1; grid-row: 2; }
  .call-card .r { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
}
/* Qo'ng'iroqlar ustunlari kam — o'z chegaralari (split ~580px: ▶ · yo'nalish · Lead · Holat · Davomiylik). */
#callsTableWrap { container-name: calls; }
@container calls (max-width: 860px) { .calls-table .c-opt2{ display: none; } }
@container calls (max-width: 640px) { .calls-table .c-opt1{ display: none; } }
@container calls (min-width: 1900px) { .calls-table .c-fill{ width: 100%; } }
.calls-table td.t { max-width: 360px; }
.tr-mark { color: var(--success-text); font-weight: var(--fw-bold); margin-left: 2px; }

/* ---------------- T-048 (spec 6.5): admin sahifalar ---------------- */
.page-note { font-size: var(--fs-sm); color: var(--text-3); }
.pipeline-picker { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.dialog-form { display: contents; }
.data-table .m, .data-table td.m { color: var(--text-2); }
.u-pipes { max-width: 360px; overflow: hidden; text-overflow: ellipsis; }
.u-pipes .link-cell { font-weight: var(--fw-medium); color: var(--primary-text); }

/* T-054: Sozlamalar — ro'yxat → bo'lim sahifasi (docs/design/T-054/spec.md). */
.settings-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: var(--sp-3); }
.settings-list[hidden], .settings-page[hidden] { display: none; }
.settings-item { position: relative; display: flex; align-items: center; gap: var(--sp-3); width: 100%; text-align: left;
  padding: 14px var(--sp-4); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); min-height: var(--h-touch); }
.settings-item:hover { border-color: var(--border-strong); background: var(--surface-2); }
.settings-item .si-hit { position: absolute; inset: 0; width: 100%; border: 0; background: transparent; border-radius: inherit; cursor: pointer; padding: 0; }
.settings-item .si-hit:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.settings-item .si-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.settings-item .si-title { font-size: var(--fs-md); font-weight: var(--fw-bold); color: var(--text); }
.settings-item .si-desc { font-size: var(--fs-sm); color: var(--text-3); margin-top: 2px; }
.settings-item .si-chev { color: var(--text-placeholder); flex-shrink: 0; }
.settings-item .badge { flex-shrink: 0; white-space: nowrap; }
.settings-item .si-status.sk { width: 100px; height: 22px; border-radius: var(--r-sm); flex-shrink: 0; }
.settings-item.is-muted { opacity: .55; }
.settings-item .si-reason { font-size: var(--fs-xs); color: var(--text-3); font-weight: var(--fw-medium); white-space: nowrap; flex-shrink: 0; }
.settings-item .si-status-err { position: relative; font-size: var(--fs-sm); color: var(--text-3); white-space: nowrap; flex-shrink: 0; }
.settings-item .si-status-err button { border: 0; background: none; color: var(--primary-text); font: inherit; font-size: var(--fs-sm);
  font-weight: var(--fw-medium); cursor: pointer; padding: 0 var(--sp-1); margin-left: 2px; min-height: 32px; min-width: 32px; }

.settings-detail-head { position: sticky; top: var(--topbar-h); z-index: var(--z-sticky);
  display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-3) 0; background: var(--bg); }
.settings-detail-head .m-back { display: inline-flex; flex-shrink: 0; margin-left: calc(-1 * var(--sp-2)); }
.settings-detail-head h2 { font-size: var(--fs-xl); font-weight: var(--fw-bold); margin: 0; }
/* Bo'lim sahifasi: faqat joriy <fieldset> ko'rinadi, kartasiz — maydonlar 2 ustunli grid'da. */
.settings-detail > fieldset.card:not(.is-current) { display: none; }
.settings-detail > fieldset.card.is-current { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 var(--sp-6); max-width: 1000px;
  border: 0; background: transparent; padding: 0; border-radius: 0; min-width: 0; }
@media (min-width: 1024px) { .settings-detail > fieldset.card.is-current { grid-template-columns: repeat(2, minmax(320px, 480px)); } }
.settings-detail > fieldset.card.is-current > legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; padding: 0; }
.settings-detail > fieldset.card > :not(.field),
.settings-detail > fieldset.card > .field.is-wide { grid-column: 1 / -1; }
.settings-detail > fieldset.card > .save-row { margin-bottom: var(--sp-3); gap: var(--sp-2); }
.settings-detail textarea.input { resize: vertical; min-height: 200px; }
.settings-detail .save-row.is-sticky-save { position: sticky; bottom: 0; z-index: var(--z-sticky); margin: var(--sp-5) 0 0; padding: var(--sp-3) 0;
  background: var(--bg); border-top: 1px solid var(--border); }
.migrations-list { display: grid; gap: 6px; margin-bottom: var(--sp-3); }
.hint-tight { margin-top: calc(-1 * var(--sp-2)); }
.hint-after { margin: var(--sp-2) 0 0; }
.row-gap { margin-top: var(--sp-3); }
.field-gap { margin-bottom: var(--sp-3); }
@media (max-width: 768px) {
  .settings-list { grid-template-columns: minmax(0, 1fr); }
  .settings-detail .save-row.is-sticky-save { bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom)); }
}

/* Voronkalar: ≥1280px ro'yxat (360px) + o'ng qism yonma-yon. */
.funnels-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-3); align-items: start; }
@media (min-width: 1280px) { .funnels-layout{ grid-template-columns: 360px minmax(0, 1fr); } }
.funnels-layout.hidden { display: none; }
.funnel-list { display: flex; flex-direction: column; }
.funnel-item { display: flex; flex-direction: column; gap: var(--sp-1); text-align: left; border: 0; border-bottom: 1px solid var(--border-soft);
  background: transparent; font: inherit; color: inherit; padding: var(--sp-2) var(--sp-4); min-height: 56px; cursor: pointer; }
.funnel-item:last-child { border-bottom: 0; }
.funnel-item:hover { background: var(--surface-2); }
.funnel-item.is-current { background: var(--primary-bg); box-shadow: inset 3px 0 0 var(--primary); }
.funnel-item-name { font-weight: var(--fw-bold); }
.funnel-item .funnel-stage-dots { gap: 4px; margin: 0; }
.funnel-item .dot { width: 10px; height: 10px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(15,18,34,.14); }
.funnels-main { min-width: 0; display: grid; gap: var(--sp-3); }
.funnels-main > [hidden] { display: none; }
#fDetail .card-title { display: flex; align-items: baseline; gap: var(--sp-2); }
#fDetail .f-src { max-width: 520px; overflow: hidden; text-overflow: ellipsis; }
.f-builder-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-2); }
.f-builder .field { max-width: 640px; }
.f-builder-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-4); margin-bottom: var(--sp-3); }
@media (min-width: 1600px) { .f-builder-grid{ grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .f-builder-grid .field{ max-width: none; } }
.f-stage-form { border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--sp-3); background: var(--surface-2); }
.f-stage-form .field:last-of-type { margin-bottom: var(--sp-3); }
.color-picker { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.sources-picker { display: flex; flex-direction: column; gap: var(--sp-3); }
.built-stages { display: flex; flex-direction: column; gap: var(--sp-2); }
.badge-btn { border: 1px solid var(--border); background: var(--surface); cursor: pointer; font: inherit; font-size: var(--fs-xs); font-weight: var(--fw-bold); }
.badge-btn:hover { border-color: var(--border-strong); }
@media (max-width: 768px), (pointer: coarse) { .badge-btn { min-height: var(--h-touch); } }
/* T-048/10: index.html inline stillari o'rniga */
.push-right { margin-left: auto; }
.meta-line { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; margin: var(--sp-2) 0 var(--sp-3); }
.meta-line.hidden { display: none; }
.job-bar > span { width: 0; }
.mt-2 { margin-top: var(--sp-2); }
.mt-3 { margin-top: var(--sp-3); }
.mb-2 { margin-bottom: var(--sp-2); }
.link-btn[data-plain] { color: var(--text); text-align: left; padding: 0; }
.fs-xs { font-size: var(--fs-xs); }
.fs-md { font-size: var(--fs-md); }
.fw-bold { font-weight: var(--fw-bold); }
.m-0 { margin: 0; }
.mb-5 { margin-bottom: var(--sp-5); }
.pad-4 { padding: var(--sp-4); }
.nowrap { white-space: nowrap; }
.lh-tight { line-height: 1.2; }
.mw-110 { max-width: 110px; }
.mw-260 { max-width: 260px; }
table.metrics.mw-640 { min-width: 640px; }
.section-row { display: flex; align-items: center; gap: var(--sp-3); justify-content: space-between; flex-wrap: wrap; }
.td-muted { color: var(--text-3); font-size: var(--fs-sm); }
.td-note { font-size: var(--fs-xs); }
.hint.is-error { color: var(--danger-text); }
.inline-label { font-size: var(--fs-sm); color: var(--text-3); font-weight: var(--fw-medium); }
.creative-thumb-badge.is-static { position: static; }
.creative-thumb-empty.is-legend { width: 22px; height: 22px; font-size: 0; }
.preview-stage { position: relative; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.preview-poster { opacity: .55; }
.preview-play { position: absolute; width: 52px; height: 52px; border-radius: 50%; background: rgba(255,255,255,.92); border: 0;
  display: flex; align-items: center; justify-content: center; cursor: pointer; }
.mig-row { display: flex; align-items: center; justify-content: space-between; font-size: var(--fs-sm); }
.mig-st { font-weight: var(--fw-bold); }
.mig-st.is-ok { color: var(--success-text); }
.mig-st.is-wait { color: var(--warning-text); }
.src-pipe { font-weight: var(--fw-medium); color: var(--text-2); margin-bottom: 6px; }
.src-list { display: flex; flex-wrap: wrap; gap: 6px; }
.src-list .btn { height: var(--h-control-sm); padding: 0 var(--sp-2); font-size: var(--fs-xs); }
.built-stage { padding: var(--sp-2) var(--sp-3); display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; border-top: 3px solid var(--border); }
.order-btns { display: flex; flex-direction: column; gap: 2px; }
.built-stage-main { flex: 1; min-width: 0; }
.built-stage-main .meta { margin-top: 2px; }

/* ---------------- T-055: Leadlar guruh segmenti (docs/design/T-055/spec.md) ---------------- */
#leadsGroupWrap { margin-bottom: var(--sp-3); }
#leadsGroupWrap[hidden] { display: none; }
#leadsGroupWrap .sk-seg { display: none; width: 280px; height: 36px; border-radius: var(--r-md); }
#leadsGroupWrap.is-sk .sk-seg { display: block; }
#leadsGroupWrap.is-sk #leadsGroupSeg { display: none; }
#leadsGroupSeg .seg-btn .count { margin-left: 6px; font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; color: var(--text-3); }
#leadsGroupSeg .seg-btn .count:empty { display: none; }
#leadsGroupSeg .seg-btn.is-active .count { color: var(--primary-text); }
#leadsGroupSeg [data-group="archived"] .short { display: none; }
@media (max-width: 768px) {
  #leadsGroupSeg { display: flex; width: 100%; }
  #leadsGroupSeg .seg-btn { flex: 1; padding: 0 var(--sp-2); white-space: nowrap; }
  #leadsGroupWrap .sk-seg { width: 100%; }
}
/* ≤600px: «Bekor bo'lgan» → «Bekor» (matn kesilmasin); aria-label to'liq nom + sonni saqlaydi */
@media (max-width: 600px) {
  #leadsGroupSeg [data-group="archived"] .full { display: none; }
  #leadsGroupSeg [data-group="archived"] .short { display: inline; }
}

/* ============================================================================
   T-063 — Dashboard 5-tab «Plan va fakt» (docs/design/T-063/spec.md, QABUL v3).
   Klasslar mockup (plan-fact.html) «T-063 YANGI KLASSLAR» blokidan aynan;
   jadval mavjud `.data-table`/`.table-wrap.is-list` (c-opt0/1/2) naqshini
   qayta ishlatadi — bu yerda yangi jadval klassi yo'q.
   ============================================================================ */
.pf-month { display: inline-flex; align-items: center; gap: var(--sp-1); }
.pf-month .icon-btn { width: var(--h-control-sm); height: var(--h-control-sm); }
.pf-month select.input { width: 156px; font-weight: var(--fw-bold); }
.pf-days { display: inline-flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-sm); color: var(--text-3); white-space: nowrap; }
.pf-days b { color: var(--text); font-variant-numeric: tabular-nums; }
.pf-days .pf-bar { width: 64px; }
@media (max-width: 1439px) { .pf-toolbar .summary-line { flex-basis: 100%; order: 10; } .pf-toolbar .pf-hint { display: none; } }
.pf-ask { font-size: var(--fs-sm); font-weight: var(--fw-bold); color: var(--text); white-space: nowrap; }
.pf-banner .btn + .btn { margin-left: 0; }
.pf-bar { position: relative; display: inline-block; width: 40px; height: 6px; border-radius: var(--r-full); background: var(--surface-3); flex-shrink: 0; vertical-align: middle; }
.pf-bar > i { position: absolute; top: 0; bottom: 0; left: 0; width: min(var(--v, 0%), 100%); border-radius: inherit; background: var(--text-placeholder); }
.pf-bar > i.ok { background: var(--success); }
.pf-bar > i.mid { background: var(--warning); }
.pf-bar > i.bad { background: var(--danger); }
.pf-bar.has-t::after { content: ''; position: absolute; left: var(--t); top: -3px; width: 2px; height: 12px; margin-left: -1px; border-radius: 1px; background: var(--text-2); }
.pf-bar.is-lg { display: block; width: 100%; height: 8px; }
.pf-bar.is-lg.has-t::after { height: 14px; }
.kpi-card.pf-kpi { display: flex; flex-direction: column; gap: var(--sp-2); }
.pf-kpi-row { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); min-width: 0; }
.pf-kpi .kpi-label { margin: 0; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-kpi-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pf-kpi-main .kpi-value { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-kpi-plan { font-size: var(--fs-sm); color: var(--text-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.pf-kpi-plan b { color: var(--text-2); }
/* review #2: ro'yxat hamma kartada (barli/barsiz) pastga yopishadi — aralash qatorda tekislanadi */
.pf-kpi-list { display: grid; grid-template-columns: 1fr auto; gap: 2px var(--sp-2); font-size: var(--fs-xs); color: var(--text-3); margin-top: auto; }
.pf-kpi-list b { color: var(--text-2); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pf-d { font-size: var(--fs-sm); font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--text-2); }
.pf-d.good { color: var(--success-text); }
.pf-d.bad { color: var(--danger-text); }
.pf-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-3); align-items: stretch; }
@media (min-width: 1280px) { .pf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pf-card { display: flex; flex-direction: column; }
.pf-card.is-editing { border-color: var(--primary-border); }
.pf-card .table-wrap { border: 0; border-radius: 0; }
.pf-table td.pf-fact { font-weight: var(--fw-bold); }
.pf-table tr.is-calc td { color: var(--text-3); }
.pf-table tr.is-calc td.t, .pf-table tr.is-calc td.pf-fact { font-weight: var(--fw-medium); }
.pf-table tr.is-total td { background: var(--surface-2); font-weight: var(--fw-bold); }
.pf-table tr.is-diff td { color: var(--text-2); }
.pf-idx { display: inline-flex; align-items: center; justify-content: flex-end; gap: var(--sp-2); }
.pf-idx .pf-bar.is-empty { visibility: hidden; }
.pf-card.is-editing .c-opt0, .pf-card.is-editing .c-opt1, .pf-card.is-editing .c-opt2 { display: none; }
.pf-in { position: relative; display: inline-flex; width: 104px; }
.pf-in .input { text-align: right; padding-right: 36px; font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; }
.pf-in .input.is-warn { border-color: var(--warning-text); }
.pf-unit { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: var(--fs-xs); color: var(--text-3); pointer-events: none; }
.pf-msg { display: inline-flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-sm); font-weight: var(--fw-medium); }
.pf-msg.is-warn { color: var(--warning-text); }
.pf-msg.is-error { color: var(--danger-text); }
.pf-toggle { display: flex; align-items: center; gap: var(--sp-2); width: 100%; min-height: var(--row-h); margin-top: auto; padding: 0 var(--sp-4);
  border: 0; border-top: 1px solid var(--border-soft); background: none; font: inherit; font-size: var(--fs-sm); font-weight: var(--fw-bold); color: var(--primary-text); cursor: pointer; text-align: left; }
.pf-toggle:hover { background: var(--surface-2); }
.pf-toggle .meta { margin-left: auto; font-weight: var(--fw-regular); }
.pf-toggle .chev { display: inline-block; transition: transform var(--dur); }
.pf-toggle[aria-expanded="true"] .chev { transform: rotate(90deg); }
.pf-sellers { margin-top: var(--sp-3); }
.pf-sellers-table th.pf-gl { height: 28px; border-bottom: 1px solid var(--border-soft); }
.pf-sellers-table .pf-gs { border-left: 1px solid var(--border-soft); }
/* review #3: «Sotuvchilar jami» indeksi — fakt biriktirilmaganni ham qo'shadi, plan faqat sotuvchilarniki (ikki xil asos) */
.pf-table tr.is-total .t { cursor: help; }

/* T-091: kunlik hisobot namunasi */
.tg-preview { margin: 0; white-space: pre-wrap; font: inherit; font-size: var(--fs-sm); color: var(--text-2); max-height: 60vh; overflow: auto; }
.ring-wait.is-short { color: var(--warning-text); font-weight: var(--fw-bold); cursor: help; }

/* ======================= T-096g: hrPulse Dashboard (alohida sayt) =======================
   docs/design/T-096g/spec.md 7-bo'lim — faqat mavjud tokenlar. `.alert` o'rniga mavjud `.banner`.
   SellUp'da faqat /stage-map sahifasi .dash-page/.dash-top/.fn-title/.stage-map-* ni ishlatadi. */
.dash-page { max-width: 1440px; margin: 0 auto; padding: var(--sp-3) var(--sp-4) var(--sp-6); }
.dash-top { height: var(--topbar-h); background: var(--surface); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: var(--sp-3); padding: 0 var(--sp-4); }
.dash-top .in { max-width: 1440px; margin: 0 auto; width: 100%; display: flex; align-items: center; gap: var(--sp-3); }
.dash-top .dash-brand { font-weight: 800; font-size: var(--fs-lg); }
.dash-top .sp { flex: 1; }
.dash-top a { color: inherit; text-decoration: none; }
.dash-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3); margin-bottom: var(--sp-2); }
.dash-bar .grow { flex: 1 1 0; min-width: 0; }
.dash-bar .hint { margin: 0; }
.dash-fresh { font-size: var(--fs-xs); color: var(--text-3); display: flex; align-items: center; gap: var(--sp-2); white-space: nowrap; }
.dash-fresh { cursor: help; }
.dash-fresh.is-stale { color: var(--warning-text); }
.dash-range { display: inline-flex; align-items: center; gap: var(--sp-2); }
.dash-page .pos-rel { position: relative; }
.dash-page .banner { margin-bottom: var(--sp-3); padding: var(--sp-2) var(--sp-3); }
.dash-page .banner .btn-text { margin-left: var(--sp-2); }
.dash-page .tab-bar { margin-bottom: var(--sp-3); }
.dash-page .tab-btn { height: 40px; }
.fn-title { font-size: var(--fs-lg); font-weight: var(--fw-bold); margin: 0 0 var(--sp-1); }
/* KPI: 6 ta, past bo'yli */
.kpi-row.is-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.kpi-row.is-6 .kpi-card.is-compact { min-height: 48px; }
.kpi-row.is-6 .kpi-card.is-compact .kpi-value { font-size: var(--fs-xl); }
/* Voronka jadvali (bitta karta, ustunli) */
.fn-card { padding: 0; overflow: hidden; }
.fn-scroll { overflow-x: auto; }
.fn-head, .fn-row { display: grid; grid-template-columns: minmax(250px, 1.2fr) minmax(120px, 2fr) 84px 64px 92px 84px 100px; column-gap: var(--sp-3); align-items: center; padding: 0 var(--sp-4); min-width: 820px; }
.fn-head { height: 34px; border-bottom: 1px solid var(--border); font-size: var(--fs-xs); font-weight: var(--fw-medium); color: var(--text-2); background: var(--surface-2); }
.fn-row { height: 40px; border-bottom: 1px solid var(--border-soft); font-size: var(--fs-sm); }
.fn-row:last-child { border-bottom: 0; }
.fn-row.is-exit .fn-name b { color: var(--text-2); }
.fn-name { display: flex; align-items: baseline; gap: var(--sp-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.fn-name b { font-weight: var(--fw-bold); font-size: var(--fs-md); }
.fn-name small { font-weight: var(--fw-regular); font-size: var(--fs-xs); color: var(--text-3); }
.fn-track { height: 14px; background: var(--surface-2); border-radius: var(--r-sm); overflow: hidden; }
.fn-fill { height: 100%; background: var(--primary); border-radius: var(--r-sm); min-width: 2px; }
.fn-fill.is-win { background: var(--success); }
.fn-fill.is-exit { background: var(--text-placeholder); } /* faqat to'ldirish, matn emas */
.fn-fill.is-bad { background: var(--danger); }
.fn-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fn-count { font-size: var(--fs-md); font-weight: var(--fw-heavy); background: none; border: 0; padding: 0 4px; cursor: pointer; color: var(--primary-text); border-radius: var(--r-sm); }
.fn-count:hover { background: var(--primary-bg); text-decoration: underline; }
.fn-count:disabled { color: var(--text-3); font-weight: var(--fw-regular); cursor: default; text-decoration: none; background: none; }
.fn-pct { color: var(--text); }
.fn-pct.is-dim { color: var(--text-3); }
.fn-note { margin: var(--sp-2) 0 0; font-size: var(--fs-sm); color: var(--text-3); }
/* Asosiy konversiyalar */
.conv-card { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: var(--sp-3); padding: 0; }
.conv-item { padding: var(--sp-3) var(--sp-4); border-left: 1px solid var(--border-soft); min-width: 0; }
.conv-item:first-child { border-left: 0; }
.conv-name { font-size: var(--fs-xs); font-weight: var(--fw-medium); color: var(--text-2); }
.conv-val { font-size: var(--fs-xl); font-weight: var(--fw-heavy); font-variant-numeric: tabular-nums; line-height: 1.2; }
.conv-meta { font-size: var(--fs-xs); color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-item.is-accent { background: var(--primary-bg); }
.conv-item.is-accent .conv-val { color: var(--primary); }
.conv-item.is-accent .conv-name, .conv-item.is-accent .conv-meta { color: var(--primary-text); }
/* Target */
.tg-wrap table.metrics th { padding: 6px 8px; white-space: normal; line-height: 1.2; vertical-align: bottom; }
.tg-wrap table.metrics td { padding: 4px 8px; height: 40px; }
.tg-wrap table.metrics th.grp { text-align: center; white-space: nowrap; background: var(--surface-2); font-weight: var(--fw-bold); }
.tg-wrap table.metrics th.grp.crm { background: var(--primary-bg); color: var(--primary-text); }
.tg-wrap td.crm-sep, .tg-wrap th.crm-sep { border-left: 2px solid var(--primary-border); }
.tg-wrap .cb { width: 36px; min-width: 36px; padding: 0 !important; text-align: center; position: sticky; left: 0; background: var(--surface); z-index: 1; }
.tg-wrap .cb input { margin: 0; cursor: pointer; }
.tg-wrap table.metrics td.name-cell, .tg-wrap table.metrics th.name-cell { position: sticky; left: 36px; background: var(--surface); box-shadow: 1px 0 0 var(--border); min-width: 200px; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; z-index: 1; }
.tg-wrap th.is-sortable { cursor: pointer; user-select: none; }
.tg-wrap th.is-sortable:hover { color: var(--text); }
.tg-wrap tr.is-total td, .tg-wrap tr.is-total td.cb, .tg-wrap tr.is-total td.name-cell { background: var(--surface-2); }
.tg-wrap tr.is-selected td, .tg-wrap tr.is-selected td.cb, .tg-wrap tr.is-selected td.name-cell { background: var(--primary-bg); }
.tg-wrap .badge { cursor: default; }
.name-link { background: none; border: 0; padding: 0; font: inherit; font-weight: var(--fw-bold); color: var(--text); cursor: pointer; text-align: left; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.name-link:hover { color: var(--primary); text-decoration: underline; }
.cell-link { background: none; border: 0; padding: 0 2px; font: inherit; font-weight: var(--fw-bold); color: var(--primary-text); cursor: pointer; border-radius: var(--r-sm); font-variant-numeric: tabular-nums; }
.cell-link:hover { background: var(--primary-bg); text-decoration: underline; }
.cell-link:disabled { color: var(--text-3); cursor: default; text-decoration: none; background: none; font-weight: var(--fw-regular); }
.cell-diff { color: var(--warning-text); font-weight: 800; margin-left: 5px; cursor: help; }
td.is-diff { background: var(--warning-bg); }
.col-pop-row { display: flex; align-items: center; gap: var(--sp-2); height: 32px; font-size: var(--fs-sm); }
.col-pop-title { font-size: var(--fs-xs); font-weight: var(--fw-medium); color: var(--text-3); padding: var(--sp-2) 0 var(--sp-1); }
.dash-pop { position: absolute; right: 0; top: calc(100% + 6px); width: 280px; max-height: 70vh; overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-pop); padding: var(--sp-3); z-index: var(--z-popover); }
.modal.is-dash-leads { max-width: 680px; }
.modal.is-dash-leads .modal-body { padding: 0; }
.modal.is-dash-leads tbody tr[data-url] { cursor: pointer; }
.modal.is-dash-leads tbody tr[data-url]:hover td { background: var(--surface-2); }
/* Bosqich xaritasi (SellUp /stage-map) */
.stage-map-row { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: var(--sp-3); padding: var(--sp-2) 0; border-bottom: 1px solid var(--border-soft); }
.stage-map-row:last-child { border-bottom: 0; }
.stage-map-row .fn-name { display: block; white-space: normal; }
.stage-map-row .fn-name small { display: block; }
.stage-map-opts { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-3); }
.stage-map-opts label { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); }
@media (max-width: 1100px) { .kpi-row.is-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 768px) {
  .dash-page { padding: var(--sp-3); }
  .dash-top { padding: 0 var(--sp-3); }
  .kpi-row.is-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .conv-card { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .conv-item:nth-child(3) { border-left: 0; }
  .conv-item:nth-child(n+3) { border-top: 1px solid var(--border-soft); }
  .dash-bar .seg { max-width: 100%; overflow-x: auto; }
  .dash-bar .grow { display: none; }
  .stage-map-row { grid-template-columns: 1fr; }
}

/* ===== T-104: Xodimlar statistikasi (docs/design/T-104). Yangi token yo'q ===== */
.ss-dates{font-size:var(--fs-sm);color:var(--text-3)}
.st-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:var(--sp-3)}
.st-head{display:flex;justify-content:space-between;align-items:center;gap:var(--sp-2);margin-bottom:var(--sp-3);font-weight:var(--fw-bold);font-size:var(--fs-lg)}
.st-cols{display:grid;grid-template-columns:1fr 1fr;gap:var(--sp-5)}
.st-cols>div+div{border-left:1px solid var(--border-soft);padding-left:var(--sp-5)}
.st-row{display:flex;justify-content:space-between;align-items:baseline;gap:var(--sp-2)}
.st-row span{font-size:var(--fs-sm);color:var(--text-2)}
.st-row b{font-size:var(--fs-xl);font-weight:var(--fw-heavy);font-variant-numeric:tabular-nums}
.st-pct{font-size:var(--fs-xs);color:var(--text-3);text-align:right;margin:0 0 var(--sp-2)}
.st-wk th.g,.st-wk td.g{border-left:1px solid var(--border-soft)}.st-wk th.g{text-align:center}
.st-wk th:first-child,.st-wk td:first-child{position:sticky;left:0;background:var(--surface);box-shadow:1px 0 0 var(--border);z-index:1}
.st-note{font-size:var(--fs-xs);color:var(--text-3);margin:var(--sp-3) 0 0}
.st-sec{font-size:var(--fs-lg);font-weight:var(--fw-bold);margin:var(--sp-5) 0 var(--sp-3)}
.st-wk tr.st-total td{font-weight:var(--fw-bold);background:var(--surface-2)}
@media(max-width:768px){.st-grid{grid-template-columns:1fr}}
@media(max-width:400px){.st-cols{grid-template-columns:1fr;gap:var(--sp-3)}.st-cols>div+div{border-left:0;padding-left:0;border-top:1px solid var(--border-soft);padding-top:var(--sp-3)}}
