/* ============================================================
   OLIMP-LIDER v6 вЂ” Qora premium + oltin (CIA/MI6 uslubi)
   Shisha (glassmorphism) uslubi вЂ” qora-premium, oltin akzentlar,
   yonli ikonlar, yonli kartalar.
   ============================================================ */

:root {
  --bg: #0a0d0a;
  --bg-grad: linear-gradient(135deg, #0a0d0a 0%, #0f172a 35%, #0a0d0a 100%);
  --card: rgba(255, 255, 255, 0.06);
  --card-2: rgba(255, 255, 255, 0.04);
  --card-3: rgba(255, 255, 255, 0.03);
  --card-4: rgba(255, 255, 255, 0.02);
  --ink: #f1f5f9;
  --ink-2: #cbd5e1;
  --muted: #94a3b8;
  --muted-2: #767e68;
  --gold: #d4af37;
  --gold-dim: #b8922e;
  --gold-soft: rgba(212, 175, 55, 0.16);
  --gold-soft-2: rgba(212, 175, 55, 0.06);
  --gold-grad: linear-gradient(135deg, #e8cc6e, #d4af37 55%, #ae8c26);
  --green: #58a946;
  --red: #c0392b;
  --blue: #3f6b8f;
  --crimson: #d84c4c;
  --code: #0b0e09;
  --text: #f1f5f9;
  --border: rgba(212, 175, 55, 0.35);
  --border-soft: rgba(212, 175, 55, 0.10);
  --line: #2c3424;
  --line-soft: rgba(212, 175, 55, 0.10);
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 16px 34px -14px rgba(0, 0, 0, 0.65);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.5), 0 34px 70px -20px rgba(0, 0, 0, 0.8);
  --ring: 0 0 0 3px rgba(212, 175, 55, 0.35);
  --ring-danger: 0 0 0 3px rgba(192, 57, 43, 0.3);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --acc: #d4af37;
  --acc-deep: #9a7b22;
  --acc-2: #e8cc6e;
  --gold-2: #e8cc6e;
  --gold-soft-b: rgba(212, 175, 55, 0.18);
  --acc-soft: rgba(212, 175, 55, 0.14);
  --green-soft: rgba(88, 169, 70, 0.16);
  --red-soft: rgba(192, 57, 43, 0.16);
  --blue-soft: rgba(63, 107, 143, 0.24);
  --amber-soft: rgba(255, 190, 70, 0.15);
  --purple-soft: rgba(146, 110, 196, 0.2);
  --bg-grad-a: rgba(212, 175, 55, 0.08);
  --bg-grad-b: rgba(46, 62, 34, 0.12);
  --bg-grad-c: rgba(5, 7, 10, 0.82);
  --card-gradient: linear-gradient(165deg, rgba(255, 255, 255, 0.06), rgba(16, 21, 14, 0.82));
  --card-velvet: rgba(16, 21, 14, 0.82);
  --backdrop: rgba(4, 6, 4, 0.62);
  /* JS inline-stillardagi eski nomlar bilan moslik */
  --border-ok: #d4af37;
  --success: #58a946;
  --success-light: rgba(88, 169, 70, 0.16);
  --danger: #c0392b;
  --text-muted: #9aa488;
  --blur: blur(12px) saturate(100%);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
  background: var(--bg-grad);
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: 0.15px;
  /* Prevent white flash on load */
  background-color: var(--bg);
}

::selection {
  background: rgba(212, 175, 55, 0.4);
  color: #fffdf2;
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(212, 175, 55, 0.35) transparent;
  /* Touch action - barcha interaktiv elementlar uchun */
  touch-action: manipulation;
}

*::-webkit-scrollbar { width: 12px; height: 12px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(212, 175, 55, 0.4), rgba(212, 175, 55, 0.18));
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover { background: rgba(212, 175, 55, 0.55); background-clip: padding-box; }
*::-webkit-scrollbar-thumb:active { background: rgba(212, 175, 55, 0.7); }

/* Touch action - barcha interaktiv elementlar uchun */
* { touch-action: manipulation; }

/* Focus visible - mobile uchun yorqinroq */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* Modal close button вЂ” 44x44px minimum touch target */
.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 24px;
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.15s, color 0.15s, transform 0.15s;
  line-height: 1;
}
.modal-close:hover,
.modal-close:focus {
  background: rgba(212, 175, 55, 0.15);
  color: var(--gold);
  transform: rotate(90deg);
}
.modal-close:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* Focus visible - mobile uchun yorqinroq */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* Touch action - barcha interaktiv elementlar uchun */
* { touch-action: manipulation; }

/* Input focus - mobile uchun yorqinroq */
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--gold);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.25);
}

/* Prevent white flash on page load */
html {
  background-color: var(--bg);
}

/* Mobile improvements */
@media (max-width: 480px) {
  /* Input font-size 16px - iOS zoom oldini olish */
  input, select, textarea, .toolbar input.date-pick, .toolbar select {
    font-size: 16px !important;
  }
  
  .content { padding: 12px 12px 26px; }
  .modal-footer { flex-wrap: wrap; }
  .modal-footer .btn { flex: 1 1 45%; }
  .nav-item { min-width: 54px; padding: 7px 4px 6px; }
  .nav-item svg { width: 21px; height: 21px; }
  .stat-card { padding: 12px 10px; }
  .stat-icon { width: 36px; height: 36px; }
  .stat-value { font-size: 19px; }
  .topbar h1 { font-size: 13px; }
  .toolbar { gap: 6px; }
  .toolbar .btn { flex: 1 1 auto; }
  .format-select, .toolbar select { max-width: 100%; }
  .score-input, .test-score { width: 66px; }
  
  /* Sidebar header mobile da ko'rinishi */
  .sidebar-header { display: flex !important; padding: 10px 12px 8px; }
  .brand-logo { width: 40px; height: 40px; padding: 3px; }
  .sidebar-header h2 { font-size: 12px; }
  .sidebar-header span { font-size: 10px; }
  
  /* Sidebar close tugmasi mobile da ko'rinadi */
  .sidebar-close { display: flex !important; }
  
  /* Panel va karta mobile uchun */
  .panel { border-radius: 16px; margin-bottom: 14px; box-shadow: 0 6px 22px -12px rgba(0, 0, 0, 0.55); }
  .panel-header { padding: 13px 16px; }
  .panel-header h3 { font-size: 13px; letter-spacing: 0.3px; }
  .panel-body { padding: 14px 16px; }
  .form-grid { grid-template-columns: 1fr; }
  
  /* Button touch targets */
  .btn { min-height: 44px; padding: 12px 16px; border-radius: 12px; }
  .btn-sm { min-height: 36px; padding: 8px 12px; }
  
  /* Modal mobile */
  .modal-overlay { align-items: flex-end; padding: 10px; }
  .modal { border-radius: 20px 20px 0 0; max-height: 92vh; }
  .modal-header { padding: 16px 18px; }
  .modal-body { padding: 18px; }
  
  .login-card { padding: 28px 22px; border-radius: 20px; }
  .insignia { width: 170px; height: 170px; }
  .insignia .logo-img { width: 135px; height: 156px; }
  
  /* Jurnal mobile */
  .journal .jname { min-width: 118px; padding: 8px 8px; font-size: 12px; }
  .journal .jhead { min-width: 30px; padding: 6px 1px; font-size: 10px; }
  .jcell { width: 30px; height: 30px; min-width: 30px; font-size: 14px; }
  
  /* Chat mobile */
  .chat-layout { display: block; height: calc(100vh - 210px); min-height: 400px; }
  .chat-list { width: 100%; height: 100%; }
  .chat-open { display: none; height: 100%; }
  .chat-list-hide-mobile { display: none; }
  .chat-open-show { display: flex; }
  .chat-row-head b { font-size: 13px; }
  .bubble { max-width: 90%; }
  .chat-head { position: sticky; top: 0; z-index: 2; backdrop-filter: blur(8px); }
  
  /* Toast mobile */
  .toast-wrap { right: 12px; left: 12px; bottom: calc(88px + env(safe-area-inset-bottom)); max-width: none; }
  .toast { font-size: 14px; padding: 14px 15px; }
  
  /* Touch targets - minimum 44x44px */
  .btn { min-height: 44px; padding: 12px 16px; border-radius: 12px; }
  .btn-sm { min-height: 36px; padding: 8px 12px; }
  .modal-close { width: 44px; height: 44px; }
  .sidebar-close { width: 44px; height: 44px; }
  .modal-close { width: 44px; height: 44px; }
  .btn { min-height: 44px; padding: 12px 16px; border-radius: 12px; }
  .btn-sm { min-height: 36px; padding: 8px 12px; }
  
  /* Input font-size 16px for iOS zoom prevention */
  input, select, textarea, .toolbar input.date-pick, .toolbar select {
    font-size: 16px !important;
    border-radius: 11px;
    padding: 12px 13px;
    border-color: rgba(212, 175, 55, 0.22);
  }
  
  /* Touch targets - minimum 44x44px */
  .btn { min-height: 44px; padding: 12px 16px; border-radius: 12px; }
  .btn-sm { min-height: 36px; padding: 8px 12px; }
  .modal-close { width: 44px; height: 44px; }
  .sidebar-close { width: 44px; height: 44px; }
  .modal-close { width: 44px; height: 44px; }
  .btn { min-height: 44px; padding: 12px 16px; border-radius: 12px; }
  .btn-sm { min-height: 36px; padding: 8px 12px; }
  
  /* Form inputs - better touch targets */
  .form-group input, .form-group select, .form-group textarea {
    min-height: 44px;
    padding: 12px 14px;
  }
  
  /* Sidebar header visible on mobile */
  .sidebar-header { display: flex !important; padding: 10px 12px 8px; }
  .brand-logo { width: 40px; height: 40px; padding: 3px; }
  .sidebar-header h2 { font-size: 12px; }
  .sidebar-header span { font-size: 10px; }
  
  /* Sidebar close button visible on mobile */
  .sidebar-close { display: flex !important; }
}

