/* ================== MezonTest — umumiy uslublar ================== */
:root {
  --navy: #0e1b3d;
  --blue: #1f6feb;
  --blue-2: #3b8bff;
  --green: #4cb02a;
  --green-2: #6bd043;
  --red: #e5484d;
  --amber: #f5a524;
  --violet: #7c5cff;
  --grad: linear-gradient(135deg, #1f6feb 0%, #22a0c8 50%, #4cb02a 100%);
  --grad-soft: linear-gradient(135deg, rgba(31, 111, 235, 0.12), rgba(76, 176, 42, 0.12));

  --bg: #f3f6fb;
  --bg-2: #e9eef7;
  --surface: #ffffff;
  --surface-2: #f7f9fd;
  --border: #e3e9f3;
  --text: #0e1b3d;
  --text-2: #52607a;
  --muted: #8a96ad;
  --pos: #23913a;
  --neg: #d93a3f;
  --warn-bg: #fff6e0;
  --warn-text: #8a5a00;
  --shadow-sm: 0 1px 2px rgba(14, 27, 61, 0.06), 0 1px 1px rgba(14, 27, 61, 0.04);
  --shadow: 0 10px 30px -12px rgba(14, 27, 61, 0.18), 0 2px 6px rgba(14, 27, 61, 0.05);
  --shadow-lg: 0 30px 60px -20px rgba(14, 27, 61, 0.35);
  --radius: 16px;
  --radius-sm: 10px;
  --sidebar: 264px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: light;
}
:root[data-theme='dark'] {
  --bg: #0a1020;
  --bg-2: #0e1629;
  --surface: #111a2f;
  --surface-2: #16213a;
  --border: #22304d;
  --text: #e8eefb;
  --text-2: #a8b4cc;
  --muted: #6f7d99;
  --pos: #4fd36a;
  --neg: #ff6b70;
  --warn-bg: #3a2c0c;
  --warn-text: #ffcf70;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 12px 34px -14px rgba(0, 0, 0, 0.7), 0 2px 6px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 30px 60px -20px rgba(0, 0, 0, 0.8);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
}
a { color: var(--blue); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
.num, td.n, th.n { font-variant-numeric: tabular-nums; }
.pos { color: var(--pos) !important; }
.neg { color: var(--neg) !important; }
.muted { color: var(--muted); }
.hidden { display: none !important; }
svg.lucide { width: 18px; height: 18px; stroke-width: 2; flex-shrink: 0; }

/* ================== Layout ================== */
.app { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar); z-index: 40;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  transition: transform 0.35s var(--ease);
}
.sidebar .brand { padding: 20px 18px 14px; }
.logo-pill {
  display: flex; align-items: center; justify-content: center;
  background: #fff; border-radius: 14px; padding: 8px 12px; min-height: 58px;
  box-shadow: var(--shadow-sm); border: 1px solid var(--border);
}
.logo-pill img { max-width: 100%; max-height: 46px; display: block; }
.text-logo { font-weight: 800; font-size: 24px; letter-spacing: -0.5px; color: var(--navy); }
.text-logo b { color: var(--green); font-weight: 800; }
.nav { padding: 8px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; overflow-y: auto; }
.nav-label { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding: 14px 12px 6px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px;
  color: var(--text-2); font-weight: 600; position: relative; transition: all 0.2s var(--ease);
}
.nav a:hover { background: var(--surface-2); color: var(--text); transform: translateX(2px); }
.nav a.active { background: var(--grad); color: #fff; box-shadow: 0 8px 20px -8px rgba(31, 111, 235, 0.6); }
.nav a.active svg { color: #fff; }
.sidebar-foot { padding: 14px; border-top: 1px solid var(--border); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; background: var(--surface-2); }
.avatar { width: 36px; height: 36px; border-radius: 10px; background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 800; flex-shrink: 0; }
.user-chip .meta { flex: 1; min-width: 0; }
.user-chip .meta b { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip .meta small { color: var(--muted); font-size: 12px; }

.main { flex: 1; margin-left: var(--sidebar); min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px;
  padding: 14px 28px; background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
}
.topbar h1 { font-size: 20px; margin: 0; font-weight: 800; letter-spacing: -0.3px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-btn {
  display: flex; align-items: center; gap: 10px; padding: 9px 14px; min-width: 240px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; color: var(--muted); cursor: pointer;
}
.search-btn kbd { margin-left: auto; font-size: 11px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; }
.content { padding: 26px 28px 60px; max-width: 1500px; width: 100%; margin: 0 auto; }
.menu-toggle { display: none; }
.backdrop { position: fixed; inset: 0; background: rgba(5, 10, 25, 0.5); z-index: 35; opacity: 0; pointer-events: none; transition: opacity 0.3s; }

/* Sahifa o'tish animatsiyasi */
.page-enter { animation: pageIn 0.45s var(--ease) both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.stagger > * { animation: pageIn 0.5s var(--ease) both; }
.stagger > *:nth-child(2) { animation-delay: 0.05s; }
.stagger > *:nth-child(3) { animation-delay: 0.1s; }
.stagger > *:nth-child(4) { animation-delay: 0.15s; }
.stagger > *:nth-child(5) { animation-delay: 0.2s; }
.stagger > *:nth-child(6) { animation-delay: 0.25s; }
.stagger > *:nth-child(7) { animation-delay: 0.3s; }
.stagger > *:nth-child(8) { animation-delay: 0.35s; }

/* ================== Tugmalar ================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px;
  border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-weight: 700; font-size: 14px; cursor: pointer; white-space: nowrap; transition: all 0.2s var(--ease);
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--blue) 40%, var(--border)); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-primary { background: var(--grad); color: #fff; border: 0; box-shadow: 0 8px 20px -10px rgba(31, 111, 235, 0.7); }
.btn-primary:hover { box-shadow: 0 14px 28px -12px rgba(31, 111, 235, 0.8); filter: saturate(1.1); }
.btn-green { background: linear-gradient(135deg, #3fa224, #6bd043); color: #fff; border: 0; }
.btn-danger { background: var(--red); color: #fff; border: 0; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-2); box-shadow: none; }
.btn-sm { padding: 6px 10px; font-size: 13px; border-radius: 10px; }
.icon-btn { width: 38px; height: 38px; padding: 0; border-radius: 11px; }
.icon-btn.sm { width: 30px; height: 30px; border-radius: 9px; }
.icon-btn.sm svg { width: 15px; height: 15px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.spinner { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ================== Kartalar ================== */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px 0; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; font-size: 16px; font-weight: 800; flex: 1; display: flex; align-items: center; gap: 8px; }
.card-body { padding: 16px 20px 20px; }
.grid { display: grid; gap: 18px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.mt { margin-top: 18px; }
.mt-lg { margin-top: 28px; }

.stat {
  position: relative; overflow: hidden; padding: 18px 18px 16px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.stat:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.stat::after {
  content: ''; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%;
  background: var(--accent, var(--blue)); opacity: 0.08; transition: transform 0.4s var(--ease);
}
.stat:hover::after { transform: scale(1.3); }
.stat .ic {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: #fff;
  background: var(--accent, var(--blue)); box-shadow: 0 8px 18px -8px var(--accent, var(--blue)); margin-bottom: 12px;
}
.stat .label { color: var(--text-2); font-size: 13px; font-weight: 600; }
.stat .value { font-size: 24px; font-weight: 800; letter-spacing: -0.5px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .value small { font-size: 13px; font-weight: 700; color: var(--muted); margin-left: 4px; }
.stat .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.stat.big { background: var(--grad); color: #fff; border: 0; }
.stat.big .label, .stat.big .hint, .stat.big .value small { color: rgba(255, 255, 255, 0.85); }
.stat.big .ic { background: rgba(255, 255, 255, 0.2); box-shadow: none; }
.stat.big::after { background: #fff; opacity: 0.12; }
.a-blue { --accent: #1f6feb; } .a-green { --accent: #3fa224; } .a-amber { --accent: #f59e0b; }
.a-red { --accent: #e5484d; } .a-violet { --accent: #7c5cff; } .a-cyan { --accent: #0ea5b7; } .a-navy { --accent: #1e3a8a; }

/* Hero banner */
.hero {
  position: relative; overflow: hidden; border-radius: 22px; padding: 28px 30px; color: #fff;
  background: radial-gradient(circle at 85% 20%, rgba(255, 255, 255, 0.18), transparent 40%), linear-gradient(120deg, #0e1b3d 0%, #1d4fb8 55%, #2f9a3a 120%);
  box-shadow: var(--shadow-lg); margin-bottom: 22px; min-height: 150px;
}
.hero h2 { margin: 0 0 6px; font-size: 26px; font-weight: 800; letter-spacing: -0.5px; position: relative; z-index: 1; }
.hero p { margin: 0; opacity: 0.85; max-width: 560px; position: relative; z-index: 1; }
.hero .hero-art { position: absolute; right: 18px; bottom: -12px; height: 170px; opacity: 0.95; pointer-events: none; }
.hero .hero-photo { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: 0.18; mix-blend-mode: luminosity; }
.hero .chips { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; position: relative; z-index: 1; }
.hero .chip { background: rgba(255, 255, 255, 0.14); border: 1px solid rgba(255, 255, 255, 0.2); backdrop-filter: blur(6px); padding: 5px 12px; border-radius: 99px; font-size: 13px; font-weight: 600; }

/* Bo'lim sarlavhasi */
.section-title { display: flex; align-items: center; gap: 10px; margin: 30px 0 14px; }
.section-title h2 { margin: 0; font-size: 18px; font-weight: 800; }
.section-title .line { flex: 1; height: 1px; background: var(--border); }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; background: var(--grad-soft); color: var(--blue); }

/* ================== Jadvallar ================== */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .spacer { flex: 1; }
.search-input { position: relative; min-width: 220px; flex: 0 1 300px; }
.search-input svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 16px; height: 16px; }
.search-input input { padding-left: 36px !important; }
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-sm); }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.tbl th {
  position: sticky; top: 0; background: var(--surface-2); color: var(--text-2); font-weight: 700; font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.03em; text-align: left; padding: 12px 12px; border-bottom: 1px solid var(--border);
  white-space: nowrap; user-select: none; z-index: 1;
}
.tbl th.sortable { cursor: pointer; }
.tbl th.sortable:hover { color: var(--blue); }
.tbl th .arrow { opacity: 0.4; margin-left: 4px; font-size: 10px; }
.tbl th.sorted .arrow { opacity: 1; color: var(--blue); }
.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; vertical-align: middle; }
.tbl td.wrap { white-space: normal; min-width: 160px; max-width: 280px; }
.tbl tbody tr { transition: background 0.15s; }
.tbl tbody tr:hover { background: color-mix(in srgb, var(--blue) 5%, transparent); }
.tbl .n { text-align: right; }
.tbl tfoot td { background: var(--surface-2); font-weight: 800; border-bottom: 0; border-top: 2px solid var(--border); position: sticky; bottom: 0; }
.tbl tr.warn td { background: color-mix(in srgb, var(--amber) 9%, transparent); }
.tbl td.actions { text-align: right; width: 1%; }
.tbl td.actions .btn-row { justify-content: flex-end; flex-wrap: nowrap; gap: 4px; }
.tbl .link { font-weight: 700; color: var(--text); cursor: pointer; }
.tbl .link:hover { color: var(--blue); }
.money-cell { cursor: pointer; display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border-radius: 8px; border: 1px dashed transparent; }
.money-cell:hover { border-color: var(--blue); background: color-mix(in srgb, var(--blue) 8%, transparent); }
.money-cell svg { width: 14px; height: 14px; color: var(--muted); }
.remainder-badge { display: inline-block; min-width: 28px; text-align: center; padding: 2px 8px; border-radius: 8px; font-weight: 700; }
.remainder-badge.bad { background: var(--warn-bg); color: var(--warn-text); }

/* ================== Badge / toggle ================== */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; border: 0; cursor: default; white-space: nowrap; }
button.badge { cursor: pointer; transition: transform 0.15s; }
button.badge:hover { transform: scale(1.06); }
.badge.yes { background: color-mix(in srgb, var(--green) 16%, transparent); color: var(--pos); }
.badge.no { background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--neg); }
.badge.blue { background: color-mix(in srgb, var(--blue) 14%, transparent); color: var(--blue); }
.badge.violet { background: color-mix(in srgb, var(--violet) 16%, transparent); color: var(--violet); }
.badge.gray { background: var(--surface-2); color: var(--text-2); }
.badge.amber { background: var(--warn-bg); color: var(--warn-text); }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ================== Formalar ================== */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 700; color: var(--text-2); }
.field label .req { color: var(--red); }
.field .help { font-size: 12px; color: var(--muted); }
.input, .select, textarea.input {
  width: 100%; padding: 10px 13px; border: 1.5px solid var(--border); border-radius: 11px;
  background: var(--surface); outline: none; transition: border 0.2s, box-shadow 0.2s;
}
.input:focus, .select:focus { border-color: var(--blue); box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 15%, transparent); }
.input.invalid { border-color: var(--red); box-shadow: 0 0 0 4px color-mix(in srgb, var(--red) 12%, transparent); }
textarea.input { min-height: 80px; resize: vertical; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a96ad' stroke-width='3'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 3px; gap: 3px; }
.seg button { border: 0; background: transparent; padding: 7px 14px; border-radius: 9px; font-weight: 700; color: var(--text-2); cursor: pointer; transition: all 0.2s; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.seg button.on.yes { background: var(--green); color: #fff; }
.seg button.on.no { background: var(--red); color: #fff; }
.input-suffix { position: relative; }
.input-suffix span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 13px; font-weight: 700; pointer-events: none; }
.input-suffix .input { padding-right: 48px; }
.calc-preview { padding: 12px 14px; border-radius: 12px; background: var(--grad-soft); display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-weight: 700; }

/* ================== Tablar (partiyalar) ================== */
.tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.tab {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 16px; border-radius: 14px; cursor: pointer;
  border: 1.5px solid var(--border); background: var(--surface); min-width: 150px; transition: all 0.2s var(--ease); text-align: left;
}
.tab b { font-size: 14px; }
.tab small { color: var(--muted); font-size: 12px; }
.tab:hover { border-color: var(--blue); }
.tab.on { border-color: transparent; background: var(--grad); color: #fff; box-shadow: 0 10px 24px -12px rgba(31, 111, 235, 0.8); }
.tab.on small { color: rgba(255, 255, 255, 0.85); }
.tab.add { align-items: center; justify-content: center; flex-direction: row; min-width: 130px; border-style: dashed; color: var(--blue); font-weight: 700; }

/* Breadcrumb */
.crumbs { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; margin-bottom: 14px; flex-wrap: wrap; }
.crumbs a { color: var(--text-2); font-weight: 600; }
.crumbs a:hover { color: var(--blue); }
.crumbs svg { width: 14px; height: 14px; }

/* Region / tuman kartochkalari */
.entity-card { padding: 20px; cursor: pointer; position: relative; overflow: hidden; transition: all 0.25s var(--ease); }
.entity-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--blue) 35%, var(--border)); }
.entity-card .top { display: flex; align-items: flex-start; gap: 12px; }
.entity-card .ic { width: 46px; height: 46px; border-radius: 14px; background: var(--grad); color: #fff; display: grid; place-items: center; flex-shrink: 0; }
.entity-card h3 { margin: 0; font-size: 17px; font-weight: 800; }
.entity-card .sub { color: var(--muted); font-size: 13px; }
.entity-card .kv { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.entity-card .kv div { background: var(--surface-2); border-radius: 10px; padding: 8px 10px; }
.entity-card .kv small { display: block; color: var(--muted); font-size: 11.5px; font-weight: 600; }
.entity-card .kv b { font-size: 14.5px; }
.entity-card .menu { position: absolute; top: 14px; right: 12px; display: flex; gap: 4px; opacity: 0; transition: opacity 0.2s; }
.entity-card:hover .menu { opacity: 1; }

/* Progress */
.progress { height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--border); }
.progress > span { display: block; height: 100%; width: 0; background: var(--grad); border-radius: 99px; transition: width 1.2s var(--ease); }
.progress.over > span { background: linear-gradient(90deg, #f59e0b, #e5484d); }

/* Ulushdor kartochkasi */
.sh-card { padding: 20px; }
.sh-card .head { display: flex; align-items: center; gap: 12px; }
.sh-card .percent { font-size: 28px; font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; margin-left: auto; }
.sh-card .rows { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 16px 0 12px; }
.sh-card .rows div small { display: block; color: var(--muted); font-size: 12px; font-weight: 600; }
.sh-card .rows div b { font-size: 15px; }

/* Ogohlantirish */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: 12px; background: var(--warn-bg); color: var(--warn-text); font-weight: 600; margin-bottom: 16px; }
.alert.info { background: color-mix(in srgb, var(--blue) 10%, transparent); color: var(--blue); }
.alert.danger { background: color-mix(in srgb, var(--red) 12%, transparent); color: var(--neg); }

/* Bo'sh holat */
.empty { text-align: center; padding: 50px 20px; color: var(--text-2); }
.empty img { width: 180px; max-width: 60%; margin-bottom: 10px; opacity: 0.95; }
.empty h3 { margin: 6px 0; color: var(--text); }

/* ================== Skeleton ================== */
.skel { position: relative; overflow: hidden; background: var(--surface-2); border-radius: 12px; }
.skel::after {
  content: ''; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--surface) 70%, transparent), transparent);
  animation: shimmer 1.3s infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }
.skel-stat { height: 132px; }
.skel-line { height: 14px; margin: 10px 0; }
.skel-block { height: 300px; }

/* ================== Modal ================== */
.modal-root { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; }
.modal-bg { position: absolute; inset: 0; background: rgba(5, 10, 25, 0.55); backdrop-filter: blur(4px); animation: fadeIn 0.25s both; }
.modal {
  position: relative; width: 100%; max-width: 560px; max-height: calc(100vh - 32px); display: flex; flex-direction: column;
  background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-lg); border: 1px solid var(--border);
  animation: modalIn 0.35s var(--ease) both;
}
.modal.wide { max-width: 820px; }
.modal.xwide { max-width: 1000px; }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; font-size: 17px; font-weight: 800; flex: 1; }
.modal-body { padding: 20px 22px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.modal-root.closing .modal { animation: modalOut 0.2s both; }
.modal-root.closing .modal-bg { animation: fadeOut 0.2s both; }
@keyframes modalIn { from { opacity: 0; transform: translateY(20px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes modalOut { to { opacity: 0; transform: translateY(10px) scale(0.98); } }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }
.confirm-ic { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; margin-bottom: 12px; background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); }
.confirm-ic svg { width: 28px; height: 28px; }

/* ================== Toast ================== */
.toasts { position: fixed; top: 18px; right: 18px; z-index: 200; display: flex; flex-direction: column; gap: 10px; max-width: calc(100vw - 36px); }
.toast {
  display: flex; align-items: flex-start; gap: 10px; min-width: 280px; max-width: 420px; padding: 13px 16px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); font-weight: 600;
  animation: toastIn 0.4s var(--ease) both; border-left: 4px solid var(--blue);
}
.toast.success { border-left-color: var(--green); } .toast.success svg { color: var(--green); }
.toast.error { border-left-color: var(--red); } .toast.error svg { color: var(--red); }
.toast.warn { border-left-color: var(--amber); } .toast.warn svg { color: var(--amber); }
.toast.out { animation: toastOut 0.3s both; }
@keyframes toastIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(40px); } }

/* ================== Global qidiruv ================== */
.palette { max-width: 620px; align-self: start; margin-top: 10vh; }
.palette .p-input { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.palette .p-input input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 16px; }
.palette .p-list { max-height: 50vh; overflow-y: auto; padding: 8px; }
.palette .p-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; cursor: pointer; color: var(--text); }
.palette .p-item.on, .palette .p-item:hover { background: var(--grad-soft); }
.palette .p-item .pi { width: 34px; height: 34px; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; color: var(--blue); }
.palette .p-item small { display: block; color: var(--muted); }

