/* ==========================================================================
   Togarak Daftari — Modern Premium UI / Design System
   ========================================================================== */

:root,
:root[data-theme="light"] {
  /* Brauzerning o'zi chizadigan narsalar (sana/oy tanlagich, skrollbar,
     checkbox) uchun — ularning ICHKI ko'rinishini CSS bilan to'liq
     o'zgartirib bo'lmaydi, lekin shu orqali brauzer ularni saytning
     yorug'/qorong'u rejimiga moslab (fon-matn rangini) chizadi. */
  color-scheme: light;
  --bg: #f6f6fb;
  --surface: #ffffff;
  --surface-soft: #f3f3f9;
  --surface-strong: #e9e9f2;
  --surface-subtle: #f8f8fc;
  --text: #17171f;
  --text-secondary: #46465a;
  --muted: #82829a;
  --border: #e7e7f1;
  --border-focus: #7c6cf0;

  /* --primary — asosiy CTA rangi: LIGHT rejimda deyarli qora (siyoh), qorong'u
     rejimda esa binafsha (pastdagi [data-theme="dark"] blokida almashtiriladi) —
     ikkala holatda ham fon bilan eng yuqori kontrastni beradigan variant. */
  --primary: #1c1b23;
  --primary-dark: #100f16;
  --primary-contrast: #ffffff;
  --primary-soft: #efeef6;

  /* --accent — brend binafsha rangi: sidebar faol band, havolalar, ikon belgilar. */
  --accent: #7c6cf0;
  --accent-dark: #6a58e0;
  --accent-light: #9585f5;
  --accent-soft: #f1eefe;

  --success: #16a34a;
  --success-dark: #15803d;
  --success-bg: #e9f9ee;
  --success-border: #bdeccb;

  --danger: #e0473d;
  --danger-dark: #c93a31;
  --danger-bg: #fdedec;
  --danger-border: #f8cac6;

  --warning: #c8860a;
  --warning-dark: #a66c06;
  --warning-bg: #fdf3de;
  --warning-border: #f3dda0;

  --gold: #b4790a;
  --gold-bg: #fdf1d9;
  --gold-border: #f2dda3;

  --info: #3b82f6;
  --info-bg: #eff6ff;
  --info-border: #bfdbfe;

  --shadow-sm: 0 1px 2px 0 rgba(23, 23, 31, 0.05);
  --shadow: 0 4px 16px -4px rgba(23, 23, 31, 0.08), 0 2px 6px -2px rgba(23, 23, 31, 0.05);
  --shadow-md: 0 10px 25px -6px rgba(23, 23, 31, 0.1), 0 4px 10px -4px rgba(23, 23, 31, 0.05);
  --shadow-lift: 0 20px 40px -8px rgba(23, 23, 31, 0.16), 0 8px 18px -6px rgba(23, 23, 31, 0.08);
  --ring: rgba(124, 108, 240, 0.28);

  --radius-sm: 9px;
  --radius: 13px;
  --radius-lg: 18px;
  --radius-xl: 24px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0b11;
  --surface: #16161f;
  --surface-soft: #1c1c27;
  --surface-strong: #292933;
  --surface-subtle: #131319;
  --text: #f5f5f8;
  --text-secondary: #c7c7d3;
  --muted: #91919f;
  --border: rgba(255, 255, 255, 0.09);
  --border-focus: #8b7cf6;

  /* Qorong'u rejimda deyarli qora tugma fonga singib ketardi — shu sabab
     asosiy CTA rangi shu yerda binafshaga almashtiriladi (--accent bilan bir xil
     oilada, lekin biroz yorqinroq — kontrast va "hayotiylik" uchun). */
  --primary: #8b7cf6;
  --primary-dark: #7a68f2;
  --primary-contrast: #ffffff;
  --primary-soft: rgba(139, 124, 246, 0.16);

  --accent: #9c8dfb;
  --accent-dark: #8b7cf6;
  --accent-light: #b3a6fc;
  --accent-soft: rgba(156, 141, 251, 0.16);

  --success: #34d399;
  --success-dark: #10b981;
  --success-bg: rgba(16, 185, 129, 0.15);
  --success-border: rgba(16, 185, 129, 0.3);

  --danger: #f87171;
  --danger-dark: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.15);
  --danger-border: rgba(239, 68, 68, 0.3);

  --warning: #fbbf24;
  --warning-dark: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.15);
  --warning-border: rgba(245, 158, 11, 0.3);

  --gold: #fbbf24;
  --gold-bg: rgba(245, 158, 11, 0.16);
  --gold-border: rgba(245, 158, 11, 0.32);

  --info: #60a5fa;
  --info-bg: rgba(59, 130, 246, 0.15);
  --info-border: rgba(59, 130, 246, 0.3);

  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.3);
  --shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.4), 0 2px 6px -1px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 10px 25px -3px rgba(0, 0, 0, 0.5), 0 4px 10px -2px rgba(0, 0, 0, 0.3);
  --shadow-lift: 0 20px 35px -5px rgba(0, 0, 0, 0.6), 0 8px 16px -4px rgba(0, 0, 0, 0.4);
  --ring: rgba(139, 124, 246, 0.35);
}

/* ==========================================================================
   Base & Typography
   ========================================================================== */

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

/* Mavzu (light/dark) almashtirilgan zumda theme.js shu klassni bir lahzaga
   qo'shadi: aks holda CSS o'zgaruvchisiga bog'liq --primary/--accent kabi
   ranglar element'ning o'zida emas, <html>da o'zgargani uchun ba'zi
   brauzerlarda `transition` bilan "eskicha rangda qotib qolardi" (masalan
   .btn fon rangi) — chunki o'tish effekti custom property o'zgarishini
   emas, faqat elementning o'z qatoridagi o'zgarishni kuzatadi. */
.theme-switching, .theme-switching * {
  transition: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: -0.01em;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

h1, h2, h3, h4, p {
  margin-top: 0;
}

h1, h2, h3, h4 {
  color: var(--text);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.25;
}

h1 {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  margin-bottom: 0.5rem;
}

h2 {
  font-size: clamp(1.2rem, 3vw, 1.45rem);
  margin-bottom: 0.85rem;
}

h3 {
  font-size: 1.08rem;
  margin-bottom: 0.4rem;
}

p {
  margin-bottom: 0.9rem;
  color: var(--text-secondary);
}

small, .small-note {
  font-size: 0.84rem;
  color: var(--muted);
  font-weight: 500;
}

.muted {
  color: var(--muted);
}

.center {
  text-align: center;
}

.mt-16 {
  margin-top: 1.15rem;
}

/* ==========================================================================
   Header & Topbar
   ========================================================================== */

.topbar {
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 1.35rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.sidebar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
}

.sidebar-toggle svg {
  width: 19px;
  height: 19px;
}

.topbar .brand {
  display: inline-flex;
  align-items: center;
  gap: 0.12rem;
  color: var(--text);
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: 1.4rem;
  text-decoration: none;
  min-width: 0;
}

.topbar .brand span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar .brand:hover {
  text-decoration: none;
}

.topbar .brand img {
  width: auto;
  height: 40px;
  object-fit: contain;
  flex: 0 0 auto;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex: 0 0 auto;
}

/* Bildirishnoma qo'ng'irog'i (hozircha faqat haqiqiy bildirishnomasi bor
   rollarda — masalan o'quvchi/ota-ona — ko'rsatiladi). */
.icon-btn-plain {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.icon-btn-plain:hover {
  background: var(--surface-soft);
  color: var(--text);
  text-decoration: none;
}

.icon-btn-plain svg {
  width: 19px;
  height: 19px;
}

.icon-btn-plain .ping-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--danger);
  border: 2px solid var(--surface);
}

