/* Insta CRM — interfeys. Bitta oila: Manrope. Bitta brend rang: plum. Qolgani — status ranglari. */

:root {
  --bg: #F2F3F5;
  --surface: #FFFFFF;
  --surface-2: #F7F8FA;
  --ink: #15181F;
  --ink-2: #5B6270;
  --ink-3: #8C93A1;
  --line: #E3E6EB;
  --line-2: #EEF0F3;

  --plum: #7A1E5C;
  --plum-ink: #5A1444;
  --plum-soft: #F7E9F2;

  --ok: #1B7F5F;   --ok-soft: #E4F3EC;
  --warn: #B7791F; --warn-soft: #FBF1DC;
  --info: #2F6FED; --info-soft: #E7EEFD;
  --bad: #C8452F;  --bad-soft: #FBE7E3;
  --mute: #8A8F98; --mute-soft: #EEF0F3;

  --r-s: 8px; --r-m: 12px; --r-l: 18px;
  --shadow: 0 1px 2px rgba(21,24,31,.05), 0 6px 20px -8px rgba(21,24,31,.12);
  --shadow-lg: 0 24px 60px -20px rgba(21,24,31,.35);
  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --nav-h: 62px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --nav-bg: rgba(255,255,255,.92);
  --invert: #15181F;        /* qorong'u fon ustida oq yozuv (toast, chip, roadmap) */
  --invert-ink: #FFFFFF;
  color-scheme: light;
}

/* ---------- Tungi rejim ---------- */
:root[data-theme="dark"] {
  --bg: #0F1217;
  --surface: #171B22;
  --surface-2: #1E232C;
  --ink: #E9EDF3;
  --ink-2: #A3ACBA;
  --ink-3: #747D8C;
  --line: #2A303A;
  --line-2: #222730;

  --plum: #E07CBC;
  --plum-ink: #F4B7DC;
  --plum-soft: #3A1B2F;

  --ok: #46C79A;   --ok-soft: #10322A;
  --warn: #E5A942; --warn-soft: #3A2D14;
  --info: #6C9BFF; --info-soft: #17243F;
  --bad: #F0765C;  --bad-soft: #3B1D18;
  --mute: #9AA2AF; --mute-soft: #222730;

  --nav-bg: rgba(23,27,34,.92);
  --invert: #E9EDF3;
  --invert-ink: #11141A;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 20px -8px rgba(0,0,0,.6);
  --shadow-lg: 0 24px 60px -20px rgba(0,0,0,.8);
  color-scheme: dark;
}
:root[data-theme="dark"] .brand-mark::after { border-color: var(--bg); }
:root[data-theme="dark"] .kcard { box-shadow: 0 1px 2px rgba(0,0,0,.35); }
:root[data-theme="dark"] img, :root[data-theme="dark"] .donut { filter: none; }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font); font-size: 15px; line-height: 1.45; color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased; font-feature-settings: 'tnum' 1, 'cv11' 1;
  overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 2px solid var(--plum); outline-offset: 2px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* ---------- Boot ---------- */
.boot { height: 100dvh; display: grid; place-items: center; }
.boot-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--plum); animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 0%,100% { transform: scale(.7); opacity: .5 } 50% { transform: scale(1); opacity: 1 } }

/* ---------- Shell ---------- */
.app { min-height: 100dvh; display: flex; flex-direction: column; }
.shell { display: flex; flex-direction: column; min-height: 100dvh; }
.main { flex: 1; padding: 14px 14px calc(var(--nav-h) + var(--safe-b) + 16px); max-width: 1280px; width: 100%; margin: 0 auto; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 2px 12px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.01em; }
.brand-mark { width: 26px; height: 26px; border-radius: 8px; background: var(--plum); position: relative; }
.brand-mark::after { content: ''; position: absolute; inset: 7px; border-radius: 4px; border: 2.5px solid #fff; }
.who { font-size: 13px; color: var(--ink-2); display: flex; align-items: center; gap: 8px; }
.who b { color: var(--ink); font-weight: 700; }
.who .pill { font-size: 11px; }

/* Pastki navigatsiya (telefon) */
.nav { position: fixed; left: 0; right: 0; bottom: 0; height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: var(--nav-bg); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line);
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; z-index: 30; }
.nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--ink-3); }
.nav button svg { width: 22px; height: 22px; }
.nav button.on { color: var(--plum); }
.nav .badge { position: absolute; margin-left: 22px; margin-top: -16px; }
.badge i { display: none; }

/* Desktop: chap panel */
@media (min-width: 900px) {
  .shell { flex-direction: row; }
  .nav { position: sticky; top: 0; height: 100dvh; width: 220px; flex-shrink: 0; border-top: 0; border-right: 1px solid var(--line);
    display: flex; flex-direction: column; padding: 18px 12px; gap: 2px; background: var(--surface); backdrop-filter: none; }
  .nav .nav-brand { padding: 4px 10px 18px; }
  .nav button { flex-direction: row; justify-content: flex-start; gap: 10px; padding: 10px 12px; border-radius: 10px; font-size: 14px; }
  .nav button.on { background: var(--plum-soft); }
  .nav button:hover:not(.on) { background: var(--surface-2); }
  .nav .nav-spacer { flex: 1; }
  .nav .badge { position: static; margin: 0 0 0 auto; padding: 0 9px; height: 20px; border-radius: 10px; }
  .nav .badge i { display: inline; font-style: normal; font-weight: 700; margin-left: 4px; opacity: .85; }
  .main { padding: 22px 28px 40px; }
  .topbar .brand { display: none; }
}
@media (max-width: 899px) { .nav .nav-brand, .nav .nav-spacer, .nav .nav-foot { display: none; } }

