:root {
  --brand: #16558f; --brand-600: #124a7d; --brand-50: #eef4fb; --brand-100: #dbe8f6;
  --bg: #f4f6fa; --surface: #ffffff; --line: #e6eaf0; --line-2: #eef1f5;
  --text: #0f1b2d; --text-2: #475467; --muted: #8a94a6;
  --green: #12b76a; --green-50: #ecfdf3; --red: #f04438; --red-50: #fef3f2; --amber: #f79009; --amber-50: #fffaeb;
  --indigo: #6172f3; --indigo-50: #eef4ff; --slate-50: #f2f4f7;
  --radius: 14px; --shadow-xs: 0 1px 2px rgba(16,24,40,.05); --shadow: 0 1px 3px rgba(16,24,40,.06), 0 1px 2px rgba(16,24,40,.04);
  --shadow-lg: 0 20px 40px -12px rgba(16,24,40,.18);
  --green-t: #067647; --red-t: #b42318; --amber-t: #b54708; --indigo-t: #3538cd;
  --green-b: #abefc6; --amber-b: #fedf89; --red-b: #fecdca;
  --input-border: #d0d5dd; --thead: #f9fafb; --hover: #fafbfc; --row-new: #f3fbf6; --topbar: rgba(255,255,255,.88);
  --chart-grid: #eef1f5; --knob: #ffffff;
  color-scheme: light;
}
/* ---------- Tungi rejim ---------- */
:root[data-theme="dark"] {
  --brand: #5b9bd8; --brand-600: #4a8ac7; --brand-50: rgba(91,155,216,.14); --brand-100: rgba(91,155,216,.3);
  --bg: #0d131f; --surface: #151d2c; --line: #243049; --line-2: #1d273a;
  --text: #e7edf6; --text-2: #b4c0d3; --muted: #7c89a0;
  --green-50: rgba(18,183,106,.14); --red-50: rgba(240,68,56,.14); --amber-50: rgba(247,144,9,.14); --indigo-50: rgba(97,114,243,.16); --slate-50: #1b2435;
  --green-t: #6ce9a6; --red-t: #fda29b; --amber-t: #fec84b; --indigo-t: #a4bcfd;
  --green-b: rgba(18,183,106,.35); --amber-b: rgba(247,144,9,.35); --red-b: rgba(240,68,56,.4);
  --input-border: #2d3a55; --thead: #1a2334; --hover: #182131; --row-new: rgba(18,183,106,.09); --topbar: rgba(21,29,44,.88);
  --chart-grid: #222d42; --knob: #e7edf6;
  --shadow-xs: 0 1px 2px rgba(0,0,0,.3); --shadow: 0 2px 6px rgba(0,0,0,.35); --shadow-lg: 0 20px 40px -12px rgba(0,0,0,.6);
  color-scheme: dark;
}
:root[data-theme="dark"] .brand-logo, :root[data-theme="dark"] .login-logo, :root[data-theme="dark"] .mib-brand img { background: #fff; }
body, .side, .card, .kpi, .topbar { transition: background-color .2s, border-color .2s; }

/* ---------- Yon panelni yig'ish ---------- */
.side { transition: width .2s ease, padding .2s ease, transform .25s ease; }
@media (min-width: 901px) {
  .side-collapsed .side { width: 76px; padding: 0 12px; }
  .side-collapsed .brand { justify-content: center; padding-left: 0; padding-right: 0; }
  .side-collapsed .brand > div, .side-collapsed .nav-label, .side-collapsed #connText, .side-collapsed #clock, .side-collapsed #logoutBtn { display: none !important; }
  .side-collapsed .nav-label + nav, .side-collapsed nav + .nav-label { margin-top: 10px; }
  .side-collapsed nav a { font-size: 0; justify-content: center; padding: 11px 0; gap: 0; position: relative; }
  .side-collapsed nav a .nav-count { position: absolute; top: 2px; right: 4px; margin: 0; font-size: 10px; line-height: 16px; padding: 0 5px; }
  .side-collapsed .side-foot { display: flex; justify-content: center; }
  .side-collapsed .conn { margin: 0; }
}
.side-backdrop { display: none; }
.mib-off .mib-only { display: none !important; }
.topbar-left { display: flex; align-items: center; gap: 14px; }
.icon-btn { width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); cursor: pointer; transition: background .15s, color .15s; }
.icon-btn:hover { background: var(--slate-50); color: var(--text); }
.icon-btn .i { width: 18px; height: 18px; }
:root[data-theme="dark"] .icon-btn .sun { display: block; } :root[data-theme="dark"] .icon-btn .moon { display: none; }
.icon-btn .sun { display: none; }
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14px/1.5 Inter, "Segoe UI", system-ui, sans-serif; background: var(--bg); color: var(--text); display: flex; min-height: 100vh; -webkit-font-smoothing: antialiased; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: "JetBrains Mono", Consolas, monospace; }
.w-full { width: 100%; justify-content: center; }
a { color: var(--brand); cursor: pointer; text-decoration: none; }
.link { font-size: 13px; font-weight: 600; }
.link:hover { text-decoration: underline; }
.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
h3 { margin: 0; font-size: 15px; font-weight: 600; }
.card-head p { margin: 2px 0 0; font-size: 13px; }