/* Dropzone */
.dropzone { border: 2px dashed var(--border); border-radius: 16px; padding: 30px; text-align: center; cursor: pointer; transition: all 0.2s; background: var(--surface-2); }
.dropzone:hover, .dropzone.drag { border-color: var(--blue); background: var(--grad-soft); }
.dropzone svg { width: 36px; height: 36px; color: var(--blue); }

/* Diagrammalar */
.chart-box { position: relative; height: 300px; }
.chart-box.sm { height: 240px; }

/* Mavzu almashtirgich */
.theme-toggle .sun { display: none; }
:root[data-theme='dark'] .theme-toggle .sun { display: block; }
:root[data-theme='dark'] .theme-toggle .moon { display: none; }

/* Ro'yxat (to'lovlar) */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: 0; }
.list-item .li-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--green) 14%, transparent); color: var(--pos); flex-shrink: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item small { color: var(--muted); display: block; }

/* ================== Chop etish ================== */
@media print {
  .sidebar, .topbar, .toolbar, .no-print, .tabs, .actions, .toasts, .hero .hero-art { display: none !important; }
  .main { margin: 0 !important; }
  .content { padding: 0 !important; max-width: none; }
  body { background: #fff; color: #000; font-size: 11px; }
  .card, .table-wrap { box-shadow: none !important; border-color: #ccc !important; }
  .tbl th { position: static; background: #eee !important; color: #000; }
  .tbl td, .tbl th { padding: 5px 6px; }
  .print-only { display: block !important; }
}
.print-only { display: none; }

.batch-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.pay-form { grid-template-columns: 1.2fr 1fr 1.5fr auto; align-items: end; }
.filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-bottom: 14px; }

/* ================== Responsive ================== */
@media (max-width: 1200px) {
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .backdrop { opacity: 1; pointer-events: auto; }
  .main { margin-left: 0; }
  .menu-toggle { display: inline-flex; }
  .g-3, .g-2, .batch-grid { grid-template-columns: minmax(0, 1fr); }
  .pay-form { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .pay-form .btn { grid-column: 1 / -1; }
  .search-btn { min-width: 0; }
  .search-btn span, .search-btn kbd { display: none; }
  .hero .hero-art { height: 120px; opacity: 0.4; }
}
@media (max-width: 640px) {
  .content { padding: 16px 14px 50px; }
  .topbar { padding: 12px 14px; }
  .topbar h1 { font-size: 17px; }
  .g-4 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
  .stat { padding: 14px; }
  .stat .value { font-size: 18px; }
  .stat .ic { width: 34px; height: 34px; margin-bottom: 8px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .hero { padding: 22px 20px; }
  .hero h2 { font-size: 21px; }
  .modal-root { padding: 0; place-items: end center; }
  .modal { border-radius: 20px 20px 0 0; max-height: 92vh; }
  .toolbar .search-input { flex: 1 1 100%; }
  .sh-card .rows { grid-template-columns: 1fr 1fr; }
  .toast { min-width: 0; }
  .entity-card .menu { opacity: 1; }
}