/* ---------- Umumiy elementlar ---------- */
.card { background: var(--surface); border-radius: var(--r-l); box-shadow: var(--shadow); }
.section { margin-top: 18px; }
.section-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 2px 10px; }
.section-h h2 { font-size: 15px; font-weight: 800; letter-spacing: -.01em; }
.section-h .count { color: var(--ink-3); font-weight: 600; font-size: 13px; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }
.row { display: flex; align-items: center; gap: 8px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.right { text-align: right; }

.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; line-height: 1.5; white-space: nowrap;
  background: var(--mute-soft); color: var(--ink-2); }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.plum { background: var(--plum-soft); color: var(--plum); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.info { background: var(--info-soft); color: var(--info); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.outline { background: transparent; box-shadow: inset 0 0 0 1px var(--line); }

.badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; gap: 4px; white-space: nowrap; line-height: 1; }
.badge.plum { background: var(--plum); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 40px; padding: 0 14px; border-radius: var(--r-m); font-weight: 700; font-size: 14px;
  background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); transition: background .12s, transform .06s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn:hover { background: #EEF0F3; }
.btn.primary { background: var(--plum); color: #fff; border-color: var(--plum); }
.btn.primary:hover { background: var(--plum-ink); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--plum); }
.btn.ghost:hover { background: var(--plum-soft); }
.btn.danger { color: var(--bad); }
.btn.sm { height: 32px; padding: 0 10px; font-size: 13px; border-radius: 9px; }
.btn.icon { width: 40px; padding: 0; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn svg { width: 18px; height: 18px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; font-weight: 700; color: var(--ink-2); }
.input, select.input, textarea.input { height: 42px; padding: 0 12px; border-radius: var(--r-m); border: 1px solid var(--line); background: var(--surface); width: 100%;
  transition: border-color .12s, box-shadow .12s; }
textarea.input { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; }
select.input { appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 34px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235B6270' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
:root[data-theme="dark"] select.input { background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23A7AEBC' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); }
select.input::-ms-expand { display: none; }
.input:focus { outline: none; border-color: var(--plum); box-shadow: 0 0 0 3px var(--plum-soft); }
.input.err { border-color: var(--bad); }
.input-wrap { position: relative; }
.input-wrap .suffix { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); font-size: 13px; pointer-events: none; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; font-weight: 600; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; transition: all .12s; }
.chip:hover { border-color: var(--ink-3); }
.chip.on { background: var(--invert); color: var(--invert-ink); border-color: var(--invert); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; margin: 0 -14px; padding-left: 14px; padding-right: 14px; }
.chips.scroll::-webkit-scrollbar { display: none; }
@media (min-width: 900px) { .chips.scroll { margin: 0; padding-left: 0; padding-right: 0; flex-wrap: wrap; } }

.seg { display: inline-flex; background: var(--mute-soft); border-radius: 10px; padding: 3px; }
.seg button { height: 30px; padding: 0 12px; border-radius: 8px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }

.empty { padding: 28px 18px; text-align: center; color: var(--ink-2); }
.empty b { display: block; color: var(--ink); font-size: 15px; margin-bottom: 4px; }

.toast-root { position: fixed; top: calc(var(--safe-t, 0px) + 14px); right: 16px; left: auto; bottom: auto; transform: none; z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast { display: flex; align-items: flex-start; gap: 9px; background: var(--invert); color: var(--invert-ink); padding: 11px 15px; border-radius: 14px; font-weight: 600; font-size: 14px; line-height: 1.45; box-shadow: var(--shadow-lg); animation: toast-in .22s ease-out; max-width: min(360px, 92vw); pointer-events: auto; cursor: pointer; }
.toast .ic { flex-shrink: 0; width: 18px; height: 18px; border-radius: 50%; background: color-mix(in srgb, var(--invert-ink) 22%, transparent); display: grid; place-items: center; font-size: 12px; font-weight: 800; margin-top: 1px; }
.toast.out { opacity: 0; transform: translateY(-6px); transition: opacity .2s, transform .2s; }
.toast.bad { background: var(--bad); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px) } to { opacity: 1; transform: none } }
@media (min-width: 900px) { .toast-root { top: 20px; right: 24px; } }

/* ---------- Bugun ---------- */
.hero { padding: 22px 20px 18px; }
.hero h1 { font-size: 26px; line-height: 1.15; font-weight: 800; letter-spacing: -.02em; max-width: 26ch; }
.hero h1 .n { color: var(--plum); }
.hero h1 .n.bad { color: var(--bad); }
.hero .sub { margin-top: 8px; color: var(--ink-2); font-size: 14px; }
.hero-hint { margin-top: 12px; font-size: 12.5px; color: var(--ink-3); line-height: 1.45; }
button.stat { width: 100%; text-align: center; border: 0; font: inherit; cursor: pointer; }
button.stat[disabled] { cursor: default; opacity: .55; }
button.stat:not([disabled]):hover { background: var(--plum-soft); }
.section.flash > .card, .section.flash .lead-list { animation: flash 1.2s ease-out; }
@keyframes flash { 0%, 40% { box-shadow: 0 0 0 3px var(--plum-soft); } 100% { box-shadow: none; } }
.hero-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 18px; }
.stat { background: var(--surface-2); border-radius: var(--r-m); padding: 10px 10px; min-width: 0; }
.stat .v { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.stat .l { font-size: 11px; color: var(--ink-2); font-weight: 600; margin-top: 1px; line-height: 1.2; }
@media (min-width: 900px) { .hero h1 { font-size: 32px; } .hero-stats { grid-template-columns: repeat(4, 1fr); max-width: 760px; } }

.lead-list { display: flex; flex-direction: column; }
.lead-row { display: grid; grid-template-columns: 4px 1fr auto; gap: 12px; align-items: center; padding: 12px 14px 12px 12px; border-top: 1px solid var(--line-2); cursor: pointer; transition: background .1s; text-align: left; width: 100%; }
.lead-row:first-child { border-top: 0; }
.lead-row:hover { background: var(--surface-2); }
.lead-row .rail { width: 4px; height: 36px; border-radius: 2px; background: var(--mute); }
.lead-row .name { font-weight: 700; }
.lead-row .meta { color: var(--ink-2); font-size: 13px; display: flex; gap: 6px; flex-wrap: wrap; margin-top: 1px; }
.lead-row .meta .sep { color: var(--line); }
.lead-row .when { font-size: 13px; font-weight: 700; color: var(--ink-2); text-align: right; white-space: nowrap; }
.lead-row .when.bad { color: var(--bad); }
.lead-row .when.money { color: var(--ok); }
.lead-row .sub { font-size: 12px; color: var(--ink-3); font-weight: 600; }

/* ---------- Lidlar: Kanban ---------- */
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.search { position: relative; flex: 1 1 200px; min-width: 180px; max-width: 420px; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--ink-3); }
.search .input { padding-left: 38px; }

.board { display: flex; gap: 10px; overflow-x: auto; padding: 2px 14px 14px; margin: 0 -14px; scroll-snap-type: x mandatory; scrollbar-width: thin; }
@media (min-width: 900px) { .board { margin: 0; padding: 2px 0 14px; } }
.col { flex: 0 0 min(82vw, 300px); scroll-snap-align: start; background: var(--surface-2); border-radius: var(--r-l); display: flex; flex-direction: column; max-height: calc(100dvh - 230px); }
.col-h { display: flex; align-items: center; gap: 8px; padding: 12px 12px 8px; position: sticky; top: 0; }
.col-h .rail { width: 10px; height: 10px; border-radius: 3px; }
.col-h h3 { font-size: 14px; font-weight: 800; }
.col-h .count { margin-left: auto; color: var(--ink-3); font-weight: 700; font-size: 13px; }
.col-body { overflow-y: auto; padding: 0 8px 8px; display: flex; flex-direction: column; gap: 8px; }
.kcard { background: var(--surface); border-radius: var(--r-m); padding: 10px 12px; box-shadow: 0 1px 2px rgba(21,24,31,.06); cursor: pointer; text-align: left; width: 100%; border: 1px solid transparent; transition: border-color .1s, transform .08s; }
.kcard:hover { border-color: var(--line); }
.kcard:active { transform: scale(.995); }
.kcard .name { font-weight: 700; display: flex; justify-content: space-between; gap: 8px; }
.kcard .name .code { color: var(--ink-3); font-size: 12px; font-weight: 600; }
.kcard .meta { font-size: 12.5px; color: var(--ink-2); margin-top: 3px; display: flex; gap: 6px; flex-wrap: wrap; }
.kcard .foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 12px; color: var(--ink-3); font-weight: 600; }
.kcard .foot .due { font-weight: 700; color: var(--info); }
.kcard .foot .due.bad { color: var(--bad); }
.kcard .foot .money { color: var(--ok); font-weight: 700; }
.col .empty { padding: 18px 10px; font-size: 13px; }

/* ---------- Lidlar: Jadval ---------- */
.table-wrap { overflow: auto; border-radius: var(--r-l); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; background: var(--surface); min-width: 860px; }
.tbl th { text-align: left; font-size: 12px; color: var(--ink-2); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); white-space: nowrap; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; white-space: nowrap; }
.tbl tr:hover td { background: var(--surface-2); }
.tbl tr { cursor: pointer; }
.tbl td.wrapcell { white-space: normal; min-width: 180px; max-width: 320px; color: var(--ink-2); }
.tbl .r { text-align: right; }

