:root {
  --bg: #F0EBDF;
  --card: #FDFBF6;
  --card-alt: #F6F1E6;
  --text: #15213B;
  --muted: #756A5A;
  --border: #E4DAC5;
  --primary: #2E446D;
  --primary-dark: #15213B;
  --primary-soft: #E4E9F1;
  --accent: #978368;
  --accent-dark: #482B25;
  --accent-soft: #EFE7D9;
  --green: #4B7A5B;
  --green-soft: #E3EEE6;
  --red: #8C3B2E;
  --red-soft: #F3E4DE;
  --amber: #9C7A38;
  --amber-soft: #F3E9D3;
  --neutral-soft: #EAE3D3;
  --radius: 18px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(21,33,59,.05), 0 10px 28px -14px rgba(21,33,59,.18);
  --font-serif: "Newsreader", Georgia, serif;
  --font-sans: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Navigatsiya "chrome"si — doim tim, mavzu (yorug'/qorong'i) bilan almashmaydi. */
  --sb-bg: #15213B;
  --sb-text: #F0EBDF;
  --sb-muted: rgba(240,235,223,.62);
  --sb-border: rgba(240,235,223,.12);
  --sb-hover: rgba(240,235,223,.08);
  --sb-active: rgba(240,235,223,.13);
  --sb-accent: #C7AD87;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101a30;
    --card: #17233f;
    --card-alt: #1c2a4a;
    --text: #F0EBDF;
    --muted: #9BA3BC;
    --border: #2A3A5C;
    --primary: #6E93CC;
    --primary-dark: #9DB7E0;
    --primary-soft: #24365a;
    --accent: #C7AD87;
    --accent-dark: #E4CBA6;
    --accent-soft: #33291f;
    --green: #7FB596;
    --green-soft: #1d3327;
    --red: #D08D79;
    --red-soft: #3a251f;
    --amber: #D8B76E;
    --amber-soft: #3a3020;
    --neutral-soft: #263252;
    --shadow: 0 1px 2px rgba(0,0,0,.2), 0 10px 28px -14px rgba(0,0,0,.5);
  }
}
:root[data-theme="dark"] {
  --bg: #101a30;
  --card: #17233f;
  --card-alt: #1c2a4a;
  --text: #F0EBDF;
  --muted: #9BA3BC;
  --border: #2A3A5C;
  --primary: #6E93CC;
  --primary-dark: #9DB7E0;
  --primary-soft: #24365a;
  --accent: #C7AD87;
  --accent-dark: #E4CBA6;
  --accent-soft: #33291f;
  --green: #7FB596;
  --green-soft: #1d3327;
  --red: #D08D79;
  --red-soft: #3a251f;
  --amber: #D8B76E;
  --amber-soft: #3a3020;
  --neutral-soft: #263252;
  --shadow: 0 1px 2px rgba(0,0,0,.2), 0 10px 28px -14px rgba(0,0,0,.5);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  -webkit-text-size-adjust: 100%;
  transition: background-color .2s ease, color .2s ease;
}

a { color: var(--primary); text-decoration: none; }

h1, h2, .serif { font-family: var(--font-serif); font-weight: 500; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  background: var(--sb-bg);
  border-bottom: 1px solid var(--sb-border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar .brand { font-weight: 700; font-size: 16px; white-space: nowrap; letter-spacing: -.01em; }
.topbar .brand a { color: var(--sb-text); display: flex; align-items: center; gap: 8px; }
.topbar .brand .mark { width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0; object-fit: contain; }
.topbar nav { display: flex; gap: 2px; flex-wrap: wrap; align-items: center; }
.topbar nav a, .topbar nav .nav-toggle, .topbar .nav-menu a {
  color: var(--sb-muted); font-size: 14px; padding: 7px 12px; border-radius: 999px; white-space: nowrap;
  background: transparent; border: none; font-weight: 600; cursor: pointer; font-family: inherit;
  transition: background-color .15s ease, color .15s ease;
  display: inline-flex; align-items: center; gap: 9px;
}
.topbar nav a svg, .topbar .nav-menu a svg { flex-shrink: 0; opacity: .85; color: var(--sb-accent); }
.topbar nav a.active, .topbar nav .nav-toggle.active, .topbar .nav-menu a.active { color: var(--sb-text); background: var(--sb-active); }
.topbar nav a.active svg, .topbar nav a:hover svg, .topbar .nav-menu a.active svg, .topbar .nav-menu a:hover svg { opacity: 1; }
.topbar nav a:hover, .topbar nav .nav-toggle:hover, .topbar .nav-menu a:hover { color: var(--sb-text); background: var(--sb-hover); }
.nav-group { position: relative; }
.nav-section-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--sb-muted); }
.nav-menu {
  display: none; position: absolute; top: 100%; left: 0; min-width: 200px; z-index: 20;
  background: var(--sb-bg); border: 1px solid var(--sb-border); border-radius: var(--radius-sm); padding: 6px;
  box-shadow: var(--shadow);
}
.nav-menu a { display: flex; border-radius: 8px !important; }
.nav-menu.open { display: block; }
.icon-btn.mobile-menu-toggle, .mobile-menu { display: none; }

