/* ==========================================================================
   Choyxona: dizayn tizimi (fitnes tizimi uslubida: ranglar, shrift, kartalar)
   ========================================================================== */

:root {
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --bg: #f5f6fa;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --surface-3: #f2f4f8;
  --surface-hover: #f2f4f8;
  --border: #e6e8ef;
  --border-strong: #d5d9e3;
  --text: #0f172a;
  --text-2: #4b5567;
  --muted: #8a93a6;

  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-soft: #eef0ff;
  --primary-text: #4338ca;
  --on-primary: #ffffff;

  --accent: #d97706;
  --accent-soft: #fdf3e2;
  --accent-text: #b45309;
  --success: #16a34a;
  --success-soft: #e7f8ee;
  --success-text: #15803d;
  --danger: #dc2626;
  --danger-soft: #fdecec;
  --danger-text: #b91c1c;
  --warning: #d97706;
  --warning-soft: #fdf3e2;
  --warning-text: #b45309;
  --info: #0284c7;
  --info-soft: #e6f4fb;
  --info-text: #0369a1;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-lg: 0 12px 32px -8px rgba(16, 24, 40, .18), 0 4px 8px -4px rgba(16, 24, 40, .06);
  --ring: 0 0 0 4px rgba(79, 70, 229, .16);
  --overlay: rgba(15, 23, 42, .45);

  --sidebar-w: 264px;
  --topbar-h: 72px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #0a0c12;
  --surface: #11141c;
  --surface-2: #161a24;
  --surface-3: #1b2030;
  --surface-hover: #1b2030;
  --border: #222839;
  --border-strong: #2e3549;
  --text: #e8eaf0;
  --text-2: #a3aabb;
  --muted: #6c7489;

  --primary: #6366f1;
  --primary-hover: #7c7ff5;
  --primary-soft: rgba(99, 102, 241, .14);
  --primary-text: #a5a8fb;

  --accent: #f59e0b;
  --accent-soft: rgba(245, 158, 11, .13);
  --accent-text: #fbbf24;
  --success: #22c55e;
  --success-soft: rgba(34, 197, 94, .12);
  --success-text: #4ade80;
  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, .13);
  --danger-text: #f87171;
  --warning: #f59e0b;
  --warning-soft: rgba(245, 158, 11, .13);
  --warning-text: #fbbf24;
  --info: #0ea5e9;
  --info-soft: rgba(14, 165, 233, .13);
  --info-text: #38bdf8;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 1px 3px rgba(0, 0, 0, .35);
  --shadow-lg: 0 16px 40px -8px rgba(0, 0, 0, .6);
  --ring: 0 0 0 4px rgba(99, 102, 241, .25);
  --overlay: rgba(0, 0, 0, .6);
  color-scheme: dark;
}