/* ---------- Sheet (lid kartasi) ---------- */
.scrim { position: fixed; inset: 0; background: rgba(21,24,31,.45); z-index: 50; animation: fade .18s ease-out; }
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
.sheet { position: fixed; z-index: 51; background: var(--surface); display: flex; flex-direction: column;
  left: 0; right: 0; bottom: 0; max-height: 94dvh; border-radius: 22px 22px 0 0; box-shadow: var(--shadow-lg); animation: up .22s cubic-bezier(.2,.8,.2,1); }
@keyframes up { from { transform: translateY(40px); opacity: .6 } to { transform: none; opacity: 1 } }
.sheet .grab { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 8px auto 0; }
.sheet-h { padding: 12px 18px 10px; display: flex; align-items: flex-start; gap: 12px; }
.sheet-h .title { font-size: 20px; font-weight: 800; letter-spacing: -.01em; line-height: 1.2; }
.sheet-h .subtitle { color: var(--ink-2); font-size: 13px; margin-top: 2px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.sheet-h .close { margin-left: auto; width: 34px; height: 34px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; color: var(--ink-2); flex-shrink: 0; }
.sheet-body { overflow-y: auto; padding: 0 18px calc(18px + var(--safe-b)); }
@media (min-width: 900px) {
  .sheet { left: auto; top: 0; bottom: 0; width: 520px; max-height: none; border-radius: 0; animation: slide .22s cubic-bezier(.2,.8,.2,1); }
  @keyframes slide { from { transform: translateX(40px); opacity: .6 } to { transform: none; opacity: 1 } }
  .sheet .grab { display: none; }
  .sheet-h { padding-top: 22px; }
}

.contact { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 6px 0 14px; }
.contact a, .contact button { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: var(--r-m); background: var(--surface-2); font-weight: 700; font-size: 13.5px; text-align: left; min-width: 0; }
.contact a > span:last-child, .contact button > span:last-child { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.contact svg { width: 18px; height: 18px; color: var(--plum); flex-shrink: 0; }
.contact .lbl { font-size: 11px; color: var(--ink-3); font-weight: 600; display: block; }

.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; padding: 12px 14px; background: var(--surface-2); border-radius: var(--r-m); margin-bottom: 14px; font-size: 13.5px; }
.facts .k { color: var(--ink-3); font-size: 12px; font-weight: 600; }
.facts .v { font-weight: 700; }
.facts .v.edit { cursor: pointer; border-bottom: 1px dashed var(--line); }

.money-bar { height: 8px; border-radius: 4px; background: var(--line-2); overflow: hidden; margin: 6px 0 4px; }
.money-bar i { display: block; height: 100%; background: var(--ok); border-radius: 4px; }
.money-line { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; }
.money-line .rem { color: var(--warn); }

.status-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin: 6px 0 14px; }
.sbtn { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; font-weight: 700; color: var(--ink-2); text-align: left; transition: all .1s; }
.sbtn .dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.sbtn:hover { border-color: var(--ink-3); }
.sbtn.on { color: var(--ink); border-color: var(--ink); background: var(--surface-2); }

.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.quick .btn { height: 44px; }

.timeline { display: flex; flex-direction: column; gap: 0; margin-top: 4px; }
.ev { display: grid; grid-template-columns: 22px 1fr; gap: 10px; padding: 8px 0; position: relative; }
.ev::before { content: ''; position: absolute; left: 10px; top: 28px; bottom: -8px; width: 2px; background: var(--line-2); }
.ev:last-child::before { display: none; }
.ev .ic { width: 22px; height: 22px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; color: var(--ink-2); font-size: 12px; z-index: 1; }
.ev .ic.ok { background: var(--ok-soft); color: var(--ok); }
.ev .ic.bad { background: var(--bad-soft); color: var(--bad); }
.ev .ic.info { background: var(--info-soft); color: var(--info); }
.ev .ic.plum { background: var(--plum-soft); color: var(--plum); }
.ev .t { font-size: 13.5px; }
.ev .t b { font-weight: 700; }
.ev .d { font-size: 12px; color: var(--ink-3); margin-top: 1px; }
.ev .txt { margin-top: 3px; padding: 6px 10px; background: var(--surface-2); border-radius: 8px; font-size: 13px; color: var(--ink-2); white-space: pre-wrap; }