.topbar .user-info { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.icon-row { display: flex; align-items: center; gap: 6px; }
.icon-btn {
  width: 32px; height: 32px; padding: 0; border-radius: 999px; flex-shrink: 0; position: relative;
  background: var(--sb-hover); color: var(--sb-text); border: 1px solid var(--sb-border);
  display: inline-flex; align-items: center; justify-content: center; line-height: 1;
}
.icon-btn:hover { background: var(--sb-active); }
.icon-btn.active { background: var(--sb-active); }
.badge-count {
  position: absolute; top: -3px; right: -4px; background: var(--red); color: #fff; font-size: 10px; font-weight: 700;
  min-width: 16px; height: 16px; line-height: 16px; border-radius: 999px; text-align: center; padding: 0 4px;
}

.avatar {
  display: inline-flex; align-items: center; justify-content: center; border-radius: 999px;
  font-weight: 700; flex-shrink: 0; line-height: 1;
}
.profile-card {
  display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius-sm);
  color: var(--sb-text);
}
.profile-card:hover, .profile-card.active { background: var(--sb-hover); }
.profile-meta { display: flex; flex-direction: column; min-width: 0; }
.profile-meta .p-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-meta .p-role { font-size: 12px; color: var(--sb-muted); }

.container { max-width: 1000px; margin: 0 auto; padding: 20px; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.grid { display: grid; gap: 14px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); }

.stat { text-align: left; position: relative; }
.stat .stat-icon {
  width: 34px; height: 34px; border-radius: 10px; background: var(--primary-soft); color: var(--primary);
  display: inline-flex; align-items: center; justify-content: center; font-size: 16px; margin-bottom: 10px;
}
.stat .label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.stat .value { font-size: 24px; font-weight: 700; margin-top: 4px; overflow-wrap: normal; }
.stat .value.long { font-size: 18px; line-height: 1.35; }
.amt { white-space: nowrap; }

h1 { font-size: 20px; margin: 0 0 16px; letter-spacing: -.01em; }
h2 { font-size: 16px; margin: 0 0 12px; }
h3 { font-size: 14px; margin: 14px 0 6px; }

label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 4px; font-weight: 500; }
input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: inherit;
  background: var(--card);
  color: var(--text);
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
textarea { resize: vertical; min-height: 70px; }

button {
  cursor: pointer;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  background: var(--primary);
  color: #fff;
  transition: background-color .15s ease, opacity .15s ease, transform .05s ease;
}
button:hover { background: var(--primary-dark); }
button:active { transform: translateY(1px); }
button.secondary { background: var(--card); color: var(--text); border: 1px solid var(--border); }
button.secondary:hover { background: var(--card-alt); }
button.danger { background: var(--red); }
button.danger:hover { filter: brightness(.9); }
button.success { background: var(--green); }
button.success:hover { filter: brightness(.9); }
button.ghost { background: transparent; color: var(--primary); padding: 7px 12px; }
button.ghost:hover { background: var(--primary-soft); }
button.small { padding: 6px 12px; font-size: 13px; }
button:disabled { opacity: .5; cursor: not-allowed; }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 700; white-space: nowrap; }
tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; white-space: nowrap; }
td.nowrap, th.nowrap { white-space: nowrap; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge.status-QORALAMA { background: var(--neutral-soft); color: var(--muted); }
.badge.status-YUBORILDI { background: var(--amber-soft); color: var(--amber); }
.badge.status-TASDIQLANDI { background: var(--primary-soft); color: var(--primary); }
.badge.status-RAD_ETILDI { background: var(--red-soft); color: var(--red); }
.badge.status-TAHRIRGA_QAYTARILDI { background: var(--red-soft); color: var(--red); }
.badge.status-TOLANDI { background: var(--green-soft); color: var(--green); }
.badge.status-HISOBOT_BERILDI { background: var(--green-soft); color: var(--green); }
.badge.status-YOPILDI { background: var(--neutral-soft); color: var(--muted); }
.badge.neutral { background: var(--neutral-soft); color: var(--muted); }
.badge.warn { background: var(--amber-soft); color: var(--amber); }
.badge.danger { background: var(--red-soft); color: var(--red); }
.badge.ok { background: var(--green-soft); color: var(--green); }

.error-msg { background: var(--red-soft); color: var(--red); padding: 10px 12px; border-radius: var(--radius-sm); font-size: 13px; margin: 10px 0; }
.success-msg { background: var(--green-soft); color: var(--green); padding: 10px 12px; border-radius: var(--radius-sm); font-size: 13px; margin: 10px 0; }
.info-msg { background: var(--primary-soft); color: var(--primary); padding: 10px 12px; border-radius: var(--radius-sm); font-size: 13px; margin: 10px 0; }
.muted { color: var(--muted); font-size: 13px; }
.empty { color: var(--muted); font-size: 14px; padding: 20px 0; text-align: center; }

.actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 14px; }
.filters > div { flex: 1 1 160px; }
.filters label { margin-top: 0; }