/* ---------- Sidebar ---------- */
.side { width: 256px; background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; flex-shrink: 0; padding: 0 14px; }
.brand { display: flex; gap: 12px; align-items: center; padding: 22px 8px 20px; border-bottom: 1px solid var(--line-2); margin-bottom: 10px; }
.brand-logo { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 1px var(--line); }
.brand b { font-size: 17px; letter-spacing: -.2px; color: var(--brand); display: block; }
.brand small { color: var(--muted); font-size: 12px; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; padding: 14px 10px 6px; }
nav { display: flex; flex-direction: column; gap: 2px; }
nav a { white-space: nowrap; color: var(--text-2); padding: 9px 12px; border-radius: 10px; display: flex; align-items: center; gap: 11px; font-weight: 500; transition: background .15s, color .15s; }
nav a:hover { background: var(--slate-50); color: var(--text); }
nav a.active { background: var(--brand-50); color: var(--brand); font-weight: 600; }
nav a.active .i { stroke: var(--brand); }
/* Yon menyu belgilari — hajmli (3D) rangli plitka: gradient + yaltiroq tepa + qalin pastki qirra + rangli soya (foydalanuvchi talabi) */
nav a .ico3d { position: relative; width: 30px; height: 30px; flex-shrink: 0; display: grid; place-items: center; border-radius: 9px;
  background: linear-gradient(150deg, var(--a) 0%, var(--b) 100%);
  box-shadow: inset 0 1px 1px rgba(255,255,255,.55), inset 0 -3px 0 rgba(0,0,0,.22), 0 4px 8px -2px color-mix(in srgb, var(--b) 60%, transparent), 0 1px 2px rgba(0,0,0,.18);
  transform: perspective(120px) rotateX(0) rotateY(0); transition: transform .25s cubic-bezier(.2,.8,.2,1.4), box-shadow .25s; }
nav a .ico3d::before { content: ''; position: absolute; inset: 2px 3px 50% 3px; border-radius: 7px 7px 10px 10px / 7px 7px 5px 5px;
  background: linear-gradient(180deg, rgba(255,255,255,.55), rgba(255,255,255,0)); pointer-events: none; }