/* Ochiq (login qilinmagan) sahifalardagi mustaqil tungi-rejim tugmasi —
   hisobga kirilgan sahifalarda esa xuddi shu #themeToggle id'si hisob
   menyusi ichida (.theme-row) boshqacha chiziladi, shu bloklarga kirmaydi. */
.theme-toggle .icon-moon {
  display: none;
}

:root[data-theme="dark"] .theme-toggle .icon-sun {
  display: none;
}

:root[data-theme="dark"] .theme-toggle .icon-moon {
  display: inline-flex;
}

/* ---- Hisob menyusi (avatar + ism + pastga tushuvchi menyu) ---- */
.account-menu {
  position: relative;
}

.account-trigger {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.3rem 0.55rem 0.3rem 0.3rem;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 14px;
  cursor: pointer;
  font-family: inherit;
  color: var(--text);
  max-width: 220px;
}

.account-trigger:hover {
  background: var(--surface-soft);
}

.account-menu.is-open .account-trigger {
  background: var(--surface-soft);
  border-color: var(--border);
}

.avatar-circle {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--primary-contrast);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.82rem;
  letter-spacing: 0.01em;
  overflow: hidden;
}

.avatar-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Sozlamalar sahifasidagi profil rasmi yuklash bloki */
.avatar-upload-row {
  display: flex;
  align-items: center;
  gap: 1.15rem;
  margin-bottom: 0.6rem;
  flex-wrap: wrap;
}

.avatar-upload-preview {
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--primary-contrast);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.4rem;
  overflow: hidden;
}

.avatar-upload-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-upload-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.avatar-upload-actions form {
  margin: 0;
}

/* ==========================================================================
   Sozlamalar sahifasidagi yig'iladigan (disclosure) bo'limlar — <details>
   asosida: JS'siz, ochiq/yopiq holatini brauzerning o'zi boshqaradi.
   ========================================================================== */

.settings-disclosure summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
  list-style: none;
}

.settings-disclosure summary::-webkit-details-marker {
  display: none;
}

.settings-disclosure summary::marker {
  content: "";
}

.settings-disclosure-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex: 0 0 auto;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}

.settings-disclosure-trigger svg {
  width: 16px;
  height: 16px;
}

.settings-disclosure[open] .settings-disclosure-trigger .icon-chevron {
  transform: rotate(180deg);
}

/* "Tahrirlash" (qalam+matn) trigger faqat YOPIQ holatda ko'rinadi — ochilgach
   pastda to'liq forma ko'ringani uchun endi keraksiz. Sessiyalar bo'limidagi
   faqat-strelka trigger (.icon-chevron, yuqorida) esa aksincha, ochiq holatda
   ham ko'rinib turishi va aylanishi kerak — shu sabab ikkalasi alohida class. */
.settings-disclosure[open] .settings-disclosure-trigger-edit {
  display: none;
}

/* Ochilgach, pastda "Profil rasmi" bo'limida O'SHA rasm allaqachon
   ko'rsatilayotgani uchun, yuqoridagi (summary) rasm+ism qatori endi
   ortiqcha — shu holatda yashiramiz. */
.settings-disclosure[open] .profile-summary-row {
  display: none;
}

/* Summary (rasm+ism+Tahrirlash) ochiq holatda butunlay yashirilgani uchun,
   yopish uchun aniq bir tugma kerak — aks holda karta "bo'sh" ko'rinadi va
   qayerga bosib yopishni topib bo'lmaydi. Tugma endi .settings-disclosure-body
   ICHIDA (uning birinchi farzandi) — shu sabab <details> yopiq holatda
   brauzerning o'zi uni yashiradi (alohida [open] qoidasi kerak emas) va
   "Profil rasmi" yozuvi bilan BIR XIL balandlikda turadi (ikkalasi ham
   body'ning bir xil padding-top'idan boshlanadi).*/
.settings-disclosure-body {
  position: relative;
  margin-top: 1.15rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}

.settings-disclosure-close {
  position: absolute;
  top: 1.15rem;
  right: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1;
  transition: background 0.15s ease, color 0.15s ease;
}

.settings-disclosure-close:hover {
  background: var(--surface-soft);
  color: var(--text);
}

.settings-disclosure-close svg {
  width: 16px;
  height: 16px;
}

.form-actions-end {
  display: flex;
  justify-content: flex-end;
}

.settings-subsection h4 {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 800;
  margin-bottom: 0.65rem;
}

.settings-subsection .field-row {
  margin-bottom: 0.85rem;
}

.settings-subsection.is-danger {
  padding-top: 1.1rem;
  border-top: 1px dashed var(--danger-border);
}

.profile-summary-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.profile-summary-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.3;
}