.history-item { padding: 8px 0; border-bottom: 1px dashed var(--border); font-size: 13px; }
.history-item:last-child { border-bottom: none; }
.file-list a { display: inline-block; margin: 4px 8px 4px 0; font-size: 13px; }
.thumb { max-width: 160px; max-height: 120px; border-radius: 8px; border: 1px solid var(--border); display: block; margin-top: 6px; }

/* --- Kirish sahifasi: split-screen --- */
.login-page { min-height: 100vh; display: flex; }
.auth-shell { display: flex; width: 100%; min-height: 100vh; }
.auth-side {
  flex: 1 1 44%;
  background:
    radial-gradient(circle at 20% 20%, rgba(151,131,104,.45), transparent 55%),
    radial-gradient(circle at 80% 85%, rgba(46,68,109,.7), transparent 55%),
    linear-gradient(160deg, #182642, #482B25 150%);
  color: #F0EBDF;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 44px 40px;
  position: relative;
  overflow: hidden;
}
.auth-side::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(240,235,223,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(240,235,223,.05) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(circle at 30% 30%, black, transparent 70%);
}
.auth-side .mark { width: 44px; height: 44px; border-radius: 12px; object-fit: contain; position: relative; z-index: 1; }
.auth-side .brand-name { font-weight: 700; font-size: 16px; margin-top: 12px; position: relative; z-index: 1; }
.auth-side .welcome { position: relative; z-index: 1; }
.auth-side .welcome h2 { font-size: 30px; margin: 0 0 10px; letter-spacing: -.01em; color: #fff; }
.auth-side .welcome p { font-size: 14px; color: rgba(240,235,223,.75); max-width: 320px; line-height: 1.5; margin: 0; }
.auth-side .foot { font-size: 12px; color: rgba(240,235,223,.5); position: relative; z-index: 1; }
.auth-chart { position: absolute; left: 0; bottom: 90px; opacity: .35; }

.auth-form-wrap {
  flex: 1 1 56%; display: flex; align-items: center; justify-content: center; padding: 32px 20px; background: var(--bg);
}
.login-box { width: 100%; max-width: 360px; }
.login-box .auth-icon {
  width: 52px; height: 52px; border-radius: 14px; background: var(--primary-soft); color: var(--primary);
  display: flex; align-items: center; justify-content: center; font-size: 22px; margin: 0 auto 16px;
}
.login-box h1 { text-align: center; font-size: 22px; }
.login-box .sub { text-align: center; color: var(--muted); font-size: 13px; margin: -10px 0 18px; }
.login-box .card { box-shadow: none; border: none; background: transparent; padding: 0; margin-bottom: 0; }
.login-box .actions { margin-top: 18px; }
.login-box button[type="submit"] { width: 100%; padding: 12px 18px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.hint-text { font-size: 12px; color: var(--muted); text-align: right; margin: 8px 0 0; }

.input-icon { position: relative; display: flex; align-items: center; }
.input-icon > span[data-icon] {
  position: absolute; left: 12px; color: var(--muted); pointer-events: none;
  display: inline-flex; align-items: center; justify-content: center;
}
.input-icon input { padding-left: 38px; }
.input-icon input:has(+ .input-icon-btn) { padding-right: 38px; }
.input-icon-btn {
  position: absolute; right: 4px; background: transparent; border: none; padding: 8px; color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center; border-radius: 999px;
}
.input-icon-btn:hover { background: var(--card-alt); color: var(--text); }

@media (max-width: 860px) {
  .auth-side { display: none; }
  .auth-form-wrap { flex: 1 1 100%; }
}

.progress { height: 8px; background: var(--neutral-soft); border-radius: 999px; overflow: hidden; margin-top: 6px; }
.progress > span { display: block; height: 100%; background: var(--primary); }
.progress > span.over { background: var(--red); }

.notif-item { padding: 12px 0; border-bottom: 1px solid var(--border); display: flex; gap: 12px; align-items: flex-start; }
.notif-item:last-child { border-bottom: none; }
.notif-item.unread { background: var(--primary-soft); margin: 0 -18px; padding: 12px 18px; border-radius: 10px; }
.notif-item .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); margin-top: 6px; flex-shrink: 0; }
.notif-item.read .dot { background: transparent; }
.notif-item .title { font-weight: 600; font-size: 14px; }
.notif-item .body { font-size: 13px; color: var(--muted); margin-top: 2px; }
.notif-item .time { font-size: 12px; color: var(--muted); margin-top: 4px; }

.lines-table input, .lines-table select { padding: 7px 9px; font-size: 14px; }
.lines-table td { padding: 6px 4px; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 14px; border-bottom: 1px solid var(--border); }
.tabs button { background: transparent; color: var(--muted); border-radius: 10px 10px 0 0; padding: 8px 14px; }
.tabs button.active { color: var(--primary); background: var(--primary-soft); }
.tabs button:hover { background: var(--card-alt); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; font-size: 14px; }
.kv .k { color: var(--muted); }

.container.wide { max-width: 1200px; }

/* --- Ro'yxat + tafsilot (master-detail) --- */
.master-detail { display: flex; gap: 16px; align-items: flex-start; }
.master-list { flex: 1 1 62%; min-width: 0; }
.master-panel { flex: 1 1 34%; min-width: 300px; position: sticky; top: 20px; }
.master-list table tbody tr[data-id] { cursor: pointer; }
.master-list table tbody tr.selected td { background: var(--primary-soft); }
.master-panel .empty { padding: 40px 0; }
@media (max-width: 960px) {
  .master-detail { flex-direction: column; }
  .master-panel { position: static; width: 100%; }
}

/* --- Radio-kartochka tanlagich (to'lov turi va h.k.) --- */
.radio-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 4px; }
.radio-card {
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; cursor: pointer;
  background: var(--card); transition: border-color .12s ease, background-color .12s ease;
}
.radio-card:hover { border-color: var(--primary); }
.radio-card input { display: none; }
.radio-card .rc-title { font-weight: 600; font-size: 14px; }
.radio-card .rc-sub { font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.4; }
.radio-card.checked { border-color: var(--primary); background: var(--primary-soft); }
@media (max-width: 560px) {
  .radio-cards { grid-template-columns: 1fr; }
}

