/* Magazin CRM — qorong'i ko'k dizayn (TradeFlow uslubida), mobilga mos */
:root {
  --bg: #070d1c;
  --bg-2: #0a1226;
  --panel: #0e1730;
  --panel-2: #111c3a;
  --border: #1b2850;
  --border-2: #243466;
  --text: #e6ebf5;
  --muted: #8a97b8;
  --muted-2: #61709a;
  --primary: #2f6bff;
  --primary-2: #1d4fd8;
  --green: #22c55e;
  --amber: #f59e0b;
  --red: #ef4444;
  --purple: #8b5cf6;
  --cyan: #06b6d4;
  --pink: #ec4899;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --sidebar-w: 236px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  background-image: radial-gradient(1200px 600px at 20% -10%, rgba(47, 107, 255, .10), transparent 60%);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: #7aa5ff; text-decoration: none; }
a:hover { color: #a9c4ff; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 22px; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
small, .muted { color: var(--muted); }
.muted-2 { color: var(--muted-2); }
hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }
.mono { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.green { color: var(--green); } .red { color: var(--red); } .amber { color: var(--amber); } .blue { color: #6f9bff; } .purple { color: #a78bfa; }
.fw { font-weight: 600; }
.lg { font-size: 18px; }
[data-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-w); z-index: 40;
  background: linear-gradient(180deg, #0a1226 0%, #070d1c 100%);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; }
.brand-logo {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  background: conic-gradient(from 200deg, #2f6bff, #06b6d4, #2f6bff); box-shadow: 0 0 18px rgba(47, 107, 255, .45);
}
.brand-logo [data-lucide] { color: #fff; width: 20px; height: 20px; }
.brand b { display: block; font-size: 16px; }
.brand small { font-size: 11px; }
.nav { padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.nav-title { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted-2); padding: 14px 12px 6px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
  color: #c3cce3; font-weight: 500; transition: background .15s, color .15s;
}
.nav a:hover { background: rgba(47, 107, 255, .08); color: #fff; }
.nav a.active { background: linear-gradient(90deg, var(--primary), var(--primary-2)); color: #fff; box-shadow: 0 6px 18px rgba(47, 107, 255, .35); }
.nav a .badge { margin-left: auto; }
.sidebar-foot { margin-top: auto; padding: 14px; }
.status-card { border: 1px solid var(--border); background: var(--panel); border-radius: 12px; padding: 12px; font-size: 12px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--green); box-shadow: 0 0 8px var(--green); }

.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: 64px; display: flex; align-items: center; gap: 14px; padding: 0 22px;
  background: rgba(7, 13, 28, .85); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border);
}
.search { flex: 1; max-width: 520px; position: relative; }
.search input { padding-left: 38px; background: var(--panel); height: 40px; }
.search [data-lucide] { position: absolute; left: 12px; top: 11px; color: var(--muted); }
.search kbd { position: absolute; right: 10px; top: 10px; font-size: 11px; color: var(--muted); border: 1px solid var(--border-2); border-radius: 6px; padding: 1px 6px; }
.topbar .spacer { flex: 1; }
.icon-btn {
  position: relative; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center;
  background: var(--panel); border: 1px solid var(--border); color: var(--text); cursor: pointer;
}
.icon-btn:hover { border-color: var(--border-2); }
.icon-btn .count { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; border-radius: 9px; font-size: 11px; display: grid; place-items: center; background: var(--red); color: #fff; padding: 0 4px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 8px 4px 4px; border-radius: 12px; cursor: pointer; border: 1px solid transparent; background: none; color: inherit; font: inherit; text-align: left; }
.user-chip:hover { border-color: var(--border); background: var(--panel); }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: linear-gradient(135deg, #2f6bff, #8b5cf6); color: #fff; flex-shrink: 0; }
.user-chip b { display: block; font-size: 13px; }
.user-chip small { font-size: 11px; }
.dropdown { position: relative; }
.dropdown-menu {
  display: none; position: absolute; right: 0; top: calc(100% + 8px); min-width: 280px; max-width: calc(100vw - 24px);
  background: var(--panel-2); border: 1px solid var(--border-2); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; z-index: 50;
}
.dropdown.open .dropdown-menu { display: block; }
.dropdown-menu a, .dropdown-menu button.link { display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 8px; color: var(--text); width: 100%; background: none; border: 0; font: inherit; cursor: pointer; text-align: left; }
.dropdown-menu a:hover, .dropdown-menu button.link:hover { background: rgba(255, 255, 255, .05); }

.content { padding: 22px; flex: 1; width: 100%; max-width: 1600px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin-top: 4px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.bottom-nav { display: none; }
.menu-toggle { display: none; }
.backdrop { display: none; }

/* ---------- Panels & grid ---------- */
.card { background: linear-gradient(180deg, var(--panel) 0%, #0c1530 100%); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-head h2 { display: flex; align-items: center; gap: 8px; }
.card-head a { font-size: 12px; }
.card.flush { padding: 0; }
.card.flush .card-head { padding: 16px 18px 0; }
.grid { display: grid; gap: 16px; }
.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-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.g-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 12px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.mt { margin-top: 16px; } .mt-s { margin-top: 8px; } .mb { margin-bottom: 16px; }

.dash { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }

/* Hero */
.hero {
  position: relative; overflow: hidden; border-radius: var(--radius); border: 1px solid var(--border); padding: 24px 26px; min-height: 120px;
  background:
    linear-gradient(90deg, rgba(7, 13, 28, .92) 0%, rgba(7, 13, 28, .55) 55%, rgba(7, 13, 28, .2) 100%),
    radial-gradient(500px 160px at 75% 120%, rgba(34, 197, 94, .35), transparent 70%),
    radial-gradient(600px 200px at 90% -40%, rgba(245, 158, 11, .30), transparent 70%),
    linear-gradient(180deg, #1b2c5c 0%, #0f1d40 60%, #0b3a2a 100%);
  display: flex; justify-content: space-between; gap: 20px; align-items: center;
}
.hero::after {
  content: ''; position: absolute; inset: auto 0 0 0; height: 55%;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120' preserveAspectRatio='none'%3E%3Cpath d='M0 80 L120 40 L220 70 L340 20 L470 75 L560 45 L680 85 L800 30 L930 70 L1050 35 L1200 65 L1200 120 L0 120Z' fill='%23123a2c' opacity='.85'/%3E%3Cpath d='M0 100 L150 70 L300 95 L450 60 L620 100 L760 72 L900 98 L1060 70 L1200 92 L1200 120 L0 120Z' fill='%230d2a20'/%3E%3C/svg%3E") bottom/100% 100% no-repeat;
  pointer-events: none; opacity: .9;
}
.hero > * { position: relative; z-index: 1; }
.hero h1 { font-size: 22px; }
.hero p { margin: 6px 0 12px; color: #c9d3ec; }
.hero .date { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: #dfe6f7; }
.hero blockquote { margin: 0; font-family: Georgia, serif; font-style: italic; color: #e6ebf5; max-width: 300px; text-align: right; font-size: 15px; }

/* KPI */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.kpi { display: flex; gap: 12px; align-items: center; background: linear-gradient(180deg, var(--panel) 0%, #0c1530 100%); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; min-width: 0; }
.kpi .ico { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; }
.kpi .ico [data-lucide] { width: 22px; height: 22px; }
.kpi .label { color: var(--muted); font-size: 12.5px; }
.kpi .value { font-size: 19px; font-weight: 700; line-height: 1.2; white-space: nowrap; font-variant-numeric: tabular-nums; }
.kpi .delta { font-size: 12px; display: inline-flex; gap: 3px; align-items: center; }
.kpi .delta [data-lucide] { width: 13px; height: 13px; }
.kpi > div:last-child { min-width: 0; }
.ico.blue { background: rgba(47, 107, 255, .16); color: #6f9bff; box-shadow: inset 0 0 0 1px rgba(47, 107, 255, .3); }
.ico.green { background: rgba(34, 197, 94, .14); color: #4ade80; box-shadow: inset 0 0 0 1px rgba(34, 197, 94, .3); }
.ico.red { background: rgba(239, 68, 68, .14); color: #f87171; box-shadow: inset 0 0 0 1px rgba(239, 68, 68, .3); }
.ico.amber { background: rgba(245, 158, 11, .14); color: #fbbf24; box-shadow: inset 0 0 0 1px rgba(245, 158, 11, .3); }
.ico.purple { background: rgba(139, 92, 246, .16); color: #a78bfa; box-shadow: inset 0 0 0 1px rgba(139, 92, 246, .3); }
.ico.cyan { background: rgba(6, 182, 212, .14); color: #22d3ee; box-shadow: inset 0 0 0 1px rgba(6, 182, 212, .3); }
.ico.pink { background: rgba(236, 72, 153, .14); color: #f472b6; box-shadow: inset 0 0 0 1px rgba(236, 72, 153, .3); }
.ico.sm { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; }
.ico.sm [data-lucide] { width: 16px; height: 16px; }

.fin { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.fin .kpi { background: rgba(255, 255, 255, .015); }

/* Lists */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; gap: 12px; align-items: flex-start; padding: 11px 0; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: 0; }
.list-item .t { font-weight: 600; font-size: 13px; }
.list-item .d { color: var(--muted); font-size: 12px; }
.list-item .time { color: var(--muted-2); font-size: 11.5px; }
.list-item > div { min-width: 0; }

/* Tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12px; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; background: rgba(255, 255, 255, .015); }
.table td.main-cell, .table td .nowrap { white-space: nowrap; }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: rgba(47, 107, 255, .04); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tfoot td { font-weight: 700; border-top: 1px solid var(--border-2); }
.card.flush .table th:first-child, .card.flush .table td:first-child { padding-left: 18px; }
.card.flush .table th:last-child, .card.flush .table td:last-child { padding-right: 18px; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.badge.green { background: rgba(34, 197, 94, .14); color: #4ade80; border-color: rgba(34, 197, 94, .35); }
.badge.red { background: rgba(239, 68, 68, .14); color: #f87171; border-color: rgba(239, 68, 68, .35); }
.badge.amber { background: rgba(245, 158, 11, .14); color: #fbbf24; border-color: rgba(245, 158, 11, .35); }
.badge.blue { background: rgba(47, 107, 255, .16); color: #7aa5ff; border-color: rgba(47, 107, 255, .4); }
.badge.purple { background: rgba(139, 92, 246, .16); color: #b69cff; border-color: rgba(139, 92, 246, .4); }
.badge.gray { background: rgba(138, 151, 184, .12); color: #a7b2cf; border-color: rgba(138, 151, 184, .3); }

/* Forms */
label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; font-weight: 500; }
input, select, textarea {
  width: 100%; font: inherit; font-size: 15px; color: var(--text); background: var(--bg-2);
  border: 1px solid var(--border-2); border-radius: var(--radius-sm); padding: 10px 12px; min-height: 44px; outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(47, 107, 255, .2); }
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; min-height: 0; accent-color: var(--primary); }
input[type=date] { color-scheme: dark; }
.check { display: flex; align-items: center; gap: 10px; color: var(--text); font-size: 14px; cursor: pointer; margin: 0; }
.field { margin-bottom: 14px; }
.field .hint { font-size: 12px; color: var(--muted-2); margin-top: 4px; }
.field .err, .err { color: #f87171; font-size: 12.5px; margin-top: 4px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-grid .full { grid-column: 1 / -1; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; }
.filters > * { flex: 1 1 160px; }
.filters .btn { flex: 0 0 auto; }
.filters input, .filters select { min-height: 40px; font-size: 14px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: var(--radius-sm);
  font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; border: 1px solid var(--border-2); background: var(--panel-2); color: var(--text);
  transition: transform .05s, background .15s, border-color .15s; white-space: nowrap; text-decoration: none;
}
.btn:hover { border-color: #3a4f8f; color: #fff; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(180deg, #3b76ff, var(--primary-2)); border-color: transparent; color: #fff; box-shadow: 0 6px 18px rgba(47, 107, 255, .3); }
.btn.success { background: linear-gradient(180deg, #2fd16b, #16a34a); border-color: transparent; color: #fff; box-shadow: 0 6px 18px rgba(34, 197, 94, .25); }
.btn.danger { background: rgba(239, 68, 68, .14); border-color: rgba(239, 68, 68, .45); color: #fca5a5; }
.btn.ghost { background: transparent; }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: 13px; }
.btn.lg { min-height: 54px; font-size: 16px; padding: 0 24px; }
.btn.block { width: 100%; }
.btn[disabled], .btn.loading { opacity: .6; pointer-events: none; }

.quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 10px; }
.quick a { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 6px; border: 1px solid var(--border); border-radius: 12px; background: rgba(255, 255, 255, .02); color: var(--text); font-size: 12px; text-align: center; }
.quick a:hover { border-color: var(--primary); background: rgba(47, 107, 255, .08); }

/* Alerts */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; margin-bottom: 16px; border: 1px solid; font-size: 14px; }
.alert.success { background: rgba(34, 197, 94, .1); border-color: rgba(34, 197, 94, .4); color: #bbf7d0; }
.alert.error { background: rgba(239, 68, 68, .1); border-color: rgba(239, 68, 68, .45); color: #fecaca; }
.alert.info { background: rgba(47, 107, 255, .1); border-color: rgba(47, 107, 255, .4); color: #c7d7ff; }
.alert.warn { background: rgba(245, 158, 11, .1); border-color: rgba(245, 158, 11, .4); color: #fde68a; }
.alert ul { margin: 0; padding-left: 18px; }

.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty [data-lucide] { width: 40px; height: 40px; color: var(--muted-2); margin-bottom: 8px; }

.tabs { display: flex; gap: 4px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; padding: 3px; overflow-x: auto; }
.tabs a { padding: 6px 12px; border-radius: 8px; color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.tabs a.active { background: var(--primary); color: #fff; }

.stat-line { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--border); }
.stat-line:last-child { border-bottom: 0; }
.stat-line.total { font-weight: 700; font-size: 16px; border-top: 1px solid var(--border-2); border-bottom: 0; padding-top: 12px; }

.legend { display: flex; flex-direction: column; gap: 10px; }
.legend div { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.legend span:last-child { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--muted); }

.pagination { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; padding: 14px; }
.pagination a, .pagination span { min-width: 36px; height: 36px; display: grid; place-items: center; padding: 0 10px; border-radius: 8px; border: 1px solid var(--border); color: var(--text); font-size: 13px; }
.pagination .active { background: var(--primary); border-color: var(--primary); }
.pagination .disabled { opacity: .4; }

dialog {
  border: 1px solid var(--border-2); border-radius: 16px; background: var(--panel-2); color: var(--text); padding: 0;
  width: min(480px, calc(100vw - 24px)); box-shadow: var(--shadow);
}
dialog::backdrop { background: rgba(3, 6, 15, .7); backdrop-filter: blur(3px); }
dialog .dlg-head { padding: 16px 18px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
dialog .dlg-body { padding: 18px; }
dialog .dlg-foot { padding: 14px 18px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

.product-cell { display: flex; gap: 10px; align-items: center; min-width: 0; }
.thumb { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex-shrink: 0; background: radial-gradient(circle at 30% 30%, #f5d58a, #b07a2a); color: #3b2506; }

/* ---------- POS ---------- */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 16px; align-items: start; }
.pos-search { position: relative; }
.pos-search input { font-size: 17px; min-height: 54px; padding-left: 46px; padding-right: 56px; }
.pos-search > [data-lucide] { position: absolute; left: 15px; top: 17px; color: var(--muted); width: 20px; height: 20px; }
.pos-search .scan { position: absolute; right: 6px; top: 6px; width: 42px; height: 42px; min-height: 0; padding: 0; }
.results { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-top: 12px; }
.pcard { text-align: left; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 12px; cursor: pointer; color: var(--text); font: inherit; display: flex; flex-direction: column; gap: 6px; min-height: 96px; }
.pcard:hover, .pcard:focus { border-color: var(--primary); outline: none; }
.pcard .n { font-weight: 600; font-size: 14px; line-height: 1.25; }
.pcard .p { font-weight: 700; color: #7aa5ff; margin-top: auto; }
.pcard .s { font-size: 12px; color: var(--muted); }
.pcard.out { opacity: .55; }
.cart { position: sticky; top: 80px; display: flex; flex-direction: column; max-height: calc(100vh - 100px); }
.cart-lines { overflow-y: auto; flex: 1; margin: 0 -18px; padding: 0 18px; }
.cart-line { padding: 12px 0; border-bottom: 1px solid var(--border); }
.cart-line .top { display: flex; justify-content: space-between; gap: 8px; }
.cart-line .name { font-weight: 600; }
.cart-line .ctrl { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.qty { display: flex; align-items: center; border: 1px solid var(--border-2); border-radius: 10px; overflow: hidden; }
.qty button { width: 40px; height: 40px; background: var(--panel-2); border: 0; color: var(--text); font-size: 20px; cursor: pointer; }
.qty input { width: 76px; text-align: center; border: 0; border-radius: 0; min-height: 40px; padding: 0 4px; background: var(--bg-2); }
.cart-line .price-input { width: 110px; min-height: 40px; }
.cart-line .rm { margin-left: auto; color: var(--muted); background: none; border: 0; cursor: pointer; padding: 8px; }
.cart-line .warn { font-size: 12px; color: #fbbf24; margin-top: 6px; }
.cart-total { border-top: 1px solid var(--border-2); padding-top: 12px; margin-top: 4px; }
.cart-total .grand { font-size: 26px; font-weight: 800; }
.methods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.methods label { margin: 0; }
.methods input { display: none; }
.methods span { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border: 1px solid var(--border-2); border-radius: 10px; cursor: pointer; color: var(--text); font-size: 13px; font-weight: 600; }
.methods input:checked + span { border-color: var(--primary); background: rgba(47, 107, 255, .15); }
.suggest { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: var(--panel-2); border: 1px solid var(--border-2); border-radius: 10px; z-index: 20; max-height: 240px; overflow-y: auto; }
.suggest button { display: block; width: 100%; text-align: left; padding: 10px 12px; background: none; border: 0; color: var(--text); font: inherit; cursor: pointer; border-bottom: 1px solid var(--border); }
.suggest button:hover { background: rgba(47, 107, 255, .1); }
#scanner { width: 100%; border-radius: 12px; overflow: hidden; background: #000; }
.cart-fab { display: none; }

/* Receipt */
.receipt { max-width: 380px; margin: 0 auto; background: #fff; color: #111; border-radius: 12px; padding: 20px; font-family: 'Courier New', monospace; font-size: 13px; }
.receipt h2 { text-align: center; font-family: var(--font); }
.receipt .line { display: flex; justify-content: space-between; gap: 8px; }
.receipt hr { border-top: 1px dashed #999; margin: 10px 0; }
.receipt .big { font-size: 18px; font-weight: 700; }

/* Login */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.auth-card { width: min(420px, 100%); }

/* Mobile "Menyu" page */
.menu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.menu-grid a { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: 14px; border: 1px solid var(--border); background: var(--panel); color: var(--text); font-weight: 600; }
.menu-grid a:hover { border-color: var(--primary); }

/* ---------- Responsive ---------- */
@media (max-width: 1280px) {
  .dash { grid-template-columns: 1fr; }
  .g-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .g-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .pos { grid-template-columns: minmax(0, 1fr) 340px; }
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); width: 280px; }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .backdrop { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 35; }
  .main { margin-left: 0; }
  .menu-toggle { display: grid; }
  .topbar { padding: 0 12px; gap: 8px; }
  .search kbd, .user-chip .who { display: none; }
  .content { padding: 16px 16px calc(84px + env(safe-area-inset-bottom)); }
  .bottom-nav {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: rgba(10, 18, 38, .97); border-top: 1px solid var(--border); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); backdrop-filter: blur(10px);
  }
  .bottom-nav a, .bottom-nav button { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; color: var(--muted); padding: 6px 0; background: none; border: 0; font-family: inherit; cursor: pointer; }
  .bottom-nav a.active { color: #7aa5ff; }
  .bottom-nav [data-lucide] { width: 22px; height: 22px; }
  .bottom-nav .sell { color: #fff; }
  .bottom-nav .sell span.ring { width: 46px; height: 46px; margin-top: -22px; border-radius: 50%; background: linear-gradient(180deg, #3b76ff, var(--primary-2)); display: grid; place-items: center; box-shadow: 0 6px 18px rgba(47, 107, 255, .45); border: 3px solid var(--bg); }
  .pos { grid-template-columns: 1fr; }
  .cart { position: fixed; inset: auto 0 0 0; top: auto; max-height: 88vh; z-index: 45; border-radius: 18px 18px 0 0; transform: translateY(105%); transition: transform .2s; padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
  body.cart-open .cart { transform: none; }
  body.cart-open .backdrop { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 44; }
  .cart-fab {
    display: flex; position: fixed; left: 12px; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 31; min-height: 56px; border-radius: 14px;
    justify-content: space-between; padding: 0 18px; font-size: 16px;
  }
  .hero { flex-direction: column; align-items: flex-start; }
  .hero blockquote { text-align: left; }
}
@media (max-width: 640px) {
  h1 { font-size: 19px; }
  .g-2, .g-3, .g-4, .g-5, .g-6 { grid-template-columns: 1fr; }
  .g-6.kp, .g-4.kp { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .span-2, .span-3 { grid-column: auto; }
  .form-grid { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px; }
  .kpi .ico { width: 38px; height: 38px; }
  .kpi .value { font-size: 17px; }
  .fin { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card { padding: 14px; }
  .card.flush .card-head { padding: 14px 14px 0; }
  .search { display: none; }
  .topbar .spacer { display: block; }
  .results { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-head .actions { width: 100%; }
  .page-head .actions .btn { flex: 1; }
  /* Jadvallar telefonda kartochka ko'rinishida */
  table.table.responsive thead { display: none; }
  table.table.responsive, .table.responsive tbody, .table.responsive tr, .table.responsive td { display: block; width: 100%; }
  .table.responsive tr { border-bottom: 1px solid var(--border); padding: 10px 14px; }
  .table.responsive td { border: 0; padding: 4px 0 !important; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .table.responsive td::before { content: attr(data-l); color: var(--muted); font-size: 12px; text-align: left; flex-shrink: 0; }
  .table.responsive td.main-cell { font-weight: 600; font-size: 14px; text-align: left; }
  .table.responsive td.main-cell::before { display: none; }
  .table.responsive tfoot { display: block; }
  .table.responsive tfoot tr { display: flex; justify-content: space-between; }
  .table.responsive td.num { justify-content: space-between; }
}

@media print {
  body { background: #fff; }
  .sidebar, .topbar, .bottom-nav, .no-print, .alert { display: none !important; }
  .main { margin: 0; }
  .content { padding: 0; }
  .receipt { box-shadow: none; border-radius: 0; max-width: 80mm; padding: 0; }
}
