@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@500;700&display=swap');

:root {
  --bg-1: #0b1020;
  --bg-2: #1a1640;
  --bg-3: #0f4c4c;
  --glass: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.14);
  --text-primary: #f1f5f9;
  --text-muted: #9aa5b8;
  --accent: #7c9eff;
  --accent-2: #34d8c8;
  --danger: #ff7a7a;
  --radius: 20px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

html[data-theme='light'] {
  --bg-1: #eef1ff;
  --bg-2: #f7f4ff;
  --bg-3: #e6fbf7;
  --glass: rgba(255, 255, 255, 0.55);
  --glass-border: rgba(30, 41, 59, 0.10);
  --text-primary: #1e2333;
  --text-muted: #5b6472;
  --shadow: 0 8px 32px rgba(30, 41, 59, 0.10);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--text-primary);
  background: linear-gradient(160deg, var(--bg-1), var(--bg-2) 55%, var(--bg-3));
  overflow-x: hidden;
  transition: background 0.4s ease, color 0.4s ease;
}

.aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.aurora span {
  position: absolute;
  width: 42vw;
  height: 42vw;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.45;
  animation: drift 26s ease-in-out infinite alternate;
}

.aurora span:nth-child(1) { background: #7c9eff; top: -10%; left: -8%; }
.aurora span:nth-child(2) { background: #34d8c8; bottom: -15%; right: -10%; animation-delay: -8s; }
.aurora span:nth-child(3) { background: #9b7cff; top: 30%; right: 20%; animation-delay: -16s; opacity: 0.3; }
.aurora span:nth-child(4) { background: #ff9f7c; width: 26vw; height: 26vw; bottom: 10%; left: 15%; animation-delay: -20s; opacity: 0.22; }

.aurora .particle {
  position: absolute;
  width: 3px; height: 3px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  animation: twinkle 4s ease-in-out infinite;
}
@keyframes twinkle {
  0%, 100% { opacity: 0.15; }
  50% { opacity: 0.7; }
}

@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(6%, 8%) scale(1.15); }
}

@media (prefers-reduced-motion: reduce) {
  .aurora span, .aurora .particle { animation: none; }
}

.shell {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

.topbar {
  position: sticky;
  top: 16px;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 36px;
  padding: 10px 10px 10px 20px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: 999px;
  box-shadow: var(--shadow);
  transition: border-radius 0.25s ease, padding 0.25s ease;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  flex-wrap: wrap;
  justify-content: center;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}

.brand .mark {
  width: 38px; height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
}

.theme-toggle {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(16px);
  color: var(--text-primary);
  border-radius: 999px;
  padding: 8px 16px;
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: transform 0.15s ease;
}
.theme-toggle:hover { transform: translateY(-1px); }

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.88rem;
  padding: 8px 12px;
  border-radius: 999px;
  transition: all 0.15s ease;
}
.nav-link:hover { color: var(--text-primary); background: var(--glass); }
.nav-link.active { color: var(--text-primary); background: var(--glass); border: 1px solid var(--glass-border); }

.glass {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.stat-card {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 40px rgba(124, 158, 255, 0.18);
  border-color: rgba(124, 158, 255, 0.35);
}

.panel:hover { box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4); }

.btn.primary {
  position: relative;
  overflow: hidden;
}
.btn.primary::after {
  content: '';
  position: absolute;
  top: 0; left: -60%;
  width: 40%; height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,0.35), transparent);
  transform: skewX(-20deg);
  transition: left 0.5s ease;
}
.btn.primary:hover::after { left: 130%; }
.btn.primary:hover { box-shadow: 0 6px 20px rgba(124, 158, 255, 0.4); }

.empty {
  text-align: center;
  padding: 32px 16px;
  position: relative;
}
.empty::before {
  content: '✨';
  display: block;
  font-size: 1.8rem;
  margin-bottom: 8px;
  opacity: 0.5;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

.stat-card {
  padding: 22px 24px;
}

.stat-card .label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}

.stat-card .value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 2.1rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 20px;
}

@media (max-width: 860px) {
  .grid-2 { grid-template-columns: 1fr; }
}

