/* Nasiya paneli — sodda va toza: oq yuzalar, ingichka chiziqlar, bitta urg'u rangi.
   Telefon (≤ 820px): pastki menyu, to'liq kenglik. Kompyuter: chap menyu, keng ish maydoni. */

:root {
  --bg: #f6f6f8;
  --panel: #ffffff;
  --panel2: #f3f3f6;
  --hover: #f0f0f4;
  --text: #111318;
  --text2: #3b3f4a;
  --muted: #747887;
  --line: #e6e6ec;
  --line2: #d9d9e1;
  --accent: #5149e6;
  --accent2: #6d66f5;
  --accent-bg: #efeefe;
  --ok: #0f9960;
  --ok-bg: #e5f6ee;
  --warn: #b86e00;
  --warn-bg: #fdf3e1;
  --bad: #d92d3f;
  --bad-bg: #fdecee;
  --radius: 12px;
  --radius-s: 9px;
  --shadow: 0 1px 2px rgba(16, 18, 30, .04);
  --shadow-l: 0 12px 40px rgba(16, 18, 30, .16);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0d10;
    --panel: #15161a;
    --panel2: #1c1d22;
    --hover: #212228;
    --text: #ececf0;
    --text2: #c9cad2;
    --muted: #8f919c;
    --line: #25262c;
    --line2: #31323a;
    --accent: #8b86ff;
    --accent2: #a19dff;
    --accent-bg: #23224a;
    --ok: #34c88a;
    --ok-bg: #12291f;
    --warn: #f0b23c;
    --warn-bg: #2f2511;
    --bad: #ff6b7a;
    --bad-bg: #331a1e;
    --shadow: none;
    --shadow-l: 0 12px 40px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; font-weight: 650; letter-spacing: -.015em; margin: 0; }
h2 { font-size: 15px; font-weight: 600; margin: 0 0 12px; letter-spacing: -.005em; }
h3 { font-size: 14px; font-weight: 600; margin: 0 0 8px; }
code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 12.5px; background: var(--panel2); padding: 1px 5px; border-radius: 5px; }
.muted { color: var(--muted); }
.kichik { font-size: 12.5px; }
.ok { color: var(--ok); }
.warn { color: var(--warn); }
.bad { color: var(--bad); }
.raqam { font-variant-numeric: tabular-nums; white-space: nowrap; }
.qalin { font-weight: 600; }
.yashir { display: none !important; }

/* ------------------------------------------------------------ joylashuv */