/* ------------------- LOGIN ------------------- */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  position: relative;
  overflow: hidden;
  background-image: url("/assets/banner.jpg");
  background-size: cover;
  background-position: center;
}
.login-page::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(5, 7, 8, 0.88), rgba(10, 13, 9, 0.8));
  z-index: 0;
}
.login-page::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 18% 22%, rgba(212, 175, 55, 0.14) 0, transparent 26%),
    radial-gradient(circle at 82% 28%, rgba(50, 62, 36, 0.3) 0, transparent 30%),
    radial-gradient(circle at 35% 78%, rgba(212, 175, 55, 0.1) 0, transparent 24%),
    radial-gradient(circle at 70% 85%, rgba(212, 175, 55, 0.08) 0, transparent 20%);
  z-index: 0;
  pointer-events: none;
}

.login-card {
  position: relative;
  z-index: 2;
  background: rgba(13, 17, 12, 0.42);
  backdrop-filter: blur(14px) saturate(110%);
  border: 1px solid rgba(212, 175, 55, 0.45);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35), 0 30px 70px rgba(0, 0, 0, 0.55);
  border-radius: 26px;
  padding: 44px 38px;
  width: 100%;
  max-width: 420px;
  text-align: center;
  animation: cardIn 0.8s var(--ease);
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(26px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

/* ============ NISHON (LOGO) вЂ” "yorug'lik nuri" konsepsiyasi ============
   Aylanuvchi halqalar olib tashlandi (ular og'ir filter/conic-gradient
   repaint qilardi). Endi: HUD burchaklari + bir marta o'tadigan yorug'lik
   yoyi + 3D egilish. Faqat transform/opacity вЂ” GPU tez. */
.insignia {
  position: relative;
  width: 232px;
  height: 232px;
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 900px;
  transform-style: preserve-3d;
  isolation: isolate;
}

/* --- HUD burchaklari (harbiy ramka, halqa emas) --- */
.insignia__brackets {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  animation: badgeBreath 5.5s ease-in-out infinite;
}
.insignia__brackets .bk {
  position: absolute;
  width: 34px;
  height: 34px;
  border: 2px solid rgba(212, 175, 55, 0.72);
}
.insignia__brackets .bk-tl { top: 0; left: 0; border-right: 0; border-bottom: 0; border-top-left-radius: 14px; }
.insignia__brackets .bk-tr { top: 0; right: 0; border-left: 0; border-bottom: 0; border-top-right-radius: 14px; }
.insignia__brackets .bk-bl { bottom: 0; left: 0; border-right: 0; border-top: 0; border-bottom-left-radius: 14px; }
.insignia__brackets .bk-br { bottom: 0; right: 0; border-left: 0; border-top: 0; border-bottom-right-radius: 14px; }
@keyframes badgeBreath {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.035); }
}

/* --- Yorug'lik yoyi: metall nishon kabi yorug'lik o'tadi --- */
.insignia__gloss {
  position: absolute;
  top: -14%;
  left: -60%;
  width: 46%;
  height: 128%;
  z-index: 4;
  pointer-events: none;
  background: linear-gradient(
    100deg,
    transparent 0%,
    rgba(255, 255, 255, 0.06) 35%,
    rgba(255, 246, 214, 0.34) 50%,
    rgba(255, 255, 255, 0.06) 65%,
    transparent 100%
  );
  transform: skewX(-14deg) translateX(0);
  animation: glossSweep 6.5s cubic-bezier(0.5, 0, 0.3, 1) infinite;
  will-change: transform, opacity;
}
@keyframes glossSweep {
  0% { transform: skewX(-14deg) translateX(-40%); opacity: 0; }
  12% { opacity: 1; }
  48% { transform: skewX(-14deg) translateX(320%); opacity: 1; }
  60% { opacity: 0; }
  100% { transform: skewX(-14deg) translateX(320%); opacity: 0; }
}

.insignia .logo-img {
  width: 186px;
  height: 215px;
  object-fit: contain;
  position: relative;
  z-index: 2;
  transform-style: preserve-3d;
  transform: translateZ(0);
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.6));
  transition: transform 0.35s var(--ease);
  will-change: transform;
}
.login-card h1, .welcome-title {
  font-size: clamp(21px, 4.6vw, 33px);
  line-height: 1.28;
  letter-spacing: 2px;
  font-weight: 800;
  margin-bottom: 22px;
  background: linear-gradient(180deg, #f7e9b8, #d4af37 80%, #b8912b);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 3px 8px rgba(212, 175, 55, 0.35));
}
.login-card .club-type {
  font-size: 12px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gold);
  margin: 2px 0 20px;
}
.login-card p { color: var(--muted); font-size: 14px; margin-bottom: 22px; }

