/* Telefon ko'rinishi (egasi 2026-10-31). Faqat 760px dan tor ekranda yuklanadi, kompyuter ko'rinishiga tegmaydi.
   Operator bir qo'lda, suhbat paytida ishlaydi: o'qilishi va tezlik bezakdan muhim. Shisha va orqa fon rasmi
   arzon telefonda sekin ishlaydi va yozuvni qiyinlashtiradi, shuning uchun bu yerda tekis yuzalar. */
:root, [data-theme=dark] {
  --mat: var(--surface);
  --mat-strong: var(--surface);
  --mat-edge: var(--line);
  --mat-blur: none;
  --neu-well: transparent;
  --tap: 44px;
  --pastki: 58px;
}
* { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
html { -webkit-tap-highlight-color: transparent; }
body { background: var(--bg); font-size: 15px; }
body::before { display: none; }
.view > * { animation: none; }
.card:hover, .stat:hover { transform: none; }
.stat::after { display: none; }

/* ── Yuqori panel: bitta qator, sahifa nomi ko'rinadi ── */
.topbar {
  flex-wrap: nowrap; gap: 6px; height: 56px; min-height: 56px; padding: 0 10px 0 6px;
  background: var(--surface); border: 0; box-shadow: 0 1px 0 var(--line);
}
.topbar .brand, .topbar-sep { display: none; }
.topbar h2 {
  display: flex; flex: 1; min-width: 0; margin: 0; font-size: 18px; line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.topbar h2 .em { flex: none; width: 24px; height: 24px; }
.nav-toggle, .icon-btn { width: 44px; height: 44px; flex: none; background: transparent; border: 0; box-shadow: none; }

/* Sahifa tugmalari kontent bilan birga suriladi, ekranda doim joy egallamaydi */
#page-actions {
  box-sizing: border-box; width: 100%; min-width: 0; margin: 0; order: 0; flex: none;
  display: flex; flex-wrap: nowrap; justify-content: flex-start; gap: 8px; overflow-x: auto; padding: 12px 12px 0;
  scrollbar-width: none;
}
#page-actions button { padding: 0 14px; font-size: 14px; }
#page-actions:empty { display: none; }
#page-actions > * { flex: none; }
.view { padding: 12px 12px calc(var(--pastki) + 24px + env(safe-area-inset-bottom, 0px)); }

/* ── Pastki menyu: asosiy bo'limlar bir bosishda, bosh barmoq yetadigan joyda ── */
.pastki-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 35;
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--surface); border-top: 1px solid var(--line);
}
.pastki-nav > a, .pastki-nav > button {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-width: 0; height: var(--pastki); padding: 0 2px; margin: 0;
  background: none; border: 0; border-radius: 0; box-shadow: none; transform: none;
  color: var(--ink-2); font-size: 11px; font-weight: 700; line-height: 1.1; letter-spacing: -.01em; text-decoration: none;
}
.pastki-nav > a:hover, .pastki-nav > button:hover { background: none; color: var(--ink-2); transform: none; }
.pastki-nav > a span:not(.badge), .pastki-nav > button span:not(.badge) {
  max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pastki-nav > a.faol { color: var(--brand); }
.pastki-nav .badge { position: absolute; top: 5px; left: calc(50% + 6px); min-width: 16px; height: 16px; padding: 0 4px; line-height: 16px; font-size: 11px; }
body.yozmoqda .pastki-nav, body.suhbatda .pastki-nav { display: none; }
#toast-root { left: 12px; right: 12px; bottom: calc(var(--pastki) + 12px + env(safe-area-inset-bottom, 0px)); }

/* ── Yon menyu: kam ishlatiladigan narsalar shu yerda ── */
.sidebar, body.nav-open .sidebar { display: flex; flex-direction: column; width: min(84vw, 300px); background: var(--side-bg); z-index: 70; }
.sidebar { box-shadow: none; }          /* yopiq menyuning soyasi ekran chetiga sizmasin */
body.nav-open .sidebar { box-shadow: 12px 0 40px -20px rgba(0,0,0,.5); }
.nav-overlay { z-index: 65; }
.sidebar #nav { flex: 1; min-height: 0; overflow-y: auto; }
.sidebar #nav a { min-height: 48px; }
.sidebar #nav a.nav-sub { min-height: 44px; padding-left: 52px; font-size: 14px; }
.mb-kim { padding: 18px 16px 10px; color: #fff; }
.mb-kim .who { display: block; font-size: 13px; text-align: left; color: rgba(255,255,255,.75); }
.mb-kim .who b { font-size: 16px; color: #fff; }
.mb-oxiri { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 10px 12px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid rgba(255,255,255,.16); }
.mb-oxiri .icon-btn { width: 40px; color: #fff; }
.mb-oxiri .lang-select { flex: 1; min-width: 84px; width: 84px; padding-right: 2px; }
.mb-oxiri .work-btn { order: -1; width: 100%; min-height: 44px; justify-content: center; }
.mb-oxiri #mb-yangila { order: 1; }
.mb-oxiri #logout { order: 2; }
.ilovada #install-btn { display: none; }

/* ── Maydon va tugmalar ── */
input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]), select, textarea {
  width: 100%; min-height: 44px; font-size: 16px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-2); box-shadow: none;
}
input::placeholder, textarea::placeholder { color: var(--ink-2); opacity: 1; }
label { font-size: 13px; color: var(--ink-2); }
button { min-height: 44px; }
button.small { min-height: 40px; font-size: 13px; }
button.ghost { background: var(--surface); border: 1px solid var(--line-2); box-shadow: none; }
.form-grid { grid-template-columns: 1fr; }
.filters > div { min-width: 0; flex: 1 1 140px; }

/* Filtr yig'iladi: birinchi ekranda ma'lumot ko'rinsin */
.mb-filtr-tugma span { white-space: nowrap; }
.mb-filtr-tugma { display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex: none; min-height: 44px; padding: 0 14px; }
.mb-filtr-tugma b { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--brand); color: #fff; font-size: 12px; line-height: 18px; }
.view .filters.mb-yopiq { display: flex !important; flex-wrap: nowrap; align-items: stretch; gap: 8px; margin-bottom: 12px; }
.filters.mb-yopiq > :not(.mb-qidiruv):not(.mb-filtr-tugma) { display: none; }
.filters.mb-yopiq > .mb-qidiruv { flex: 1; min-width: 0; }
.filters.mb-yopiq > .mb-qidiruv label { display: none; }
.filters.mb-yopiq > .mb-filtr-tugma { width: auto; }
.filters.mb-yopiq > .mb-filtr-tugma.keng { flex: 1 1 100%; width: 100%; max-width: 100%; }
.filters:not(.mb-yopiq) > .mb-filtr-tugma { grid-column: 1 / -1; width: 100%; order: -1; }

/* ── Ko'rsatkichlar ikki ustunda ── */
.grid.cols-4, .grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.stat { padding: 12px; }
.stat .label { font-size: 12px; padding-right: 26px; }
.stat .value { font-size: 19px; }
.stat .sub { font-size: 12px; }
.stat > .em { width: 24px; height: 24px; top: 10px; right: 10px; }

/* ── Jadval o'rniga karta: barmoq bilan yonga surish shart emas ── */
.table-wrap:has(> table.mb-karta), .table-wrap.mb-ichi { background: none; border: 0; box-shadow: none; overflow: visible; }
table.mb-karta, table.mb-karta tbody { display: block; width: 100%; }
table.mb-karta thead { display: none; }
table.mb-karta tr {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px;
  padding: 12px; margin-bottom: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
}
table.mb-karta td { display: block; min-width: 0; padding: 0; border: 0; font-size: 14px; text-align: left; overflow-wrap: anywhere; white-space: normal; }
table.mb-karta td::before { content: attr(data-l); display: block; font-size: 12px; font-weight: 600; color: var(--ink-2); }
table.mb-karta td.mb-sarlavha { grid-column: 1 / -1; font-size: 15px; font-weight: 800; }
table.mb-karta td.mb-sarlavha::before, table.mb-karta td[colspan]::before { display: none; }
table.mb-karta td[colspan] { grid-column: 1 / -1; }
table.mb-karta td.mb-bosh { display: none; }
table.mb-karta td .tag { white-space: normal; }

/* ── Lidlar ── */
.view > .spread .row.grow { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -12px; padding: 0 12px; }
.view > .spread .row.grow > * { flex: none; }
.kanban { gap: 10px; margin: 0 -12px; padding: 2px 12px 12px; scroll-snap-type: x proximity; scroll-padding: 12px; }
.kanban .col { flex: 0 0 calc(100vw - 56px); max-width: none; scroll-snap-align: start; background: color-mix(in srgb, var(--ink) 5%, var(--bg)); box-shadow: none; }
.bxf-row { margin-bottom: 8px; }

/* ── Yozuv o'lchami: 12px dan kichik emas ── */
.tag, .chip, th, small, .small, .muted.small, .badge, .kanban .item, .kanban .item .tag, .kanban .col .count, .jr-tur small { font-size: 12px; }
.tag { padding: 3px 9px; }
.muted, .sub { color: var(--ink-2); }

/* ── Oynalar: butun ekran, shaffofsiz ── */
.modal-back { padding: 0; background: var(--bg); align-items: stretch; }
.modal, .modal.wide, .modal.lead-modal, .modal.rm-modal {
  width: 100%; max-width: none; min-height: 100dvh; border-radius: 0; background: var(--bg); box-shadow: none; border: 0;
}
.modal-head, .lead-modal .modal-head { min-height: 56px; padding: 0 6px 0 16px; background: var(--surface); border-radius: 0; box-shadow: 0 1px 0 var(--line); }
.modal-foot, .lead-modal .modal-foot { position: sticky; bottom: 0; margin: 0; gap: 8px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px)); background: var(--surface); border-radius: 0; box-shadow: 0 -1px 0 var(--line); }
.modal-foot > button { flex: 1; min-height: 48px; }
.modal .x { width: 44px; height: 44px; }
/* Lid kartasi: yopish, nom va saqlash bitta qatorda, kontentga joy qoladi */
.lead-modal .modal-head { display: flex; flex-wrap: nowrap; align-items: center; gap: 4px; height: 56px; padding: 0 8px 0 4px; }
.lead-modal .modal-head h3 { flex: 1; min-width: 0; margin: 0; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.lead-modal .lc-actions { position: static; display: flex; flex: none; gap: 6px; margin: 0; padding: 0; background: none; box-shadow: none; }
.lead-modal .lc-actions button { min-height: 40px; padding: 0 12px; font-size: 14px; }
.lead-modal .lc-actions [data-lc-cancel] { display: none; }      /* «×» bilan bir xil ishlaydi */
.lead-modal .lc-actions .danger { width: 40px; padding: 0; justify-content: center; overflow: hidden; }
.lc-sec, .card { border: 1px solid var(--line); box-shadow: none; }
.lc-stages { scrollbar-width: none; }

/* ── Chat: ro'yxat pastki menyu ustida tugaydi ── */
.chat-side, .chat-oyna { border-radius: 14px; }
.chat-side input, .chat-side select { flex: none; }

/* Interaktiv skript: bosh barmoq bilan tanlash */
.qk-v { min-height: 44px; padding: 0 14px; font-size: 14px; }
/* Pastki panel ixcham: skriptga joy qolsin */
.qk-yakun { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px)); }
.qk-natijalar { grid-column: 1 / -1; display: flex; flex-wrap: nowrap; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -12px; padding: 0 12px; }
.qk-natijalar button { flex: none; white-space: nowrap; }
.qk-izoh { margin: 0; }
.qk-yop { padding: 0 14px; white-space: nowrap; }