.panel {
  padding: 26px 26px 20px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.panel h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.05rem;
  margin: 0 0 18px;
  font-weight: 600;
}

table { width: 100%; border-collapse: collapse; }
th, td {
  text-align: left;
  padding: 10px 8px;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--glass-border);
}
th { color: var(--text-muted); font-weight: 500; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; }
tr:last-child td { border-bottom: none; }

.rank {
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent-2);
  font-weight: 700;
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
}
.badge.on { background: rgba(52, 216, 200, 0.18); color: var(--accent-2); }
.badge.off { background: rgba(255, 122, 122, 0.18); color: var(--danger); }
.badge.pause { background: rgba(124, 158, 255, 0.18); color: var(--accent); }

.empty {
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 12px 0;
}

/* --- login page --- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.login-card {
  width: 100%;
  max-width: 380px;
  padding: 40px 36px;
  text-align: center;
}

.login-card .mark {
  width: 56px; height: 56px;
  margin: 0 auto 18px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
}

.login-card h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.3rem;
  margin: 0 0 6px;
}

.login-card p.sub {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin: 0 0 26px;
}

.login-card input {
  width: 100%;
  padding: 13px 16px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: rgba(255,255,255,0.04);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  margin-bottom: 14px;
}
.login-card input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.login-card button {
  width: 100%;
  padding: 13px 16px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #08111f;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.15s ease;
}
.login-card button:hover { transform: translateY(-1px); }

.error-msg {
  background: rgba(255,122,122,0.14);
  color: var(--danger);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.85rem;
  margin-bottom: 16px;
}

a.logout {
  color: var(--text-muted);
  font-size: 0.85rem;
  text-decoration: none;
}
a.logout:hover { color: var(--text-primary); }

.dropdown-menu {
  position: absolute;
  top: 44px;
  width: 240px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 8px;
  display: none;
  flex-direction: column;
  gap: 2px;
  z-index: 50;
}
.dropdown-menu.open { display: flex; }
.dropdown-item {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.85rem;
  transition: background 0.15s ease;
}
.dropdown-item:hover { background: rgba(255,255,255,0.06); }
.dropdown-item.active { color: var(--accent); font-weight: 600; }
.dropdown-divider { height: 1px; background: var(--glass-border); margin: 6px 4px; }

/* --- mobil off-canvas menyu (hamburger) --- */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}
.hamburger span {
  display: block;
  width: 16px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.hamburger.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.mobile-nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 8, 20, 0.55);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 90;
}
.mobile-nav-overlay.open { opacity: 1; pointer-events: auto; }

.mobile-nav-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(320px, 86vw);
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border-left: 1px solid var(--glass-border);
  box-shadow: -16px 0 48px rgba(0, 0, 0, 0.35);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(.4,0,.2,1);
  z-index: 91;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.mobile-nav-panel.open { transform: translateX(0); }

.mobile-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 16px 14px;
  border-bottom: 1px solid var(--glass-border);
  position: sticky;
  top: 0;
  background: inherit;
}

.mobile-nav-close {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  color: var(--text-primary);
  font-size: 1rem;
  cursor: pointer;
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  padding: 10px;
  gap: 2px;
}
.mobile-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 14px;
  border-radius: 12px;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.95rem;
  transition: background 0.15s ease;
}
.mobile-nav-item:hover { background: var(--glass); }
.mobile-nav-item.active { background: var(--glass); color: var(--accent); font-weight: 600; border: 1px solid var(--glass-border); }
.mobile-nav-item.danger { color: var(--danger); }
.mobile-nav-divider { height: 1px; background: var(--glass-border); margin: 8px 10px; }

body.nav-open { overflow: hidden; }

@media (max-width: 900px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .topbar { border-radius: 24px; padding: 10px 12px 10px 16px; }
}

@media (max-width: 480px) {
  .topbar-actions a.logout { display: none; }
  .brand span { display: none; }
}