.form-group { text-align: left; margin-bottom: 15px; }
.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-bottom: 6px;
  color: var(--gold);
}
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: rgba(5, 8, 5, 0.5);
  color: var(--text);
  transition: border 0.15s, box-shadow 0.15s, background 0.15s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--gold);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.25);
}
.form-group input::placeholder { color: #5d6352; }
select option { background: #141a12; color: var(--text); }

.password-wrap { position: relative; }
.password-wrap input { padding-right: 48px; }
.toggle-pass {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}
.toggle-pass:hover { color: var(--gold); background: rgba(255, 255, 255, 0.06); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid rgba(212, 175, 55, 0.45);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: transform 0.18s var(--ease), box-shadow 0.22s var(--ease), filter 0.18s, background 0.18s, border-color 0.18s;
  position: relative;
  overflow: hidden;
  min-height: 44px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--gold);
}
.btn:hover {
  border-color: var(--gold);
  background: rgba(212, 175, 55, 0.16);
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.25), 0 0 0 1px rgba(212, 175, 55, 0.35);
}
.btn:active { transform: translateY(1px) scale(0.985); }
.btn::after {
  content: "";
  position: absolute;
  top: 0; left: -120%;
  width: 60%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.18), transparent);
  transform: skewX(-20deg);
  transition: left 0.5s;
  opacity: 0.7;
}
.btn:hover::after { left: 130%; }

.btn-primary {
  background: linear-gradient(180deg, rgba(212, 175, 55, 0.2), rgba(169, 145, 89, 0.15));
  border-color: #d4af37;
  color: #f6e9b8;
  box-shadow: 0 6px 16px -8px rgba(212, 175, 55, 0.45);
}
.btn-primary:hover { box-shadow: 0 10px 24px -8px rgba(212, 175, 55, 0.55); transform: translateY(-1px); }
.btn-success { background: linear-gradient(180deg, rgba(88, 169, 70, 0.2), rgba(63, 127, 49, 0.2)); border-color: #2f5e24; color: #d7f4d8; box-shadow: 0 6px 16px -8px rgba(88, 169, 70, 0.35); }
.btn-success:hover { box-shadow: 0 10px 24px -8px rgba(88, 169, 70, 0.45); transform: translateY(-1px); }
.btn-danger { background: linear-gradient(180deg, rgba(192, 57, 43, 0.2), rgba(111, 47, 32, 0.2)); border-color: #8e2b20; color: #f3c6c0; box-shadow: 0 6px 16px -8px rgba(192, 57, 43, 0.35); }
.btn-danger:hover { box-shadow: 0 10px 24px -8px rgba(192, 57, 43, 0.45); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--muted); border-color: transparent; }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); }
.btn-outline { background: transparent; color: var(--gold); border-color: rgba(212, 175, 55, 0.55); }
.btn-outline:hover { background: var(--gold-soft); box-shadow: 0 0 12px rgba(212, 175, 55, 0.3); }
.btn-sm { padding: 7px 11px; font-size: 13px; border-radius: 8px; font-weight: 600; min-height: 36px; }
.btn-block { width: 100%; }
.btn:focus-visible { box-shadow: var(--ring); }

.alert-error {
  background: rgba(192, 57, 43, 0.18);
  color: #f37f70;
  border: 1px solid rgba(192, 57, 43, 0.5);
  border-radius: 8px;
  padding: 11px 14px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 15px;
  display: none;
}

/* ------------------- APP LAYOUT ------------------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 248px;
  background: rgba(5, 7, 8, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: var(--text);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  flex-shrink: 0;
  border-right: 1px solid rgba(212, 175, 55, 0.15);
  z-index: 50;
}
.sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 18px 16px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}
.brand-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: 16px;
  padding: 5px;
  background: linear-gradient(160deg, rgba(212, 175, 55, 0.3), rgba(212, 175, 55, 0.06));
  border: 2px solid rgba(212, 175, 55, 0.6);
  box-shadow: 0 0 18px rgba(212, 175, 55, 0.3);
  flex-shrink: 0;
  animation: logoGlow 3.2s ease-in-out infinite;
}
@keyframes logoGlow {
  0%, 100% { box-shadow: 0 0 14px rgba(212, 175, 55, 0.3), inset 0 0 10px rgba(212, 175, 55, 0.12); }
  50% { box-shadow: 0 0 28px rgba(212, 175, 55, 0.6), inset 0 0 16px rgba(212, 175, 55, 0.22); }
}
.sidebar-header h2 {
  font-size: 14px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--gold);
  line-height: 1.2;
}
.sidebar-header span { font-size: 11px; color: var(--muted); }

.nav { padding: 14px 10px; flex: 1; display: flex; flex-direction: column; gap: 3px; }
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 10px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: transparent;
  font-family: inherit;
  width: 100%;
  text-align: left;
  transition: all 0.18s;
}
.nav-item:hover { background: var(--gold-soft-2); color: var(--text); }
.nav-item:hover svg {
  transform: scale(1.24) translateX(2px) rotate(-6deg);
  filter: drop-shadow(0 0 7px rgba(212, 175, 55, 0.8));
}
.nav-item.active {
  background: linear-gradient(90deg, rgba(212, 175, 55, 0.22), rgba(212, 175, 55, 0.05));
  color: #f7ecc0;
  border-left: 3px solid var(--gold);
}
.nav-item.active svg { animation: iconPulse 2s ease-in-out infinite; }
@keyframes iconPulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 0 rgba(212, 175, 55, 0)); }
  50% { transform: scale(1.16); filter: drop-shadow(0 0 8px rgba(212, 175, 55, 0.85)); }
}
.nav-item.active::after {
  content: "";
  position: absolute;
  right: 10px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 8px var(--gold);
  animation: blinkDot 1.6s ease-in-out infinite;
}
@keyframes blinkDot { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
.nav-item svg { flex-shrink: 0; transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.25s; }
.nav-item span.text { display: block; }
.nav-badge {
  position: absolute;
  top: 6px;
  right: 8px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.sidebar-footer { padding: 14px 18px; border-top: 1px solid rgba(212, 175, 55, 0.2); }
.user-info { font-size: 13px; margin-bottom: 8px; color: var(--text); font-weight: 600; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  background: rgba(13, 16, 11, 0.88);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(212, 175, 55, 0.3);
  padding: 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 15;
  background-image: repeating-linear-gradient(45deg, rgba(212, 175, 55, 0.035) 0 10px, transparent 10px 22px);
}
.topbar h1 {
  font-size: 18px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--ink-2);
}
.refresh-btn { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; border-color: rgba(212, 175, 55, 0.35); font-size: 13px; }
.refresh-btn:hover { border-color: var(--gold); }
.refresh-btn:hover svg { animation: refreshSpin 0.9s linear infinite; }
@keyframes refreshSpin { to { transform: rotate(360deg); } }
.refresh-btn svg { transition: transform 0.3s; }

.clock-box {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}
.clock-box svg { color: var(--gold); flex-shrink: 0; }
.clock-box .clock-time { color: var(--ink-2); font-weight: 700; letter-spacing: 0.5px; font-variant-numeric: tabular-nums; }
.clock-box .clock-date { color: var(--muted); }
.login-clock { justify-content: center; margin-top: 16px; }
.content { padding: 24px 28px; flex: 1; animation: pageIn 0.4s var(--ease); }
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.refresh-label { display: inline; }

/* ------------------- CARDS / STATS ------------------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--card-gradient);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
  transition: transform 0.28s var(--ease), box-shadow 0.28s var(--ease), border-color 0.28s var(--ease);
  animation: cardUp 0.45s var(--ease);
}
.stat-card:hover { transform: translateY(-4px); border-color: rgba(212, 175, 55, 0.55); box-shadow: var(--shadow-lg); }
@keyframes cardUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.stat-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 100%;
  background: linear-gradient(180deg, var(--gold), rgba(212, 175, 55, 0));
  border-radius: 999px;
  opacity: 0.85;
}
.stat-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid var(--border-soft);
  font-size: 20px;
}
.stat-icon.blue { background: var(--blue-soft); color: #8ec9e8; }
.stat-icon.green { background: var(--green-soft); color: #9ce08f; }
.stat-icon.red { background: var(--red-soft); color: #f08a7c; }
.stat-icon.amber { background: var(--amber-soft); color: #e8d28a; }
.stat-icon.purple { background: var(--purple-soft); color: #c9a8f0; }
.stat-value { font-size: 24px; font-weight: 800; line-height: 1.1; color: var(--ink-2); font-variant-numeric: tabular-nums; letter-spacing: -0.5px; }
.stat-label { font-size: 12px; color: var(--muted); margin-top: 2px; letter-spacing: 0.4px; }

/* ------------------- PANEL / TABLE ------------------- */
.panel {
  background: var(--card-gradient);
  border: 1px solid rgba(212, 175, 55, 0.15);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 22px;
  overflow: hidden;
  animation: cardUp 0.4s var(--ease);
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
  /* backdrop-filter olib tashlandi: har bir panel GPU yukini olardi.
     Fon allaqachon quyuq gradient — blur ko'rinmasligi uchun kerak emas. */
  /* Ensure visibility on mobile */
  opacity: 1;
  visibility: visible;
}
.panel:hover { border-color: rgba(212, 175, 55, 0.45); box-shadow: 0 4px 12px -2px rgba(0,0,0,0.4), 0 8px 24px -4px rgba(212, 175, 55, 0.15); }
.panel-header {
  padding: 15px 18px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.15);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: linear-gradient(90deg, rgba(212, 175, 55, 0.08), transparent 60%);
  background-image: repeating-linear-gradient(45deg, rgba(212, 175, 55, 0.025) 0 8px, transparent 8px 18px);
}
.panel-header h3 { font-size: 14px; letter-spacing: 0.6px; text-transform: uppercase; color: var(--ink-2); font-weight: 700; }
.panel-body { padding: 16px 18px; }
.panel-footer { padding: 14px 18px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }

table { width: 100%; border-collapse: separate; border-spacing: 0; }
th, td { text-align: left; padding: 12px 14px; font-size: 14px; border-bottom: 1px solid rgba(212, 175, 55, 0.14); vertical-align: middle; background: rgba(0,0,0,0.02); }
th {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold);
  background: rgba(0,0,0,0.15);
  font-weight: 700;
}
tbody tr:nth-child(even) td { background: rgba(255, 255, 255, 0.02); }
tr:last-child td { border-bottom: none; }
tbody tr { transition: background 0.15s ease; }
tbody tr:hover td { background: rgba(212, 175, 55, 0.08); }
td.actions { display: flex; gap: 6px; }

.table-wrap { overflow-x: auto; overflow-y: hidden; border-radius: var(--radius-lg); background: rgba(255,255,255,0.03); }

.table-cell-ghost { background: rgba(255,255,255,0.03); border-bottom: 1px solid rgba(212, 175, 55, 0.08); }

.avatar {
  width: 40px; height: 40px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--gold-soft);
  border: 1px solid rgba(212, 175, 55, 0.35);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--gold);
  font-size: 15px;
}
.student-cell { display: flex; align-items: center; gap: 10px; }
.student-cell .name { font-weight: 600; color: var(--ink); }
.student-cell .sub { font-size: 12px; color: var(--muted); }

.name { font-weight: 600; }
.sub { font-size: 12px; color: var(--muted); }

/* ------------------- PROFIL KARTASI ------------------- */
.profile-card { display: flex; align-items: center; gap: 16px; padding: 18px; flex-wrap: wrap; }
.profile-avatar { flex-shrink: 0; }
.profile-info h3 { margin: 0 0 4px; }
.profile-info .sub { margin-bottom: 2px; }
.profile-actions { margin-left: auto; }

.health-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid rgba(212, 175, 55, 0.12); }
.health-row:last-child { border-bottom: none; }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar-label { font-size: 13px; color: var(--muted); font-weight: 600; }