.profile-summary-text strong {
  font-size: 1rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-summary-text span {
  font-size: 0.83rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sessions-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.session-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
}

.session-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

/* Rasmni kesish/joylashtirish oynasi (assets/avatar-crop.js) */
.crop-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(10, 10, 16, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.crop-overlay[hidden] {
  display: none;
}

.crop-card {
  width: min(360px, 100%);
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lift);
  text-align: center;
}

.crop-card h3 {
  margin: 0 0 0.3rem;
  font-size: 1.05rem;
}

.crop-card p {
  margin: 0 0 1.1rem;
  color: var(--muted);
  font-size: 0.84rem;
}

.crop-viewport {
  position: relative;
  width: 260px;
  height: 260px;
  margin: 0 auto 1.1rem;
  border-radius: 50%;
  overflow: hidden;
  background: var(--surface-strong);
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 4px var(--border);
  cursor: grab;
  touch-action: none;
}

.crop-viewport:active {
  cursor: grabbing;
}

.crop-viewport img {
  position: absolute;
  max-width: none;
  max-height: none;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.crop-zoom {
  width: 100%;
  min-height: auto;
  margin: 0 0 1.25rem;
  accent-color: var(--accent);
  padding: 0;
  border: 0;
  background: transparent;
}

.crop-actions {
  display: flex;
  gap: 0.6rem;
}

.crop-actions .btn {
  flex: 1;
}

/* ==========================================================================
   Sana/oy tanlagich (assets/date-picker.js) — native <input type="date"/
   "month">ni saytga mos ko'rinishda almashtiradi.
   ========================================================================== */

.dp-wrap {
  position: relative;
  display: block;
  width: 100%;
}

.dp-native-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.dp-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  width: 100%;
  font-family: inherit;
  font-size: 0.93rem;
  font-weight: 600;
  text-align: left;
  padding: 0.65rem 0.9rem;
  min-height: 46px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.dp-trigger:hover {
  border-color: var(--accent);
}

.dp-wrap.is-open .dp-trigger {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.dp-trigger-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dp-trigger-icon {
  flex-shrink: 0;
  display: flex;
  color: var(--muted);
}

.dp-trigger-icon svg {
  width: 17px;
  height: 17px;
}

.dp-panel {
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  z-index: 30;
  width: min(272px, calc(100vw - 2rem));
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lift);
  padding: 0.85rem;
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  pointer-events: none;
  transform-origin: top left;
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.dp-wrap.is-open .dp-panel {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.dp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.7rem;
}

.dp-head-label {
  font-weight: 800;
  font-size: 0.92rem;
  color: var(--text);
}

.dp-nav-btn {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.dp-nav-btn:hover {
  background: var(--surface-soft);
  color: var(--text);
}

.dp-nav-btn svg {
  width: 16px;
  height: 16px;
}

.dp-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 0.2rem;
}

.dp-weekdays span {
  text-align: center;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--muted);
  padding: 0.3rem 0;
}

.dp-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.dp-day {
  aspect-ratio: 1;
  border: 0;
  background: transparent;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dp-day:hover {
  background: var(--surface-soft);
}

.dp-day.is-muted {
  color: var(--muted);
  font-weight: 500;
}

.dp-day.is-today {
  box-shadow: inset 0 0 0 1.5px var(--accent);
}

.dp-day.is-selected {
  background: var(--primary);
  color: var(--primary-contrast);
}

.dp-months {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.dp-month-btn {
  padding: 0.6rem 0.4rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}

.dp-month-btn:hover {
  background: var(--surface-soft);
  border-color: var(--accent);
}

.dp-month-btn.is-selected {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-contrast);
}

.dp-today-link {
  display: block;
  width: 100%;
  text-align: center;
  margin-top: 0.7rem;
  padding: 0.6rem 0 0;
  border: 0;
  border-top: 1px solid var(--border);
  background: none;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent);
  cursor: pointer;
}

.dp-today-link:hover {
  color: var(--accent-dark);
}

.account-text {
  display: none;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.2;
  min-width: 0;
  text-align: left;
}

.account-text strong {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  max-width: 132px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-text small {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 600;
}

.account-caret {
  display: none;
  color: var(--muted);
  flex: 0 0 auto;
}

.account-caret svg {
  width: 16px;
  height: 16px;
  transition: transform 0.15s ease;
}

.account-menu.is-open .account-caret svg {
  transform: rotate(180deg);
}

@media (min-width: 720px) {
  .account-text {
    display: flex;
  }
  .account-caret {
    display: inline-flex;
  }
}

.account-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 250px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lift);
  padding: 0.5rem;
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  pointer-events: none;
  transform-origin: top right;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 60;
}

.account-menu.is-open .account-dropdown {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.account-dropdown-head {
  padding: 0.55rem 0.7rem 0.75rem;
  margin-bottom: 0.3rem;
  border-bottom: 1px solid var(--border);
}

.account-dropdown-head span {
  display: block;
  font-size: 0.68rem;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.account-dropdown-head strong {
  display: block;
  font-size: 0.93rem;
  color: var(--text);
  margin-top: 0.15rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.6rem 0.65rem;
  border-radius: 10px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 600;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
}

.account-dropdown-item:hover {
  background: var(--surface-soft);
  text-decoration: none;
  color: var(--text);
}

.account-dropdown-item svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: var(--muted);
}

.account-dropdown-item.is-danger {
  color: var(--danger);
}

.account-dropdown-item.is-danger svg {
  color: var(--danger);
}

.account-dropdown-item.is-danger:hover {
  background: var(--danger-bg);
}

.account-dropdown-item.theme-row {
  justify-content: space-between;
  cursor: pointer;
}

.account-dropdown-item.theme-row .adi-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.account-dropdown-item.theme-row .adi-left svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: var(--muted);
}

.theme-switch {
  position: relative;
  width: 36px;
  height: 21px;
  flex: 0 0 36px;
  border-radius: 999px;
  background: var(--surface-strong);
  transition: background 0.15s ease;
}

.theme-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: transform 0.15s ease;
}

:root[data-theme="dark"] .theme-switch {
  background: var(--accent);
}

:root[data-theme="dark"] .theme-switch::after {
  transform: translateX(15px);
}

.account-dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 0.35rem 0.2rem;
}

/* ==========================================================================
   App Shell — sidebar + asosiy kontent
   (teacher/student/center/admin panellarida header.php shu qatlamni ochadi,
   tegishli *_nav.php uni yopmasdan <aside> chizadi va <main>ni ochadi)
   ========================================================================== */

.app-shell {
  display: flex;
  align-items: flex-start;
}

.impersonation-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
  padding: 0.65rem 1.2rem;
  background: var(--warning-bg);
  border-bottom: 1px solid var(--warning-border);
  color: var(--warning);
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
}

.impersonation-banner svg {
  width: 16px;
  height: 16px;
  vertical-align: -3px;
  margin-right: 0.2rem;
}

.impersonation-banner form {
  margin: 0;
  flex: 0 0 auto;
}

.sidebar {
  width: 262px;
  flex: 0 0 262px;
  min-height: calc(100vh - 66px);
  position: sticky;
  top: 66px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 1rem 0.85rem;
  z-index: 45;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.62rem 0.7rem;
  border-radius: 11px;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.87rem;
  text-decoration: none;
  position: relative;
}

.sidebar-link:hover {
  background: var(--surface-soft);
  color: var(--text);
  text-decoration: none;
}

.sidebar-link svg {
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  color: var(--muted);
}

.sidebar-link.active {
  background: var(--accent-soft);
  color: var(--accent);
}

:root[data-theme="dark"] .sidebar-link.active {
  color: var(--text);
}

.sidebar-link.active svg {
  color: var(--accent);
}

.sidebar-link .active-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex: 0 0 auto;
  margin-left: auto;
}

.sidebar-link .badge-count {
  margin-left: auto;
  background: var(--surface-strong);
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.14rem 0.5rem;
  border-radius: 999px;
  flex: 0 0 auto;
}

.sidebar-link .badge-pro {
  margin-left: auto;
  background: var(--gold-bg);
  color: var(--gold);
  font-size: 0.66rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.14rem 0.55rem;
  border-radius: 999px;
  flex: 0 0 auto;
}

.sidebar-link .badge-trial {
  margin-left: auto;
  background: var(--info-bg);
  color: var(--info);
  font-size: 0.66rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.14rem 0.55rem;
  border-radius: 999px;
  flex: 0 0 auto;
}

.sidebar-link .badge-soft {
  margin-left: auto;
  background: var(--success-bg);
  color: var(--success-dark);
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.14rem 0.5rem;
  border-radius: 999px;
  flex: 0 0 auto;
}

.sidebar-gap {
  flex: 1;
  min-height: 1rem;
}

.sidebar-bottom {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}

.workspace-card {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-soft);
  text-decoration: none;
}

.workspace-card:hover {
  border-color: var(--accent-light);
  text-decoration: none;
}

.workspace-avatar {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 10px;
  background: var(--primary);
  color: var(--primary-contrast);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.78rem;
}

.workspace-info {
  min-width: 0;
  line-height: 1.25;
}

.workspace-info strong {
  display: block;
  font-size: 0.83rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.workspace-info span {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Obuna holati qutisi (sidebar pastida) — bosilsa Obuna bo'limiga o'tadi. */
.subscription-box {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.75rem;
  border-radius: 14px;
  border: 1px solid transparent;
  text-decoration: none;
}

.subscription-box:hover {
  text-decoration: none;
  filter: brightness(0.97);
}

.subscription-box-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #ffffff;
}

.subscription-box-icon svg {
  width: 18px;
  height: 18px;
}

.subscription-box-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  line-height: 1.3;
}

.subscription-box-text strong {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}