/* --- Phase 7: analytics charts --- */
.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 160px;
  padding-top: 10px;
}
.chart-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
}
.chart-bar {
  width: 100%;
  max-width: 34px;
  border-radius: 8px 8px 3px 3px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  min-height: 4px;
  transition: height 0.5s ease;
}
.chart-label {
  margin-top: 8px;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.hbar-list { display: flex; flex-direction: column; gap: 12px; }
.hbar-row { display: grid; grid-template-columns: 110px 1fr 34px; align-items: center; gap: 10px; }
.hbar-label { font-size: 0.78rem; color: var(--text-muted); text-transform: capitalize; }
.hbar-track { height: 10px; border-radius: 999px; background: rgba(255,255,255,0.06); overflow: hidden; }
.hbar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.hbar-count { font-family: 'JetBrains Mono', monospace; font-size: 0.78rem; text-align: right; }

/* --- Phase 8: mobil moslashuv --- */
@media (max-width: 640px) {
  .shell { padding: 16px 12px 48px; }
  .brand { font-size: 1.05rem; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-card .value { font-size: 1.6rem; }
  table { font-size: 0.8rem; }
  th, td { padding: 8px 6px; white-space: nowrap; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .pagination { justify-content: center; }
  .nav-link { padding: 6px 9px; font-size: 0.8rem; }
  .panel { padding: 18px 16px 16px; }
  .field input[type="text"],
  .field input[type="number"],
  .field select,
  .field textarea { font-size: 16px; } /* iOS'da avtomatik zoom bo'lmasligi uchun */
  .btn { padding: 10px 16px; }
}

/* --- shared form/button styles for management pages --- */
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.field input[type="text"],
.field input[type="number"],
.field select,
.field textarea {
  width: 100%;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  background: rgba(255,255,255,0.04);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.92rem;
}
.field textarea { resize: vertical; min-height: 70px; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.btn {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #08111f; border: none; font-weight: 600; }
.btn.danger { color: var(--danger); }
.btn.small { padding: 5px 12px; font-size: 0.76rem; }

.actions-row { display: flex; gap: 8px; flex-wrap: wrap; }

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.pagination { display: flex; gap: 6px; margin-top: 18px; flex-wrap: wrap; }

.inline-form { display: flex; gap: 6px; align-items: center; }
.inline-form input[type="number"] { width: 70px; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--glass-border); background: rgba(255,255,255,0.04); color: var(--text-primary); }

/* ============================================================
   Chap sidebar navigatsiya (2026-08-13) — eski .topbar pill-nav
   o'rnini bosdi. .shell endi .admin-main ichida joylashadi.
   ============================================================ */

/* MUHIM: .admin-sidebar va .admin-topbar HAR IKKALASI ham `body`ning
   to'g'ridan-to'g'ri (sibling) farzandlari — .admin-topbar `.admin-main`
   ICHIDA emas (chunki _nav.html shablon strukturasi shunday joylashgan).
   Shuning uchun flexbox emas, balki .admin-sidebar'ni doim `position:fixed`
   qilib, qolgan ikkalasiga (`.admin-topbar`, `.admin-main`) bir xil
   `margin-left` berish orqali joylashtiramiz — bu DOM tartibiga bog'liq
   emas, shuning uchun ishonchliroq. */
body.admin-body { min-height: 100vh; }

.admin-sidebar {
  width: 264px;
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 200;
  background: var(--glass);
  border-right: 1px solid var(--glass-border);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  display: flex;
  flex-direction: column;
  padding: 18px 14px 16px;
  transform: translateX(0);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 20px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}
.sidebar-brand .mark {
  width: 36px; height: 36px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.sidebar-close {
  display: none;
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.15rem;
  cursor: pointer;
  padding: 4px;
}

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.87rem;
  transition: background 0.15s ease, color 0.15s ease;
}
.sidebar-link:hover { background: var(--glass); color: var(--text-primary); }
.sidebar-link.active {
  background: linear-gradient(135deg, rgba(124, 158, 255, 0.20), rgba(52, 216, 200, 0.14));
  color: var(--text-primary);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(124, 158, 255, 0.35);
}
.sidebar-link.danger { color: var(--danger); }
.sidebar-divider { height: 1px; background: var(--glass-border); margin: 10px 6px; }
.sidebar-group-label {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  opacity: 0.7;
  padding: 8px 12px 4px;
}

.sidebar-user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 11px 12px;
  border-radius: 14px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
}
.sidebar-user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  color: #08111f;
  flex-shrink: 0;
  font-size: 0.85rem;
}
.sidebar-user-info { display: flex; flex-direction: column; line-height: 1.25; overflow: hidden; }
.sidebar-user-info strong { font-size: 0.83rem; }
.sidebar-user-info span { font-size: 0.7rem; color: var(--text-muted); }

.sidebar-toggle {
  display: none;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 210;
  width: 42px; height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  backdrop-filter: blur(16px);
  color: var(--text-primary);
  font-size: 1.1rem;
  cursor: pointer;
  transition: opacity 0.2s ease;
}
body.admin-nav-open .sidebar-toggle { opacity: 0; pointer-events: none; }

.admin-nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 8, 20, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 190;
}
.admin-nav-overlay.open { opacity: 1; pointer-events: auto; }

.admin-main,
.admin-topbar {
  margin-left: 264px;
  min-width: 0;
  box-sizing: border-box;
}
.admin-main { position: relative; }

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--glass-border);
  background: var(--bg-1);
}
.admin-topbar .page-title {
  margin-right: auto;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text-primary);
}
.admin-topbar-actions { display: flex; align-items: center; gap: 8px; }