/* --- Ma'lumot paneli (qadam-qadam ko'rsatma, Yangi so'rov) --- */
.info-side { background: var(--sb-bg); color: var(--sb-text); border-radius: var(--radius); padding: 22px; position: sticky; top: 20px; }
.info-side h3 { font-family: var(--font-serif); font-weight: 500; font-size: 16px; margin: 0 0 16px; color: var(--sb-text); }
.stepper { display: flex; flex-direction: column; gap: 16px; }
.step { display: flex; gap: 12px; align-items: flex-start; }
.step .num {
  width: 26px; height: 26px; border-radius: 999px; background: var(--sb-hover); border: 1px solid var(--sb-border);
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.step .txt .t { font-weight: 600; font-size: 13px; }
.step .txt .d { font-size: 12px; color: var(--sb-muted); margin-top: 2px; line-height: 1.4; }
.tip-box { margin-top: 20px; padding: 12px 14px; border: 1px dashed var(--sb-border); border-radius: var(--radius-sm); font-size: 12px; color: var(--sb-muted); line-height: 1.5; }
.tip-box strong { color: var(--sb-text); }

/* --- Donat diagramma (Kassalar qoldig'i) --- */
.donut-card { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.donut { flex-shrink: 0; }
.donut circle { transition: stroke-dasharray .3s ease; }
.donut-value { font-family: var(--font-serif); font-size: 20px; font-weight: 500; fill: var(--text); }
.donut-sub { font-size: 10px; fill: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.legend { display: flex; flex-direction: column; gap: 9px; flex: 1 1 160px; min-width: 160px; }
.legend-item { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.legend-item .dot { width: 9px; height: 9px; border-radius: 999px; flex-shrink: 0; }
.legend-item .l-label { flex: 1 1 auto; color: var(--text); }
.legend-item .l-value { font-weight: 600; white-space: nowrap; }

/* --- Gorizontal ustunli ro'yxat (TOP-5 xarajat) --- */
.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 13px; }
.bar-row:last-child { margin-bottom: 0; }
.bar-row-label { flex: 0 0 110px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { flex: 1 1 auto; height: 8px; background: var(--neutral-soft); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; }
.bar-row-value { flex: 0 0 auto; font-weight: 600; white-space: nowrap; }

/* --- Avatar bilan ro'yxat qatori (qarzdorlar, muddati o'tgan va h.k.) --- */
.list-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.list-row:last-child { border-bottom: none; }
.list-row .meta { flex: 1 1 auto; min-width: 0; }
.list-row .meta .name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row .meta .sub { font-size: 12px; color: var(--muted); }
.list-row .end { flex: 0 0 auto; text-align: right; }
.list-row .end .amount { font-weight: 700; font-size: 13px; }

/* --- Chap tarafdagi vertikal navigatsiya (keng ekranlarda) --- */
@media (min-width: 881px) {
  .topbar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 30;
    width: 232px; flex-direction: column; align-items: stretch;
    padding: 20px 14px; gap: 0; border-bottom: none; border-right: 1px solid var(--sb-border);
    overflow-y: auto;
  }
  .topbar .brand { padding: 4px 10px 20px; border-bottom: 1px solid var(--sb-border); margin-bottom: 14px; }
  .topbar nav { flex-direction: column; align-items: stretch; gap: 2px; flex: 1 1 auto; }
  .topbar nav a, .topbar nav .nav-toggle { text-align: left; padding: 10px 12px; border-radius: var(--radius-sm); }
  .nav-group { width: 100%; }
  .nav-toggle {
    width: 100%; display: flex; align-items: center; justify-content: space-between;
    margin-top: 16px; padding: 4px 12px !important; color: var(--sb-muted); cursor: default;
  }
  .nav-toggle:hover { background: transparent !important; color: var(--sb-muted) !important; }
  .nav-toggle svg { display: none; }
  .nav-menu {
    display: flex !important; flex-direction: column; gap: 2px; position: static; min-width: 0; z-index: auto;
    background: transparent; border: none; border-radius: 0; padding: 0; box-shadow: none;
  }
  .nav-menu a { border-radius: var(--radius-sm) !important; }
  .topbar .user-info {
    flex-direction: column; align-items: stretch; gap: 10px; white-space: normal;
    margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--sb-border);
  }
  .icon-row { justify-content: flex-start; }
  .container { margin: 0 0 0 232px; max-width: 900px; }
}

@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; padding: 10px 12px; }
  /* Gorizontal skroll + kichik ochiladigan menyu o'rniga (bu ekran
     torligida ko'p muammo chiqargan: overflow-kesish, mobil Safari'ning
     position:fixed/manzil-paneli xatti-harakati) — bitta xatchizilar
     tugmasi, bosilganda BARCHA bo'limlar oddiy sahifa oqimida (fixed/
     absolute'siz) ochiladi. */
  .topbar nav { display: none; }
  .icon-btn.mobile-menu-toggle { display: inline-flex; order: 2; }
  .topbar .user-info { order: 3; }
  .mobile-menu {
    display: none; order: 5; width: 100%; flex-direction: column; gap: 2px;
    padding-top: 8px; margin-top: 8px; border-top: 1px solid var(--sb-border);
  }
  .mobile-menu.open { display: flex; }
  .mobile-menu a {
    color: var(--sb-muted); font-size: 14px; padding: 10px 12px; border-radius: var(--radius-sm);
    font-weight: 600; display: flex; align-items: center; gap: 9px;
  }
  .mobile-menu a svg { flex-shrink: 0; opacity: .85; color: var(--sb-accent); }
  .mobile-menu a.active { color: var(--sb-text); background: var(--sb-active); }
  .profile-card { display: none; }
  .notif-item.unread { margin: 0 -14px; padding: 12px 14px; }
  .container { padding: 12px; }
  .card { padding: 14px; }
  .stat .value { font-size: 20px; }
  table { font-size: 13px; }
  th, td { padding: 8px 6px; }
  button { padding: 10px 14px; }
  .actions button { flex: 1 1 auto; }
}