.badge {
  display: inline-block;
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.badge-green { background: var(--green-soft); color: #9ce08f; border: 1px solid rgba(88, 169, 70, 0.4); }
.badge-red { background: var(--red-soft); color: #f59588; border: 1px solid rgba(192, 57, 43, 0.4); }
.badge-amber { background: var(--amber-soft); color: #e8d28a; border: 1px solid rgba(212, 175, 55, 0.4); }
.badge-blue { background: var(--blue-soft); color: #9ccfe8; border: 1px solid rgba(69, 140, 190, 0.4); }
.badge-purple { background: var(--purple-soft); color: #cdb0ec; border: 1px solid rgba(140, 110, 180, 0.4); }
.badge-gold { background: var(--gold-grad); color: #1a1608; font-weight: 800; border: none; box-shadow: 0 4px 10px -4px rgba(212, 175, 55, 0.55); }
.badge-gold-dim { background: var(--gold-soft); color: var(--gold); border: 1px solid rgba(212, 175, 55, 0.4); }

/* ------------------- MODAL ------------------- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(4, 6, 4, 0.78);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal-overlay.open { display: flex; animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: linear-gradient(170deg, #161c12, #0d110b);
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 640px;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.3s var(--ease);
  padding-bottom: 8px;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(18px) scale(0.98); } to { opacity: 1; transform: none; } }
.modal-header {
  padding: 18px 22px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.3);
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 2;
  background: rgba(13, 17, 11, 0.92);
  backdrop-filter: blur(8px);
}
.modal-header h3 { font-size: 16px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--ink-2); }
.modal-close {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 24px;
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.15s, color 0.15s, transform 0.15s;
  line-height: 1;
}
.modal-close:hover,
.modal-close:focus {
  background: rgba(212, 175, 55, 0.15);
  color: var(--gold);
  transform: rotate(90deg);
}
.modal-close:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
.sidebar-close {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 24px;
  cursor: pointer;
  border-radius: 50%;
  line-height: 1;
}
.sidebar-close:hover { background: rgba(212, 175, 55, 0.15); color: var(--gold); }
.modal-body { padding: 22px; }
.modal-footer {
  padding: 15px 22px;
  border-top: 1px solid rgba(212, 175, 55, 0.25);
  display: flex; justify-content: flex-end; gap: 10px;
  position: sticky; bottom: 0;
  background: rgba(13, 17, 11, 0.92);
  backdrop-filter: blur(8px);
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.muted { color: var(--muted); font-size: 13px; }

.hint {
  background: var(--gold-soft-2);
  border-left: 3px solid var(--gold);
  border-radius: 6px;
  padding: 12px 14px;
  font-size: 13px;
  color: var(--ink);
  margin-bottom: 14px;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  animation: pageIn 0.35s var(--ease);
}
.empty-state svg { opacity: 0.4; margin-bottom: 12px; }
.empty-state h4 { color: var(--text); margin-bottom: 4px; }

/* ------------------- TOOLBAR / SWITCH ------------------- */
.toolbar input.date-pick, .toolbar select {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: rgba(5, 8, 5, 0.65);
  color: var(--text);
}
.toolbar input.date-pick:focus, .toolbar select:focus, input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--gold) !important;
  box-shadow: var(--ring);
}
input, select, textarea { transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease; }
input, select, textarea { border-radius: 8px; border: 1px solid var(--border); background: rgba(5, 8, 5, 0.6); color: var(--text); padding: 10px 12px; font-family: inherit; font-size: 14px; }
input::placeholder { color: #5d6352; }

.switch-cell { text-align: center; }
.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; inset: 0;
  background: var(--red);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s;
  border: 1px solid rgba(255, 255, 255, 0.15);
}
.slider:before {
  content: "";
  position: absolute;
  height: 18px; width: 18px;
  left: 3px; top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}
.switch input:checked + .slider { background: var(--green); }
.switch input:checked + .slider:before { transform: translateX(20px); }

.pay-status { font-size: 13px; font-weight: 600; }
.pay-status.ok { color: #9ce08f; }
.pay-status.no { color: #f59588; }

/* To'lanmagan вЂ” aniq qizil nishon + butun qator foni */
.pay-status.badge-no {
  display: inline-block; padding: 4px 11px; border-radius: 999px;
  background: rgba(220, 38, 38, .22); border: 1px solid rgba(220, 38, 38, .6);
  color: #ff8b7d; font-size: 11.5px; font-weight: 800; letter-spacing: .4px;
  text-transform: uppercase; white-space: nowrap;
}
.pay-status.badge-ok {
  display: inline-block; padding: 4px 11px; border-radius: 999px;
  background: rgba(34, 197, 94, .16); border: 1px solid rgba(34, 197, 94, .45);
  color: #9ce08f; font-size: 11.5px; font-weight: 700; letter-spacing: .4px;
  text-transform: uppercase; white-space: nowrap;
}
tr.pay-row-unpaid > td { background: rgba(220, 38, 38, .07); }
tr.pay-row-unpaid:hover > td { background: rgba(220, 38, 38, .12) !important; }
tr.pay-row-unpaid td.rownum { color: #ff8b7d; }
@media (max-width: 480px) {
  .pay-status.badge-no, .pay-status.badge-ok { font-size: 10px; padding: 3px 8px; }
}

/* ------------------- PARENT HERO ------------------- */
.parent-hero {
  border-radius: 20px;
  padding: 26px;
  background: var(--card-gradient);
  border: 1px solid rgba(212, 175, 55, 0.45);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
  animation: cardUp 0.5s var(--ease);
}
.parent-hero::before {
  content: "";
  position: absolute;
  right: -60px; top: -60px;
  width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.2), transparent 70%);
}
.parent-hero .avatar {
  width: 84px; height: 84px;
  border-radius: 50%;
  background: var(--gold-soft);
  color: var(--gold);
  font-size: 32px;
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.4);
}
.parent-hero h2 { font-size: 21px; letter-spacing: 0.8px; text-transform: uppercase; }
.parent-hero .meta { font-size: 14px; opacity: 0.9; margin-top: 4px; color: var(--gold); }

.avg-circle {
  width: 92px; height: 92px;
  border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--gold-grad);
  color: #1a1608;
  font-weight: 800; font-size: 24px;
  margin-left: auto;
  box-shadow: 0 0 24px rgba(212, 175, 55, 0.45);
  flex-shrink: 0;
}
.avg-circle span { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }

.empty-note { color: var(--muted); font-size: 14px; }

/* ------------------- PROGRESS ------------------- */
.progress-wrap { display: flex; align-items: center; gap: 10px; }
.progress {
  flex: 1; height: 8px;
  background: rgba(5, 8, 5, 0.6);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border-soft);
}
.progress > div { height: 100%; border-radius: 999px; transition: width 0.6s ease; }

.tactical-strip {
  height: 4px;
  background: repeating-linear-gradient(90deg, #d4af37 0 14px, #141a12 14px 28px);
}

/* ------------------- MODAL: title/actions ------------------- */
.modal-title {
  font-size: 17px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ink-2);
  margin-bottom: 14px;
}
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.cred-card {
  background: var(--gold-soft-2);
  border: 1px dashed rgba(212, 175, 55, 0.5);
  border-radius: 12px;
  padding: 14px;
}
.cred-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; font-size: 14px; }
.cred-row span { color: var(--muted); font-weight: 600; }
.cred-row code {
  background: var(--code);
  border: 1px solid rgba(212, 175, 55, 0.3);
  color: var(--ink-2);
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 14px;
}
.chip-group { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px;
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  background: var(--gold-soft-2);
  color: var(--text);
  user-select: none;
}
.chip:has(input:checked) { background: var(--gold-soft); border-color: var(--gold); }
.chip input { accent-color: var(--gold); }
.score-input, .test-score {
  width: 84px;
  padding: 8px 10px;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  border-radius: 8px;
  border: 1px solid rgba(212, 175, 55, 0.35);
  background: var(--code);
  color: var(--text);
}
.score-input:focus, .test-score:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.18); }

/* ------------------- KONTAKT ------------------- */
.contact-links { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.contact-link {
  display: inline-flex; align-items: center; gap: 8px; color: var(--gold);
  font-size: 13px; text-decoration: none; font-weight: 600; padding: 3px 0;
}
.contact-link:hover { text-decoration: underline; }
.contact-link svg { width: 16px; height: 16px; flex-shrink: 0; }
.contact-strip {
  display: none;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 18px;
  padding: 8px 16px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.2);
  background: var(--gold-soft-2);
  font-size: 14px;
}
.contact-strip .contact-link { font-size: 14px; }

/* ------------------- JURNAL (o'qituvchi) ------------------- */
.rownum {
  width: 52px; min-width: 52px; text-align: center;
  color: var(--muted); font-weight: 700; font-size: 13px;
  font-variant-numeric: tabular-nums;
}
td.rownum { color: var(--gold); }

/* ------------------- QIDIRUV / FILTR / BULK ------------------- */
.filter-bar {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(5, 8, 5, .35);
}
.search-box { position: relative; display: flex; align-items: center; min-width: 210px; flex: 0 1 280px; }
.search-box .s-ico { position: absolute; left: 11px; font-size: 13px; opacity: .6; pointer-events: none; }
.search-box input {
  width: 100%; padding: 9px 32px 9px 32px;
  border: 1px solid var(--line-soft); border-radius: 8px;
  background: rgba(5, 8, 5, .65); color: var(--ink); font-size: 14px;
}
.search-box input::-webkit-search-cancel-button { display: none; }
.search-box .s-clear {
  position: absolute; right: 6px; width: 22px; height: 22px;
  border: none; border-radius: 50%; cursor: pointer;
  background: rgba(255, 255, 255, .08); color: var(--ink);
  font-size: 15px; line-height: 1; display: flex; align-items: center; justify-content: center;
}
.search-box .s-clear:hover { background: rgba(212, 175, 55, .3); }
.f-select {
  padding: 9px 10px; font-size: 13px; border-radius: 8px;
  border: 1px solid var(--line-soft);
  background: rgba(5, 8, 5, .65); color: var(--ink);
}
.f-count { font-size: 13px; color: var(--muted); font-weight: 600; margin-left: auto; }

.rowsel { width: 40px; min-width: 40px; text-align: center; padding: 12px 6px !important; }
.rowsel input[type="checkbox"] {
  width: 17px; height: 17px; cursor: pointer;
  accent-color: var(--gold); vertical-align: middle;
}
tr.sel-row { background: rgba(212, 175, 55, .09); }
tr.sel-row:hover { background: rgba(212, 175, 55, .14) !important; }

.bulk-bar {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  padding: 10px 16px;
  background: linear-gradient(90deg, rgba(212, 175, 55, .16), rgba(212, 175, 55, .05));
  border-bottom: 1px solid rgba(212, 175, 55, .38);
  animation: cardUp .22s var(--ease);
}
.bulk-n { font-size: 13.5px; font-weight: 700; color: var(--gold); margin-right: 4px; }
.bulk-n b { font-size: 15px; }