.note-box { display: flex; gap: 8px; align-items: flex-end; margin-bottom: 14px; }
.note-box textarea { min-height: 44px; height: 44px; }

.subform { background: var(--surface-2); border-radius: var(--r-m); padding: 12px; margin-bottom: 14px; display: flex; flex-direction: column; gap: 10px; animation: fade .15s; }
.subform h4 { margin: 0; font-size: 14px; font-weight: 800; }
.subform .actions { display: flex; gap: 8px; justify-content: flex-end; }
.date-quick { display: flex; gap: 6px; flex-wrap: wrap; }

.dup { background: var(--warn-soft); color: #7A4E0A; padding: 10px 12px; border-radius: var(--r-m); font-size: 13px; margin-bottom: 12px; }
.newalert { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: var(--plum); color: #fff; border: 0; border-radius: var(--r-l); padding: 14px 16px; margin-bottom: 14px; box-shadow: 0 12px 28px -16px var(--plum); }
.newalert .n { flex: 0 0 auto; min-width: 38px; height: 38px; border-radius: 12px; background: rgba(255,255,255,.18); display: grid; place-items: center; font-size: 18px; font-weight: 800; }
.newalert b { font-size: 15px; font-weight: 800; }
.newalert .s { font-size: 12.5px; opacity: .8; margin-top: 1px; }
.newalert .go { flex: 0 0 auto; font-size: 13.5px; font-weight: 700; opacity: .9; }
.cpick { position: relative; display: inline-block; }
.cbtn { display: inline-flex; align-items: center; gap: 6px; height: 42px; padding: 0 10px 0 8px; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); cursor: pointer; }
.cbtn svg { width: 16px; height: 16px; color: var(--ink-3); }
.cpop { display: none; position: absolute; z-index: 60; top: calc(100% + 6px); left: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); box-shadow: var(--shadow-lg); padding: 12px; width: 318px; }
.cpick.open .cpop { display: block; }
.swgrid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; }
.sw { aspect-ratio: 1; width: 100%; border-radius: 5px; border: 2px solid transparent; box-shadow: inset 0 0 0 1px rgba(0,0,0,.1); cursor: pointer; transition: transform .1s; }
.sw:hover { transform: scale(1.25); z-index: 2; position: relative; }
.sw.on { border-color: var(--ink); box-shadow: inset 0 0 0 2px var(--surface), 0 0 0 1px var(--ink); }
.cprow { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.cprev { width: 26px; height: 26px; border-radius: 7px; border: 1px solid var(--line); flex: 0 0 auto; }
.iconbtn { width: 36px; height: 36px; border-radius: 10px; display: inline-grid; place-items: center; color: var(--ink-2); background: transparent; border: 0; cursor: pointer; flex: 0 0 auto; }
.iconbtn:hover { background: var(--surface-2); color: var(--ink); }
.iconbtn svg { width: 18px; height: 18px; }
.cprow .iconbtn { position: relative; overflow: hidden; border: 1px solid var(--line); }
.iconbtn.danger { color: var(--bad); }
.iconbtn.danger:hover { background: var(--bad-soft, color-mix(in srgb, var(--bad) 10%, transparent)); }
.formprev { position: relative; display: block; width: 100%; height: 148px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #F2F3F5; cursor: zoom-in; padding: 0; margin: 2px 0 8px; }
.formprev iframe { position: absolute; top: 0; left: 50%; width: 440px; height: 700px; border: 0; transform: scale(.42) translateX(-50%); transform-origin: top left; pointer-events: none; }
.formprev .fpv-lbl { position: absolute; left: 0; right: 0; bottom: 0; padding: 20px 10px 7px; font-size: 11.5px; font-weight: 700; color: var(--ink-2); background: linear-gradient(to top, var(--surface) 55%, transparent); text-align: center; }
.formprev:hover { border-color: var(--plum); }
.formprev:hover .fpv-lbl { color: var(--plum); }
.modal.wide { max-width: 940px; width: calc(100vw - 32px); }
.keywrap { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.mypos { display: flex; align-items: center; gap: 12px; background: var(--plum); color: #fff; border-radius: var(--r-l); padding: 14px 16px; margin-bottom: 12px; }
.mypos .pl { min-width: 38px; height: 38px; border-radius: 12px; background: rgba(255,255,255,.18); display: grid; place-items: center; font-size: 17px; font-weight: 800; }
.mypos b { font-size: 15px; }
.mypos .s { font-size: 12.5px; opacity: .85; margin-top: 2px; }
.lb { padding: 14px 16px; }
.lbtabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.lbrow { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.lbrow:last-child { border-bottom: 0; }
.lbrow .pl { width: 26px; text-align: center; font-size: 17px; font-weight: 800; color: var(--ink-3); flex: 0 0 auto; }
.lbrow .grow { min-width: 0; flex: 1; }
.lbrow .grow b { font-size: 14.5px; }
.lbrow .lbbar { height: 5px; border-radius: 3px; background: var(--surface-2); margin-top: 5px; overflow: hidden; }
.lbrow .lbbar i { display: block; height: 100%; border-radius: 3px; background: var(--plum); }
.lbrow .amt { text-align: right; flex: 0 0 auto; }
.lbrow .amt b { display: block; font-size: 15px; font-weight: 800; }
.lbrow .amt i { font-style: normal; font-size: 11.5px; color: var(--ink-3); }
.lbrow { cursor: pointer; }
.lbrow .lbsub { font-size: 11.5px; color: var(--ink-3); margin-top: 4px; }
.lbrow.open { background: var(--surface-2); border-radius: 10px 10px 0 0; padding-left: 8px; padding-right: 8px; border-bottom: 0; }
.lbdet { background: var(--surface-2); border-radius: 0 0 10px 10px; padding: 4px 12px 12px; margin-bottom: 8px; }
.lbd { display: grid; grid-template-columns: 96px 1fr 72px; gap: 10px; align-items: center; font-size: 12.5px; padding: 3px 0; }
.lbd .k { color: var(--ink-2); font-weight: 700; }
.lbd .t { height: 6px; border-radius: 3px; background: var(--line-2); overflow: hidden; }
.lbd .t i { display: block; height: 100%; background: var(--plum); border-radius: 3px; }
.lbd .v { text-align: right; font-weight: 800; }
.lbd .v .muted { font-weight: 600; }
.lbfacts { font-size: 11.5px; color: var(--ink-3); margin-top: 8px; line-height: 1.5; }
.lbrow.me { background: var(--plum-soft); border-radius: 10px; padding-left: 8px; padding-right: 8px; }
.lbrow.me .lbbar i { background: var(--plum); }
.lbsep { text-align: center; color: var(--ink-3); letter-spacing: 4px; padding: 4px 0; }
.stpick { position: relative; margin-bottom: 12px; }
.stbtn { display: flex; align-items: center; gap: 10px; width: 100%; padding: 13px 14px; border-radius: var(--r-m); border: 1px solid var(--line); background: color-mix(in srgb, var(--c) 8%, var(--surface)); cursor: pointer; text-align: left; }
.stbtn .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: 0 0 auto; }
.stbtn b { font-size: 15.5px; font-weight: 800; color: var(--c); }
.stbtn .hint { margin-left: auto; font-size: 12px; color: var(--ink-3); }
.stbtn svg { width: 16px; height: 16px; color: var(--ink-3); }
.stpick.open .stbtn { border-color: var(--c); }
.stmenu { display: none; position: absolute; z-index: 60; top: calc(100% + 6px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); box-shadow: var(--shadow-lg); padding: 6px; max-height: 320px; overflow: auto; }
.stpick.open .stmenu { display: block; }
.stitem { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; background: none; border-radius: 10px; cursor: pointer; font-size: 14.5px; text-align: left; color: var(--ink); }
.stitem .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); flex: 0 0 auto; }
.stitem .grow { flex: 1; }
.stitem svg { width: 15px; height: 15px; color: var(--c); }
.stitem:hover { background: var(--surface-2); }
.stitem.on { font-weight: 800; color: var(--c); }
.prevtabs { display: flex; gap: 6px; margin-bottom: 10px; }
.keyprev { background: #F2F3F5; border-right: 1px solid var(--line); min-height: 520px; display: grid; place-items: center; padding: 14px; }
.keyprev { display: block; }
.keyprev iframe { width: 100%; height: 480px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
@media (max-width: 760px) { .keywrap { grid-template-columns: 1fr; } .keyprev { border-right: 0; border-bottom: 1px solid var(--line); min-height: 0; } .keyprev iframe { height: 380px; } }
.moreinfo { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 2px; }
.moreinfo > summary { cursor: pointer; font-size: 13px; font-weight: 700; color: var(--ink-2); list-style: none; padding: 4px 0; }
.moreinfo > summary::-webkit-details-marker { display: none; }
.moreinfo > summary::before { content: '▸ '; color: var(--ink-3); }
.moreinfo[open] > summary::before { content: '▾ '; }
.moreinfo > *:not(summary) { margin-top: 10px; }
.nowrap { white-space: nowrap; }
.selname { display: flex; align-items: center; gap: 10px; }
.selname b { font-size: 14.5px; }
.tbl .warn-t { color: var(--warn); font-weight: 700; }
.tbl .bad-t { color: var(--bad); font-weight: 700; }
.tbl .ok-t { color: var(--ok); }
.tbl tr.total td { background: var(--surface-2); border-top: 1px solid var(--line); }
.srow { gap: 10px; flex-wrap: wrap; }
.snums { display: flex; gap: 14px; flex-wrap: wrap; margin-left: auto; }
.snums > span { display: flex; flex-direction: column; align-items: flex-end; min-width: 52px; }
.snums b { font-size: 15px; font-weight: 800; }
.snums i { font-style: normal; font-size: 11px; color: var(--ink-3); }
.snums .bad b { color: var(--bad); } .snums .warn b { color: var(--warn); } .snums .ok b { color: var(--ok); }
.srow.total { background: var(--surface-2); }
.cphide { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dupgroup { border: 1px solid var(--line); border-radius: var(--r-m); padding: 10px 12px; margin-bottom: 10px; }
.dupgroup .dgh { font-size: 12.5px; color: var(--ink-2); margin-bottom: 6px; }
.dgrow { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; cursor: pointer; }
.dgrow:hover { background: var(--surface-2); }
.dgrow input { width: 18px; height: 18px; flex: 0 0 auto; accent-color: var(--plum); }
.dgrow .grow { min-width: 0; }
.dgrow .s { font-size: 12.5px; color: var(--ink-2); margin-top: 2px; }
.dupgroup .actions { justify-content: flex-end; margin-top: 4px; }
.dupcard { background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); border-radius: var(--r-m); padding: 12px 14px; margin-bottom: 12px; }
.dupcard .dt { font-size: 12.5px; font-weight: 800; color: var(--warn); margin-bottom: 6px; }
.dupcard .dn { font-size: 16px; font-weight: 800; }
.dupcard .dr { font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.dupcard .dr.muted { color: var(--ink-3); font-size: 12.5px; }

/* ---------- Dashboard ---------- */
.grid { display: grid; gap: 12px; }
.grid.kpis { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 700px) { .grid.kpis { grid-template-columns: repeat(4, 1fr); } }
.grid.two { grid-template-columns: 1fr; }
@media (min-width: 900px) { .grid.two { grid-template-columns: 1fr 1fr; } }
.kpi { padding: 14px 16px; }
.kpi .v { font-size: 24px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.kpi .l { font-size: 12.5px; color: var(--ink-2); font-weight: 600; margin-top: 4px; }
.kpi .d { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.kpi.alert .v { color: var(--bad); }
.kpi.money .v { color: var(--ok); }

.bars { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.bar { display: grid; grid-template-columns: 150px 1fr 56px; gap: 10px; align-items: center; font-size: 13px; }
.bar .lbl { font-weight: 700; color: var(--ink-2); display: flex; align-items: center; gap: 6px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.bar .lbl .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.bar .track { height: 10px; border-radius: 5px; background: var(--line-2); overflow: hidden; }
.bar .track i { display: block; height: 100%; border-radius: 5px; background: var(--plum); }
.bar .n { text-align: right; font-weight: 800; }
@media (max-width: 480px) { .bar { grid-template-columns: 110px 1fr 48px; } }

.risk { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line-2); }
.risk:first-child { border-top: 0; }
.risk .n { font-size: 22px; font-weight: 800; color: var(--bad); min-width: 44px; }
.risk .n.ok { color: var(--ok); }
.risk .t { font-weight: 700; }
.risk .s { font-size: 12.5px; color: var(--ink-2); }

/* ---------- Sozlamalar / ro'yxatlar ---------- */
.list { display: flex; flex-direction: column; }
.list-row { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-top: 1px solid var(--line-2); }
.list-row:first-child { border-top: 0; }
.list-row .dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.list-row .t { font-weight: 700; }
.list-row .s { font-size: 12.5px; color: var(--ink-2); }
.list-row .off { opacity: .5; }
.switch { width: 38px; height: 22px; border-radius: 11px; background: var(--line); position: relative; transition: background .15s; flex-shrink: 0; }
.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch.on { background: var(--ok); }
.switch.on::after { transform: translateX(16px); }

.form { display: flex; flex-direction: column; gap: 12px; padding: 16px; }
.form .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form .actions { display: flex; gap: 8px; justify-content: flex-end; }

.code-block { background: var(--invert); color: var(--invert-ink); padding: 12px 14px; border-radius: var(--r-m); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; overflow-x: auto; white-space: pre; }

.demo-banner { background: var(--warn-soft); color: var(--warn); font-size: 12.5px; font-weight: 600; padding: 6px 14px; text-align: center; }

.gate { min-height: 100dvh; display: grid; place-items: center; padding: 24px; background: radial-gradient(1200px 600px at 50% -10%, var(--plum-soft) 0%, transparent 60%), var(--bg); }
.gate .card { padding: 28px 24px; max-width: 420px; width: 100%; text-align: center; }
.gate-card { max-width: 380px !important; padding: 34px 28px 30px !important; border-radius: 22px; box-shadow: 0 1px 2px rgba(21,24,31,.04), 0 30px 60px -28px rgba(21,24,31,.28); }
.gate h1 { font-size: 22px; font-weight: 800; margin: 14px 0 6px; }
.gate p { color: var(--ink-2); }
.gate .idbox { margin: 16px 0; font-size: 22px; font-weight: 800; letter-spacing: .04em; background: var(--surface-2); padding: 10px; border-radius: 10px; }

/* ---------- Manba linklari ---------- */
.linkgrid { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .linkgrid { grid-template-columns: 1fr 1fr; } }
.linkgrid > * { min-width: 0; }
.linkcard { min-width: 0; border: 1px solid var(--line); border-radius: var(--r-m); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; background: var(--surface); }
.linkcard.off { opacity: .55; }
.linkcard .t { font-weight: 800; overflow-wrap: anywhere; }
.linkcard .s { font-size: 12.5px; color: var(--ink-2); overflow-wrap: anywhere; }
.linkcard .grow { min-width: 0; }
.linkrow { display: flex; gap: 6px; align-items: center; min-width: 0; }
.linkrow .btn { flex: 0 0 auto; }
.linkrow code { flex: 1; min-width: 0; background: var(--surface-2); padding: 7px 10px; border-radius: 8px; font-size: 12.5px; }
.newlink { border-top: 1px dashed var(--line); padding-top: 14px; display: flex; flex-direction: column; gap: 12px; }
.tbl.summary td, .tbl.summary th { padding: 11px 12px; }
.tbl tr.total td { background: var(--surface-2); border-top: 2px solid var(--line); cursor: default; }
.tbl tr.total:hover td { background: var(--surface-2); }

/* ---------- Boshqaruv: jamoa ---------- */
.teamgrid { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 1200px) { .teamgrid { grid-template-columns: 1fr 1fr; } }
.team { background: var(--surface); border-radius: var(--r-l); box-shadow: var(--shadow); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; border-left: 4px solid var(--ok); }
.team.alarm { border-left-color: var(--bad); }
.team-nums { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--ink-2); }
.team-nums b { color: inherit; font-weight: 800; }
.tbl.matrix th, .tbl.matrix td { padding: 8px 10px; font-size: 13px; }
.tbl.matrix td.muted { color: var(--line); }
.tbl.matrix tr:not(.total) { cursor: pointer; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }

.grid > div, .grid.two > div { min-width: 0; }
.main { min-width: 0; overflow-x: hidden; }
.section, .card { min-width: 0; }

/* ---------- Sozlamalar ---------- */
.h3 { font-size: 15px; font-weight: 800; margin: 0; }
.editbox { flex-basis: 100%; background: var(--surface-2); border-radius: var(--r-m); padding: 12px; margin-top: 8px; display: flex; flex-direction: column; gap: 10px; }
.editbox .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.editbox .actions { display: flex; gap: 8px; justify-content: flex-end; }
.cred { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.cred > div { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; min-width: 0; overflow-wrap: anywhere; }
.cred .k { display: block; font-size: 11.5px; color: var(--ink-3); font-weight: 600; }
.cred b { font-size: 15px; }
@media (max-width: 700px) { .cred { grid-template-columns: 1fr; } }
button.who { background: none; border: 0; cursor: pointer; }
.gate .field label { text-align: left; }

/* ---------- Yo'l xaritasi (burchak vidjeti) ---------- */
.roadmap { position: fixed; right: 14px; bottom: calc(var(--nav-h) + var(--safe-b) + 12px); z-index: 40; font-family: var(--font); }
@media (min-width: 900px) { .roadmap { bottom: 16px; } }
.rm-pill { display: flex; align-items: center; gap: 10px; background: var(--invert); color: var(--invert-ink); border-radius: 999px; padding: 6px 12px 6px 8px; box-shadow: var(--shadow-lg); cursor: pointer; }
.rm-track { position: relative; display: flex; gap: 3px; align-items: center; width: 96px; height: 22px; padding: 0 2px; }
.rm-track i { flex: 1; height: 3px; border-radius: 2px; background: color-mix(in srgb, var(--invert-ink) 22%, transparent); }
.rm-track i.done { background: #4ADE80; }
.rm-track i.cur { background: #FBBF24; }
.rm-walker { position: absolute; top: -2px; width: 18px; height: 18px; margin-left: -9px; color: #fff; transition: left .6s; }
.rm-walker svg { width: 18px; height: 18px; }
.rm-legA { animation: rm-leg 0.7s ease-in-out infinite; transform-origin: 12px 13px; }
.rm-legB { animation: rm-leg 0.7s ease-in-out infinite reverse; transform-origin: 12px 13px; }
.rm-armA { animation: rm-leg 0.7s ease-in-out infinite reverse; transform-origin: 12px 8px; }
.rm-armB { animation: rm-leg 0.7s ease-in-out infinite; transform-origin: 12px 8px; }
@keyframes rm-leg { 0%,100% { transform: rotate(-22deg) } 50% { transform: rotate(22deg) } }
.rm-walker { animation: rm-bob 0.7s ease-in-out infinite; }
@keyframes rm-bob { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-1.5px) } }
.rm-text { font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.rm-text b { font-weight: 800; }
.rm-pct { opacity: .6; margin-left: 4px; }
.rm-panel { display: none; position: absolute; right: 0; bottom: 44px; width: min(380px, calc(100vw - 28px)); max-height: 70vh; overflow-y: auto; background: var(--surface); color: var(--ink); border-radius: var(--r-l); box-shadow: var(--shadow-lg); padding: 12px 14px; }
.roadmap.open .rm-panel { display: block; }
.rm-h { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.rm-row { display: grid; grid-template-columns: 22px 1fr; gap: 8px; padding: 7px 0; border-top: 1px solid var(--line-2); }
.rm-row:first-of-type { border-top: 0; }
.rm-n { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800; background: var(--mute-soft); color: var(--ink-2); }
.rm-row.done .rm-n { background: var(--ok-soft); color: var(--ok); }
.rm-row.cur .rm-n { background: var(--warn-soft); color: var(--warn); }
.rm-row.cur .rm-name { color: var(--plum); }
.rm-name { font-size: 13px; font-weight: 700; }
.rm-bar { height: 4px; border-radius: 2px; background: var(--line-2); margin: 3px 0; overflow: hidden; }
.rm-bar i { display: block; height: 100%; background: var(--plum); }
.rm-row.done .rm-bar i { background: var(--ok); }
@media (prefers-reduced-motion: reduce) { .rm-legA, .rm-legB, .rm-armA, .rm-armB, .rm-walker { animation: none; } }

/* ---------- Sotuvchi paneli: FAB, modal, chat, status ---------- */
.fab { position: fixed; right: 18px; bottom: calc(var(--nav-h) + var(--safe-b) + 18px); z-index: 35; display: inline-flex; align-items: center; gap: 6px; height: 48px; padding: 0 18px 0 14px; border-radius: 999px; background: var(--plum); color: #fff; font-weight: 800; font-size: 15px; box-shadow: var(--shadow-lg); cursor: grab; touch-action: none; user-select: none; }
.fab:active { cursor: grabbing; }
.fab svg { width: 20px; height: 20px; }
@media (min-width: 900px) { .fab { bottom: 72px; } }
.modal { position: fixed; z-index: 61; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(460px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow-y: auto; background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-lg); animation: fade .15s; }
#modal-root .scrim { z-index: 60; }
.modal-h { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 0; font-size: 17px; }
.modal-h .close { width: 32px; height: 32px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; color: var(--ink-2); }
.modal-h .close svg { width: 16px; height: 16px; }
.newlead textarea.input { min-height: 64px; }
.status-select { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 12px; border-radius: var(--r-m); background: color-mix(in srgb, var(--c) 12%, #fff); margin: 2px 0 12px; cursor: pointer; }
.status-select .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex-shrink: 0; }
.status-select select { flex: 1; height: 100%; border: 0; background: transparent; font-weight: 800; font-size: 15px; color: var(--c); cursor: pointer; outline: none; }
.quick.three { grid-template-columns: repeat(3, 1fr); }
.chat { display: flex; flex-direction: column; gap: 6px; max-height: 340px; min-height: 120px; overflow-y: auto; padding: 10px; background: var(--surface-2); border-radius: var(--r-m); }
.msg { display: flex; }
.msg.mine { justify-content: flex-end; }
.bubble { max-width: 82%; padding: 7px 10px 5px; border-radius: 14px 14px 14px 4px; background: var(--surface); font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; box-shadow: 0 1px 1px rgba(21,24,31,.06); }
.msg.mine .bubble { background: var(--plum-soft); border-radius: 14px 14px 4px 14px; }
.bubble .mt { display: inline-block; margin-left: 8px; font-size: 10.5px; color: var(--ink-3); font-weight: 600; float: right; margin-top: 4px; }
.svc { display: flex; justify-content: center; }
.svc span { font-size: 11.5px; font-weight: 600; color: var(--ink-2); background: rgba(21,24,31,.06); padding: 2px 10px; border-radius: 999px; text-align: center; }
.composer { display: flex; gap: 8px; align-items: flex-end; margin: 8px 0 4px; }
.composer textarea { min-height: 42px; height: 42px; max-height: 120px; border-radius: 21px; padding: 10px 14px; resize: none; }
.composer .btn.icon { border-radius: 50%; flex-shrink: 0; }
.card.me { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.card.mecard { padding: 14px 16px; display: flex; flex-direction: row; align-items: center; gap: 14px; flex-wrap: wrap; }
.card.mecard .btn { flex-shrink: 0; }
.avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--plum-soft); color: var(--plum); display: grid; place-items: center; font-weight: 800; flex-shrink: 0; }
.me-name { font-size: 18px; font-weight: 800; letter-spacing: -.01em; }
.me-today { text-align: left; padding: 12px 14px; border-radius: var(--r-m); background: var(--surface-2); font-size: 15px; }
.donut-card { display: flex; align-items: center; gap: 18px; padding: 16px; }
.donut { width: 120px; height: 120px; flex-shrink: 0; }
.donut-legend { display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.donut-legend > div { display: flex; justify-content: space-between; gap: 10px; }
.donut-legend .k { color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; }
.donut-legend i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.ndot { width: 8px; height: 8px; border-radius: 50%; background: transparent; flex-shrink: 0; }
.ndot.on { background: var(--plum); }

.gate .input::placeholder { color: var(--ink-3); opacity: .55; }

/* ---------- Lidlar: ko'rinish tugmalari, filtr, surib o'tkazish ---------- */
.viewsw { display: inline-flex; gap: 2px; }
.viewsw button { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: var(--ink-3); }
.viewsw button svg { width: 20px; height: 20px; }
.viewsw button.on { color: var(--plum); background: var(--plum-soft); }
.fsel .input { width: auto; height: 40px; max-width: 190px; }
.fpanel { display: grid; grid-template-columns: 200px 1fr; margin-bottom: 12px; overflow: hidden; max-width: 640px; }
.fp-presets { display: flex; flex-direction: column; border-right: 1px solid var(--line-2); padding: 6px; }
.fp-presets button { text-align: left; padding: 10px 12px; border-radius: 10px; font-weight: 600; font-size: 14px; color: var(--ink-2); }
.fp-presets button.on { color: var(--plum); background: var(--plum-soft); }
.fp-fields { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.fp-fields .fsel .input { width: 100%; max-width: none; }
@media (max-width: 640px) { .fpanel { grid-template-columns: 1fr; } .fp-presets { flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line-2); } }
.kcard[draggable="true"] { cursor: grab; }
.kcard.dragging { opacity: .4; }
.col.over { outline: 2px dashed var(--plum); outline-offset: -2px; background: var(--plum-soft); }
@media (max-width: 620px) {
  .toolbar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .toolbar::-webkit-scrollbar { display: none; }
  .toolbar .search { flex: 1 0 150px; min-width: 150px; }
  .fsel .input { max-width: 140px; }
  .toolbar > .muted.small { display: none; }
}

.roles { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--ink-2); background: var(--surface-2); border-radius: var(--r-m); padding: 10px 12px; }
.roles b { color: var(--ink); }
.card.mecard .grow { min-width: 110px; }
@media (max-width: 560px) { .card.mecard .btn, .card.mecard a.btn { flex: 1 1 100%; justify-content: center; } }
.hint { font-size: 12px; color: var(--ink-3); margin-top: 4px; line-height: 1.4; }
.user-row { width: 100%; text-align: left; cursor: pointer; }
.user-row:hover { background: var(--surface-2); }
.btn.danger.ghost { background: transparent; color: var(--bad); }
.btn.danger.ghost:hover { background: var(--bad-soft); }
.btn.danger.ghost svg { width: 17px; height: 17px; }

.list-row.msg { align-items: flex-start; gap: 10px; }
.msg-text { margin-top: 3px; font-size: 14.5px; line-height: 1.5; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.facts .v.linklike { display: inline-flex; align-items: center; gap: 5px; color: var(--plum); cursor: pointer; font-weight: 700; }
.facts .v.linklike svg { width: 13px; height: 13px; opacity: .6; }
.chatfab { position: fixed; left: 18px; bottom: calc(var(--nav-h) + var(--safe-b) + 18px); z-index: 35; width: 48px; height: 48px; border-radius: 50%; background: var(--surface); color: var(--plum); display: grid; place-items: center; box-shadow: var(--shadow-lg); border: 1px solid var(--line-2); }
.chatfab svg { width: 22px; height: 22px; }
.chatfab .dot { position: absolute; top: -3px; right: -3px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--bad); color: #fff; font-size: 11.5px; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--surface); animation: dotpop .25s ease-out; }
.chatfab.has-new { border-color: var(--plum); box-shadow: var(--shadow-lg), 0 0 0 4px var(--plum-soft); }
@keyframes dotpop { from { transform: scale(.4); opacity: 0 } to { transform: scale(1); opacity: 1 } }
@media (min-width: 900px) { .chatfab { bottom: 72px; } }
.tag-repeat { display: inline-flex; align-items: center; gap: 3px; background: var(--warn-soft); color: var(--warn); font-size: 11.5px; font-weight: 800; padding: 2px 7px; border-radius: 999px; white-space: nowrap; }
.kcard .tag-repeat { margin-top: 4px; }
/* Internetsiz rejim */
.offbar { position: fixed; left: 0; right: 0; top: 0; z-index: 90; padding: 8px 14px; font-size: 13px; font-weight: 600; text-align: center; background: var(--plum-soft); color: var(--plum); box-shadow: 0 1px 4px rgba(21,24,31,.08); }
.offbar.off { background: var(--warn-soft); color: var(--warn); }
.tag-pending { display: inline-flex; align-items: center; gap: 3px; background: var(--mute-soft); color: var(--ink-2); font-size: 11.5px; font-weight: 800; padding: 2px 7px; border-radius: 999px; white-space: nowrap; margin-left: 4px; }
/* Kirish sahifasi */
.gate-brand { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 22px; }
.gate-mark { width: 54px; height: 54px; border-radius: 17px; background: var(--plum); position: relative; box-shadow: 0 10px 24px -10px var(--plum); }
.gate-mark::after { content: ''; position: absolute; inset: 15px; border-radius: 7px; border: 3px solid #fff; }
.gate-brand h1 { font-size: 21px; font-weight: 800; letter-spacing: -.02em; margin: 0; }
.gate-msg { font-size: 13.5px; color: var(--bad); background: var(--bad-soft); border-radius: 10px; padding: 8px 12px; margin-bottom: 14px; }
.gate-form { display: flex; flex-direction: column; gap: 10px; }
.gate-form .input { height: 48px; border-radius: 14px; text-align: left; font-size: 15px; padding: 0 16px; }
.gate-form .btn.primary { height: 48px; border-radius: 14px; font-size: 15.5px; margin-top: 4px; }
.gate-id { margin: 14px 0 0; line-height: 1.5; }
.gate-or { display: flex; align-items: center; gap: 12px; margin: 20px 0 14px; color: var(--ink-3); font-size: 12px; }
.gate-or::before, .gate-or::after { content: ''; flex: 1; height: 1px; background: var(--line-2); }
.gate-demo-link { width: 100%; padding: 6px 0; border: 0; background: none; color: var(--plum); font-weight: 700; font-size: 14.5px; text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1.5px; text-decoration-color: color-mix(in srgb, var(--plum) 35%, transparent); cursor: pointer; transition: opacity .12s; }
.gate-demo-link:hover { opacity: .65; }
.demo-banner #demo-exit { background: none; border: 0; color: inherit; cursor: pointer; }
.topbar .iconbtn { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: var(--ink-2); margin-left: auto; margin-right: 4px; }
.topbar .iconbtn:hover { background: var(--surface-2); color: var(--ink); }
.topbar .iconbtn svg { width: 19px; height: 19px; }

/* Til tanlash: UZ | RU */
.langsw { display: inline-flex; margin-left: auto; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 2px; }
.langsw button { min-width: 36px; height: 26px; padding: 0 9px; border-radius: 999px; font-size: 11.5px; font-weight: 800; letter-spacing: .03em; color: var(--ink-3); }
.langsw button.on { background: var(--plum); color: #fff; }
.langsw + .iconbtn { margin-left: 4px; }
