:root {
  --bg: #0b1222;
  --bg-2: #0f1729;
  --panel: #141d33;
  --panel-2: #1a2540;
  --line: #24314f;
  --line-2: #2f3e61;
  --text: #e8edf7;
  --muted: #8d9bb8;
  --dim: #64728f;
  --blue: #2aa4f4;
  --blue-2: #1d8fdc;
  --green: #22c55e;
  --green-bg: #0f3b2a;
  --green-line: #1f7a4d;
  --red: #f05252;
  --red-bg: #3d1620;
  --red-line: #8a2a3a;
  --orange: #f59e0b;
  --orange-bg: #3a2810;
  --orange-line: #8a5a14;
  --gray-bg: #232c40;
  --gray-line: #3a4560;
  --violet: #8b7cf6;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(1200px 600px at 80% -10%, #16244a 0%, transparent 60%) fixed, var(--bg);
  color: var(--text);
  font: 15px/1.5 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
svg.ic { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Layout ---------- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px;
  padding: 20px 14px; background: rgba(15, 23, 41, .85); border-right: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; font-weight: 800; font-size: 17px; letter-spacing: -.01em; }
.brand .logo { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(135deg, var(--blue), #1565c0); box-shadow: 0 6px 18px rgba(42, 164, 244, .35); }
.brand .logo svg { width: 20px; height: 20px; fill: #fff; stroke: none; }
.brand small { display: block; font-size: 11px; font-weight: 500; color: var(--muted); }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 12px; border-radius: 12px; color: var(--muted);
  font-weight: 600; cursor: pointer; border: 0; background: none; text-align: left; width: 100%;
}
.nav-item:hover { background: var(--panel); color: var(--text); text-decoration: none; }
.nav-item.active { background: linear-gradient(90deg, rgba(42, 164, 244, .18), rgba(42, 164, 244, .04)); color: #fff; box-shadow: inset 3px 0 0 var(--blue); }
.nav-item .badge { margin-left: auto; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.me { display: flex; align-items: center; gap: 10px; padding: 6px 8px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--panel-2); border: 1px solid var(--line-2); flex: none; }
.me .who { min-width: 0; }
.me .who b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.me .who span { font-size: 12px; color: var(--muted); }

.main { padding: 28px 32px 60px; min-width: 0; }
.page-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { margin: 0; font-size: 26px; letter-spacing: -.02em; }
.page-head .sub { color: var(--muted); font-size: 14px; margin-top: 2px; }
.page-head .spacer { flex: 1; }

/* ---------- Components ---------- */
.card { background: linear-gradient(180deg, var(--panel), #121a2e); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card h2 { margin: 0 0 14px; font-size: 17px; display: flex; align-items: center; gap: 10px; }
.card h2 .spacer { flex: 1; }
.card .hint { color: var(--muted); font-size: 13.5px; margin: -6px 0 14px; }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mt { margin-top: 18px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line-2);
  background: var(--panel-2); color: var(--text); padding: 11px 18px; border-radius: 12px; font-weight: 600;
  cursor: pointer; transition: .15s; white-space: nowrap; min-height: 44px;
}
.btn:hover { border-color: var(--blue); }
.btn:disabled { opacity: .55; cursor: progress; }
.btn.primary { background: linear-gradient(180deg, var(--blue), var(--blue-2)); border-color: transparent; color: #fff; box-shadow: 0 6px 18px rgba(42, 164, 244, .25); }
.btn.green { background: linear-gradient(180deg, #27c564, #17a34a); border-color: transparent; color: #fff; }
.btn.red { background: linear-gradient(180deg, #f05252, #d43c3c); border-color: transparent; color: #fff; }
.btn.ghost { background: transparent; }
.btn.danger-ghost { background: transparent; color: #ff8a8a; border-color: var(--red-line); }
.btn.sm { padding: 6px 12px; min-height: 34px; font-size: 13.5px; border-radius: 10px; }
.btn.lg { padding: 16px 24px; font-size: 17px; min-height: 56px; border-radius: 14px; }
.btn.icon { padding: 0; width: 38px; min-height: 38px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 12px 14px;
  outline: none; min-height: 46px; transition: border-color .15s;
}
.input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(42, 164, 244, .15); }
textarea.input { min-height: 110px; resize: vertical; line-height: 1.5; }
.pw { position: relative; }
.pw .input { padding-right: 48px; }
.pw button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--muted); cursor: pointer; padding: 8px; }

.chips { display: inline-flex; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 4px; gap: 2px; }
.chips button { border: 0; background: none; padding: 8px 14px; border-radius: 9px; color: var(--muted); cursor: pointer; font-weight: 600; font-size: 14px; }
.chips button.on { background: var(--panel-2); color: #fff; box-shadow: 0 1px 0 var(--line-2) inset; }
.lang-switch button { padding: 6px 10px; font-size: 13px; }

.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--gray-bg); color: var(--muted); }
.badge.green { background: rgba(34, 197, 94, .15); color: #4ade80; }
.badge.red { background: rgba(240, 82, 82, .15); color: #ff8a8a; }
.badge.orange { background: rgba(245, 158, 11, .15); color: #fbbf24; }
.badge.blue { background: rgba(42, 164, 244, .15); color: #6cc4ff; }
.badge.violet { background: rgba(139, 124, 246, .18); color: #b3a8ff; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--dim); display: inline-block; }
.dot.on { background: var(--green); box-shadow: 0 0 0 4px rgba(34, 197, 94, .15); }

.switch { position: relative; width: 50px; height: 28px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch i { position: absolute; inset: 0; background: var(--line-2); border-radius: 99px; cursor: pointer; transition: .2s; }
.switch i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: .2s; }
.switch input:checked + i { background: var(--green); }
.switch input:checked + i::after { transform: translateX(22px); }
.toggle-row { display: flex; align-items: center; gap: 14px; justify-content: space-between; padding: 12px 14px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; }

/* ---------- KPI ---------- */
.kpi { position: relative; overflow: hidden; }
.kpi .label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 600; font-size: 14px; }
.kpi .value { font-size: 28px; font-weight: 800; margin-top: 8px; letter-spacing: -.02em; }
.kpi .value small { font-size: 14px; color: var(--muted); font-weight: 600; margin-left: 4px; }
.kpi.green { background: linear-gradient(160deg, #10372a, #0f2a22); border-color: var(--green-line); }
.kpi.red { background: linear-gradient(160deg, #3a1622, #2a121b); border-color: var(--red-line); }
.kpi.blue { background: linear-gradient(160deg, #10284a, #0f1f3a); border-color: #1f4f85; }
.kpi.warn { background: linear-gradient(160deg, #3a1622, #2a121b); border-color: var(--red-line); cursor: pointer; }
.kpi .kpi-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: rgba(255, 255, 255, .06); position: absolute; right: 16px; top: 16px; }

/* ---------- Chat groups ---------- */
.groups { display: grid; gap: 12px; }
.group-card { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px; border: 1px solid; cursor: pointer; font-weight: 700; }
.group-card .n { margin-left: auto; font-size: 22px; font-weight: 800; }
.group-card.buyer { background: var(--green-bg); border-color: var(--green-line); }
.group-card.unanswered { background: var(--red-bg); border-color: var(--red-line); }
.group-card.complaint { background: var(--orange-bg); border-color: var(--orange-line); }
.group-card.personal { background: var(--gray-bg); border-color: var(--gray-line); color: var(--muted); }

/* ---------- Charts ---------- */
.chart { width: 100%; height: 240px; display: block; }
.chart text { fill: var(--dim); font-size: 11px; font-family: inherit; }
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.bars { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: center; }
.bar-row .rank { width: 26px; height: 26px; border-radius: 8px; background: var(--panel-2); display: grid; place-items: center; font-weight: 800; font-size: 13px; color: var(--muted); }
.bar-row .name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { height: 8px; border-radius: 99px; background: var(--bg-2); margin-top: 6px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--blue), var(--violet)); }
.bar-row .cnt { font-weight: 800; color: var(--text); }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }
.empty svg { width: 36px; height: 36px; opacity: .5; margin-bottom: 8px; }

/* ---------- Chats ---------- */
.tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.tab { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; font-weight: 700; color: var(--muted); text-align: left; }
.tab .n { margin-left: auto; font-size: 18px; }
.tab.buyer.on { background: var(--green-bg); border-color: var(--green); color: #fff; }
.tab.unanswered.on { background: var(--red-bg); border-color: var(--red); color: #fff; }
.tab.complaint.on { background: var(--orange-bg); border-color: var(--orange); color: #fff; }
.tab.personal.on { background: var(--gray-bg); border-color: #6b7690; color: #fff; }
.tab.buyer .n { color: #4ade80; }
.tab.unanswered .n { color: #ff8a8a; }
.tab.complaint .n { color: #fbbf24; }
.chat-wrap { display: grid; grid-template-columns: 360px 1fr; gap: 16px; height: calc(100vh - 230px); min-height: 480px; }
.chat-list { display: flex; flex-direction: column; overflow: hidden; padding: 12px; }
.chat-list .scroll { overflow-y: auto; flex: 1; margin: 10px -4px 0; padding: 0 4px; }
.chat-item { display: flex; gap: 12px; padding: 12px; border-radius: 12px; cursor: pointer; border: 1px solid transparent; }
.chat-item:hover { background: var(--panel-2); }
.chat-item.on { background: var(--panel-2); border-color: var(--line-2); }
.chat-item .meta { min-width: 0; flex: 1; }
.chat-item .top { display: flex; gap: 8px; align-items: center; }
.chat-item b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14.5px; }
.chat-item time { margin-left: auto; font-size: 12px; color: var(--dim); flex: none; }
.chat-item p { margin: 2px 0 0; color: var(--muted); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item.unanswered .avatar { border-color: var(--red); color: #ff8a8a; }
.conv { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.conv-head { padding: 16px 18px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; }
.conv-head .who { display: flex; align-items: center; gap: 12px; }
.conv-body { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 10px; background: linear-gradient(180deg, transparent, rgba(0, 0, 0, .12)); }
.msg { max-width: 75%; padding: 10px 14px; border-radius: 16px; white-space: pre-wrap; word-wrap: break-word; font-size: 14.5px; }
.msg.in { align-self: flex-start; background: var(--panel-2); border-bottom-left-radius: 4px; }
.msg.out { align-self: flex-end; background: linear-gradient(180deg, #1d6fb0, #185d95); border-bottom-right-radius: 4px; }
.msg .t { display: block; font-size: 11px; color: rgba(255, 255, 255, .55); margin-top: 4px; text-align: right; }
.conv-foot { display: flex; gap: 10px; padding: 14px; border-top: 1px solid var(--line); }
.conv-foot .input { min-height: 48px; }
.notice { padding: 12px 14px; border-radius: 12px; background: var(--orange-bg); border: 1px solid var(--orange-line); color: #fcd38d; font-size: 14px; }
.notice.blue { background: rgba(42, 164, 244, .08); border-color: #1f4f85; color: #a9d8ff; }
.notice.red { background: var(--red-bg); border-color: var(--red-line); color: #ffb3b3; }
.back-btn { display: none; }

/* ---------- Products ---------- */
.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.product { display: flex; flex-direction: column; gap: 10px; padding: 16px; }
.product .pname { font-weight: 700; font-size: 15.5px; line-height: 1.35; }
.product .price { font-size: 20px; font-weight: 800; color: #6cc4ff; }
.product .stats { display: flex; gap: 14px; font-size: 13px; color: var(--muted); }
.product .actions { display: flex; gap: 8px; margin-top: auto; flex-wrap: wrap; }
.channel-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-2); flex-wrap: wrap; }
.channel-row .ch-ic { width: 40px; height: 40px; border-radius: 12px; background: rgba(42, 164, 244, .15); color: var(--blue); display: grid; place-items: center; }

/* ---------- Tables / lists ---------- */
.list { display: flex; flex-direction: column; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
.list-row .grow { flex: 1; min-width: 0; }
.amount { font-weight: 800; white-space: nowrap; }
.amount.income { color: #4ade80; }
.amount.expense { color: #ff8a8a; }
.task-row input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--green); flex: none; }
.task-row.done .grow b { text-decoration: line-through; color: var(--dim); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; }

/* ---------- Connection wizard ---------- */
.wizard { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.step { position: relative; border-radius: var(--radius); padding: 20px; border: 1px solid; display: flex; flex-direction: column; gap: 12px; }
.step.s1 { background: linear-gradient(160deg, #0f3b2a, #0f2a22); border-color: var(--green-line); }
.step.s2 { background: linear-gradient(160deg, #10284a, #0f1f3a); border-color: #1f4f85; }
.step.s3 { background: linear-gradient(160deg, #3a2414, #2a1a10); border-color: #7a4a20; }
.step .num { font-size: 22px; font-weight: 800; opacity: .7; }
.step .step-ic { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: rgba(255, 255, 255, .08); }
.step .step-ic svg { width: 28px; height: 28px; }
.step h3 { margin: 0; font-size: 17px; }
.step ol { margin: 0; padding-left: 18px; color: var(--muted); font-size: 13.5px; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login { width: 100%; max-width: 420px; padding: 32px; box-shadow: var(--shadow); }
.login .lock { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; margin: 4px auto 14px; background: linear-gradient(135deg, var(--blue), #1565c0); box-shadow: 0 10px 30px rgba(42, 164, 244, .35); }
.login .lock svg { width: 30px; height: 30px; color: #fff; }
.login h1 { text-align: center; margin: 0; font-size: 24px; }
.login p.lead { text-align: center; color: var(--muted); margin: 6px 0 22px; }
.login .top { display: flex; justify-content: flex-end; margin: -12px -12px 6px 0; }
.err { color: #ff8a8a; font-size: 14px; min-height: 20px; }

/* ---------- Modal / toast ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(3, 7, 18, .7); display: grid; place-items: center; z-index: 50; padding: 16px; backdrop-filter: blur(3px); }
.modal { width: 100%; max-width: 520px; max-height: calc(100vh - 32px); overflow-y: auto; box-shadow: var(--shadow); }
.modal h2 { font-size: 19px; }
#toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 60; }
.toast { background: var(--panel-2); border: 1px solid var(--line-2); padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow); max-width: 360px; animation: pop .2s ease; }
.toast.ok { border-color: var(--green-line); }
.toast.bad { border-color: var(--red-line); color: #ffb3b3; }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }
.spinner { width: 18px; height: 18px; border: 2px solid rgba(255, 255, 255, .25); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { display: grid; place-items: center; padding: 60px; }
pre.report { white-space: pre-wrap; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px; font-family: inherit; font-size: 14px; line-height: 1.6; margin: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wizard { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side {
    position: fixed; bottom: 0; top: auto; left: 0; right: 0; height: auto; flex-direction: row; z-index: 40;
    padding: 6px; border-right: 0; border-top: 1px solid var(--line); background: rgba(11, 18, 34, .97); gap: 2px;
  }
  .side .brand, .side-foot { display: none; }
  .nav-item { flex-direction: column; gap: 3px; padding: 8px 2px; font-size: 10.5px; justify-content: center; text-align: center; border-radius: 10px; }
  .nav-item.active { box-shadow: none; }
  .nav-item .badge { position: absolute; margin: -6px 0 0 18px; padding: 1px 6px; }
  .nav-item { position: relative; }
  .nav-label-long { display: none; }
  .side .nav-label-short { display: block; white-space: nowrap; }
  .main { padding: 18px 16px 96px; }
  .mobile-top { display: flex !important; }
  .g2, .g3, .span2 { grid-template-columns: 1fr; grid-column: auto; }
  .tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chat-wrap { grid-template-columns: 1fr; height: auto; }
  .chat-wrap.has-open .chat-list { display: none; }
  .chat-wrap:not(.has-open) .conv { display: none; }
  .conv { height: calc(100vh - 170px); }
  .back-btn { display: inline-flex; }
  .page-head h1 { font-size: 22px; }
  .msg { max-width: 88%; }
}
@media (max-width: 520px) {
  .g4 { grid-template-columns: 1fr; }
  .kpi .value { font-size: 24px; }
  .login { padding: 24px 18px; }
}
.nav-label-short { display: none; }
.mobile-top { display: none; align-items: center; gap: 10px; margin-bottom: 14px; }
.mobile-top .spacer { flex: 1; }

/* ---------- Birinchi sozlash (startup) ---------- */
.setup-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center; max-width: 1180px; margin: 0 auto; padding: 40px 32px; }
.hero h1 { font-size: 44px; line-height: 1.1; letter-spacing: -.03em; margin: 44px 0 14px; background: linear-gradient(90deg, #fff, #8fd0ff 60%, #b3a8ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lead { color: var(--muted); font-size: 17px; margin: 0 0 30px; max-width: 520px; }
.hero-feature { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: rgba(20, 29, 51, .6); }
.hero-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: rgba(42, 164, 244, .14); color: var(--blue); flex: none; }
.setup-card { padding: 30px; box-shadow: var(--shadow); }
.onboarding { margin-bottom: 18px; background: linear-gradient(135deg, #12284a, #141d33 60%); border-color: #1f4f85; }
.ob-rocket { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 24px; background: rgba(255, 255, 255, .07); }
.ob-count { font-size: 20px; color: #6cc4ff; }
.ob-steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.ob-step { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line-2); color: var(--text); font-weight: 600; font-size: 14px; }
.ob-step:hover { border-color: var(--blue); text-decoration: none; }
.ob-step.done { opacity: .6; border-color: var(--green-line); }
.ob-num { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--panel-2); font-size: 13px; flex: none; }
.ob-step.done .ob-num { background: var(--green); color: #fff; }
.ob-step.done .ob-num svg { width: 16px; height: 16px; }
.ob-go { margin-left: auto; color: var(--blue); }
@media (max-width: 1180px) { .ob-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .setup-wrap { grid-template-columns: 1fr; gap: 24px; padding: 20px 16px; }
  .hero h1 { font-size: 30px; margin-top: 24px; }
  .hero .stack { display: none; }
  .setup-card { padding: 22px 18px; }
  .ob-steps { grid-template-columns: 1fr; }
}

/* ---------- Login havolalari ---------- */
.login-links { text-align: center; margin-top: 14px; font-size: 14px; }

/* ---------- Super-Admin: buyurtmalar ---------- */
.nav-admin { margin-top: 8px; border: 1px dashed var(--line-2); }
.orders { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.order { display: flex; flex-direction: column; gap: 12px; }
.order-contacts { display: flex; gap: 8px; flex-wrap: wrap; }
.order-contacts .btn { text-decoration: none; }
.order-contacts svg { width: 16px; height: 16px; }

/* ---------- Birinchi kirish ustasi ---------- */
.wizard-page { min-height: 100vh; max-width: 680px; margin: 0 auto; padding: 22px 16px 60px; }
.wz-top { display: flex; align-items: center; gap: 10px; margin-bottom: 26px; }
.wz-progress { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.wz-progress span { height: 6px; border-radius: 99px; background: var(--line); }
.wz-progress span.done { background: var(--green); }
.wz-progress span.on { background: linear-gradient(90deg, var(--blue), var(--violet)); }
.wz-steplabel { color: var(--muted); font-size: 13px; font-weight: 600; margin: 10px 0 16px; }
.wz-card { padding: 30px; display: flex; flex-direction: column; gap: 16px; box-shadow: var(--shadow); }
.wz-card h1 { margin: 0; font-size: 28px; letter-spacing: -.02em; }
.wz-card .lead { margin: 0; color: var(--muted); font-size: 16px; }
.wz-emoji { font-size: 44px; line-height: 1; }
.wz-ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; color: var(--text); }
.wz-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
@media (max-width: 560px) { .wz-card { padding: 22px 18px; } .wz-card h1 { font-size: 23px; } .orders { grid-template-columns: 1fr; } }

/* ---------- Mahsulot rasmlari va DEMO ---------- */
.badge.demo { background: rgba(245, 158, 11, .16); color: #fbbf24; letter-spacing: .04em; }
.product.has-img { padding-top: 0; overflow: hidden; }
.p-img { position: relative; margin: 0 -16px 4px; aspect-ratio: 4 / 3; overflow: hidden; background: var(--bg-2); }
.p-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s ease; }
.product:hover .p-img img { transform: scale(1.05); }
.p-sold-out { position: absolute; inset: auto 10px 10px auto; padding: 4px 10px; border-radius: 99px; background: rgba(240, 82, 82, .9); color: #fff; font-size: 12px; font-weight: 800; }
.product.has-img .p-img + .row { margin-top: 4px; }
.rank-img { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; flex: none; }
.bar-row:has(.rank-img) { grid-template-columns: 40px 1fr auto; }
.demo-notice { margin-bottom: 18px; background: rgba(245, 158, 11, .08); border-color: var(--orange-line); color: #fcd38d; }
.demo-notice a { color: #fbbf24; font-weight: 700; }

/* ---------- Buyurtmalar ---------- */
.order-card { display: flex; flex-direction: column; gap: 12px; }
.order-items { display: flex; flex-direction: column; gap: 8px; }
.oi { display: flex; align-items: center; gap: 10px; }
.oi img { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; flex: none; }
.oi .grow { min-width: 0; } .oi b { font-size: 14px; }
@media (max-width: 900px) {
  .side { overflow-x: auto; justify-content: flex-start; }
  .nav-item { min-width: 64px; flex: 1 0 64px; }
}

.o-history summary { cursor: pointer; }
.o-history .o-ev { padding: 3px 0; border-left: 2px solid var(--line-2); padding-left: 10px; margin-left: 4px; }
.badge.violet { background: rgba(139, 124, 246, .18); color: #b3a8ff; }

/* ---- Mahsulot rasmlari: yuklash / havola / galereya ---- */
.p-count { position: absolute; left: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 99px; background: rgba(11, 18, 34, .78); color: #fff; font-size: 12px; font-weight: 700; backdrop-filter: blur(4px); }
.p-count .ic { width: 14px; height: 14px; }
.img-picker > span.row { justify-content: space-between; }
.img-count { font-weight: 600; color: var(--dim); font-variant-numeric: tabular-nums; }
.img-tabs { display: flex; align-self: stretch; }
.img-tabs button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; padding-inline: 8px; }
.img-tabs .ic { width: 16px; height: 16px; }
.img-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; padding: 22px 16px; border: 1.5px dashed var(--line-2); border-radius: 14px; background: var(--bg-2); cursor: pointer; transition: border-color .15s, background .15s; }
.img-drop:hover, .img-drop:focus-visible, .img-drop.over { border-color: var(--blue); background: rgba(42, 164, 244, .07); outline: none; }
.img-drop .ic.lg { width: 30px; height: 30px; color: var(--blue); }
.img-link { display: flex; flex-direction: column; gap: 6px; }
.img-link .row { gap: 8px; flex-wrap: nowrap; }
.img-link .input { flex: 1; min-width: 0; }
.img-link .row > .btn { flex: none; }
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 8px; margin-top: 4px; }
.img-tile { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--bg-2); border: 1px solid var(--line-2); cursor: grab; }
.img-tile.is-main { border: 2px solid var(--blue); }
.img-tile.dragging { opacity: .4; }
.img-tile.loading { display: grid; place-items: center; cursor: default; }
.img-tile.broken img { visibility: hidden; }
.img-tile.broken::after { content: "⚠"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--orange); font-size: 22px; }
.img-tile img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.img-main { position: absolute; left: 4px; bottom: 4px; padding: 2px 7px; border-radius: 99px; background: var(--blue); color: #fff; font-size: 10.5px; font-weight: 800; }
.img-act { position: absolute; top: 4px; width: 26px; height: 26px; border: 0; border-radius: 50%; display: grid; place-items: center; background: rgba(11, 18, 34, .78); color: #fff; cursor: pointer; font-size: 12px; padding: 0; }
.img-act.del { right: 4px; }
.img-act.star { left: 4px; }
.img-act .ic { width: 14px; height: 14px; }
.img-act:hover { background: var(--blue); }
.img-act.del:hover { background: var(--red); }
@media (hover: hover) { .img-tile .img-act { opacity: 0; transition: opacity .15s; } .img-tile:hover .img-act, .img-act:focus-visible { opacity: 1; } }

/* ---- Mahsulot formasi: bo'limlar, xususiyatlar, variantlar, qoldiq ---- */
.form-sec { display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: rgba(15, 23, 41, .45); }
.form-sec-head { display: flex; flex-direction: column; gap: 2px; }
.form-sec-head b { font-size: 15px; }
.stack.sm { gap: 10px; }
.row.wrap { flex-wrap: wrap; gap: 6px; }
.kv-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: 8px; align-items: center; }
.chip-btn { border: 1px dashed var(--line-2); background: transparent; color: var(--muted); border-radius: 99px; padding: 5px 11px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.chip-btn:hover { border-color: var(--blue); color: #fff; }
.opt-card { display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); }
.opt-card .row { gap: 8px; flex-wrap: nowrap; }
.opt-card .opt-name { flex: 1; min-width: 0; font-weight: 700; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 44px; padding: 6px 8px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--bg); cursor: text; }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 4px 6px 4px 10px; border-radius: 99px; background: rgba(42, 164, 244, .16); color: #cfe9ff; font-size: 13px; font-weight: 600; }
.tag button { border: 0; background: none; color: inherit; cursor: pointer; font-size: 15px; line-height: 1; padding: 0 2px; opacity: .7; }
.tag button:hover { opacity: 1; }
.tag-input { flex: 1; min-width: 120px; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; padding: 4px; }
.var-table { display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow-y: auto; }
.var-row { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(70px, .7fr) minmax(90px, .9fr); gap: 8px; align-items: center; }
.var-row.head span { font-size: 12px; font-weight: 700; color: var(--dim); text-transform: uppercase; letter-spacing: .03em; }
.var-row .var-name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.var-row .input { padding: 9px 10px; }
.p-stock { display: flex; flex-wrap: wrap; gap: 10px; font-size: 13px; font-weight: 600; }
.p-stock.low { color: var(--orange); }
@media (max-width: 560px) { .kv-row { grid-template-columns: 1fr 1fr auto; } }

/* ---- Kunlik hisobot oynasi ---- */
.modal:has(.rep-list), .modal:has(.rep-kpis) { max-width: 720px; }
.rep-kpis .kpi .value { font-size: 18px; }
.rep-summary { white-space: pre-line; line-height: 1.55; font-size: 14px; }
.rep-advice { margin-top: 10px; }
.rep-advice ul { margin: 6px 0 0; padding-left: 20px; }
.rep-list { display: flex; flex-direction: column; gap: 8px; }
.rep-item { display: flex; gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-2); }
.rep-item img, .rep-item .avatar { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; flex: none; }
.rep-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.rep-vars { display: flex; flex-wrap: wrap; gap: 5px; }
.rep-vars .tag { padding: 3px 9px; font-size: 12px; }
.rep-vars small { opacity: .75; font-weight: 500; }
.rep-num { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; }
.rep-num small { color: var(--muted); font-size: 12px; }
.rep-num small.warn { color: var(--orange); font-weight: 700; }
.opt-card .row.wrap { flex-wrap: wrap; }
.chip-btn { white-space: nowrap; }

/* ---- Sahifa bo'limlari (tab) ---- */
.page-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 18px; padding: 5px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; }
.page-tabs::-webkit-scrollbar { display: none; }
.page-tabs button { flex: 1 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border: 0; border-radius: 10px; background: none; color: var(--muted); font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; transition: background .15s, color .15s; }
.page-tabs button:hover { color: var(--text); }
.page-tabs button.on { background: var(--panel-2); color: #fff; box-shadow: 0 1px 0 var(--line-2) inset; }
.pt-ic { font-size: 16px; }
.pt-badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--red); color: #fff; font-size: 11px; font-weight: 800; display: inline-grid; place-items: center; }
.stack.lg { gap: 18px; }

/* ---- AI provayder tanlash ---- */
.ai-providers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.ai-prov { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 14px; border-radius: 14px; border: 1.5px solid var(--line-2); background: var(--bg-2); color: var(--text); font: inherit; text-align: left; cursor: pointer; transition: border-color .15s, background .15s; }
.ai-prov:hover { border-color: var(--blue); }
.ai-prov.on { border-color: var(--blue); background: rgba(42, 164, 244, .1); }
.ai-prov b { font-size: 16px; }
.ai-prov small { color: var(--muted); }
.ai-prov .badge { margin-top: 4px; }
.ai-logo { font-size: 22px; line-height: 1; }
.notice.green-notice { background: var(--green-bg); border-color: var(--green-line); color: #c9f5da; }
@media (max-width: 560px) { .ai-providers { grid-template-columns: 1fr 1fr 1fr; gap: 6px; } .ai-prov { padding: 10px; } .ai-prov small { display: none; } .page-tabs button { padding: 9px 12px; font-size: 13px; } }

/* Mirvays AI Agent logosi */
.brand .logo { background: #0b1222; overflow: hidden; }
.brand .logo img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Bo'sh nishonchalar ko'rinmasin (badge display hidden atributini bosib ketmasin) */
[hidden] { display: none !important; }