/* --- Asos ---------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}
h1, h2, h3, h4, h5, h6, p { margin: 0; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
.icon { flex-shrink: 0; }
.num, .tabular { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--radius-sm); }

.skip-link {
  position: absolute; left: 16px; top: 16px; z-index: 100;
  padding: 8px 14px; border-radius: 10px; background: var(--primary); color: #fff;
  transform: translateY(-200%); transition: transform .2s;
}
.skip-link:focus { transform: none; }

/* --- Matn uslublari ------------------------------------------------------ */
.heading-3 { font-size: 30px; line-height: 1.15; font-weight: 800; letter-spacing: -.03em; }
.heading-4 { font-size: 30px; line-height: 1.15; font-weight: 800; letter-spacing: -.03em; }
.heading-5 { font-size: 24px; line-height: 1.2; font-weight: 750; letter-spacing: -.03em; }
.heading-6 { font-size: 20px; line-height: 1.3; font-weight: 700; letter-spacing: -.02em; }
.title-1 { font-size: 18px; font-weight: 650; letter-spacing: -.01em; }
.title-2 { font-size: 15px; font-weight: 650; letter-spacing: -.01em; }
.title-3 { font-size: 14px; font-weight: 600; }
.title-4 { font-size: 13px; font-weight: 600; }
.title-5 { font-size: 12px; font-weight: 600; }
.body-1 { font-size: 15px; font-weight: 700; }
.body-2 { font-size: 14px; font-weight: 500; }
.body-3 { font-size: 14px; }
.body-4 { font-size: 14px; font-weight: 600; }
.body-5 { font-size: 14px; font-weight: 600; }
.body-6 { font-size: 13.5px; }
.caption-1 { font-size: 13px; font-weight: 500; }
.caption-2 { font-size: 13px; }
.caption-3 { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.caption-4 { font-size: 12.5px; font-weight: 500; }
.caption-5 { font-size: 12.5px; }
.text-2 { color: var(--text-2); }
.muted { color: var(--muted); }
.text-right { text-align: right; }
.text-success { color: var(--success-text); }
.text-danger { color: var(--danger-text); }
.text-warning { color: var(--warning-text); }
.text-primary { color: var(--primary-text); }

/* --- Joylashuv ----------------------------------------------------------- */
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 6px; }
.stack-lg { display: flex; flex-direction: column; gap: 24px; }
.stack > *, .stack-lg > *, .grid > * { min-width: 0; }
.row { display: flex; align-items: center; gap: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 20px; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 1fr) 380px; align-items: start; }
.page-narrow { max-width: 760px; }
@media (max-width: 1200px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1100px) { .grid-main { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) { .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid { gap: 14px; } }
@media (max-width: 480px) { .grid-2.grid-stack-sm { grid-template-columns: minmax(0, 1fr); } }

/* --- Qobiq --------------------------------------------------------------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 40;
  display: flex; flex-direction: column;
  background: var(--surface); border-right: 1px solid var(--border);
  transition: transform .25s var(--ease);
}
.sidebar-head { display: flex; align-items: center; height: var(--topbar-h); padding: 0 12px 0 20px; border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.brand-mark {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; flex: none;
  color: #fff;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 50%, #7c3aed 100%);
  box-shadow: 0 6px 14px -4px rgba(79, 70, 229, .55);
}
.brand-logo { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; flex: none; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name { font-weight: 700; font-size: 15px; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-sub { font-size: 12px; color: var(--muted); }

.nav { flex: 1; overflow-y: auto; padding: 12px; }
.nav-section { margin: 16px 12px 6px; color: var(--muted); }
.nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; margin-bottom: 2px; border-radius: 10px;
  color: var(--text-2); font-weight: 500;
  transition: background .15s, color .15s;
}
.nav-link:hover { background: var(--surface-hover); color: var(--text); }
.nav-link.active { background: var(--primary-soft); color: var(--primary-text); font-weight: 600; }
.nav-badge {
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px;
  display: inline-grid; place-items: center; border-radius: 99px;
  font-size: 11.5px; font-weight: 700; background: var(--warning); color: #fff;
}
.sidebar-footer { padding: 12px; border-top: 1px solid var(--border); display: grid; gap: 12px; }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 4px 4px 0; }
.sidebar-user-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.sidebar-user-info > * { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-backdrop { display: none; }
.sidebar-close { display: none !important; }

.main { flex: 1; min-width: 0; margin-left: var(--sidebar-w); display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  height: var(--topbar-h); padding: 0 32px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(12px); backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar .topbar-menu { display: none; }
.topbar-title { flex: 1; min-width: 0; }
.topbar-title h1 { font-size: 20px; font-weight: 700; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.breadcrumb { display: flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--muted); margin-bottom: 1px; }
.breadcrumb a:hover { color: var(--text); }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.content { padding: 28px 32px 48px; width: 100%; max-width: 1400px; }

.cash-chip {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px;
  border-radius: 10px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #059669 0%, #0d9488 55%, #0891b2 100%);
  box-shadow: 0 6px 14px -6px rgba(5, 150, 105, .6);
  transition: filter .15s, transform .15s;
}
.cash-chip:hover { filter: brightness(1.06); }
.cash-chip:active { transform: translateY(1px); }

[data-theme="dark"] .theme-icon-light, :root:not([data-theme="dark"]) .theme-icon-dark { display: none; }
.theme-icon-light, .theme-icon-dark { display: flex; }

@media (max-width: 1023px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  body.sidebar-open .sidebar { transform: none; }
  body.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 35; background: var(--overlay); }
  body.sidebar-open { overflow: hidden; }
  .sidebar-close { display: inline-flex !important; }
  .main { margin-left: 0; }
  .topbar { padding: 0 16px; height: 64px; }
  .topbar .topbar-menu { display: inline-flex; }
  .content { padding: 20px 16px 40px; }
}
@media (max-width: 480px) {
  .cash-chip { padding: 0 10px; font-size: 13px; }
  .cash-chip .icon { display: none; }
}

/* --- Tugmalar ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid transparent;
  font-size: 14px; font-weight: 600; white-space: nowrap; cursor: pointer; user-select: none;
  background: none; color: var(--text);
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .05s, filter .15s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn.is-disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }
.btn-primary { background: var(--primary); color: var(--on-primary); box-shadow: 0 1px 2px rgba(79, 70, 229, .3), inset 0 1px 0 rgba(255, 255, 255, .12); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-outline { background: var(--surface); border-color: var(--border-strong); color: var(--text); box-shadow: var(--shadow-sm); }
.btn-outline:hover { background: var(--surface-hover); }
.btn-ghost { color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-hover); color: var(--text); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { filter: brightness(1.06); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.06); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { filter: brightness(1.06); }
.btn-light { background: #fff; color: #047857; }
.btn-light:hover { background: #f0fdf4; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 9px; gap: 6px; }
.btn-lg { height: 48px; padding: 0 22px; font-size: 15px; border-radius: 12px; }
.btn-icon { width: 40px; padding: 0; }
.btn-sm.btn-icon { width: 34px; }
.btn-block { width: 100%; }

/* --- Karta --------------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); min-width: 0; }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.card-body { padding: 20px; }
.card-footer { padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.card-flat { box-shadow: none; background: var(--surface-2); }
@media (max-width: 600px) {
  .card-header { padding: 14px 16px; }
  .card-body { padding: 16px; }
  .card-footer { padding: 12px 16px; }
}

/* Statistika kartalari */
.stat { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stat-label { font-size: 13px; font-weight: 500; color: var(--text-2); display: flex; align-items: center; gap: 8px; }
.stat-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; flex: none; }
.tone-primary { background: var(--primary-soft); color: var(--primary-text); }
.tone-success { background: var(--success-soft); color: var(--success-text); }
.tone-warning { background: var(--warning-soft); color: var(--warning-text); }
.tone-info { background: var(--info-soft); color: var(--info-text); }
.tone-danger { background: var(--danger-soft); color: var(--danger-text); }
.stat-value { font-size: 26px; font-weight: 750; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat-value small { font-size: 14px; font-weight: 600; color: var(--muted); letter-spacing: 0; margin-left: 2px; }
.stat-meta { font-size: 12.5px; color: var(--muted); }
a.stat:hover { border-color: var(--border-strong); }
@media (max-width: 600px) { .stat { padding: 16px; gap: 10px; } .stat-value { font-size: 21px; } }

/* Kassa kartasi (gradient) */
.cash-hero {
  padding: 24px; border-radius: var(--radius-lg); color: #fff;
  background:
    radial-gradient(120% 120% at 100% 0%, rgba(255, 255, 255, .18), transparent 50%),
    linear-gradient(135deg, #059669 0%, #0d9488 55%, #0891b2 100%);
  box-shadow: 0 16px 32px -14px rgba(5, 150, 105, .6);
}
.cash-hero.is-pending {
  background:
    radial-gradient(120% 120% at 100% 0%, rgba(255, 255, 255, .18), transparent 50%),
    linear-gradient(135deg, #d97706, #ea580c);
  box-shadow: 0 16px 32px -14px rgba(234, 88, 12, .6);
}
.cash-hero.is-empty { background: var(--surface-2); color: var(--text); border: 1px dashed var(--border-strong); box-shadow: none; }
.cash-hero-label { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; opacity: .85; }
.cash-hero-value { font-size: 34px; font-weight: 800; letter-spacing: -.03em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.cash-hero-meta { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 10px; font-size: 13px; opacity: .9; }
.cash-hero-meta span { display: inline-flex; align-items: center; gap: 6px; }
.cash-hero .btn-light { color: #047857; }
.cash-hero.is-pending .btn-light { color: #b45309; }
@media (max-width: 600px) { .cash-hero { padding: 20px; } .cash-hero-value { font-size: 28px; } }

/* --- Badge, avatar ------------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px;
  border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap;
  background: var(--surface-2); color: var(--text-2);
}
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-success { background: var(--success-soft); color: var(--success-text); }
.badge-danger { background: var(--danger-soft); color: var(--danger-text); }
.badge-warning { background: var(--warning-soft); color: var(--warning-text); }
.badge-info { background: var(--info-soft); color: var(--info-text); }
.badge-primary { background: var(--primary-soft); color: var(--primary-text); }
.badge-accent { background: var(--accent-soft); color: var(--accent-text); }
.badge-muted { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }

.avatar { border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.avatar-sm { width: 32px; height: 32px; font-size: 12px; }
.avatar-md { width: 40px; height: 40px; font-size: 14px; }
.avatar-initials { display: inline-grid; place-items: center; font-weight: 700; color: #fff; letter-spacing: .02em; }
.avatar-initials[data-seed="0"] { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.avatar-initials[data-seed="1"] { background: linear-gradient(135deg, #0ea5e9, #6366f1); }
.avatar-initials[data-seed="2"] { background: linear-gradient(135deg, #10b981, #0ea5e9); }
.avatar-initials[data-seed="3"] { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.avatar-initials[data-seed="4"] { background: linear-gradient(135deg, #ec4899, #8b5cf6); }
.avatar-initials[data-seed="5"] { background: linear-gradient(135deg, #14b8a6, #22c55e); }
.cell-user { display: flex; align-items: center; gap: 12px; min-width: 0; }

/* --- Ogohlantirish ------------------------------------------------------- */
.alert { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: var(--radius); font-size: 13.5px; background: var(--surface-2); }
.alert > .icon { margin-top: 1px; }
.alert-info { background: var(--info-soft); color: var(--info-text); }
.alert-success { background: var(--success-soft); color: var(--success-text); }
.alert-warning { background: var(--warning-soft); color: var(--warning-text); }
.alert-danger { background: var(--danger-soft); color: var(--danger-text); }
.alert a { text-decoration: underline; font-weight: 600; }

/* --- Forma --------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.label { font-size: 13px; font-weight: 600; color: var(--text); }
.label .req, .req { color: var(--danger); }
.label .opt { color: var(--muted); font-weight: 400; }
.input, .select, .textarea {
  width: 100%; height: 42px; padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--border-strong); background: var(--surface); box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s; outline: none;
}
.textarea { height: auto; min-height: 96px; padding: 10px 14px; resize: vertical; }
.select {
  appearance: none; padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a93a6' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.input::placeholder, .textarea::placeholder { color: var(--muted); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); box-shadow: var(--ring); }
.has-error .input, .has-error .select, .has-error .textarea { border-color: var(--danger); }
.has-error .input:focus { box-shadow: 0 0 0 4px var(--danger-soft); }
.field-error { font-size: 12.5px; color: var(--danger-text); font-weight: 500; }
.field-hint { font-size: 12.5px; color: var(--muted); }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap .input { flex: 1; }
.input-affix { position: absolute; color: var(--muted); font-size: 13.5px; pointer-events: none; display: flex; }
.input-prefix { left: 14px; }
.input-suffix { right: 14px; }
.has-prefix .input { padding-left: 42px; }
.has-suffix .input { padding-right: 64px; }
input[type="date"].input { padding-right: 10px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 500; user-select: none; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; }

.segmented { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.choice { position: relative; cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice-body {
  height: 100%; display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 10px 16px; font-weight: 600; text-align: center;
  border-radius: var(--radius); border: 1.5px solid var(--border); background: var(--surface);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.choice:hover .choice-body { border-color: var(--border-strong); }
.choice input:checked + .choice-body { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-text); box-shadow: var(--ring); }
.choice input:focus-visible + .choice-body { box-shadow: var(--ring); }
.choice-col .choice-body { flex-direction: column; align-items: flex-start; justify-content: flex-start; text-align: left; gap: 4px; padding: 14px 16px; font-weight: 400; }

.receipt-drop { display: block; cursor: pointer; border: 1.5px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface-2); transition: border-color .15s; }
.receipt-drop:hover { border-color: var(--primary); }
.receipt-drop input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.receipt-drop-body { display: flex; align-items: center; gap: 12px; padding: 16px; color: var(--text-2); font-size: 13.5px; }
.receipt-drop-body img { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; }
.has-file .receipt-drop { border-style: solid; border-color: var(--success); }
.receipt-thumb img { width: 56px; height: 56px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); }
kbd { font: inherit; font-size: 11.5px; padding: 0 5px; border: 1px solid var(--border-strong); border-radius: 5px; background: var(--surface); }

/* --- Jadval -------------------------------------------------------------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); padding: 12px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table td { padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table td.num, .table td.text-right { white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table th:first-child, .table td:first-child { padding-left: 20px; }
.table th:last-child, .table td:last-child { padding-right: 20px; }
.table tbody tr { transition: background .1s; }
.table tbody tr[data-href] { cursor: pointer; }
.table tbody tr:hover { background: var(--surface-hover); }
.table .is-muted td { color: var(--muted); }
.table a.num, .table td > a { color: var(--primary-text); font-weight: 600; }
@media (max-width: 700px) {
  .table-cards thead { display: none; }
  .table-cards, .table-cards tbody, .table-cards tr, .table-cards td { display: block; width: 100%; }
  .table-cards tr { padding: 12px 16px; border-bottom: 1px solid var(--border); }
  .table-cards tr:last-child { border-bottom: 0; }
  .table-cards td, .table-cards td:first-child, .table-cards td:last-child { border: 0; padding: 3px 0; display: flex; justify-content: space-between; align-items: center; gap: 16px; text-align: right; white-space: normal; }
  .table-cards td::before { content: attr(data-label); color: var(--muted); text-align: left; font-size: 12px; font-weight: 500; }
}

.dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; font-size: 13.5px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; text-align: right; font-weight: 500; }

/* --- Bo'sh holat --------------------------------------------------------- */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 48px 24px; }
.empty-icon { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-text); margin-bottom: 8px; }
.empty-text { color: var(--text-2); max-width: 420px; }
.empty .btn { margin-top: 12px; }

/* --- Toastlar ------------------------------------------------------------ */
.toasts { position: fixed; right: 24px; bottom: 24px; z-index: 80; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.toast {
  display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); font-size: 13.5px;
  animation: toast-in .35s var(--ease);
}
.toast.hide { animation: toast-out .25s ease forwards; }
.toast-icon { display: inline-flex; margin-top: 1px; }
.toast-success .toast-icon { color: var(--success); }
.toast-danger .toast-icon { color: var(--danger); }
.toast-warning .toast-icon { color: var(--warning); }
.toast-info .toast-icon { color: var(--info); }
.toast-text { flex: 1; }
.toast-close { background: none; border: 0; padding: 0; cursor: pointer; color: var(--muted); display: inline-flex; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }
@media (max-width: 600px) { .toasts { left: 16px; right: 16px; bottom: 16px; max-width: none; } }

/* --- Dialog -------------------------------------------------------------- */
.dialog { border: 0; padding: 0; border-radius: 18px; width: min(460px, calc(100vw - 32px)); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
.dialog[open] { animation: dialog-in .3s var(--ease); }
.dialog::backdrop { background: var(--overlay); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.dialog-body { display: flex; flex-direction: column; gap: 16px; padding: 24px; }
.dialog-icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-text); }
.dialog-icon.is-danger { background: var(--danger-soft); color: var(--danger-text); }
.dialog-icon.is-success { background: var(--success-soft); color: var(--success-text); }
@keyframes dialog-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }

/* --- Kirish -------------------------------------------------------------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: min(420px, 100%); }
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; margin-bottom: 24px; }
.auth-brand .brand-mark, .auth-brand .brand-logo { width: 56px; height: 56px; border-radius: 16px; }

/* --- Xonalar paneli ------------------------------------------------------ */
.board-summary { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.board-summary .badge { height: 30px; padding: 0 12px; font-size: 13px; }
.room-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.room {
  position: relative; display: flex; flex-direction: column; gap: 10px; width: 100%;
  min-height: 160px; padding: 18px; text-align: left; cursor: pointer; color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-sm);
  transition: transform .2s var(--ease), box-shadow .2s, border-color .15s;
}
.room:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--border-strong); }
.room:active { transform: translateY(0); }
.room-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.room-name { font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.room-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--text-2); font-size: 13px; }
.room-meta span { display: inline-flex; align-items: center; gap: 5px; }
.room-total { margin-top: auto; font-size: 20px; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.room-open-cta { margin-top: auto; display: inline-flex; align-items: center; gap: 6px; color: var(--primary-text); font-weight: 600; }
.room.is-busy {
  color: #fff; border-color: transparent;
  background:
    radial-gradient(120% 120% at 100% 0%, rgba(255, 255, 255, .18), transparent 50%),
    linear-gradient(135deg, #6366f1 0%, #4f46e5 50%, #7c3aed 100%);
  box-shadow: 0 14px 28px -14px rgba(79, 70, 229, .7);
}
.room.is-busy .room-meta { color: rgba(255, 255, 255, .85); }
.room.is-busy .badge { background: rgba(255, 255, 255, .2); color: #fff; }
.room.is-free .room-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--success-soft); color: var(--success-text); }
.room-static { cursor: default; }
.room-static:hover { transform: none; box-shadow: var(--shadow-sm); }
@media (max-width: 600px) {
  .room-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .room { min-height: 132px; padding: 14px; gap: 8px; }
  .room-name { font-size: 15px; }
  .room-total { font-size: 17px; }
  .room .room-icon { display: none !important; }
}

/* --- Buyurtma sahifasi --------------------------------------------------- */
.order-layout { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 24px; align-items: start; }
.order-panel { position: sticky; top: calc(var(--topbar-h) + 20px); }
@media (max-width: 1180px) {
  .order-layout { grid-template-columns: minmax(0, 1fr); }
  .order-panel { position: static; }
}
.menu-search { margin-bottom: 14px; }
.menu-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
.menu-tabs::-webkit-scrollbar { display: none; }
.menu-tab {
  flex: none; height: 36px; padding: 0 16px; border-radius: 99px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2);
  font-size: 13px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center;
  transition: background .15s, color .15s, border-color .15s;
}
.menu-tab:hover { color: var(--text); background: var(--surface-hover); }
.menu-tab[aria-selected="true"] { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 4px 10px -4px rgba(79, 70, 229, .6); }
.menu-section { margin-top: 20px; }
.menu-section h2 { margin-bottom: 10px; color: var(--muted); }
.menu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.menu-item {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; width: 100%;
  min-height: 92px; padding: 14px 14px 12px 16px; text-align: left; cursor: pointer; color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm);
  overflow: hidden; transition: border-color .15s, box-shadow .15s, transform .05s;
}
.menu-item::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--cat, var(--primary)); }
.menu-item:hover { border-color: var(--primary); box-shadow: var(--ring); }
.menu-item:active { transform: translateY(1px); }
.menu-item.is-added { animation: added .7s var(--ease); }
.menu-item-name { font-weight: 600; }
.menu-item-price { margin-top: auto; color: var(--text-2); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
@keyframes added { 0% { background: var(--primary-soft); } 100% { background: var(--surface); } }
.menu-section[data-tone="0"] { --cat: #6366f1; }
.menu-section[data-tone="1"] { --cat: #f59e0b; }
.menu-section[data-tone="2"] { --cat: #10b981; }
.menu-section[data-tone="3"] { --cat: #0ea5e9; }
.menu-section[data-tone="4"] { --cat: #ec4899; }
.menu-section[data-tone="5"] { --cat: #14b8a6; }
@media (max-width: 600px) { .menu-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.lines { display: flex; flex-direction: column; }
.line { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.line:first-child { padding-top: 0; }
.line:last-child { border-bottom: 0; padding-bottom: 0; }
.line-name { font-weight: 600; overflow-wrap: anywhere; }
.line-sub { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.line-amount { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.line-controls { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; }
.qty { min-width: 40px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.totals { display: flex; flex-direction: column; gap: 6px; font-variant-numeric: tabular-nums; }
.totals-row { display: flex; justify-content: space-between; gap: 12px; color: var(--text-2); font-size: 13.5px; }
.totals-grand { display: flex; justify-content: space-between; gap: 12px; padding-top: 10px; margin-top: 4px; border-top: 1px dashed var(--border-strong); font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.panel-busy { opacity: .6; pointer-events: none; transition: opacity .15s; }

.mobile-total {
  display: none; position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 30;
  align-items: center; justify-content: space-between; gap: 12px;
  height: 56px; padding: 0 18px; border-radius: 14px; color: #fff;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 50%, #7c3aed 100%);
  box-shadow: 0 14px 28px -10px rgba(79, 70, 229, .7);
}
@media (max-width: 1180px) {
  .mobile-total { display: flex; }
  .has-mobile-total .content { padding-bottom: 96px; }
}
@media (min-width: 1024px) and (max-width: 1180px) {
  .mobile-total { left: calc(var(--sidebar-w) + 16px); }
}

.log-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.log-list li { display: flex; flex-direction: column; gap: 2px; font-size: 13.5px; }
details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }

/* --- Chiziqli diagramma ------------------------------------------------- */
.bar { display: block; height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 99px; background: var(--primary); }
.tone-bar-danger { background: var(--danger); }
.tone-bar-success { background: var(--success); }
.day-chart { display: flex; align-items: flex-end; gap: 4px; height: 180px; padding-top: 12px; }
.day-col { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; }
.day-bar { width: 100%; max-width: 36px; min-height: 2px; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, #818cf8, #4f46e5); transition: filter .15s; }
.day-col:hover .day-bar { filter: brightness(1.1); }
.day-label { font-size: 11px; color: var(--muted); white-space: nowrap; height: 14px; }
.profit-list { display: flex; flex-direction: column; gap: 10px; font-variant-numeric: tabular-nums; }
.profit-row { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.profit-row.is-minus span:last-child { color: var(--danger-text); }
.profit-total { display: flex; justify-content: space-between; gap: 12px; padding-top: 12px; border-top: 1px dashed var(--border-strong); font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.preset-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 20px; }
@media print {
  .sidebar, .topbar, .toolbar, .preset-bar, .no-print, .toasts { display: none !important; }
  .main { margin-left: 0; }
  .content { padding: 0; max-width: none; }
  .card { box-shadow: none; break-inside: avoid; }
  body { background: #fff; }
}

/* --- Boshqa -------------------------------------------------------------- */
.skeleton { border-radius: 8px; background: var(--surface-2); animation: pulse 1.4s ease infinite; }
@keyframes pulse { 50% { opacity: .5; } }
.error-page { min-height: 70vh; display: grid; place-items: center; text-align: center; padding: 24px; }
.error-code { font-size: 64px; font-weight: 800; letter-spacing: -.04em; color: var(--primary); }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 20px; }
.toolbar .input, .toolbar .select { width: auto; height: 40px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}