/* ------------------- DASHBORD TEZ TUGMALARI ------------------- */
.quick-grid {
  display: grid; gap: 10px; margin-bottom: 20px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}
.quick-btn {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; min-height: 68px;
  border: 1px solid var(--line-soft); border-radius: var(--radius);
  background: var(--card-gradient); color: var(--ink);
  cursor: pointer; text-align: left; font-family: inherit;
  box-shadow: var(--shadow);
  transition: transform .18s var(--ease), border-color .18s, box-shadow .18s;
}
.quick-btn:hover {
  transform: translateY(-3px);
  border-color: rgba(212, 175, 55, .6);
  box-shadow: var(--shadow-lg);
}
.quick-btn:active { transform: translateY(0); }
.quick-btn .q-ico { font-size: 24px; line-height: 1; flex-shrink: 0; }
.quick-btn .q-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.quick-btn .q-label { font-size: 14px; font-weight: 700; color: var(--ink); }
.quick-btn .q-sub { font-size: 11.5px; color: var(--muted); }

@media (max-width: 480px) {
  .quick-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .quick-btn { padding: 12px 10px; min-height: 74px; gap: 8px; }
  .quick-btn .q-ico { font-size: 20px; }
  .quick-btn .q-label { font-size: 12px; }
  .quick-btn .q-sub { font-size: 10px; }
  .filter-bar { padding: 10px 12px; gap: 6px; }
  .search-box { flex: 1 1 100%; min-width: 0; }
  .f-select { flex: 1 1 calc(50% - 3px); }
  .f-count { margin-left: 0; flex: 1 1 100%; }
}

.hint:empty { display: none; }

/* disabled holat вЂ” ko'rinib tursin */
.btn:disabled, .btn[disabled] {
  opacity: .42; cursor: not-allowed; transform: none !important;
  box-shadow: none !important; filter: grayscale(.55);
}

/* Eslatma ko'rish oynasi */
.tg-stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px; margin-bottom: 4px;
}
.tg-stat-grid > div {
  padding: 10px 12px; border-radius: 10px;
  background: var(--card-2); border: 1px solid var(--line-soft);
  display: flex; flex-direction: column; gap: 3px;
}
.tg-stat-grid span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.tg-stat-grid b { font-size: 17px; color: var(--gold); font-weight: 800; }
.tg-preview-list {
  max-height: 210px; overflow-y: auto; padding: 11px 13px;
  border-radius: 10px; border: 1px solid var(--line-soft);
  background: rgba(5, 8, 5, .55); font-size: 13px; line-height: 1.65; color: var(--ink);
}
.tg-preview-list i { color: var(--muted); }

/* ------------------- TELEGRAM ------------------- */
.tg-bar-host:empty { display: none; }
.tg-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 18px; padding: 12px 16px;
  border: 1px solid rgba(212, 175, 55, .38); border-radius: var(--radius);
  background: linear-gradient(90deg, rgba(212, 175, 55, .12), rgba(212, 175, 55, .03));
  font-size: 14px; color: var(--ink);
}
.tg-bar.ok { border-color: rgba(88, 169, 70, .5); background: linear-gradient(90deg, rgba(88, 169, 70, .14), rgba(88, 169, 70, .03)); }
.tg-bar a.btn { text-decoration: none; }
@media (max-width: 480px) {
  .tg-bar { padding: 11px 12px; font-size: 13px; }
  .tg-bar .btn { width: 100%; }
}
.badge-amber { background: rgba(217, 119, 6, .18); color: #f0a742; border-color: rgba(217, 119, 6, .4); }

/* ------------------- DARS JADVALI ------------------- */
.sched-wrap { overflow-x: auto; padding-bottom: 4px; }
.sched { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 620px; }
.sched .snum {
  width: 46px; min-width: 46px; text-align: center;
  color: var(--gold); font-weight: 800; font-size: 13px;
  padding: 8px 4px; background: var(--card-2);
  border: 1px solid var(--line-soft);
}
.sched .sday {
  padding: 6px 8px; text-align: center; font-weight: 800; font-size: 13px;
  color: var(--gold); background: var(--card-2);
  border: 1px solid var(--line-soft);
}
.sched .sdayfull { font-size: 10px; font-weight: 500; color: var(--muted); margin-top: 2px; }
.sched .scell {
  border: 1px solid var(--line-soft);
  padding: 5px; vertical-align: top;
  background: var(--card);
  min-width: 118px;
}
.sched .ssubject {
  font-size: 12.5px; font-weight: 600; color: var(--ink);
  padding: 6px 4px; text-align: center; line-height: 1.3;
}
.sched .sempty { font-size: 13px; color: var(--muted); opacity: .45; text-align: center; padding: 6px 4px; }
.sched .sched-in {
  width: 100%; margin-bottom: 4px; padding: 5px 6px;
  font-size: 11.5px; border-radius: 6px;
  border: 1px solid var(--line-soft);
  background: var(--card-2); color: var(--ink);
}
.sched .sched-in:last-child { margin-bottom: 0; }
.sched .sched-in:focus { outline: none; border-color: var(--gold); }
.sched td.scell:has(.sched-in:focus) { background: rgba(212, 175, 55, .07); }
.select-inline {
  padding: 6px 10px; font-size: 13px; border-radius: 8px;
  border: 1px solid var(--line-soft); background: var(--card-2); color: var(--ink);
}
.panel-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ------------------- JURNAL (o'qituvchi) ------------------- */
.journal-wrap { overflow-x: auto; }
.journal { border-collapse: separate; border-spacing: 0; min-width: 640px; }
.journal .jname {
  position: sticky; left: 0; z-index: 2;
  background: #10150e;
  border-right: 1px solid rgba(212, 175, 55, 0.35);
  padding: 8px 12px; font-size: 13px; min-width: 150px;
  color: var(--ink);
}
.journal th.jname { background: #171d13; }
.journal .jhead {
  padding: 6px 2px; font-size: 11px; color: var(--muted);
  border: 1px solid var(--line-soft); min-width: 34px; text-align: center;
}
.journal .jhead .jday { font-size: 12px; color: var(--text); font-weight: 700; }
.journal td { border-bottom: 1px solid var(--line-soft); padding: 4px 2px; text-align: center; }
.jcell {
  width: 32px; height: 32px; min-width: 32px; border-radius: 8px; border: none;
  cursor: pointer; font-weight: 700; font-size: 15px; background: var(--code); color: var(--muted);
  transition: transform 0.14s var(--ease), background 0.14s;
}
.jcell:hover { background: rgba(212, 175, 55, 0.2); transform: scale(1.1); }
.jcell.s5 { background: var(--gold-grad); color: #1a1608; box-shadow: 0 0 8px rgba(212, 175, 55, 0.4); }
.jcell.s4 { background: rgba(212, 175, 55, 0.65); color: #1a1608; }
.jcell.s3 { background: rgba(212, 175, 55, 0.38); color: var(--ink); }
.jcell.s2 { background: rgba(192, 57, 43, 0.5); color: #fff; }
.jcell.s1 { background: rgba(192, 57, 43, 0.8); color: #fff; }
.javg { padding: 8px; text-align: center; font-weight: 700; color: var(--gold); border-left: 1px solid var(--line-soft); }
.javghead { border-left: 1px solid var(--line-soft) !important; }

/* ------------------- KUNDALIK (ota-ona) ------------------- */
.diary-body { display: flex; flex-direction: column; gap: 8px; }
.diary-entry { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--border-soft); border-radius: 10px; }
.diary-subj { font-weight: 600; font-size: 14px; }
.diary-score { min-width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; font-weight: 800; font-size: 15px; background: var(--green-soft); color: #9ce08f; }
.diary-score.a { background: var(--amber-soft); color: #e8d28a; }
.diary-score.r { background: var(--red-soft); color: #f59588; }

/* ------------------- CHAT ------------------- */
.chat-layout {
  display: flex;
  height: calc(100vh - 210px);
  min-height: 420px;
  gap: 14px;
}
.chat-list {
  width: 320px;
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  padding: 4px;
}
.chat-open {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow);
}
.chat-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: left;
  color: var(--text);
  transition: transform 0.16s var(--ease), border-color 0.16s, background 0.16s;
}
.chat-row:hover { border-color: rgba(212, 175, 55, 0.5); background: var(--card-3); transform: translateX(2px); }
.chat-row:active { transform: scale(0.985); }
.chat-row-main { flex: 1; min-width: 0; }
.chat-row-head { display: flex; align-items: center; gap: 8px; }
.chat-row-head b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-time { font-size: 11px; color: var(--muted); margin-left: auto; white-space: nowrap; }
.chat-preview {
  display: block;
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}
.chat-preview-unread { color: var(--text); font-weight: 600; }
.chat-unread {
  flex: none;
  align-self: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
}
.chat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--card-3);
}
.chat-head b { font-size: 15px; }
.chat-head .sub { font-size: 12px; }
.chat-back { margin-right: 2px; }
.chat-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(0, 0, 0, 0.25);
}
.bubble {
  max-width: 78%;
  align-self: flex-start;
  background: var(--card-3);
  border: 1px solid var(--border);
  border-radius: 14px 14px 14px 4px;
  padding: 9px 12px;
  box-shadow: var(--shadow-sm);
  animation: bubbleIn 0.22s var(--ease);
}
.bubble.mine {
  align-self: flex-end;
  background: linear-gradient(160deg, rgba(212, 175, 55, 0.35), rgba(212, 175, 55, 0.16));
  border-color: rgba(212, 175, 55, 0.5);
  border-radius: 14px 14px 4px 14px;
}
@keyframes bubbleIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.bubble-text { font-size: 14px; line-height: 1.45; word-break: break-word; white-space: pre-wrap; }
.bubble-time { font-size: 10.5px; color: var(--muted); margin-top: 3px; text-align: right; }
.chat-form {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  background: var(--card);
}
.chat-form textarea {
  flex: 1;
  resize: none;
  background: var(--card-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14px;
  outline: none;
}
.chat-form textarea:focus { border-color: var(--gold) !important; box-shadow: var(--ring); }
.chat-form .btn { align-self: flex-end; }

/* ------------------- SKELETON ------------------- */
.skeleton {
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.045);
  border-radius: var(--radius-sm);
}
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.09), transparent);
  transform: translateX(-100%);
  animation: skeletonSweep 1.35s infinite;
}
@keyframes skeletonSweep { to { transform: translateX(100%); } }
.skeleton-line { height: 12px; border-radius: 999px; margin: 8px 0; }
.skeleton-line.w-40 { width: 40%; }
.skeleton-line.w-60 { width: 60%; }
.skeleton-line.w-80 { width: 80%; }
.skeleton-avatar { width: 42px; height: 42px; border-radius: 50%; flex: none; }
.skeleton-card { height: 84px; border-radius: var(--radius-lg); }
.skeleton-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.skeleton-pad { padding: 14px; }

/* ------------------- TOAST ------------------- */
.toast-wrap {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(92vw, 380px);
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 15px;
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(24, 30, 20, 0.98), rgba(12, 15, 10, 0.98));
  border: 1px solid var(--border-soft);
  border-left: 3px solid var(--gold);
  box-shadow: var(--shadow-lg);
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.45;
  animation: toastIn 0.35s var(--ease);
  backdrop-filter: blur(8px);
}
.toast.hide { animation: toastOut 0.28s ease forwards; }
.toast-success { border-left-color: var(--green); }
.toast-error { border-left-color: var(--red); }
.toast-icon { flex: none; color: var(--gold); margin-top: 1px; }
.toast-success .toast-icon { color: #9ce08f; }
.toast-error .toast-icon { color: #f59588; }
.toast-msg { flex: 1; word-break: break-word; }
.toast-close {
  flex: none; background: transparent; border: none; cursor: pointer;
  color: var(--muted); font-size: 18px; line-height: 1; padding: 0 2px;
}
.toast-close:hover { color: var(--text); }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px) scale(0.98); } }