.subscription-box-text span {
  font-size: 0.88rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.subscription-box-arrow {
  flex: 0 0 auto;
  display: flex;
}

.subscription-box-arrow svg {
  width: 15px;
  height: 15px;
}

.subscription-box.is-trial {
  background: var(--accent-soft);
}

.subscription-box.is-trial .subscription-box-icon {
  background: var(--accent);
}

.subscription-box.is-trial .subscription-box-text span {
  color: var(--accent-dark);
}

.subscription-box.is-trial .subscription-box-arrow {
  color: var(--accent);
}

.subscription-box.is-active {
  background: var(--success-bg);
}

.subscription-box.is-active .subscription-box-icon {
  background: var(--success);
}

.subscription-box.is-active .subscription-box-text span {
  color: var(--success-dark);
}

.subscription-box.is-active .subscription-box-arrow {
  color: var(--success);
}

.sidebar-overlay {
  display: none;
}

/* Tor ekranlarda sidebar ekrandan tashqariga chiqib turadi, hamburger tugmasi
   bosilganda .is-open bilan ichkariga suriladi — orqa fonni bosish ham yopadi. */
@media (max-width: 980px) {
  .sidebar-toggle {
    display: inline-flex;
  }
  .app-shell {
    position: relative;
  }
  .sidebar {
    position: fixed;
    left: 0;
    top: 66px;
    height: calc(100vh - 66px);
    min-height: calc(100vh - 66px);
    transform: translateX(-100%);
    box-shadow: var(--shadow-lift);
    transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 46;
  }
  .sidebar.is-open {
    transform: translateX(0);
  }
  .sidebar-overlay {
    display: block;
    position: fixed;
    top: 66px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 16, 0.45);
    z-index: 44;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }
  .sidebar-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
  }
}

/* ==========================================================================
   Sahifa konteyneri va farzand almashtirgich (child-switcher)
   ========================================================================== */

.page-wrap {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 1.5rem max(1.2rem, calc((100vw - 1180px) / 2)) 3.5rem;
}

.app-shell .page-wrap {
  width: 100%;
  min-width: 0;
  max-width: 1360px;
  padding: 1.6rem clamp(1rem, 2.6vw, 2.25rem) 3rem;
}

.child-switcher {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 1rem;
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  border-radius: var(--radius);
  font-size: 0.88rem;
  color: var(--warning-dark);
  font-weight: 600;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.child-switcher label {
  font-weight: 700;
  margin: 0;
  color: inherit;
}

.child-switcher select {
  min-width: 170px;
  width: auto;
  padding: 0.35rem 0.65rem;
  min-height: 38px;
  border-radius: 8px;
  border: 1px solid var(--warning-border);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
}

/* ==========================================================================
   Cards & Layout Components
   ========================================================================== */

.card, .stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: clamp(1.2rem, 3.5vw, 1.75rem);
  margin-bottom: 1.25rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-muted {
  background: var(--surface-soft);
}

.narrow-card {
  max-width: 580px;
  margin-left: auto;
  margin-right: auto;
}

/* Hero Cards */
.hero-card, .landing-hero {
  background: linear-gradient(135deg, #2b2846 0%, #1c1b23 55%, #100f16 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-xl);
  color: #ffffff;
  padding: clamp(1.5rem, 5vw, 2.75rem);
  box-shadow: var(--shadow-lift);
  margin: 0 0 1.5rem;
  position: relative;
  overflow: hidden;
}

:root[data-theme="dark"] .hero-card,
:root[data-theme="dark"] .landing-hero {
  background: linear-gradient(135deg, #3c2f78 0%, #201c33 55%, #0b0b11 100%);
  border: 1px solid rgba(139, 124, 246, 0.28);
}

.hero-card::before, .landing-hero::before {
  content: "";
  position: absolute;
  top: -60px;
  right: -60px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.25) 0%, transparent 70%);
  pointer-events: none;
}

.hero-card::after, .landing-hero::after {
  content: "";
  position: absolute;
  bottom: -80px;
  left: 20%;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139, 124, 246, 0.28) 0%, transparent 70%);
  pointer-events: none;
}

.hero-card h1, .landing-hero h1 {
  color: #ffffff;
  margin-bottom: 0.5rem;
  max-width: 750px;
}

.hero-card p:not(.eyebrow), .landing-hero p:not(.eyebrow) {
  margin: 0;
  color: rgba(255, 255, 255, 0.85);
  font-size: 1.05rem;
  max-width: 650px;
  line-height: 1.6;
}

.landing-hero {
  margin-top: 0.5rem;
  text-align: center;
  padding: clamp(1.5rem, 4.5vw, 2.5rem) 1.5rem;
  border-radius: var(--radius-xl);
}

.landing-hero h1 {
  font-size: clamp(1.5rem, 3.2vw, 2.1rem);
  margin-inline: auto;
  margin-bottom: 0;
  letter-spacing: -0.02em;
  font-weight: 800;
}

.landing-hero p {
  margin-inline: auto;
  max-width: 620px;
  text-align: center;
}

.landing-hero-wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.landing-hero-wordmark:hover {
  transform: scale(1.04);
}

.landing-hero-wordmark img {
  height: clamp(70px, 10vw, 100px);
  width: auto;
  object-fit: contain;
}

.landing-hero-wordmark span {
  font-size: clamp(2.4rem, 7vw, 3.6rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.eyebrow {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #fbbf24 !important;
  font-weight: 800;
  font-size: 0.76rem;
  margin-bottom: 0.55rem !important;
  background: rgba(245, 158, 11, 0.15);
  padding: 0.25rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* ==========================================================================
   Landing Features & Role Cards
   ========================================================================== */

.role-grid {
  display: grid;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.role-grid.role-grid-3 {
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.role-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.1rem;
  text-align: center;
  box-shadow: var(--shadow);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.role-card-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.role-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, var(--surface-soft) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.role-card:hover {
  border-color: var(--primary);
  transform: translateY(-5px);
  box-shadow: var(--shadow-lift);
  text-decoration: none;
}

.role-card:hover::before {
  opacity: 1;
}

.role-emoji-wrap {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
  margin-bottom: 0.7rem;
  background: var(--primary-soft);
  border: 1px solid var(--border);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  z-index: 1;
}

.role-card:hover .role-emoji-wrap {
  transform: scale(1.12);
}

.role-card .role-emoji {
  display: block;
  font-size: 2.2rem;
  margin-bottom: 0.8rem;
  transition: transform 0.25s ease;
}

.role-card:hover .role-emoji {
  transform: scale(1.1);
}

.role-card h3 {
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
  position: relative;
  z-index: 1;
}

.role-card p {
  color: var(--muted);
  font-size: 0.88rem;
  margin: 0;
  line-height: 1.45;
  position: relative;
  z-index: 1;
}

.role-action-btn {
  margin-top: 0.75rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

/* Landing Highlights & Features */
.landing-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.15rem;
  margin: 2rem 0;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.feature-icon {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.feature-content h4 {
  font-size: 0.98rem;
  margin-bottom: 0.25rem;
  color: var(--text);
}

.feature-content p {
  font-size: 0.84rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.45;
}

/* ==========================================================================
   Metrics & Dashboard Components
   ========================================================================== */

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.metric-card {
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  text-decoration: none;
  position: relative;
  overflow: hidden;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.metric-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  opacity: 0;
  transition: opacity 0.2s ease;
}

.metric-card:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}

.metric-card:hover::before {
  opacity: 1;
}

.metric-card span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.metric-card strong {
  font-size: clamp(1.6rem, 3.5vw, 2.1rem);
  display: block;
  line-height: 1.2;
  color: var(--text);
  font-weight: 800;
  margin: 0.4rem 0 0.25rem;
  letter-spacing: -0.03em;
}

.metric-card small {
  display: block;
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 600;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin: 0 0 1.25rem;
}

.quick-actions a {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 0.85rem 0.5rem;
  font-size: 0.88rem;
  font-weight: 700;
  text-align: center;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  transition: all 0.2s ease;
}

.quick-actions a:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-contrast);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(23, 23, 31, 0.2);
  text-decoration: none;
}

:root[data-theme="dark"] .quick-actions a:hover {
  font-weight: 800;
}

/* ==========================================================================
   Dashboard Overview kartalari (teacher/index.php va shunga o'xshash panellar)
   ========================================================================== */

.overview-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.75rem;
}

@media (max-width: 1080px) {
  .overview-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

.overview-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.35rem 1.15rem;
  box-shadow: var(--shadow-sm);
}

.overview-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.1rem;
}

.overview-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
}

.overview-icon svg {
  width: 21px;
  height: 21px;
}

.overview-icon.tone-neutral {
  background: var(--surface-strong);
  color: var(--text-secondary);
}

.overview-icon.tone-green {
  background: var(--success-bg);
  color: var(--success);
}

.overview-icon.tone-accent {
  background: var(--accent-soft);
  color: var(--accent);
}

.overview-icon.tone-gold {
  background: var(--gold-bg);
  color: var(--gold);
}

.overview-pill {
  background: var(--surface-strong);
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  white-space: nowrap;
}

.overview-value {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1;
}

.overview-value.tone-green {
  color: var(--success);
}

.overview-label {
  font-size: 0.87rem;
  color: var(--text-secondary);
  font-weight: 700;
  margin-top: 0.4rem;
}

.overview-foot {
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  font-size: 0.79rem;
  color: var(--muted);
}

/* ---- Bo'lim asboblar paneli: sparkle-pill + sarlavha + tab/tugmalar ---- */
.roster-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 0.9rem;
}