nav a .ico3d .i { position: relative; width: 16px; height: 16px; stroke: #fff !important; stroke-width: 2.2; filter: drop-shadow(0 1px 1px rgba(0,0,0,.35)); }
nav a:hover .ico3d { transform: perspective(120px) rotateX(14deg) rotateY(-14deg) translateY(-1px);
  box-shadow: inset 0 1px 1px rgba(255,255,255,.6), inset 0 -3px 0 rgba(0,0,0,.22), 5px 7px 12px -3px color-mix(in srgb, var(--b) 65%, transparent), 0 1px 2px rgba(0,0,0,.18); }
nav a.active .ico3d { transform: perspective(120px) translateY(-1px) scale(1.06);
  box-shadow: inset 0 1px 1px rgba(255,255,255,.6), inset 0 -3px 0 rgba(0,0,0,.25), 0 6px 14px -3px color-mix(in srgb, var(--b) 75%, transparent), 0 0 0 2px color-mix(in srgb, var(--a) 35%, transparent); }
nav a:has(.ico3d) { padding-top: 5px; padding-bottom: 5px; }
.side-collapsed nav a .ico3d { width: 34px; height: 34px; border-radius: 10px; }
.side-collapsed nav a .ico3d .i { width: 18px; height: 18px; }
nav a .i.ext { width: 14px; height: 14px; margin-left: auto; opacity: .5; }
.nav-count { margin-left: auto; background: var(--brand); color: #fff; border-radius: 20px; padding: 0 8px; font-size: 11px; font-weight: 600; line-height: 19px; }
.nav-count:empty, .nav-count[data-zero] { display: none; }
.nav-count.green { background: var(--green); }
.nav-count.red { background: var(--red); }
.side-foot { margin-top: auto; padding: 16px 8px; border-top: 1px solid var(--line-2); font-size: 13px; }
/* Ma'lumot manbalari (Asosiy baza, MIB, ADOLAT): yashil miltillaydi — ishlayapti, qizil — uzilgan */
.manbalar { display: flex; flex-direction: column; gap: 5px; margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--line-2); }
.manba { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-weight: 600; font-size: 12.5px; cursor: default; }
.mdot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.mdot.ok { background: var(--green); animation: miltilla 1.2s ease-in-out infinite; }
.mdot.off { background: var(--red); box-shadow: 0 0 0 3px rgba(240,68,56,.2); }
@keyframes miltilla { 0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(18,183,106,.55); } 50% { opacity: .35; box-shadow: 0 0 0 4px rgba(18,183,106,0); } }
@media (prefers-reduced-motion: reduce) { .mdot.ok { animation: none; } }
.side-collapsed .manba span:not(.mdot) { display: none; }
.side-collapsed .manbalar { align-items: center; }
.conn { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-weight: 500; margin-bottom: 4px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); }
.dot.on { background: var(--green); box-shadow: 0 0 0 3px rgba(18,183,106,.18); }

/* ---------- Main ---------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 18px 32px; background: var(--topbar); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; gap: 16px; flex-wrap: wrap; }
.crumb { font-size: 12.5px; }
.topbar h1 { margin: 0; font-size: 22px; letter-spacing: -.4px; }
.topbar-right { display: flex; gap: 12px; align-items: center; }
/* Tekshiruv dvigateli boshqaruvi — Vazifalar sahifasining tepasida (yuqori paneldan ko'chirildi) */
.eng-panel { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.eng-panel .eng-holat { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.status-chip { display: flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--slate-50); color: var(--text-2); border: 1px solid var(--line); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.status-chip.working { background: var(--green-50); color: var(--green-t); border-color: var(--green-b); }
.status-chip.working .status-dot { background: var(--green); animation: pulse 1.4s infinite; }
.status-chip.schedule, .status-chip.idle { background: var(--brand-50); color: var(--brand); border-color: var(--brand-100); }
.status-chip.schedule .status-dot, .status-chip.idle .status-dot { background: var(--brand); }
.status-chip.login, .status-chip.limit, .status-chip.error { background: var(--amber-50); color: var(--amber-t); border-color: var(--amber-b); }
.status-chip.login .status-dot, .status-chip.limit .status-dot, .status-chip.error .status-dot { background: var(--amber); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(18,183,106,.5); } 100% { box-shadow: 0 0 0 8px rgba(18,183,106,0); } }
main { padding: 26px 32px 48px; }
.page { display: none; animation: fade .25s; }
.page.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 20px; box-shadow: var(--shadow-xs); }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.grid-2-1 { display: grid; grid-template-columns: 1.7fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-2-1 > .card, .grid-3 > .card { margin-bottom: 20px; }
.notice { display: flex; gap: 12px; align-items: center; padding: 14px 18px; border-radius: 12px; margin-bottom: 20px; font-weight: 500; background: var(--amber-50); color: var(--amber-t); border: 1px solid var(--amber-b); }

.kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; margin-bottom: 20px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-xs); display: flex; flex-direction: column; gap: 14px; transition: box-shadow .2s, transform .2s; }
.kpi:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.kpi-ic { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; }
.kpi-ic .i { width: 20px; height: 20px; }
.kpi-ic.blue { background: var(--brand-50); color: var(--brand); }
.kpi-ic.indigo { background: var(--indigo-50); color: var(--indigo); }
.kpi-ic.red { background: var(--red-50); color: var(--red); }
.kpi-ic.green { background: var(--green-50); color: var(--green); }
.kpi-ic.amber { background: var(--amber-50); color: var(--amber); }
.kpi-ic.slate { background: var(--slate-50); color: var(--text-2); }
.kpi-body small { color: var(--text-2); font-weight: 500; font-size: 13px; display: block; }
.kpi-body b { font-size: 28px; font-weight: 700; letter-spacing: -.8px; display: block; line-height: 1.25; font-variant-numeric: tabular-nums; }
.kpi-body span { font-size: 12px; color: var(--muted); }
.t-red { color: var(--red); } .t-green { color: var(--green); } .t-amber { color: var(--amber); }