/* ------------------- HARAKATNI KAMAYTIRISH ------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================================
   MOBIL (max-width: 900px)
   ============================================================ */
@media (max-width: 900px) {
  .app { display: block; }
  body { background-attachment: scroll; }

  .sidebar {
    width: 100%;
    height: auto;
    position: fixed;
    left: 0;
    top: auto;
    bottom: 0;
    flex-direction: row;
    align-items: stretch;
    border-right: none;
    border-top: 1px solid rgba(212, 175, 55, 0.35);
    background: rgba(8, 11, 7, 0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 60;
    padding: 5px 6px calc(5px + env(safe-area-inset-bottom));
    box-shadow: 0 -10px 30px -14px rgba(0, 0, 0, 0.85);
  }
  .sidebar-header { display: none; }
  .nav {
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    align-items: stretch;
    gap: 3px;
    padding: 2px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav-item {
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    min-width: 62px;
    min-height: 54px;
    padding: 7px 6px 6px;
    font-size: 10px !important;
    text-align: center;
    border-left: none !important;
    border-radius: 12px;
    scroll-snap-align: center;
    transition: background 0.18s ease, color 0.18s ease, transform 0.14s ease;
  }
  .nav-item:active { transform: scale(0.94); background: var(--gold-soft); }
  .nav-item svg { width: 22px; height: 22px; }
  .nav-item span.text {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.15;
  }
  .nav-item.active {
    border-left: none;
    background: linear-gradient(180deg, rgba(212, 175, 55, 0.24), rgba(212, 175, 55, 0.09));
    color: var(--ink-2);
    box-shadow: inset 0 2px 0 var(--gold);
  }
  .nav-item.active::after { display: none; }
  .nav-item.active svg { animation: none; filter: drop-shadow(0 0 6px rgba(212, 175, 55, 0.7)); }
  .nav-badge { top: 2px; right: 10px; }
  .sidebar-footer {
    border-top: none;
    padding: 2px;
    flex-shrink: 0;
    display: flex;
    align-items: stretch;
  }
  .sidebar-footer .user-info, .sidebar-footer .contact-links { display: none; }
  .sidebar-footer .nav-item { min-width: 58px; color: #f59588; }
  .sidebar-close { display: none !important; }
  .sidebar-footer {
    border-top: none;
    padding: 2px;
    flex-shrink: 0;
    display: flex;
    align-items: stretch;
  }
  .sidebar-footer .user-info, .sidebar-footer .contact-links { display: none; }
  .sidebar-footer .nav-item { min-width: 58px; color: #f59588; }

  .main { padding-bottom: calc(78px + env(safe-area-inset-bottom)); }

  .topbar {
    padding: 12px 16px;
    gap: 8px;
    flex-wrap: wrap;
    background: linear-gradient(180deg, rgba(10, 13, 8, 0.97), rgba(9, 12, 7, 0.95));
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(212, 175, 55, 0.22);
    box-shadow: 0 4px 18px -10px rgba(0, 0, 0, 0.6);
    position: sticky;
    top: 0;
    z-index: 30;
  }
  .topbar h1 { font-size: 15px; letter-spacing: 0.4px; font-weight: 800; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar .clock-box { display: none; }
  .topbar .refresh-btn { border: none; background: var(--gold-soft); color: var(--gold); width: 38px; height: 38px; min-height: 38px; border-radius: 12px; padding: 0; justify-content: center; }
  .topbar .refresh-btn:hover { background: rgba(212, 175, 55, 0.2); }

  .content { padding: 14px 14px 30px; animation: pageIn 0.3s var(--ease); }
  .refresh-label { display: none; }

  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
  .stat-card {
    padding: 14px 12px;
    border-radius: 14px;
    gap: 10px;
    flex-direction: column;
    align-items: flex-start;
  }
  .stat-card::before { display: none; }
  .stat-icon { width: 40px; height: 40px; border-radius: 11px; }
  .stat-value { font-size: 21px; }
  .stat-label { font-size: 11px; }

  .panel { border-radius: 16px; margin-bottom: 14px; box-shadow: 0 6px 22px -12px rgba(0, 0, 0, 0.55); }
  .panel-header { padding: 13px 16px; }
  .panel-header h3 { font-size: 13px; letter-spacing: 0.3px; }
  .panel-body { padding: 14px 16px; }
  .form-grid { grid-template-columns: 1fr; }

  .parent-hero {
    padding: 18px;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    border-radius: 18px;
  }
  .parent-hero .avatar { width: 64px; height: 64px; font-size: 24px; }
  .parent-hero h2 { font-size: 18px; }
  .parent-hero .meta { font-size: 13px; }
  .parent-hero .avg-circle { width: 72px; height: 72px; font-size: 19px; margin-left: auto; }

  .diary-entry { padding: 11px 13px; border-radius: 12px; flex-wrap: wrap; gap: 8px; }
  .table-wrap { border-radius: 10px; margin: 0 -4px; }
  th, td { padding: 11px 12px; font-size: 13px; }

  .toolbar { flex-wrap: wrap; }
  .toolbar input, .toolbar select, .toolbar button, input, select, textarea { font-size: 16px; }
  input, select, textarea, .toolbar input.date-pick, .toolbar select {
    border-radius: 11px;
    padding: 12px 13px;
    border-color: rgba(212, 175, 55, 0.22);
  }
  .btn { min-height: 44px; padding: 12px 16px; border-radius: 12px; }
  .btn-sm { min-height: 36px; padding: 8px 12px; }

  .modal-overlay { align-items: flex-end; padding: 10px; }
  .modal { border-radius: 20px 20px 0 0; max-height: 92vh; }
  .modal-header { padding: 16px 18px; }
  .modal-body { padding: 18px; }

  .login-card { padding: 28px 22px; border-radius: 20px; }
  .insignia { width: 170px; height: 170px; }
  .insignia .logo-img { width: 135px; height: 156px; }

  .journal .jname { min-width: 118px; padding: 8px 8px; font-size: 12px; }
  .journal .jhead { min-width: 30px; padding: 6px 1px; font-size: 10px; }
  .jcell { width: 30px; height: 30px; min-width: 30px; font-size: 14px; }

  .chat-layout { display: block; height: calc(100vh - 210px); min-height: 400px; }
  .chat-list { width: 100%; height: 100%; }
  .chat-open { display: none; height: 100%; }
  .chat-list-hide-mobile { display: none; }
  .chat-open-show { display: flex; }
  .chat-row-head b { font-size: 13px; }
  .bubble { max-width: 90%; }
  .chat-head { position: sticky; top: 0; z-index: 2; backdrop-filter: blur(8px); }

  .toast-wrap { right: 12px; left: 12px; bottom: calc(88px + env(safe-area-inset-bottom)); max-width: none; }
  .toast { font-size: 14px; padding: 14px 15px; }
}

@media (max-width: 480px) {
  /* Input font-size 16px - iOS zoom oldini oladi */
  input, select, textarea, .toolbar input.date-pick, .toolbar select {
    font-size: 16px !important;
  }
  
  .content { padding: 12px 12px 26px; }
  .modal-footer { flex-wrap: wrap; }
  .modal-footer .btn { flex: 1 1 45%; }
  .nav-item { min-width: 54px; padding: 7px 4px 6px; }
  .nav-item svg { width: 21px; height: 21px; }
  .stat-card { padding: 12px 10px; }
  .stat-icon { width: 36px; height: 36px; }
  .stat-value { font-size: 19px; }
  .topbar h1 { font-size: 13px; }
  .toolbar { gap: 6px; }
  .toolbar .btn { flex: 1 1 auto; }
  .format-select, .toolbar select { max-width: 100%; }
  .score-input, .test-score { width: 66px; }
  .main { padding-bottom: calc(74px + env(safe-area-inset-bottom)); }

  /* Bottom bar rejimi - sidebar header va close tugmasi kerak emas */
  .sidebar-header { display: none !important; }
  .sidebar-close { display: none !important; }
  
  /* Prevent white flash on mobile */
  html { background-color: var(--bg); }
  
  /* Ensure panels visible on mobile */
  .panel { opacity: 1 !important; visibility: visible !important; }
  .stat-card { opacity: 1 !important; visibility: visible !important; display: flex !important; }
}


/* ============================================================
   3D EFEKTLAR — chuqurlik, tez va xavfsiz
   Faqat transform/opacity (GPU tez), filter emas.
   ============================================================ */

/* Nishon ustida yengil 3D ko'tarilish */
.insignia:hover .logo-img {
  transform: translateZ(18px) scale(1.02);
}

/* Kartalar 3D da chuqurlashadi */
.stat-card:hover {
  transform: translateY(-4px) rotateX(2.2deg) scale(1.012);
  box-shadow: 0 18px 38px -14px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(212, 175, 55, 0.22);
  border-color: rgba(212, 175, 55, 0.38);
}
.panel:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow), 0 0 0 1px rgba(212, 175, 55, 0.14);
}

/* Tugmalar bosilganda "bosilgan" 3D holat */
.btn {
  transform-style: preserve-3d;
  transition: transform 0.16s var(--ease), box-shadow 0.16s var(--ease), background 0.16s var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(1px) scale(0.985); }

/* Jadval qatorlari — yengil ko'tarilish */
.table-wrap tbody tr {
  transition: background 0.18s var(--ease), transform 0.18s var(--ease);
}
.table-wrap tbody tr:hover {
  background: rgba(212, 175, 55, 0.06);
  transform: translateX(2px);
}

/* Kirish kartasi — 3D kirish */
.login-card {
  transform-style: preserve-3d;
  will-change: transform;
}
@keyframes cardIn {
  from { opacity: 0; transform: perspective(1100px) rotateX(7deg) translateY(26px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

/* Modal — 3D ochilish */
.modal-overlay.open .modal {
  animation: modalIn3d 0.32s var(--ease);
}
@keyframes modalIn3d {
  from { opacity: 0; transform: perspective(900px) rotateX(-6deg) translateY(18px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

/* ============================================================
   HARAKATGA QARAMA (accessibility) + TEZLIK
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .insignia__gloss { display: none; }
  .stat-card:hover, .panel:hover, .btn:hover { transform: none; }
}

/* Kichik ekranlarda 3D kamaytiriladi (tezlik uchun) */
@media (max-width: 640px) {
  .stat-card:hover { transform: translateY(-2px); }
  .insignia__gloss { animation-duration: 9s; }
}