.roster-pill svg {
  width: 15px;
  height: 15px;
  color: var(--accent);
}

.section-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.pill-tabs {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.25rem;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.pill-tab {
  display: inline-flex;
  align-items: center;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.83rem;
  font-weight: 700;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

.pill-tab:hover {
  color: var(--text);
}

.pill-tab.active {
  background: var(--primary);
  color: var(--primary-contrast);
  box-shadow: 0 2px 8px rgba(23, 23, 31, 0.2);
}

:root[data-theme="dark"] .pill-tab.active {
  box-shadow: 0 2px 10px rgba(139, 124, 246, 0.4);
}

/* ---- Mini-statistika qatori (Guruhlar sahifasi ustida) ---- */
.mini-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

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

.mini-stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  box-shadow: var(--shadow-sm);
}

.mini-stat-card .mini-label {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.mini-stat-card .mini-value {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}

.mini-stat-card .mini-value.tone-green {
  color: var(--success);
}

/* ---- Guruh kartalari ---- */
.group-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.1rem;
}

.group-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.3rem 1.3rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.18s ease, border-color 0.18s ease;
}

.group-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--accent-light);
}

.group-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}

.group-card-tags {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  background: var(--surface-strong);
  color: var(--text-secondary);
  font-size: 0.73rem;
  font-weight: 700;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  white-space: nowrap;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.73rem;
  font-weight: 700;
  padding: 0.22rem 0.6rem 0.22rem 0.5rem;
  border-radius: 999px;
  white-space: nowrap;
}

.status-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.status-pill.is-active {
  background: var(--success-bg);
  color: var(--success);
}

.status-pill.is-upcoming {
  background: var(--info-bg);
  color: var(--info);
}

.group-card-menu-wrap {
  position: relative;
  flex: 0 0 auto;
}

.group-card-menu {
  border: 0;
  background: transparent;
  color: var(--muted);
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.group-card-menu:hover {
  background: var(--surface-soft);
  color: var(--text);
}

.group-card-menu svg {
  width: 18px;
  height: 18px;
}

.account-dropdown.is-compact {
  width: 178px;
  right: 0;
  left: auto;
}

[data-card-menu] .account-dropdown {
  top: calc(100% + 4px);
}

.group-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.15rem;
}

.group-card-meta {
  font-size: 0.83rem;
  color: var(--muted);
  margin-bottom: 0.95rem;
}

.group-card-schedule {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.schedule-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.79rem;
  font-weight: 600;
  padding: 0.4rem 0.65rem;
  border-radius: var(--radius-sm);
}

.schedule-chip svg {
  width: 15px;
  height: 15px;
  color: var(--muted);
  flex: 0 0 auto;
}

.group-card-stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.group-card-stat-row .gcs-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.group-card-stat-row svg {
  width: 16px;
  height: 16px;
  color: var(--muted);
}

.group-card-stat-row strong {
  color: var(--text);
  font-weight: 800;
}

.group-card-stat-row.is-good strong {
  color: var(--success);
}

.progress-track {
  height: 8px;
  border-radius: 999px;
  background: var(--surface-strong);
  overflow: hidden;
  margin-bottom: 1rem;
}

.progress-track > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--success);
}

.group-card-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: auto;
}

.group-card-actions .btn {
  flex: 1;
}

.group-card-icon-btn {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  display: grid;
  place-items: center;
  text-decoration: none;
}

.group-card-icon-btn:hover {
  background: var(--surface-soft);
  color: var(--text);
  text-decoration: none;
}

.group-card-icon-btn svg {
  width: 19px;
  height: 19px;
}

/* ==========================================================================
   Forms, Inputs & Buttons
   ========================================================================== */

.page-head {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  margin: 0 0 1.25rem;
}

.page-head h1, .page-head h2 {
  margin: 0;
}

.page-head p {
  margin: 0.3rem 0 0;
}

.form-group {
  margin-bottom: 0.85rem;
}

.form-group label, label {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  color: var(--text);
}

input, select, textarea {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.72rem 0.95rem;
  min-height: 46px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

textarea {
  resize: vertical;
  min-height: 90px;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3.5px var(--ring);
}

input::placeholder, textarea::placeholder {
  color: var(--muted);
  opacity: 0.7;
}

input[type="radio"], input[type="checkbox"] {
  width: auto;
  min-height: auto;
  accent-color: var(--primary);
  cursor: pointer;
}

input.input-error {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3.5px rgba(239, 68, 68, 0.2) !important;
}

input.input-ok {
  border-color: var(--success) !important;
  box-shadow: 0 0 0 3.5px rgba(16, 185, 129, 0.2) !important;
}

.field-msg {
  display: block;
  font-size: 0.82rem;
  margin-top: 0.35rem;
  min-height: 1.1em;
  font-weight: 600;
}

.field-msg.input-error {
  color: var(--danger);
}

.field-msg.input-ok {
  color: var(--success);
}

.field-row, .filter-grid {
  display: grid;
  gap: 0.85rem;
}

.filter-grid {
  grid-template-columns: 1fr;
}

.filter-grid .form-group {
  margin: 0;
}

.filter-action {
  display: flex;
  align-items: flex-end;
}

.filter-action .btn {
  width: 100%;
}

@media (min-width: 580px) {
  .field-row {
    grid-template-columns: 1fr 1fr;
  }
  .filter-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  }
  .filter-action .btn {
    width: auto;
  }
}

/* Buttons */
.btn {
  border: 1px solid var(--primary);
  background: var(--primary);
  border-radius: var(--radius);
  padding: 0.68rem 1.25rem;
  color: var(--primary-contrast) !important;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1.25;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  min-height: 44px;
  box-shadow: 0 2px 8px rgba(23, 23, 31, 0.16);
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

:root[data-theme="dark"] .btn:not(.btn-outline):not(.btn-danger) {
  box-shadow: 0 4px 14px rgba(139, 124, 246, 0.35);
}

.btn:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: var(--primary-contrast) !important;
  text-decoration: none;
  transform: translateY(-1.5px);
  box-shadow: 0 6px 16px rgba(23, 23, 31, 0.22);
}