.big-pct { font-size: 26px; font-weight: 700; color: var(--brand); letter-spacing: -.6px; font-variant-numeric: tabular-nums; }
.bar { height: 12px; background: var(--slate-50); border-radius: 99px; overflow: hidden; display: flex; margin: 4px 0 12px; }
.bar i { display: block; height: 100%; transition: width .6s cubic-bezier(.2,.8,.2,1); }
.bar.thin { height: 6px; margin: 14px 0 12px; }
.g { background: var(--green); } .r { background: var(--red); } .a { background: var(--amber); }
.legend { display: flex; gap: 18px; font-size: 12.5px; color: var(--text-2); flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; background: var(--line); vertical-align: -1px; }
.legend i.g { background: var(--green); } .legend i.r { background: var(--red); } .legend i.a { background: var(--amber); }
.stat-inline { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--brand); background: var(--brand-50); padding: 6px 12px; border-radius: 99px; }
.stat-inline .i { width: 15px; height: 15px; }
.chart-box { position: relative; height: 240px; }
.chart-box.donut { height: 190px; }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.donut-center b { font-size: 26px; letter-spacing: -.6px; }
.donut-center small { color: var(--muted); font-size: 12px; }
.pie-legend { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; margin-top: 16px; }
.pie-legend div { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }
.pie-legend i { width: 10px; height: 10px; border-radius: 3px; }
.pie-legend b { margin-left: auto; color: var(--text); font-variant-numeric: tabular-nums; }

.current { font-size: 13px; color: var(--text-2); }
.current .q { font-size: 20px; font-weight: 700; color: var(--text); font-family: "JetBrains Mono", Consolas, monospace; margin: 4px 0; letter-spacing: -.3px; }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; color: var(--green-t); background: var(--green-50); padding: 3px 10px; border-radius: 99px; }
.live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--green); animation: pulse 1.4s infinite; }
.mini-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.mini-stats small { color: var(--muted); display: block; font-size: 12px; }
.mini-stats b { font-size: 22px; font-variant-numeric: tabular-nums; letter-spacing: -.4px; }

.log { font-family: "JetBrains Mono", Consolas, monospace; font-size: 12.5px; max-height: 240px; overflow: auto; }
.log.tall { max-height: calc(100vh - 190px); }
.log div { padding: 7px 4px; border-bottom: 1px solid var(--line-2); display: flex; gap: 12px; }
.log .t { color: var(--muted); flex-shrink: 0; }
.log .error { color: var(--red); } .log .warn { color: var(--amber-t); } .log .ok { color: var(--green-t); } .log .found { color: var(--red); font-weight: 600; }
.log .info { color: var(--text-2); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 10px; font: 600 13.5px/1 Inter, system-ui, sans-serif; cursor: pointer; white-space: nowrap;
  background: var(--surface); color: var(--text-2); border: 1px solid var(--input-border); box-shadow: var(--shadow-xs); transition: background .15s, border-color .15s, box-shadow .15s, transform .05s; }
.btn .i { width: 16px; height: 16px; }
.btn:hover { background: var(--thead); color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--brand-100); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.btn-success { background: var(--green); border-color: var(--green); color: #fff; }
.btn-success:hover { background: #079455; border-color: #079455; color: #fff; }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { background: #d92d20; border-color: #d92d20; color: #fff; }
.btn-danger-soft { color: var(--red); border-color: var(--red-b); }
.btn-danger-soft:hover { background: var(--red-50); color: var(--red-t); }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn-ghost:hover { background: var(--slate-50); }
.btn-lg { height: 44px; padding: 0 20px; font-size: 14.5px; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: 8px; }
.btn-icon { width: 38px; padding: 0; }
.btn-sm.btn-icon { width: 32px; }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: 8px 0 0 8px; margin-left: 0; }
.btn-group .btn:last-child { border-radius: 0 8px 8px 0; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 16px; }
.actions.end { justify-content: flex-end; }

/* ---------- Forms ---------- */
input, select { width: 100%; height: 42px; background: var(--surface); color: var(--text); border: 1px solid var(--input-border); border-radius: 10px; padding: 0 12px; font: inherit; margin-top: 6px; box-shadow: var(--shadow-xs); transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-100); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 4px 0 18px; }
.form-grid.four { grid-template-columns: repeat(4, 1fr); }
.form-grid label, .lbl { font-size: 13px; color: var(--text-2); font-weight: 500; display: block; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 500; color: var(--text-2); font-size: 13.5px; }
.switch input { display: none; }
.switch span { width: 40px; height: 22px; background: var(--input-border); border-radius: 20px; position: relative; flex-shrink: 0; transition: .2s; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--knob); transition: .2s; box-shadow: 0 1px 3px rgba(16,24,40,.2); }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::after { left: 20px; }