@media (max-width: 900px) {
  .sidebar-toggle { display: flex; }
  .admin-sidebar {
    width: 280px;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }
  .admin-sidebar.open { transform: translateX(0); box-shadow: 0 0 40px rgba(0, 0, 0, 0.5); }
  .sidebar-close { display: block; }
  .admin-main,
  .admin-topbar { margin-left: 0; }
  .admin-topbar { padding-left: 64px; }
}

@media (max-width: 480px) {
  .admin-topbar .page-title { display: none; }
  .admin-topbar-actions a.btn { display: none; }
}

/* --- Dashboard: statistik kartalarda o'sish belgisi (%delta) --- */
.stat-card .delta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
}
.stat-card .delta.up { color: var(--accent-2); background: rgba(52, 216, 200, 0.14); }
.stat-card .delta.down { color: var(--danger); background: rgba(255, 122, 122, 0.14); }
.stat-card .delta.flat { color: var(--text-muted); background: rgba(255, 255, 255, 0.06); }
.stat-card .delta-note { display: block; font-size: 0.7rem; color: var(--text-muted); margin-top: 6px; }

/* --- Dashboard: donut chart (test turlari taqsimoti) --- */
.donut-wrap { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; }
.donut {
  width: 148px; height: 148px;
  border-radius: 50%;
  flex-shrink: 0;
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 24px), #000 calc(100% - 24px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 24px), #000 calc(100% - 24px));
}
.donut-center {
  position: relative;
  width: 148px; height: 148px;
  flex-shrink: 0;
}
.donut-center .donut { position: absolute; inset: 0; }
.donut-center .donut-total {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.donut-total .n { font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: 1.3rem; }
.donut-total .l { font-size: 0.66rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }

.donut-legend { display: flex; flex-direction: column; gap: 9px; flex: 1; min-width: 160px; }
.donut-legend-row { display: flex; align-items: center; gap: 9px; font-size: 0.82rem; }
.donut-legend-dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.donut-legend-label { flex: 1; color: var(--text-primary); text-transform: capitalize; }
.donut-legend-pct { color: var(--text-muted); font-family: 'JetBrains Mono', monospace; font-size: 0.78rem; }

/* --- Dashboard: so'nggi faoliyatlar lentasi --- */
.activity-feed { display: flex; flex-direction: column; gap: 4px; }
.activity-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 6px;
  border-bottom: 1px solid var(--glass-border);
}
.activity-row:last-child { border-bottom: none; }
.activity-icon {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}
.activity-body { flex: 1; min-width: 0; }
.activity-title { font-size: 0.86rem; font-weight: 500; }
.activity-subtitle { font-size: 0.78rem; color: var(--text-muted); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity-when { font-size: 0.72rem; color: var(--text-muted); flex-shrink: 0; white-space: nowrap; }