:root[data-theme="dark"] .btn:hover:not(.btn-outline):not(.btn-danger) {
  box-shadow: 0 6px 18px rgba(139, 124, 246, 0.42);
}

.btn:active {
  transform: scale(0.98) translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn-block {
  width: 100%;
}

.btn-outline {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text) !important;
  box-shadow: var(--shadow-sm);
}

.btn-outline:hover {
  background: var(--surface-soft);
  border-color: var(--accent);
  color: var(--accent) !important;
  box-shadow: var(--shadow);
}

.btn-danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #ffffff !important;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.25);
}

.btn-danger:hover {
  background: var(--danger-dark);
  border-color: var(--danger-dark);
  color: #ffffff !important;
  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.35);
}

.btn-sm {
  font-size: 0.82rem;
  padding: 0.42rem 0.8rem;
  min-height: 36px;
  border-radius: var(--radius-sm);
}

/* ui_icon() SVG'lari o'z ichida width/height belgilamaydi (faqat viewBox) —
   .btn kabi flex konteynerlar ichida buni CSS orqali aniq belgilamasak,
   ba'zi brauzerlarda 0x0 (butunlay ko'rinmas) bo'lib qolardi. */
.btn svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

/* Password Toggle */
.password-field {
  position: relative;
}

.password-field input {
  padding-right: 2.8rem;
}

.password-toggle-btn {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 2.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s ease;
}

.password-toggle-btn:hover {
  color: var(--text);
}

.password-toggle-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 8px;
}

/* ==========================================================================
   Alerts & Notifications
   ========================================================================== */

.alert {
  border-radius: var(--radius);
  padding: 0.9rem 1.15rem;
  margin: 0 0 1.25rem;
  font-size: 0.92rem;
  line-height: 1.5;
  border: 1px solid transparent;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.65rem;
  box-shadow: var(--shadow-sm);
  overflow-wrap: anywhere;
}

.alert a {
  font-weight: 700;
  text-decoration: underline;
}

.alert-error {
  background: var(--danger-bg);
  border-color: var(--danger-border);
  color: var(--danger);
  font-weight: 600;
  animation: alert-error-shake 0.4s ease;
}

@keyframes alert-error-shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX(4px); }
}

.alert-success {
  background: var(--success-bg);
  border-color: var(--success-border);
  color: var(--success);
}

.alert-warning {
  background: var(--warning-bg);
  border-color: var(--warning-border);
  color: var(--warning);
}

.alert-info {
  background: var(--info-bg);
  border-color: var(--info-border);
  color: var(--info);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 1.25rem 0;
  flex-wrap: wrap;
}

.credentials-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.select-fancy {
  position: relative;
  display: inline-block;
  min-width: 200px;
  max-width: 100%;
}
.select-fancy-wide {
  display: block;
  width: 100%;
}
.select-fancy-native {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.select-fancy-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  text-align: left;
  padding: 0.65rem 0.9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.select-fancy-trigger:hover {
  border-color: var(--accent);
}
.select-fancy.is-open .select-fancy-trigger {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.select-fancy-chevron {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--text-secondary);
  transition: transform 0.18s ease;
}
.select-fancy.is-open .select-fancy-chevron {
  transform: rotate(180deg);
}
.select-fancy-list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 20;
  margin: 0;
  padding: 6px;
  list-style: none;
  max-height: 280px;
  overflow-y: auto;
  scroll-padding-top: 44px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.16);
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  pointer-events: none;
  transform-origin: top center;
  transition: opacity 0.16s ease, transform 0.16s ease;
}
.select-fancy.is-open .select-fancy-list {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.select-fancy-list li {
  padding: 0.6rem 0.75rem;
  border-radius: calc(var(--radius) - 4px);
  cursor: pointer;
  font-size: 0.93rem;
  font-weight: 500;
  color: var(--text);
}
.select-fancy-list li:hover,
.select-fancy-list li.is-selected {
  background: var(--accent-soft);
  color: var(--accent-dark);
}
.select-fancy-short {
  display: none;
}

/* Qidiruvli variant (data-search-input) — ro'yxat uzun bo'lganda (o'qituvchi,
   markaz, o'quvchi tanlash) taxminan 10 ta band sig'adigan qilib balandroq,
   qidiruv qatori esa tepada "yopishib" turadi (li o'rniga sticky). */
.select-fancy-list-searchable {
  max-height: 380px;
}
.select-fancy-list li.select-fancy-search-row,
.select-fancy-list li.select-fancy-search-row:hover {
  position: sticky;
  top: -6px;
  z-index: 1;
  margin: -6px -6px 6px;
  padding: 8px;
  background: var(--surface);
  cursor: default;
  border-bottom: 1px solid var(--border);
}
.select-fancy-search {
  width: 100%;
  padding: 0.5rem 0.7rem;
  border: 1.5px solid var(--border);
  border-radius: calc(var(--radius) - 4px);
  font-family: inherit;
  font-size: 0.9rem;
  background: var(--surface-soft);
  color: var(--text);
}
.select-fancy-search:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.login-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.login-alert-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ==========================================================================
   Lists, Tables & Badges
   ========================================================================== */

.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0.95rem 1.15rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  margin: 0.65rem 0;
  box-shadow: var(--shadow-sm);
  transition: all 0.18s ease;
}