.drop { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 48px 20px; border: 1.5px dashed var(--input-border); border-radius: 12px; cursor: pointer; text-align: center; transition: .2s; background: var(--thead); }
.drop:hover, .drop.over { border-color: var(--brand); background: var(--brand-50); }
.drop u { color: var(--brand); font-weight: 600; text-decoration: none; }
.drop-ic { width: 52px; height: 52px; border-radius: 50%; background: var(--brand-50); color: var(--brand); display: grid; place-items: center; margin-bottom: 8px; box-shadow: 0 0 0 8px var(--brand-50); }
.drop-ic .i { width: 22px; height: 22px; }
.file-chip { display: flex; gap: 12px; align-items: center; }
.file-chip > .i { width: 36px; height: 36px; padding: 8px; border-radius: 10px; background: var(--green-50); color: var(--green); }
.file-chip small { display: block; }

.table-wrap { overflow: auto; max-height: 440px; border: 1px solid var(--line); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { padding: 10px 14px; border-bottom: 1px solid var(--line-2); text-align: left; white-space: nowrap; max-width: 420px; overflow: hidden; text-overflow: ellipsis; }
th { background: var(--thead); position: sticky; top: 0; font-weight: 600; color: var(--text-2); font-size: 12px; }
tr:hover td { background: var(--hover); }
th.sel { background: var(--brand-50); color: var(--brand); }
td.sel { background: rgba(22,85,143,.04); font-weight: 600; color: var(--brand); }
td.wrap { white-space: normal; min-width: 260px; color: var(--text-2); }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 99px; background: var(--slate-50); color: var(--text-2); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.found { background: var(--red-50); color: var(--red-t); } .pill.clean { background: var(--green-50); color: var(--green-t); }
.pill.error { background: var(--amber-50); color: var(--amber-t); } .pill.pending, .pill.skip { color: var(--muted); }
.pill.running { background: var(--green-50); color: var(--green-t); } .pill.done { background: var(--brand-50); color: var(--brand); } .pill.paused { background: var(--amber-50); color: var(--amber-t); } .pill.queued { background: var(--indigo-50); color: var(--indigo-t); }

/* ---------- Jobs ---------- */
.job-list { display: flex; flex-direction: column; gap: 16px; }
.job { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow-xs); transition: box-shadow .2s; }
.job:hover { box-shadow: var(--shadow); }
.job-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.job-title { display: flex; gap: 14px; align-items: flex-start; }
.job-title > .i { width: 42px; height: 42px; padding: 10px; border-radius: 10px; background: var(--brand-50); color: var(--brand); }
.job-title h3 { font-size: 16px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.job-meta { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.job-meta b { color: var(--text-2); font-weight: 600; }
.job-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.job-nums { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.job-nums div { background: var(--thead); border-radius: 10px; padding: 10px 14px; }
.job-nums small { display: block; font-size: 12px; color: var(--muted); }
.job-nums b { font-size: 18px; font-variant-numeric: tabular-nums; }
.empty { text-align: center; padding: 64px 20px; }
.empty .drop-ic { margin: 0 auto 14px; }
.empty h3 { margin-bottom: 4px; }

.days { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 18px; }
.days label { min-width: 58px; text-align: center; padding: 9px 12px; border: 1px solid var(--input-border); border-radius: 10px; cursor: pointer; user-select: none; font-weight: 600; color: var(--text-2); font-size: 13px; transition: .15s; }
.days input { display: none; }
.days label.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.timeline { position: relative; height: 40px; background: repeating-linear-gradient(90deg, var(--slate-50) 0 calc(100%/24 - 1px), var(--line) calc(100%/24 - 1px) calc(100%/24)); border-radius: 10px; margin: 8px 0 28px; }
.timeline .win { position: absolute; top: 4px; bottom: 4px; background: linear-gradient(180deg, #4b8ac4, var(--brand)); border-radius: 7px; opacity: .9; }
.timeline .now { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--red); border-radius: 2px; }
.timeline .now::before { content: ""; position: absolute; top: -4px; left: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.timeline .h { position: absolute; bottom: -22px; font-size: 11px; color: var(--muted); transform: translateX(-50%); }

/* ---------- Modal / toast ---------- */
.modal { position: fixed; inset: 0; background: rgba(15,27,45,.45); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 50; padding: 24px; animation: fade .15s; }
.modal-box { background: var(--surface); border-radius: 16px; width: min(1200px, 100%); max-height: 90vh; display: flex; flex-direction: column; padding: 22px 24px; box-shadow: var(--shadow-lg); }
.modal-box.sm { width: min(460px, 100%); }
.modal-head { display: flex; justify-content: space-between; align-items: center; }
.modal-head h3 { font-size: 17px; }
.modal-body { overflow: auto; margin-top: 16px; }
.menu-list { display: flex; flex-direction: column; gap: 6px; }
.menu-list .btn { justify-content: flex-start; height: 44px; }
.filters { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.seg { display: inline-flex; background: var(--slate-50); padding: 3px; border-radius: 10px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 7px 14px; border-radius: 8px; font: 600 13px Inter, sans-serif; color: var(--text-2); cursor: pointer; }
:root[data-theme="dark"] .seg button.on { background: var(--line); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.search { position: relative; }
.search .i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 16px; }
.search input { margin: 0; padding-left: 36px; width: 260px; height: 38px; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 14px; }

#toasts { position: fixed; right: 24px; bottom: 24px; display: flex; flex-direction: column; gap: 10px; z-index: 99; }
.toast { display: flex; gap: 10px; align-items: center; background: var(--surface); border: 1px solid var(--line); padding: 12px 16px; border-radius: 12px; max-width: 400px; box-shadow: var(--shadow-lg); animation: tin .25s; font-weight: 500; }
.toast::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); flex-shrink: 0; }
.toast.err::before { background: var(--red); } .toast.ok::before { background: var(--green); }
@keyframes tin { from { transform: translateY(12px); opacity: 0; } }

.login { position: fixed; inset: 0; background: radial-gradient(circle at 30% 20%, var(--brand-50), var(--bg) 60%); display: grid; place-items: center; z-index: 100; }
.login-card { width: 360px; background: var(--surface); padding: 36px 32px; border-radius: 18px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: 12px; text-align: center; border: 1px solid var(--line); }
.login-logo { width: 72px; height: 72px; border-radius: 50%; margin: 0 auto; }
.login-card h2 { margin: 6px 0 0; color: var(--brand); }
.login-card p { margin: 0 0 8px; }
.err { color: var(--red); font-size: 13px; min-height: 18px; }
.faceid-btn { gap: 10px; height: 54px; font-size: 16px; }
.faceid-btn .i { width: 26px; height: 26px; }
.faceid-btn.busy { opacity: .7; pointer-events: none; }
.login-card .faceid-hint { margin: -4px 0 0; }
.login-card .faceid-ok { color: var(--green); font-weight: 600; }
.pass-login { display: flex; flex-direction: column; gap: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.link-btn { background: none; border: 0; color: var(--muted); font-size: 12px; cursor: pointer; padding: 4px; margin: 0 auto; text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { color: var(--brand); }
.link-btn.yil-btn, .link-btn.yil-btn:hover { text-decoration: none; color: var(--muted); cursor: default; }
/* Sudga chiqarilganlar: bugun + oylar bo'yicha raqamlar; Boshqaruvdagi 30+ bloki */
.oy-strip { display: flex; flex-wrap: wrap; gap: 8px; }
.oy-chip { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 104px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; text-align: left; }
button.oy-chip { cursor: pointer; }
button.oy-chip:hover { border-color: var(--brand-100); background: var(--brand-50); }
.oy-chip small { font-size: 12px; color: var(--text-2); white-space: nowrap; }
.oy-chip b { font-size: 20px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.oy-chip.bugun { border-color: var(--green-b); background: var(--green-50); }
.oy-chip.bugun b { color: var(--green-t); }
.oy-chip.nomalum b { color: var(--muted); }
.oy-chip.on { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-100); }
.oy-chip.tozala b { font-size: 14px; color: var(--brand); }
.k30-oraliq { margin: 0 0 12px; }
.k30-oraliq .oy-chip b { font-size: 16px; }
.k30-oraliq { align-items: center; }
.k30-oraliq .oy-chip .small { font-size: 11px; }
.k30-cheg-nom { font-size: 13px; font-weight: 600; color: var(--text-2); margin-right: 4px; }
.dash-k30 { margin-bottom: 20px; }
/* 30+ lardan ADOLATda arizasi yo'qlar — qizil, bosiladigan */
.kpi-qizil { cursor: pointer; border-color: var(--red-b); background: var(--red-50); }
.kpi-qizil b { color: var(--red); }
.kpi-qizil small { color: var(--red-t); font-weight: 600; }
.kpi-qizil.on { box-shadow: 0 0 0 2px var(--red); }
.sana-inp { width: auto; height: 34px; padding: 0 10px; }
.sana-oraliq { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.sana-oraliq label { font-weight: 600; color: var(--text-2); }
.adolat-filtr { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.kabinet-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; padding: 10px 14px; margin-bottom: 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.kabinet-bar.hidden { display: none; }
.kabinet-bar.ok { border-color: var(--green-b); background: var(--green-50); }
.kabinet-bar.ogoh { border-color: var(--amber-b); background: var(--amber-50); }
.kabinet-bar .btn { margin-left: auto; }
.kabinet-bar .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--amber); }
.kabinet-bar .dot.on { background: var(--green); }
.dash-k30-title { display: flex; align-items: baseline; gap: 10px; margin: 0 0 10px; }
.dash-k30-title h2 { margin: 0; font-size: 18px; }

/* Statistika: tovar turlari hudud bo'yicha */
.hudud-sel { width: auto; min-width: 200px; height: 36px; }
.tovar-jadval tr[data-hudud] { cursor: pointer; }
.tovar-jadval tr[data-hudud]:hover td { background: var(--hover); }
.tovar-jadval tr.tanlangan td { background: var(--brand-50); }
.tovar-jadval th, .tovar-jadval td { white-space: nowrap; }
.hamkor-grid + .table-wrap { margin-top: 16px; }

/* Yordamchi — savol-javob */
.yordam-card { display: flex; flex-direction: column; gap: 12px; height: calc(100vh - 170px); min-height: 420px; }
.yordam-log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 4px; }
.y-xabar { max-width: 92%; padding: 10px 14px; border-radius: 12px; line-height: 1.5; }
.y-xabar p { margin: 0 0 6px; }
.y-xabar p:last-child { margin-bottom: 0; }
.y-xabar.men { align-self: flex-end; background: var(--brand); color: #fff; }
.y-xabar.u { align-self: flex-start; background: var(--slate-50); border: 1px solid var(--line); }
.y-xabar .table-wrap { margin: 8px 0; max-height: 360px; overflow: auto; background: var(--surface); border-radius: 8px; }
.y-xabar table { font-size: 12.5px; }
.yordam-misol { display: flex; flex-wrap: wrap; gap: 6px; }
.yordam-misol .oy-chip { min-width: 0; padding: 6px 10px; cursor: pointer; }
.yordam-form { display: flex; gap: 8px; }
.yordam-form input { flex: 1; }

/* Kompyuterga QR orqali Face ID kirish */
.fid-kirqr { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.fid-kirqr img { width: 220px; height: 220px; border-radius: 10px; border: 1px solid var(--line); background: #fff; padding: 6px; }
.fid-kirqr.hidden { display: none; }
.faceid-qr { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.faceid-qr img { width: 180px; height: 180px; border-radius: 10px; border: 1px solid var(--line); background: #fff; padding: 6px; }
.faceid-qr .qr-text { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 8px; }
.faceid-qr input { font-size: 12px; }

@media (max-width: 1280px) { .kpis { grid-template-columns: repeat(3, 1fr); } .grid-3 { grid-template-columns: 1fr 1fr; } .job-nums { grid-template-columns: repeat(3, 1fr); } .form-grid.four { grid-template-columns: 1fr 1fr; } }
/* ---------- Telefon va planshet ---------- */
@media (max-width: 900px) {
  body { display: block; }
  /* Yon panel — chapdan chiqadigan menyu */
  .side { position: fixed; left: 0; top: 0; bottom: 0; height: 100%; width: 280px; max-width: 86vw; z-index: 60; transform: translateX(-102%); box-shadow: var(--shadow-lg); overflow-y: auto; }
  .side-open .side { transform: none; }
  .side-backdrop { position: fixed; inset: 0; background: rgba(8,12,20,.5); z-index: 55; }
  .side-open .side-backdrop { display: block; }
  .side-open body { overflow: hidden; }
  nav a { padding: 11px 12px; font-size: 15px; }

  .topbar { padding: 10px 14px; gap: 10px; flex-wrap: nowrap; }
  .topbar-left { gap: 10px; min-width: 0; }
  .topbar-left > div { min-width: 0; }
  .topbar h1 { font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .crumb { display: none; }
  .topbar-right { gap: 8px; }
  .topbar .btn-lg { height: 38px; padding: 0 12px; font-size: 13px; }
  main { padding: 16px 12px 40px; }

  .kpis, .kpis.four, .kpis.five { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 14px; gap: 10px; }
  .kpi-ic { width: 34px; height: 34px; }
  .kpi-body b { font-size: 22px; }
  .kpi-body b.money { font-size: 17px; }
  .card { padding: 16px 14px; margin-bottom: 14px; }
  .grid-2-1, .grid-3, .form-grid, .form-grid.four { grid-template-columns: 1fr; gap: 14px; }
  .grid-2-1 > .card, .grid-3 > .card { margin-bottom: 14px; }
  .chart-box { height: 220px; }

  .filters { flex-direction: column; align-items: stretch; }
  .toolbar { width: 100%; }
  .toolbar > * { flex: 1 1 auto; }
  .search, .search input, .toolbar .search input { width: 100% !important; }
  .job-head { flex-direction: column; }
  .job-actions { width: 100%; }
  .job-nums { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .job-nums div { padding: 8px 10px; }
  .modal { padding: 0; }
  .modal-box { height: 100%; max-height: 100%; border-radius: 0; padding: 16px 14px; }
  #toasts { left: 12px; right: 12px; bottom: 12px; }
  .toast { max-width: none; }
  .days label { min-width: 0; flex: 1; padding: 9px 6px; }
  .drop { padding: 30px 14px; }
}
@media (max-width: 560px) {
  .topbar .status-chip { display: none; }
  .topbar #engBtn { padding: 0 10px; }
  .kpi-body small { font-size: 12px; }
  .job-nums { grid-template-columns: 1fr 1fr; }
  .login-card { width: calc(100vw - 32px); padding: 28px 20px; }
}

/* ---------- Raqobatchi MKOlar (public/raqobatview.js) ---------- */
.rq-bar { flex-wrap: wrap; gap: 12px; }
.rq-manba { font-size: 13px; color: var(--text-2); }
.rq-tanlov { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.rq-tanlov label { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); font-weight: 600; }
.rq-tanlov select { max-width: 230px; }
.rq-kpis { grid-template-columns: repeat(6, 1fr); }
.rq-kpis .kpi-body b { font-size: 24px; }
.rq-dan { font-size: 13px; font-weight: 500; color: var(--muted); letter-spacing: 0; font-style: normal; }
.rq-kpis .kpi-body em { font-style: normal; }
.rq-xulosa { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 9px; line-height: 1.55; font-size: 13.5px; color: var(--text); }
.rq-qidir input { min-width: 240px; }
#page-raqobat td.num, #page-raqobat th.num { text-align: right; font-variant-numeric: tabular-nums; }
#page-raqobat tr[data-nom] { cursor: pointer; }
#page-raqobat tr[data-nom]:hover td { background: var(--hover); }
#page-raqobat tr.rq-biz td { background: var(--brand-50); }
#page-raqobat tr.rq-raq td { background: var(--amber-50); }
.rq-teg { display: inline-block; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 6px; background: var(--brand); color: #fff; vertical-align: middle; text-transform: uppercase; }
.rq-teg.yangi { background: var(--amber-50); color: var(--amber-t); border: 1px solid var(--amber-b); }
.rq-chiziq { display: inline-block; height: 6px; border-radius: 3px; background: var(--brand-100); margin-right: 8px; vertical-align: middle; }
.rq-izoh { margin: 12px 0 0; line-height: 1.6; }
@media (max-width: 1300px) { .rq-kpis { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px) { .rq-kpis { grid-template-columns: repeat(2, 1fr); } .rq-tanlov select { max-width: 160px; } .rq-qidir input { min-width: 0; width: 100%; } }