.qobiq { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.yon {
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 14px 10px;
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 1px;
}
.yon .logo { display: flex; align-items: center; gap: 10px; font-weight: 650; font-size: 15px; padding: 6px 10px 18px; letter-spacing: -.01em; min-width: 0; }
.yon .logo img { width: 30px; height: 30px; border-radius: 8px; flex: none; }
.yon .logo span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.yon .bolim-sarlavha { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 14px 12px 6px; }
.yon a.bolim {
  display: flex; align-items: center; gap: 11px; padding: 8px 12px; border-radius: 8px; color: var(--text2); font-weight: 500;
}
.yon a.bolim:hover { background: var(--hover); text-decoration: none; color: var(--text); }
.yon a.bolim.faol { background: var(--accent-bg); color: var(--accent); }
.yon a.bolim svg { width: 18px; height: 18px; flex: none; }
.profil {
  margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 10px;
  border: 0; background: none; text-align: left; font: inherit; color: inherit; cursor: pointer; width: 100%;
}
.profil:hover { background: var(--hover); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: none;
  background: var(--accent-bg); color: var(--accent); font-weight: 650; font-size: 13px;
}
.avatar.kichik { width: 26px; height: 26px; font-size: 11px; }
.profil .ism { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profil .rol { font-size: 12px; color: var(--muted); }
.asosiy { min-width: 0; }
.tepa {
  display: flex; align-items: center; gap: 10px; padding: 14px 28px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 5;
}
.tepa .qidiruv { flex: 1; max-width: 560px; position: relative; }
.tepa .qidiruv input { width: 100%; padding-left: 38px; background: var(--panel); }
.tepa .qidiruv > svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; color: var(--muted); pointer-events: none; }
.tepa .mobil-logo { display: none; }
.qidiruv-natija {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-l); max-height: 60vh; overflow: auto; z-index: 20; padding: 4px;
}
.qidiruv-natija a { display: block; padding: 9px 12px; color: var(--text); border-radius: 8px; }
.qidiruv-natija a:hover, .qidiruv-natija a.tanlangan { background: var(--hover); text-decoration: none; }
.sahifa { padding: 6px 28px 48px; max-width: 1180px; }
.sahifa-bosh { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 4px 0 20px; }
.sahifa-bosh .bosh-tugmalar { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.sahifa-bosh .tag-matn { color: var(--muted); margin-top: 2px; }
.pastki-menyu { display: none; }

@media (max-width: 820px) {
  body { font-size: 15px; }
  .qobiq { grid-template-columns: 1fr; }
  .yon { display: none; }
  .tepa { padding: 10px 14px; gap: 8px; }
  .tepa .mobil-logo { display: inline-flex; flex: none; }
  .tepa .mobil-logo img { width: 30px; height: 30px; border-radius: 8px; }
  .tepa .tolov-t span { display: none; }
  .sahifa { padding: 4px 14px calc(92px + env(safe-area-inset-bottom)); }
  h1 { font-size: 20px; }
  .pastki-menyu {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 10; background: color-mix(in srgb, var(--panel) 94%, transparent);
    backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .pastki-menyu a, .pastki-menyu button {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; font: inherit; font-size: 11px; font-weight: 500;
    color: var(--muted); padding: 4px 0; background: none; border: 0; cursor: pointer;
  }
  .pastki-menyu .faol { color: var(--accent); }
  .pastki-menyu a:hover { text-decoration: none; }
  .pastki-menyu svg { width: 22px; height: 22px; }
}

/* ------------------------------------------------------------ elementlar */

.karta { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.karta + .karta { margin-top: 14px; }
.panjara > .karta + .karta, .ustun > .karta + .karta { margin-top: 0; }
.karta.yassi { box-shadow: none; background: var(--panel2); border-color: transparent; }
.panjara { display: grid; gap: 14px; }
.panjara.ikki { grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); }
.panjara.stat { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .panjara.stat { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.qator { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.qator.oraliq { justify-content: space-between; }
.ustun { display: flex; flex-direction: column; gap: 12px; }
.bosh-joy { flex: 1; min-width: 0; }
@media (max-width: 820px) {
  .karta { padding: 14px; border-radius: 14px; }
  .panjara.ikki { grid-template-columns: 1fr; }
  .panjara.stat { grid-template-columns: 1fr 1fr; gap: 10px; }
}

.stat-karta { padding: 14px 16px; display: block; }
.stat-karta .nom { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.stat-karta .qiymat { font-size: 21px; font-weight: 650; margin-top: 4px; letter-spacing: -.02em; }
.stat-karta .izoh { font-size: 12px; color: var(--muted); margin-top: 2px; }
.stat-karta.bad .qiymat { color: var(--bad); }
.stat-karta.ok .qiymat { color: var(--ok); }
a.stat-karta:hover { border-color: var(--line2); }
@media (max-width: 820px) { .stat-karta .qiymat { font-size: 17px; } }

button, .tugma {
  font: inherit; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid var(--line2); background: var(--panel); color: var(--text);
  padding: 7px 14px; border-radius: var(--radius-s); cursor: pointer; white-space: nowrap; min-height: 36px;
  transition: background .12s, border-color .12s, transform .06s;
}
button:hover, .tugma:hover { background: var(--hover); text-decoration: none; }
button:active { transform: translateY(1px); }
button:disabled { opacity: .5; cursor: default; transform: none; }
button.asosiy-t, .tugma.asosiy-t { background: var(--accent); border-color: var(--accent); color: #fff; }
button.asosiy-t:hover, .tugma.asosiy-t:hover { background: var(--accent2); border-color: var(--accent2); }
button.xavfli { color: var(--bad); }
button.xavfli.toliq { background: var(--bad); border-color: var(--bad); color: #fff; }
button.kichik-t { padding: 4px 10px; min-height: 30px; font-size: 13px; border-radius: 8px; }
button.belgi-t { padding: 6px; min-height: 32px; width: 32px; border-color: transparent; background: transparent; color: var(--muted); }
button.belgi-t:hover { background: var(--hover); color: var(--text); }
button svg, .tugma svg { width: 16px; height: 16px; flex: none; }

input, select, textarea {
  font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--line2); border-radius: var(--radius-s);
  padding: 8px 11px; min-height: 38px; width: 100%; min-width: 0; transition: border-color .12s, box-shadow .12s;
}
textarea { resize: vertical; min-height: 80px; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
input[type=checkbox] { width: 18px; height: 18px; min-height: 0; accent-color: var(--accent); box-shadow: none; }
label.maydon { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--muted); font-weight: 500; }
label.maydon > span.yordam { font-size: 12px; font-weight: 400; }
label.belgi { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.forma { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.forma .butun { grid-column: 1 / -1; }
.tugmalar { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 16px; }
@media (max-width: 820px) { input, select, textarea { min-height: 42px; font-size: 16px; } button, .tugma { min-height: 40px; } }

.yorliq {
  display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 99px;
  font-size: 11.5px; font-weight: 600; background: var(--panel2); color: var(--muted); white-space: nowrap;
}
.yorliq.ok { background: var(--ok-bg); color: var(--ok); }
.yorliq.warn { background: var(--warn-bg); color: var(--warn); }
.yorliq.bad { background: var(--bad-bg); color: var(--bad); }
.yorliq.accent { background: var(--accent-bg); color: var(--accent); }

.tablar { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.tablar::-webkit-scrollbar { display: none; }
.tablar button { border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; padding: 9px 12px; color: var(--muted); min-height: 0; }
.tablar button:hover { background: none; color: var(--text); }
.tablar button.faol { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.tablar button .son { margin-left: 4px; font-weight: 500; }

.jadval-wrap { overflow-x: auto; margin: 0 -18px; padding: 0 18px; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tr.bosiladi { cursor: pointer; }
tr.bosiladi:hover td { background: var(--hover); }
td.ong, th.ong { text-align: right; }

.royxat-qator { display: flex; align-items: center; gap: 12px; padding: 12px 6px; border-bottom: 1px solid var(--line); border-radius: 8px; }
.royxat-qator:last-child { border-bottom: 0; }
.royxat-qator .asos { flex: 1; min-width: 0; }
.royxat-qator .asos .nom { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.royxat-qator .asos .tag { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.royxat-qator .summa { text-align: right; }
.royxat-qator .amallar { display: flex; gap: 6px; }
.royxat-qator.bosiladi { cursor: pointer; }
.royxat-qator.bosiladi:hover { background: var(--hover); }
@media (max-width: 560px) {
  .royxat-qator { flex-wrap: wrap; }
  .royxat-qator .amallar { width: 100%; justify-content: flex-end; }
}

.bosh-xabar { text-align: center; color: var(--muted); padding: 30px 10px; }
.progress { height: 6px; background: var(--panel2); border-radius: 99px; overflow: hidden; }
.progress > div { height: 100%; background: var(--ok); border-radius: 99px; }

.kanal-holat { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; }
.kanal-holat:hover { text-decoration: none; }
.nuqta { width: 8px; height: 8px; border-radius: 50%; background: var(--line2); flex: none; }
.nuqta.ok { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-bg); }
.nuqta.bad { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-bg); }
.nuqta.warn { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-bg); }

.chiplar { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12.5px; padding: 4px 10px; border-radius: 99px; background: var(--panel2); color: var(--text2); border: 1px solid var(--line); min-height: 0; font-weight: 500; }
.chip:hover { background: var(--accent-bg); color: var(--accent); border-color: transparent; }

.kod-katta { font-size: 34px; letter-spacing: 8px; font-weight: 700; font-variant-numeric: tabular-nums; text-align: center; padding: 12px; background: var(--panel2); border-radius: var(--radius); }
.oldindan { white-space: pre-wrap; background: var(--panel2); border-radius: 10px; padding: 10px 12px; font-size: 13.5px; }

/* ------------------------------------------------------------ oyna va xabar */

.oyna-fon {
  position: fixed; inset: 0; background: rgba(10, 11, 18, .42); z-index: 50; backdrop-filter: blur(2px);
  display: flex; align-items: flex-start; justify-content: center; padding: 8vh 14px 14px; overflow-y: auto;
  animation: paydo .14s ease-out;
}
.oyna { background: var(--panel); border-radius: 16px; width: 100%; max-width: 540px; padding: 22px; box-shadow: var(--shadow-l); border: 1px solid var(--line); }
.oyna.keng { max-width: 820px; }
.oyna-bosh { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 10px; }
.oyna-bosh h2 { margin: 0; font-size: 17px; }
@keyframes paydo { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 560px) {
  .oyna-fon { padding: 0; align-items: flex-end; }
  .oyna { border-radius: 18px 18px 0 0; max-height: 92vh; overflow-y: auto; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); border: 0; }
}

.toastlar { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: #17181d; color: #fff; padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow-l); max-width: 90vw; font-weight: 500; }
.toast.bad { background: var(--bad); }
@media (max-width: 820px) { .toastlar { bottom: calc(88px + env(safe-area-inset-bottom)); } }

.kirish-oyna { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.kirish-oyna .karta { width: 100%; max-width: 380px; padding: 30px 28px; box-shadow: var(--shadow-l); }
.kirish-oyna .logo { display: flex; flex-direction: column; align-items: center; gap: 12px; font-size: 20px; font-weight: 650; margin-bottom: 22px; text-align: center; }
.kirish-oyna .logo img { width: 56px; border-radius: 14px; }

.yangilanish {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 22px; z-index: 90; display: flex; align-items: center; gap: 12px;
  background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow-l); border-radius: 12px; padding: 10px 12px 10px 16px; font-weight: 500;
}
@media (max-width: 820px) { .yangilanish { bottom: calc(86px + env(safe-area-inset-bottom)); width: calc(100% - 28px); } }

.jadval-holat-tolandi td { color: var(--muted); }
.jadval-holat-kechikdi td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
.jadval-holat-bugun td:first-child { box-shadow: inset 3px 0 0 var(--warn); }

.qoida-qator { display: flex; flex-direction: column; gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.qoida-qator select, .qoida-qator input[type=number] { max-width: 100%; }
.qoida-qator .tavsif { font-size: 12px; color: var(--accent); }

/* ------------------------------------------------------------ buyruq qutisi ("Nima bo'ldi?") */

.buyruq-quti { padding: 12px; margin-bottom: 14px; }
.buyruq-satr { display: flex; gap: 8px; align-items: flex-end; }
.buyruq-satr > input, .buyruq-satr > textarea { flex: 1; }
.buyruq-input { resize: none; min-height: 46px; font-size: 15px; padding: 11px 14px; overflow: hidden; border-color: var(--line); background: var(--panel2); }
.buyruq-input:focus { background: var(--panel); }
.buyruq-satr > button { min-height: 46px; min-width: 46px; }
.buyruq-natija { margin-top: 12px; border: 1px solid var(--line); border-left: 3px solid var(--muted); border-radius: 10px; padding: 12px 14px; background: var(--panel); }
.buyruq-natija.tayyor { border-left-color: var(--accent); }
.buyruq-natija.savol { border-left-color: var(--warn); }
.buyruq-natija.ok { border-left-color: var(--ok); }
.buyruq-natija.bad { border-left-color: var(--bad); }
.buyruq-qatorlar { margin-top: 6px; line-height: 1.65; color: var(--text2); }
.buyruq-natija .oldindan { margin-top: 6px; }

.tez-amallar { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.tez-amallar button { min-height: 46px; font-weight: 600; background: var(--panel); box-shadow: var(--shadow); border-color: var(--line); }

.segment { display: inline-flex; background: var(--panel2); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.segment button { border: 0; background: transparent; min-height: 32px; padding: 5px 12px; border-radius: 8px; color: var(--muted); }
.segment button:hover { background: transparent; color: var(--text); }
.segment button.faol { background: var(--panel); color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }

.ogohlar { margin-bottom: 14px; display: flex; flex-direction: column; gap: 8px; }
.ogoh { background: var(--warn-bg); color: var(--text); border-radius: 10px; padding: 10px 14px; font-size: 13.5px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.yigma { border: 1px solid var(--line); border-radius: 10px; padding: 0 14px; margin-top: 12px; }
.yigma > summary { cursor: pointer; padding: 11px 0; font-weight: 600; list-style: none; }
.yigma > summary::-webkit-details-marker { display: none; }
.yigma > summary::before { content: '›'; display: inline-block; width: 14px; color: var(--muted); transition: transform .15s; }
.yigma[open] > summary::before { transform: rotate(90deg); }
.yigma[open] { padding-bottom: 14px; }
.ulanish-bosh { display: flex; align-items: center; gap: 12px; }
.ulanish-bosh .belgi-katta { width: 40px; height: 40px; border-radius: 10px; background: var(--panel2); display: inline-flex; align-items: center; justify-content: center; font-size: 20px; flex: none; }

/* ------------------------------------------------------------ kuzatuv (dasturchi) */

.lenta-kun { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin: 18px 0 6px; }
.lenta-kun:first-child { margin-top: 0; }
.lenta { display: flex; gap: 12px; padding: 11px 6px; border-bottom: 1px solid var(--line); }
.lenta:last-child { border-bottom: 0; }
.lenta .asos { flex: 1; min-width: 0; }
.lenta .kim { font-weight: 600; }
.lenta .matn { margin-top: 2px; word-break: break-word; }
.lenta .matn.iqtibos { background: var(--panel2); border-radius: 8px; padding: 6px 10px; display: inline-block; max-width: 100%; }
.lenta .tafsilot { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.lenta .vaqt { font-size: 12px; color: var(--muted); white-space: nowrap; }
.menyu-qator { display: flex; align-items: center; gap: 12px; padding: 12px 8px; border-radius: 10px; cursor: pointer; color: var(--text); }
.menyu-qator:hover { background: var(--hover); text-decoration: none; }
.menyu-qator svg { width: 18px; height: 18px; color: var(--muted); }
@media (max-width: 820px) {
  .buyruq-quti .chiplar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-right: -12px; padding-right: 12px; }
  .buyruq-quti .chiplar::-webkit-scrollbar { display: none; }
  .buyruq-quti .chip { flex: none; }
  .buyruq-input::placeholder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