.list-row:hover {
  border-color: var(--border-focus);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.list-row-main {
  min-width: 0;
  flex: 1;
}

.list-row-title {
  font-weight: 800;
  font-size: 0.96rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-row-sub {
  color: var(--muted);
  font-size: 0.83rem;
  margin-top: 0.2rem;
}

.list-row-actions, .form-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.inline-fields {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.inline-fields input[type="number"] {
  width: 90px;
}

.inline-fields input[type="date"] {
  width: 140px;
}

.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--muted);
}

.empty-state p {
  font-size: 1rem;
  margin-bottom: 1.25rem;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.badge-success {
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  color: var(--success);
}

.badge-danger {
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: var(--danger);
}

.badge-warning {
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  color: var(--warning);
}

.badge-neutral {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  color: var(--muted);
}

.badge-info {
  background: var(--info-bg);
  border: 1px solid var(--info-border);
  color: var(--info);
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

th, td {
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 0.95rem;
  text-align: left;
  vertical-align: middle;
}

th {
  background: var(--surface-soft);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

tr:last-child td {
  border-bottom: 0;
}

tr:hover td {
  background: var(--surface-subtle);
}

.cell-note {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

.search-bar {
  display: flex;
  gap: 0.65rem;
}

.search-bar input {
  min-width: 0;
}

.year-filter {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.65rem;
  margin: -0.2rem 0 1rem;
  font-size: 0.86rem;
  font-weight: 600;
}

.year-filter label {
  margin: 0;
}

.year-filter select {
  width: auto;
  min-height: 38px;
  padding: 0.35rem 0.75rem;
}

/* ==========================================================================
   Attendance & Special Views
   ========================================================================== */

.attendance-card {
  max-width: 860px;
  margin-inline: auto;
}

.section-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
}

.attendance-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  border-bottom: 1px solid var(--border);
  padding: 0.65rem 0.2rem;
  transition: background 0.15s ease;
}

.attendance-row:last-of-type {
  border-bottom: 0;
}

.attendance-name {
  font-weight: 750;
  font-size: 0.94rem;
  color: var(--text);
}

.attendance-choice {
  display: flex;
  gap: 0.65rem;
}

.choice-icon {
  position: relative;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.choice-icon:hover {
  transform: scale(1.08);
}

.choice-icon input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}

.choice-icon svg {
  width: 20px;
  height: 20px;
  pointer-events: none;
}

.choice-icon svg path {
  stroke: var(--muted);
  transition: stroke 0.15s ease;
}

.choice-icon.choice-k.is-active {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(23, 23, 31, 0.3);
  transform: scale(1.05);
}

:root[data-theme="dark"] .choice-icon.choice-k.is-active {
  box-shadow: 0 4px 12px rgba(139, 124, 246, 0.4);
}

.choice-icon.choice-y.is-active {
  background: var(--danger);
  border-color: var(--danger);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
  transform: scale(1.05);
}

.choice-icon.is-active svg path {
  stroke: #ffffff;
}

.status-cancelled {
  color: var(--danger);
  margin: 0.85rem 0 0;
  font-weight: 600;
}

.attendance-report table {
  min-width: 740px;
}

.attendance-report th, .attendance-report td {
  text-align: center;
  padding: 0.55rem;
}

.attendance-report .student-col {
  text-align: left;
  min-width: 165px;
}

.attendance-report .date-col {
  min-width: 44px;
}

.attendance-report small {
  display: block;
  color: var(--danger);
  font-size: 0.65rem;
  font-weight: 700;
}

.status-icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
  vertical-align: middle;
}

.status-icon path {
  stroke-width: 2.2;
}

.status-k .status-icon path {
  stroke: var(--success);
}

.status-y .status-icon path {
  stroke: var(--danger);
}

.no-class {
  background: var(--danger-bg);
}

.report-title {
  text-align: center;
  margin-bottom: 1.25rem;
}

.report-title p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.inline-payment {
  display: grid;
  grid-template-columns: minmax(100px, 1fr) auto;
  gap: 0.45rem;
  min-width: 200px;
}

.inline-payment input {
  padding: 0.45rem 0.65rem;
  font-size: 0.84rem;
  min-height: 38px;
}

.payment-table {
  min-width: 740px;
}

/* Day Picker & Subtabs */
.day-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.day-picker label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  font-size: 0.86rem;
  min-height: 40px;
  background: var(--surface);
  transition: all 0.15s ease;
}

.day-picker label:hover {
  background: var(--surface-soft);
  border-color: var(--primary);
}

.subtabs {
  display: flex;
  gap: 0.55rem;
  margin-bottom: 1.25rem;
}

.subtabs button {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.65rem;
  color: var(--text);
  font-weight: 800;
  font-size: 0.9rem;
  cursor: pointer;
  min-height: 46px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.subtabs button.active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-contrast);
  box-shadow: 0 4px 12px rgba(23, 23, 31, 0.25);
}

.subsection {
  display: none;
}

.subsection.active {
  display: block;
}

/* File Upload */
.file-upload {
  position: relative;
}

.file-upload-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  margin: 0;
  cursor: pointer;
  z-index: 1;
}

.file-upload-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  border: 2px dashed var(--border);
  background: var(--surface-soft);
  border-radius: var(--radius);
  padding: 1.5rem;
  font-weight: 750;
  color: var(--primary);
  text-align: center;
  transition: all 0.2s ease;
}

.file-upload-icon {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  stroke: var(--primary);
}

.file-upload-input:hover + .file-upload-label,
.file-upload-input:focus + .file-upload-label {
  background: var(--surface-strong);
  border-color: var(--primary);
}

.file-drop {
  border: 2px dashed var(--border);
  background: var(--surface-soft);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
}

.push-enabled-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--success-dark);
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  border-radius: 999px;
  padding: 0.45rem 0.9rem 0.45rem 0.7rem;
  font-size: 0.86rem;
  font-weight: 700;
}

.push-enabled-badge svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.push-enabled-badge[hidden] {
  display: none;
}

.check-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.6rem;
  transition: opacity 0.2s ease;
}

.check-grid.is-disabled {
  opacity: 0.45;
}

.check-grid input[type="checkbox"]:disabled {
  cursor: not-allowed;
}

.session-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.icon-btn {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 50%;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: #ffffff;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.icon-btn:hover {
  transform: scale(1.08);
  filter: brightness(1.08);
}

.icon-btn svg {
  width: 15px;
  height: 15px;
}

.icon-btn-approve {
  background: var(--success);
}

.icon-btn-revoke {
  background: var(--danger);
}

/* Charts & Stats */
.stat-card {
  background: linear-gradient(135deg, #2b2846 0%, #100f16 100%);
  border: 0;
  color: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.stat-card span {
  display: block;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 600;
}

.stat-card strong {
  font-size: clamp(2rem, 5vw, 3.2rem);
  display: block;
  margin-top: 0.25rem;
  color: #ffffff;
  letter-spacing: -0.03em;
}

.stat-card small {
  color: #fbbf24;
  font-size: 1rem;
  font-weight: 700;
}

.bar-chart {
  display: grid;
  gap: 0.85rem;
}

.bar-row {
  display: grid;
  grid-template-columns: 88px 1fr auto;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.82rem;
}

.bar-row strong {
  font-size: 0.82rem;
}

.bar-track {
  height: 10px;
  border-radius: 999px;
  background: var(--surface-soft);
  overflow: hidden;
}

.bar-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

/* Notifications & Lists */
.announcement-list {
  display: grid;
  gap: 0.85rem;
}

.announcement-list article {
  padding: 0.95rem 1.15rem;
  border-left: 4px solid var(--accent);
  background: var(--surface-soft);
  border-radius: 0 var(--radius) var(--radius) 0;
  box-shadow: var(--shadow-sm);
}

.announcement-list p {
  margin: 0 0 0.4rem;
  color: var(--text);
}

.history-list, .status-list, .family-list {
  display: grid;
  gap: 0.4rem;
}

.history-list > div, .status-list > div, .family-list > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 0.7rem 0.2rem;
  border-bottom: 1px solid var(--border);
}

.history-list > div:last-child, .status-list > div:last-child, .family-list > div:last-child {
  border-bottom: 0;
}

.history-list > div > span, .status-list > div > span, .family-list > div > span {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.notification-list {
  display: grid;
  gap: 0.75rem;
}

.notification-list article {
  position: relative;
  display: flex;
  gap: 0.85rem;
  padding: 1.15rem;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.notification-list article.unread {
  background: var(--surface-soft);
  border-color: var(--accent-light);
}

.notification-content {
  min-width: 0;
  flex: 1;
}

.notification-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-weight: 800;
  color: var(--text);
}

.notification-list p {
  margin: 0.35rem 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.notification-dot {
  margin-top: 0.55rem;
  display: block;
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border-radius: 50%;
  background: var(--border);
}

.unread .notification-dot {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.confirm-box {
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  border-radius: var(--radius);
  padding: 1.15rem;
}

.confirm-box p {
  margin-bottom: 0.85rem;
}

.phone-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.45rem;
  color: var(--primary);
  font-weight: 750;
  font-size: 0.86rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 1.15rem;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.88rem;
  transition: color 0.15s ease;
}

.back-link:hover {
  color: var(--primary);
  text-decoration: none;
}

/* Student Onboarding */
.student-onboarding {
  position: fixed;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
  z-index: 60;
  width: min(940px, calc(100% - 2rem));
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lift);
}

.onboarding-icon {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  font-size: 1.2rem;
  border-radius: 12px;
  background: var(--accent-soft);
  overflow: hidden;
}

.onboarding-icon img {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  object-fit: cover;
}

.onboarding-copy {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
  flex: 1;
}

.onboarding-copy strong {
  font-size: 0.95rem;
  color: var(--text);
}

.onboarding-copy span {
  color: var(--muted);
  font-size: 0.84rem;
}

.onboarding-actions {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.student-onboarding[hidden] {
  display: none;
}

/* Telegram kanal taklifi — markazlashgan modal (ketma-ket taklifning 3-bosqichi) */
.telegram-promo-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.telegram-promo-overlay[hidden] {
  display: none;
}

.telegram-promo-card {
  position: relative;
  width: min(360px, 100%);
  padding: 2rem 1.75rem 1.75rem;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lift);
  text-align: center;
}

.telegram-promo-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.telegram-promo-close:hover {
  background: var(--danger-bg);
  color: var(--danger);
}

.telegram-promo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin-bottom: 1rem;
  border-radius: 50%;
  background: #229ed9;
  color: #ffffff;
}

.telegram-promo-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
}

.telegram-promo-card p {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* ==========================================================================
   Focus & Accessibility
   ========================================================================== */

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.btn:focus-visible,
.sidebar-link:focus-visible,
.pill-tab:focus-visible,
.account-dropdown-item:focus-visible,
a:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
}

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

/* ==========================================================================
   Mobile Responsive Adjustments
   ========================================================================== */

@media (max-width: 768px) {
  .select-fancy-full {
    display: none;
  }
  .select-fancy-short {
    display: inline;
  }
  .role-grid.role-grid-3 {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }
  .role-card {
    flex-direction: row;
    align-items: center;
    text-align: left;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
  }
  .role-emoji-wrap {
    margin-bottom: 0;
    width: 44px;
    height: 44px;
    font-size: 1.35rem;
    flex-shrink: 0;
  }
  .role-card-body {
    flex: 1;
    min-width: 0;
  }
  .role-card h3 {
    font-size: 0.92rem;
    margin-bottom: 0.1rem;
  }
  .role-card p {
    font-size: 0.76rem;
    line-height: 1.3;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .role-action-btn {
    margin-top: 0;
    font-size: 0.72rem;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .quick-actions {
    grid-template-columns: repeat(2, 1fr);
  }

  /* To'lovlar jadvali: Guruh va Holat ustunlari sig'maydigan qurilmalarda
     yashiriladi, qolgan 2 ustun (O'quvchi, To'lov kiritish) siqiladi — shu
     bilan gorizontal scroll'siz to'liq sig'adi. Kengroq ekranlarda (>768px)
     jadval to'liq 4 ustun bilan ko'rsatiladi. */
  .payment-table {
    min-width: 0;
  }
  .payment-table th:nth-child(2),
  .payment-table td:nth-child(2),
  .payment-table th:nth-child(3),
  .payment-table td:nth-child(3) {
    display: none;
  }
  .payment-table th,
  .payment-table td {
    padding: 0.7rem 0.6rem;
  }
  .payment-table .inline-payment {
    min-width: 0;
    grid-template-columns: minmax(76px, 1fr) auto;
  }
  .payment-table .inline-payment input {
    padding: 0.4rem 0.5rem;
  }

  /* Kiritilgan to'lovlar jurnali: har bir yozuv 1 qatorda qoladi (ichki
     matn bo'linmaydi), sig'masa .table-wrap'ning o'zi gorizontal scroll
     qiladi — vertikal bo'linib, qator balandligi o'sib ketmaydi. */
  .payment-log table {
    min-width: 460px;
  }
  .payment-log th,
  .payment-log td {
    white-space: nowrap;
  }
}

@media (max-width: 480px) {
  .topbar {
    height: 60px;
    padding: 0 0.85rem;
  }
  .sidebar {
    top: 60px;
    height: calc(100vh - 60px);
    min-height: calc(100vh - 60px);
  }
  .sidebar-overlay {
    top: 60px;
  }
  .page-wrap {
    padding: 1.4rem 0.85rem 2.5rem;
  }
  .app-shell .page-wrap {
    padding: 1.4rem 0.85rem 2.5rem;
  }
  .landing-hero {
    padding: 2.2rem 1.15rem;
    border-radius: var(--radius-lg);
  }
  .landing-hero h1 {
    font-size: 1.55rem;
  }
  .landing-hero p {
    font-size: 0.88rem;
  }
  .landing-hero-wordmark img {
    height: 46px;
  }
  .landing-hero-wordmark span {
    font-size: 1.7rem;
  }
  .hero-card h1 {
    font-size: 1.3rem;
  }
  .hero-card p:not(.eyebrow) {
    font-size: 0.86rem;
  }
  .eyebrow {
    font-size: 0.66rem;
    padding: 0.22rem 0.65rem;
  }
  .card, .stat-card {
    border-radius: var(--radius);
    padding: 1.15rem;
  }
  .list-row {
    align-items: flex-start;
    flex-direction: column;
    padding: 0.95rem;
  }
  .list-row-actions {
    width: 100%;
    margin-top: 0.45rem;
  }
  .list-row-actions .btn {
    flex: 1;
  }
  .metric-grid {
    grid-template-columns: 1fr 1fr;
  }
  .metric-card {
    padding: 0.85rem;
  }
  .metric-card span {
    font-size: 0.7rem;
  }
  .metric-card strong {
    font-size: 1.25rem;
    margin: 0.3rem 0 0.15rem;
  }
  .metric-card small {
    font-size: 0.72rem;
  }
  .student-onboarding {
    width: calc(100% - 1.25rem);
    align-items: flex-start;
    flex-wrap: wrap;
    padding: 0.95rem;
  }
  .onboarding-actions {
    width: 100%;
  }
  .onboarding-actions .btn {
    flex: 1;
  }

  /* Juda tor ekranlarda "100 000 so'm" kabi summa matni bitta qatorga
     to'liq sig'ishi uchun shrift bir oz kichraytiriladi. */
  .payment-log table {
    font-size: 0.82rem;
    min-width: 420px;
  }
  .payment-log td strong {
    font-size: 0.95em;
  }
}

/* ==========================================================================
   Print Stylesheet
   ========================================================================== */

@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 10pt;
  }
  .topbar, .sidebar, .sidebar-overlay, .child-switcher, .print-hidden, .btn, .year-filter, .quick-actions {
    display: none !important;
  }
  .page-wrap, .app-shell .page-wrap {
    width: 100% !important;
    max-width: none !important;
    padding: 0 !important;
  }
  .card {
    box-shadow: none !important;
    border: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  .report-sheet {
    display: block;
  }
  .report-title h2 {
    font-size: 16pt;
    color: #000000;
  }
  .report-title p {
    color: #333333;
  }
  .table-wrap {
    overflow: visible !important;
    border: 0 !important;
  }
  .attendance-report table {
    min-width: 0 !important;
    font-size: 8pt;
  }
  .attendance-report th, .attendance-report td {
    padding: 3px;
    border: 1px solid #888888;
  }
  .attendance-report .student-col {
    min-width: 110px;
  }
  .no-class {
    background: #eeeeee !important;
  }
  .status-k, .status-y {
    color: #000000;
  }
  .status-icon path {
    stroke: #000000 !important;
  }
  .print-note {
    color: #333333;
  }
}
