/* English Tutor — Telegram Mini App (Step 1) */

:root {
  --page: #eef1f7;
  --bg: var(--tg-theme-bg-color, #f7f8fc);
  --card: var(--tg-theme-secondary-bg-color, #ffffff);
  --text: var(--tg-theme-text-color, #0f172a);
  --muted: var(--tg-theme-hint-color, #64748b);
  --line: var(--tg-theme-section-separator-color, rgba(15, 23, 42, 0.07));
  --line-2: rgba(15, 23, 42, 0.11);
  --accent: var(--tg-theme-button-color, #4f46e5);
  --accent-2: #6366f1;
  --accent-grad: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
  --accent-text: var(--tg-theme-button-text-color, #ffffff);
  --danger: var(--tg-theme-destructive-text-color, #e11d48);
  --ok: var(--tg-theme-link-color, #059669);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 6px 18px rgba(15, 23, 42, 0.08);
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

html, body { margin: 0; padding: 0; }

body {
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: -0.011em;
  background: var(--page);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
a { color: var(--accent); }
h1, h2, h3, p { margin: 0; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; background: var(--bg); padding: 2px 6px; border-radius: 6px; }
/* Login — oddiy matn (badge/monospace/ramka O'CHIRILDI) */
.login-val { font-size: inherit; font-weight: 500; color: #334155; font-family: inherit; }

.app {
  max-width: 100%;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
}

@media (min-width: 768px) {
  .app {
    max-width: 1200px !important;
    width: 95% !important;
    margin: 0 auto !important;
    padding: 24px !important;
  }
}

/* ---------- Desktop navigation tabs (hidden on mobile) ---------- */
.top-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  max-width: 100%;
  background: rgba(255, 255, 255, 0.80);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  backdrop-filter: saturate(180%) blur(24px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.60);
  display: none;
}
.top-nav.md-block {
  display: block;
}
.top-nav .header-inner {
  max-width: 100%;
  height: calc(54px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 24px 14px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.top-nav .brand {
  font-weight: 800; font-size: 20px; letter-spacing: -0.035em;
}
.top-nav .brand-wrap { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.top-nav .brand-sub { font-size: 11.5px; font-weight: 600; color: var(--muted); letter-spacing: -0.005em; }
.top-nav .role-badge {
  font-size: 12.5px; padding: 4px 12px; margin-right: 12px;
}
.top-nav .nav-item { display: none; }
.top-nav .nav-item:first-child { display: flex; }

/* ---------- Content ---------- */
.app-content {
  max-width: 100%;
  margin: 0 auto;
  padding: calc(54px + env(safe-area-inset-top) + 14px) 14px calc(74px + env(safe-area-inset-bottom) + 12px);
}
body.auth-mode .app-content { padding-bottom: calc(30px + env(safe-area-inset-bottom)); }
@media (min-width: 768px) {
  .app-content { padding-left: 2rem; padding-right: 2rem; }
}
@media (min-width: 1024px) {
  .app-content { padding-left: 1rem; padding-right: 1rem; }
}


/* ---------- Header ---------- */
/* Ajoyib shisha (glassmorphism) effekt — suzuvchi, yarim shaffof */
.app-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.80);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  backdrop-filter: saturate(180%) blur(24px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.60);
}
.header-inner {
  max-width: 480px;
  margin: 0 auto;
  height: calc(54px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 14px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.brand { font-weight: 800; font-size: 16.5px; letter-spacing: -0.035em; }
.brand-wrap { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-sub { font-size: 11.5px; font-weight: 600; color: var(--muted); letter-spacing: -0.005em; }

.role-badge {
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.role-badge.is-teacher { background: rgba(47, 143, 239, 0.15); color: var(--accent); }
.role-badge.is-student { background: rgba(124, 92, 255, 0.15); color: #7c5cff; }

/* ---------- Content ---------- */
.app-content {
  max-width: 100%;
  margin: 0 auto;
  padding: calc(54px + env(safe-area-inset-top) + 14px) 14px calc(74px + env(safe-area-inset-bottom) + 12px);
}
body.auth-mode .app-content { padding-bottom: calc(30px + env(safe-area-inset-bottom)); }
@media (min-width: 768px) {
  .app-content { max-width: 100%; padding-left: 24px; padding-right: 24px; }
  .app-header { display: none; }
  .header-inner { max-width: 100%; }
}

/* ---------- Bottom nav ---------- */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 40;
  max-width: 480px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.80);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  backdrop-filter: saturate(180%) blur(24px);
  border-top: 1px solid rgba(226, 232, 240, 0.60);
  display: flex;
  padding-bottom: env(safe-area-inset-bottom);
}
@media (min-width: 768px) {
  .bottom-nav { display: none; }
}

/* ---------- Desktop navigation tabs (hidden on mobile) ---------- */
.top-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  max-width: 100%;
  background: rgba(255, 255, 255, 0.80);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  backdrop-filter: saturate(180%) blur(24px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.60);
  display: none;
}
.top-nav.md-block {
  display: block;
}
.top-nav .header-inner {
  max-width: 100%;
  height: calc(54px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 24px 14px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.top-nav .brand {
  font-weight: 800; font-size: 20px; letter-spacing: -0.035em;
}
.top-nav .brand-wrap { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.top-nav .brand-sub { font-size: 11.5px; font-weight: 600; color: var(--muted); letter-spacing: -0.005em; }
.top-nav .role-badge {
  font-size: 12.5px; padding: 4px 12px; margin-right: 12px;
}
.top-nav .nav-item { display: none; }
.top-nav .nav-item:first-child { display: flex; }

@media (min-width: 768px) {
  .top-nav { display: block; }
  .bottom-nav { display: none; }
}

.nav-item {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 9px 1px 8px;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 600;
  transition: color 0.2s var(--ease), transform 0.2s var(--ease);
}
.nav-item:active { transform: scale(0.94); }
.nav-item span {
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-item svg { width: 22px; height: 22px; }
.nav-item.active { color: var(--accent); font-weight: 700; }
.nav-item.active svg { filter: drop-shadow(0 3px 8px rgba(79, 70, 229, 0.35)); }

/* ---------- Common ---------- */
.card {
  background: var(--card);
  border: 1px solid rgba(226, 232, 240, 0.70);
  border-radius: 18px;
  padding: 15px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s var(--ease);
}
@media (hover: hover) { .card:hover { box-shadow: var(--shadow-md); } }
.card:active { transform: scale(0.97); }
.card + .card { margin-top: 10px; }
.card-title { font-size: 17px; font-weight: 800; letter-spacing: -0.025em; margin-bottom: 4px; }
.card-h { font-size: 15.5px; font-weight: 800; letter-spacing: -0.02em; margin: 0; min-width: 0; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }

.row { display: flex; gap: 12px; align-items: center; }
.row.between { justify-content: space-between; }
.row.top { align-items: flex-start; }
.row.g8 { gap: 8px; }
.col { min-width: 0; flex: 1; }

.section-title {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  margin: 18px 2px 8px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.screen-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 10px;
  margin: 2px 2px 12px;
}
.screen-title { font-size: 21px; font-weight: 800; letter-spacing: -0.035em; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 13px 16px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.012em;
  transition: all 0.2s var(--ease);
  user-select: none;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: var(--accent-grad);
  color: var(--accent-text);
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.26);
}
.btn-primary:active { filter: brightness(0.95); box-shadow: 0 3px 8px rgba(79, 70, 229, 0.22); }
.btn-ghost { border: 1px solid var(--line-2); color: var(--text); background: var(--card); }
@media (hover: hover) { .btn-ghost:hover { background: var(--bg); } }
.btn-danger { background: rgba(225, 29, 72, 0.10); color: var(--danger); }
.btn-block { width: 100%; margin-top: 12px; }
.btn-sm { padding: 9px 14px; font-size: 13.5px; border-radius: 11px; font-weight: 700; }
.link-btn { display: block; width: 100%; margin-top: 14px; color: var(--accent); font-size: 14px; font-weight: 500; }
.icon-btn {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  flex: none;
  transition: background 0.2s var(--ease), transform 0.2s var(--ease);
}
.icon-btn:active { transform: scale(0.92); }

.input {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background: var(--card);
  color: var(--text);
  font-size: 16px;
  font-weight: 500;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12); }
.input::placeholder { color: var(--muted); }
select.input {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8'><path d='M1 1l5 5 5-5' fill='none' stroke='%237f8aa0' stroke-width='2' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.field-label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin: 14px 0 6px; text-align: left; }
.field-hint { font-size: 12.5px; color: var(--ok); margin-top: 8px; text-align: left; }
.field-error { display: none; font-size: 13px; color: var(--danger); margin-top: 8px; text-align: left; }
.field-error.show { display: block; }

.empty { text-align: center; color: var(--muted); padding: 30px 12px; font-size: 14px; }
.empty .empty-ico {
  display: flex;
  justify-content: center;
  color: var(--muted);
  opacity: 0.75;
  margin-bottom: 9px;
}
.empty .empty-ico svg { width: 34px; height: 34px; stroke-width: 1.6; }

/* ---------- Vektor ikonkalar (inline SVG, emoji o'rniga) ---------- */
svg { display: inline-block; vertical-align: -3px; }
.pw-toggle svg { width: 18px; height: 18px; }
.btn svg, .chip-btn svg, .att-pill svg, .list-row svg { flex: none; }

/* ---------- Auth screens ---------- */
.auth { text-align: center; padding-top: 6px; }
.auth-logo {
  width: 74px; height: 74px;
  border-radius: 22px;
  background: var(--accent-grad);
  display: flex; align-items: center; justify-content: center;
  margin: 6px auto 14px;
  box-shadow: 0 14px 30px rgba(79, 70, 229, 0.34);
}
.auth-logo svg { width: 36px; height: 36px; color: #fff; }
/* --- Rasmiy gerb (logo): header brend, login markasi, profil avatar --- */
.brand-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  vertical-align: middle;
  margin-right: 8px;
}
img.auth-logo {
  object-fit: contain;
  background: #fff;
  padding: 6px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
}
.avatar-gerb {
  background: #fff;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12);
}
.avatar-gerb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 7px;
  border-radius: 50%;
}
.auth-title { font-size: 24px; font-weight: 800; letter-spacing: -0.04em; }
.auth-sub { color: var(--muted); font-size: 14px; margin-top: 4px; }
.auth-card { margin-top: 18px; text-align: left; }
.auth-card .btn-block { text-align: center; }
.center { text-align: center; }
.center .field-label, .center .field-error { text-align: center; }

.phone-readonly {
  font-size: 17px;
  font-weight: 700;
  padding: 11px 0 2px;
  letter-spacing: 0.02em;
}

.role-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 6px; }
.role-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 8px 12px;
  border: 1.5px solid var(--line);
  border-radius: 15px;
  background: var(--card);
  text-align: center;
}
.role-card .role-emoji { font-size: 26px; }
.role-card strong { font-size: 14.5px; }
.role-card small { font-size: 11.5px; color: var(--muted); line-height: 1.35; }
.role-card.selected { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }

.pin-icon { font-size: 34px; margin-bottom: 6px; }
.pin-wrap { position: relative; height: 56px; display: flex; align-items: center; justify-content: center; margin: 16px 0 4px; }
.pin-dots { display: flex; gap: 14px; pointer-events: none; }
.pin-dots i {
  width: 15px; height: 15px;
  border-radius: 50%;
  border: 2px solid var(--line);
  display: block;
  transition: transform 0.12s, background 0.12s;
}
.pin-dots i.on { background: var(--accent); border-color: var(--accent); transform: scale(1.1); }
.pin-input {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  opacity: 0;
  border: 0;
  background: transparent;
  font-size: 16px;
  text-align: center;
}
.pin-error { min-height: 18px; font-size: 13px; color: var(--danger); text-align: center; margin-top: 4px; }
.shake { animation: shake 0.3s; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-7px); }
  75% { transform: translateX(7px); }
}

/* ---------- Home ---------- */
.greet-main { display: flex; gap: 13px; align-items: center; }
.greet-hi { font-size: 13px; color: var(--muted); }
.greet-name { font-size: 18px; font-weight: 800; letter-spacing: -0.035em; margin-bottom: 6px; }

.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
@media (min-width: 768px) {
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1024px) {
  .stat-grid { grid-template-columns: repeat(6, 1fr); gap: 12px; }
}

@media (min-width: 768px) {
  .stat { padding: 20px 12px 16px; }
  .stat-ico { width: 44px; height: 44px; margin: 0 auto 10px; }
  .stat-ico svg { width: 24px; height: 24px; }
  .stat-num { font-size: 28px; }
  .stat-label { font-size: 13px; }
}

@media (min-width: 1024px) {
  .stat-grid { grid-template-columns: repeat(12, 1fr); gap: 8px; }
  .stat { padding: 24px 8px 18px; }
  .stat-ico { width: 56px; height: 56px; margin: 0 auto 12px; }
  .stat-ico svg { width: 32px; height: 32px; }
  .stat-num { font-size: 36px; }
  .stat-label { font-size: 14px; }
}
/* Dashboard kartalari — yumshoq pastel aksent + vektor ikonka */
.stat { text-align: center; padding: 14px 6px 12px; }
.stat-ico {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin: 0 auto 7px;
  border-radius: 11px;
  background: rgba(79, 70, 229, 0.10);
  color: var(--accent);
}
.stat-ico svg { width: 18px; height: 18px; }
.stat:nth-child(2) .stat-ico { background: rgba(2, 132, 199, 0.11); color: #0284c7; }
.stat:nth-child(3) .stat-ico { background: rgba(180, 83, 9, 0.12); color: #b45309; }
.stat-num { display: block; font-size: 23px; font-weight: 800; letter-spacing: -0.045em; line-height: 1.1; }
.stat-label { font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: -0.005em; }
/* Stat kartalari bosiladigan tutqich (cursor-pointer + active:scale-95) */
.stat { cursor: pointer; transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease); }
.stat:active { transform: scale(0.95); }

/* --- Tez amallar: barcha 6 ta karta qat'iy 88px, bir xil qorizontalda --- */
.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; grid-auto-rows: 88px; align-items: stretch; }
@media (min-width: 768px) {
  .quick-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; grid-auto-rows: auto; }
}
@media (min-width: 1024px) {
  .quick-grid { grid-template-columns: repeat(6, 1fr); gap: 16px; grid-auto-rows: 100px; }
}
.quick {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  height: 88px;
  min-height: 88px;
  padding: 14px;
  overflow: hidden;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.22;
  text-align: left;
  transition: all 0.2s var(--ease);
}
/* Matn uzs ham balandlik o'zgarmaydi: 2 qator bilan cheklanadi */
.quick > span:not(.quick-ico) {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* Desktop: kartalar kengayadi, matn to'liq ko'rinadi (ellipsis yo'q) */
@media (min-width: 768px) {
  .quick {
    height: 100px;
    min-height: 100px;
    min-width: 160px;
    padding: 16px;
    overflow: visible;
  }
  .quick > span:not(.quick-ico) {
    display: block;
    -webkit-line-clamp: unset;
    overflow: visible;
    white-space: normal;
    text-overflow: clip;
  }
}
/* --- Tez amallar: vektor ikonka + yumshoq rangli badge --- */
.quick-ico {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.quick-ico svg { width: 20px; height: 20px; }

/* --- Soft badge tints (indigo / emerald / sky / amber / purple / slate) --- */
.tint-indigo  { background: #eef2ff; color: #4f46e5; }
.tint-emerald { background: #ecfdf5; color: #059669; }
.tint-sky     { background: #f0f9ff; color: #0284c7; }
.tint-amber   { background: #fffbeb; color: #d97706; }
.tint-purple  { background: #faf5ff; color: #9333ea; }
.tint-slate   { background: #f1f5f9; color: #334155; }
.tint-rose    { background: #fff1f2; color: #e11d48; }
.quick:active { transform: scale(0.97); }

/* ---------- Guruhlar: yumshoq pastel aksent ---------- */
.group-card {
  background: linear-gradient(180deg, rgba(79, 70, 229, 0.045) 0%, rgba(255, 255, 255, 0) 60%), var(--card);
}
.group-card .row.between { align-items: flex-start; }
.pill {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 4px 9px;
  border-radius: 999px;
  white-space: nowrap;
  flex: none;
  transition: all 0.2s var(--ease);
}
.meta-rows { margin-top: 8px; display: flex; flex-direction: column; gap: 5px; font-size: 13.5px; color: var(--muted); }
.meta-row { display: flex; gap: 8px; align-items: center; }

/* ---------- Students ---------- */
/* --- Qidiruv: pill shakli, ichida qidiruv ikonkasi --- */
.search-wrap { margin-bottom: 10px; position: relative; }
.search-wrap::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 20px;
  width: 17px;
  height: 17px;
  z-index: 1;
  pointer-events: none;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.3' stroke-linecap='round'><circle cx='11' cy='11' r='7'/><path d='M20 20l-3.4-3.4'/></svg>") no-repeat center / contain;
}
.search-wrap .input {
  padding-left: 42px;
  border-radius: 999px;
  background: var(--bg);
}
.search-wrap .input:focus { background: var(--card); }
.search-wrap .input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 10px; scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-behavior: smooth; }
.chips::-webkit-scrollbar { display: none; }
/* "Sinflar" kartasidan kirilganda sinf filtri bir zumda ajratib ko'rsatiladi */
.chips.is-hl .chip-btn { animation: chipPulse 1.5s ease; }
@keyframes chipPulse {
  0%, 100% { box-shadow: none; }
  30%, 60% { box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.18); }
}
.chip-btn {
  white-space: nowrap;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line-2);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  flex: none;
  transition: all 0.2s var(--ease);
}
.chip-btn:active { transform: scale(0.97); }
@media (hover: hover) { .chip-btn:hover { color: var(--text); border-color: rgba(79, 70, 229, 0.35); } }
.chip-btn.active {
  background: var(--accent-grad);
  border-color: transparent;
  color: var(--accent-text);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.24);
}

.avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.16), rgba(99, 102, 241, 0.10));
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -0.02em;
  flex: none;
}
.avatar-lg { width: 54px; height: 54px; font-size: 19px; }
.avatar-xl { width: 76px; height: 76px; font-size: 26px; margin: 0 auto 10px; }

.s-main { flex: 1; min-width: 0; }
.s-name { font-weight: 800; font-size: 15px; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip-class {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(79, 70, 229, 0.10);
  color: var(--accent);
  white-space: nowrap;
  flex: none;
}
.s-group { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.s-contacts { margin-top: 7px; display: flex; flex-direction: column; gap: 4px; }
.s-contact {
  display: flex;
  gap: 7px;
  align-items: center;
  font-size: 13px;
  color: var(--text);
  text-decoration: none;
}
.s-contact .lbl { color: var(--muted); font-size: 12px; min-width: 62px; }
.s-contact:active { color: var(--accent); }

/* ---------- Profile ---------- */
.profile-head { text-align: center; padding: 20px 14px; }
.profile-name { font-size: 18px; font-weight: 800; letter-spacing: -0.03em; margin-bottom: 2px; }
.list-card { padding: 4px 14px; }
.list-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.list-row:last-child { border-bottom: 0; }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(15, 23, 42, 0.42);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.modal-sheet {
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--card);
  border-radius: 24px 24px 0 0;
  padding: 16px 16px calc(20px + env(safe-area-inset-bottom));
  box-shadow: 0 -12px 40px rgba(15, 23, 42, 0.18);
  animation: sheetUp 0.24s var(--ease);
}
@keyframes sheetUp { from { transform: translateY(40px); opacity: 0.5; } to { transform: translateY(0); opacity: 1; } }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 4px; }
.modal-head h3 { font-size: 17px; font-weight: 800; }

.day-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 6px; }
/* Har bir tanlangan kun uchun alohida vaqt picker (dinamik) */
.day-times { margin-top: 2px; }
.day-time-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.day-time-row .dt-day { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 700; color: var(--text); }
.day-time-row .dt-time { width: auto; min-width: 130px; flex: none; padding: 9px 12px; border-radius: 12px; font-size: 15px; font-variant-numeric: tabular-nums; }
.day-opt { position: relative; display: block; }
.day-opt input { position: absolute; opacity: 0; pointer-events: none; }
.day-box {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 2px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  transition: all 0.2s var(--ease);
}
.day-opt input:checked + .day-box {
  background: var(--accent-grad);
  border-color: transparent;
  color: var(--accent-text);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.24);
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(88px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(16px);
  z-index: 90;
  background: #0f172a;
  color: #fff;
  font-size: 14px;
  padding: 11px 17px;
  border-radius: 14px;
  max-width: 88%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.28);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--danger); }
/* Tugmali toast (bildirishnoma ruxsati so'rovi) */
.toast--action {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  max-width: 92%;
  line-height: 1.45;
}
.toast.show.toast--action { pointer-events: auto; } /* aslida .toast pointer-events: none */
.toast-action {
  flex: none;
  border: 0;
  border-radius: 9px;
  background: #fff;
  color: #0f172a;
  font-size: 13px;
  font-weight: 700;
  padding: 7px 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s var(--ease);
}
.toast-action:active { transform: translateY(1px); }
body.auth-mode .toast { bottom: calc(26px + env(safe-area-inset-bottom)); }

/* ==================== Step 2: Baholar jurnali ==================== */
.selector-row { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }

/* ---------- Hafta navigatsiya paneli (Baholar jurnali) ---------- */
.week-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  background: var(--card);
  border: 1px solid rgba(226, 232, 240, 0.70);
  border-radius: 14px;
  margin-bottom: 16px;
}
.week-nav-bar .week-label {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}
.week-nav-bar .week-btn {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
}
.week-nav-bar .week-btn.prev,
.week-nav-bar .week-btn.next {
  background: #f1f5f9;
  color: #334155;
}
.week-nav-bar .week-btn.prev:hover,
.week-nav-bar .week-btn.next:hover {
  background: #e2e8f0;
}
.week-nav-bar .week-btn.today {
  background: rgba(79, 70, 229, 0.08);
  color: #4f46e5;
}
.week-nav-bar .week-btn.today:hover {
  background: rgba(79, 70, 229, 0.15);
}

/* ---------- Desktop top-nav tabs ---------- */
.top-nav .header-inner {
  padding-left: 24px;
  padding-right: 24px;
}
.top-nav-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  justify-content: center;
}
.top-nav-item {
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}
.top-nav-item:hover { background: rgba(79, 70, 229, 0.06); color: #334155; }
.top-nav-item.active { background: rgba(79, 70, 229, 0.10); color: #4f46e5; font-weight: 700; }
.top-nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}
.selector-label { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }

/* ==================== Baholar jurnali — Notion uslubida minimal ==================== */
.grid-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  border: 1px solid rgba(226, 232, 240, 0.70);
  border-radius: 18px;
  background: var(--card);
  margin-bottom: 12px;
  overscroll-behavior-x: contain;
  box-shadow: var(--shadow-sm);
}
.bj { border-collapse: separate; border-spacing: 0; width: max-content; }
.bj th, .bj td { padding: 0; margin: 0; }

.bj thead th {
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  padding: 9px 6px;
  text-align: center;
  white-space: nowrap;
  letter-spacing: 0.01em;
}
/* Yopishqoq talaba nomi ustuni — silliq gorizontal siljish */
.bj-name {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--card);
  min-width: 124px;
  max-width: 148px;
  text-align: left;
  border-right: 1px solid var(--line);
  padding: 8px 10px !important;
  box-shadow: 6px 0 12px -10px rgba(15, 23, 42, 0.45);
}
.bj thead th.bj-name { background: var(--bg); z-index: 4; }
.bj-date, .bj-cell { min-width: 54px; width: 54px; text-align: center; }
.bj-cell { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); height: 46px; }
.bj-cell.is-focus, .bj-date.is-focus { box-shadow: inset 0 0 0 2px rgba(79, 70, 229, 0.45); }
.bj tbody tr:last-child .bj-cell, .bj tbody tr:last-child .bj-name { border-bottom: 0; }

.bj-name-cell { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.bj-name-cell .s-name { font-size: 13.5px; font-weight: 700; line-height: 1.2; }

.bj-grade {
  width: 100%;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.02em;
  border: 0;
  background: transparent;
  transition: all 0.2s var(--ease);
}
.bj-grade:active { transform: scale(0.97); }
@media (hover: hover) { .bj-grade:hover { background: #f1f5f9; } }

.bj-sum {
  min-width: 78px;
  text-align: center;
  border-left: 1px solid var(--line);
  padding: 7px 6px !important;
  background: var(--bg);
}
.bj-sum .sum-avg { display: block; font-size: 16px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.bj-sum .sum-total { display: block; font-size: 10.5px; color: var(--muted); margin-top: 2px; }

/* Neytral 10-ballik: toza dark-slate raqam, yumshoq kulrang fon, nozik ramka */
.g-num { background: #f1f5f9; color: #0f172a; border: 1px solid #e2e8f0; border-radius: 9px; }
.g-empty { background: transparent; color: var(--muted); font-weight: 500; border: 1px solid transparent; }
.bj-grade.on { box-shadow: inset 0 0 0 2px #0f172a; border-radius: 9px; }

.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 11px; height: 11px; border-radius: 4px; display: inline-block; }

/* --- Baho editori --- */
.score-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 8px; }
.score-btn {
  padding: 12px 0;
  border-radius: 13px;
  border: 1px solid var(--line-2);
  background: var(--card);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  transition: all 0.2s var(--ease);
}
.score-btn:active { transform: scale(0.97); }
.score-btn.sel.g-num { background: #0f172a; border-color: #0f172a; color: #fff; box-shadow: 0 6px 16px rgba(15, 23, 42, 0.22); }

.cat-wrap { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 6px; }

.editor-info { display: flex; align-items: center; gap: 10px; padding: 10px 0 2px; }
.editor-info .avatar { width: 38px; height: 38px; font-size: 13px; }

/* ==================== Step 2: Tezkor davomat ==================== */
.att-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.att-row:last-child { border-bottom: 0; }
.att-top { display: flex; align-items: center; gap: 9px; justify-content: space-between; }
.att-btns { display: flex; gap: 6px; }
.att-btn {
  flex: 1;
  padding: 9px 5px;
  border-radius: 11px;
  border: 1px solid var(--line-2);
  background: var(--card);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  white-space: nowrap;
  transition: all 0.2s var(--ease);
}
.att-btn:active { transform: scale(0.97); }
.att-btn .ic { font-size: 13px; }
.att-btn.on-present { background: #059669; border-color: #059669; color: #fff; box-shadow: 0 4px 12px rgba(5, 150, 105, 0.24); }
.att-btn.on-absent { background: #e11d48; border-color: #e11d48; color: #fff; box-shadow: 0 4px 12px rgba(225, 29, 72, 0.22); }
.att-btn.on-excused { background: #d97706; border-color: #d97706; color: #fff; box-shadow: 0 4px 12px rgba(217, 119, 6, 0.22); }
.att-summary { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.att-pill { font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); color: var(--muted); }

/* ==================== Step 2: O'quvchi portali ==================== */
/* --- O'quvchi portali: hero karta + gradient mesh --- */
.hero-card {
  background:
    radial-gradient(120% 100% at 0% 0%, rgba(99, 102, 241, 0.16) 0%, rgba(99, 102, 241, 0) 55%),
    radial-gradient(110% 90% at 100% 0%, rgba(56, 189, 248, 0.13) 0%, rgba(56, 189, 248, 0) 52%),
    radial-gradient(130% 110% at 100% 100%, rgba(168, 85, 247, 0.12) 0%, rgba(168, 85, 247, 0) 55%),
    var(--card);
  border-color: rgba(79, 70, 229, 0.10);
  box-shadow: 0 10px 30px rgba(79, 70, 229, 0.10);
}
.portal-head { display: flex; gap: 13px; align-items: center; }
.portal-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; align-items: center; }

.avg-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.avg-badge {
  min-width: 78px;
  padding: 12px 13px;
  border-radius: 16px;
  text-align: center;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid var(--line);
  flex: none;
}
.avg-badge .avg-num { display: block; font-size: 23px; line-height: 1; }
.avg-badge .avg-lab { display: block; font-size: 10px; margin-top: 4px; font-weight: 600; opacity: 0.9; }

.grade-row { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.grade-row:last-child { border-bottom: 0; }
.gr-date { font-size: 12.5px; font-weight: 700; color: var(--muted); width: 50px; flex: none; }
.gr-score {
  width: 34px; height: 30px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px;
  letter-spacing: -0.02em;
  flex: none;
  transition: all 0.2s var(--ease);
}
.gr-main { min-width: 0; flex: 1; font-size: 13.5px; }
.gr-note { color: var(--muted); font-size: 12px; margin-top: 1px; }

.att-line { display: flex; gap: 9px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.att-line:last-child { border-bottom: 0; }
.att-tag { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; flex: none; }
.att-tag.on-present { background: rgba(5, 150, 105, 0.13); color: #047857; }
.att-tag.on-absent { background: rgba(225, 29, 72, 0.12); color: #be123c; }
.att-tag.on-excused { background: rgba(217, 119, 6, 0.14); color: #b45309; }


.slot-card { display: flex; align-items: center; gap: 12px; }
.slot-day { font-size: 20px; }

/* Yopiq (bloklangan) ekran */
.blocked { text-align: center; padding: 30px 12px; color: var(--muted); }
.blocked .empty-ico {
  display: flex;
  justify-content: center;
  color: var(--muted);
  opacity: 0.7;
  margin-bottom: 10px;
}
.blocked .empty-ico svg { width: 34px; height: 34px; stroke-width: 1.6; }
.bj-date-btn { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; width: 100%; }

/* ==================== Step 3: Speaking (1-on-1) ==================== */
.speak-row {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.speak-row:last-child { border-bottom: 0; }
.speak-top { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.slot-time {
  font-size: 14.5px;
  font-weight: 800;
  letter-spacing: -0.03em;
  white-space: nowrap;
  flex: none;
}
.slot-who { min-width: 0; text-align: right; }
.slot-who .who-name { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot-who .who-free { font-size: 13px; color: var(--muted); }
.slot-badge { font-size: 11.5px; font-weight: 700; padding: 4px 9px; border-radius: 999px; flex: none; }
.slot-badge.done { background: rgba(5, 150, 105, 0.13); color: #047857; }
.slot-badge.wait { background: rgba(79, 70, 229, 0.10); color: var(--accent); }
.speak-actions { display: flex; gap: 7px; flex-wrap: wrap; }
.btn-xs { padding: 8px 11px; font-size: 12.5px; border-radius: 10px; font-weight: 700; }
.btn-xs.primary { background: var(--accent-grad); color: var(--accent-text); }
.btn-xs.ghost { border: 1px solid var(--line-2); color: var(--text); background: var(--card); }
.btn-xs.danger { background: rgba(225, 29, 72, 0.10); color: var(--danger); }

.strong-label { font-weight: 800; font-size: 15px; }

/* Recorder & Audio */
.recorder { display:flex; gap:8px; flex-wrap:wrap; align-items:center; margin:10px 0 6px; }
.recorder__status { color:var(--muted); font-size:12px; }
.audio-list { display:flex; flex-direction:column; gap:8px; margin-top:8px; }
.audio-item {
  border:1px solid var(--line);
  border-radius:14px;
  padding:11px;
  background:var(--bg);
  transition: all 0.2s var(--ease);
}
.audio-item__meta { font-size:12px; color:var(--muted); margin-bottom:6px; }
/* Baholangan karta INBOXdan silliq chiqadi (jonli realtime) */
.audio-item.is-leaving { opacity:0; transform: translateY(-6px) scale(0.98); pointer-events:none; }
.audio-player { width:100%; }
.grade-row { display:flex; gap:6px; flex-wrap:wrap; align-items:center; margin-top:8px; }
/* --- Speaking qarzi: ayrim, zamonaviy tipografiya bilan --- */
.debt-badge {
  display:inline-flex; align-items:center; gap:7px;
  padding:8px 13px; border-radius:999px;
  background:linear-gradient(135deg,#fff1f2,#ffe4e6);
  border:1px solid rgba(225,29,72,.14);
  color:#be123c;
  font-weight:800; font-size:12.5px;
  letter-spacing:-0.01em;
}
.debt-controls { display:flex; gap:6px; align-items:center; }
.debt-num { min-width:20px; text-align:center; font-weight:600; }


/* ==================== Step 5: Chat (Ustoz ↔ O'quvchi) ==================== */
/* --- Chat: iMessage / Telegram uslubida pufakchalar --- */
.chat-card { display: flex; flex-direction: column; gap: 9px; }
.chat-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 46vh;
  overflow-y: auto;
  padding: 4px 2px;
  -webkit-overflow-scrolling: touch;
}
.chat-msg {
  max-width: 84%;
  align-self: flex-start;
  padding: 9px 13px;
  border-radius: 20px 20px 20px 7px;
  background: var(--card);
  border: 1px solid var(--line);
  font-size: 13.5px;
  line-height: 1.42;
  box-shadow: var(--shadow-sm);
  animation: msgIn 0.18s var(--ease);
}
@keyframes msgIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.chat-msg.mine {
  align-self: flex-end;
  background: var(--accent-grad);
  border-color: transparent;
  color: #fff;
  border-radius: 20px 20px 7px 20px;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.24);
}
.chat-msg .chat-time { display: block; margin-top: 3px; font-size: 10px; opacity: .62; text-align: right; }
.chat-input-row { display: flex; gap: 8px; align-items: center; }
.chat-input-row .input { flex: 1; min-width: 0; }
.chat-hint {
  font-size: 11.5px;
  color: var(--muted);
  background: var(--bg);
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 7px 9px;
}

/* ==================== Step 6: O'chirish tasdig'i ==================== */
.confirm-body { text-align: center; padding: 4px 0 2px; }
.confirm-emoji {
  width: 56px;
  height: 56px;
  border-radius: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  color: var(--text);
  line-height: 1;
  margin-bottom: 12px;
  animation: sheetUp .22s ease;
}
.confirm-emoji svg { width: 26px; height: 26px; }
.modal-head h3 { display: flex; align-items: center; gap: 8px; }
.modal-head h3 svg { width: 20px; height: 20px; flex: none; }
.confirm-text { font-size: 14.5px; line-height: 1.55; color: var(--text); }
.confirm-text strong { font-weight: 800; }
.confirm-actions { display: flex; gap: 10px; margin-top: 16px; }
.confirm-actions .btn {
  flex: 1;
  padding-top: 12px;
  padding-bottom: 12px;
  transition: background .18s ease, color .18s ease, border-color .18s ease, transform .12s ease, filter .15s;
}
.confirm-actions .btn-ghost:hover { background: var(--bg); }
.confirm-actions .btn-danger:hover { background: rgba(229, 72, 77, 0.2); }
.btn-danger { transition: background .18s ease, color .18s ease, transform .12s ease, filter .15s; }

/* ==================== Step 7: Parol ko'zgusi + Zaxira ==================== */
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 44px; }
.pw-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  border-radius: 9px;
  transition: background .15s ease, transform .12s ease;
}
.pw-toggle:hover { background: var(--bg); }
.pw-toggle:active { transform: translateY(-50%) scale(0.92); }

.backup-card { display: flex; flex-direction: column; gap: 10px; }
.backup-card .btn-block { margin-top: 0; }
.speak-cta { margin: 4px 0 10px; font-weight: 800; letter-spacing: -0.02em; }

/* --- Umumiy mikro-interaksiya: barcha tugma/karta/baho hujayralari --- */
.chip-btn, .att-btn, .score-btn, .bj-grade, .quick, .day-box, .role-card,
.pill, .slot-badge, .att-tag, .chip-class, .debt-badge, .switch,
.link-btn, .icon-btn, .pw-toggle, .btn-xs, .toast-action, .bj-date-btn,
.att-btn, .list-row, .group-card, .student-card {
  transition: all 0.2s var(--ease);
}
.chip-btn:active, .att-btn:active, .score-btn:active, .bj-grade:active,
.quick:active, .day-box:active, .role-card:active, .btn-xs:active,
.link-btn:active, .bj-date-btn:active {
  transform: scale(0.97);
}
/* Interaktiv sirtlar — ko'rsatkich barmoq */
.chip-btn, .att-btn, .score-btn, .bj-grade, .quick, .day-box, .role-card,
.btn, .btn-xs, .link-btn, .icon-btn, .pw-toggle, .nav-item, .switch,
.bj-date-btn, .toast-action, .group-card, .card[role="button"] {
  cursor: pointer;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* --- Ovozli topshirishga ruxsat kaliti (neytral, rangli emas) --- */
.switch {
  position: relative;
  width: 44px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg);
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease;
  flex: 0 0 auto;
  padding: 0;
}
.switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .35);
  transition: transform .18s ease;
}
.switch.on { background: var(--accent-grad); border-color: transparent; }
.switch.on::after { transform: translateX(18px); }
.switch:active::after { width: 23px; }

/* --- Uyga vazifa qatori --- */
.hw-item { padding: 9px 0; border-bottom: 1px solid var(--line); }
.hw-item:last-child { border-bottom: 0; }
.hw-head { align-items: center; gap: 8px; }
.hw-head-right { display: inline-flex; align-items: center; gap: 8px; flex: none; }

/* Ustoz: o'chirish tugmasi (karta yuqori o'ng burchagi) */
.hw-del {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 10px;
  background: #fff1f2;
  color: #e11d48;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  cursor: pointer;
  transition: all 0.16s var(--ease);
}
.hw-del:hover { background: #ffe4e6; }
.hw-del:active { transform: scale(0.9); }

/* O'quvchi: aylantirish checkbox (○ / ✓) */
.hw-task-row { display: flex; align-items: flex-start; gap: 10px; }
.hw-check {
  width: 26px;
  height: 26px;
  margin-top: 1px;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: var(--card);
  color: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  cursor: pointer;
  transition: all 0.16s var(--ease);
}
.hw-check:active { transform: scale(0.88); }
.hw-check.on { background: #10b981; border-color: #10b981; color: #fff; }
.hw-task-body { flex: 1; min-width: 0; }
.hw-title { color: inherit; }
.hw-struck { text-decoration: line-through; color: #94a3b8; opacity: 0.6; }
.hw-done-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: max-content;
  margin-top: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  background: #ecfdf5;
  color: #059669;
  font-size: 11px;
  font-weight: 700;
}

/* ---------- Guruh kartasi: tugmalar 2x2 grid (ramkadan chiqmasligi uchun) ---------- */
.group-card { overflow: hidden; max-width: 100%; box-sizing: border-box; }
.gc-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
  margin-top: 11px;
}
.gc-actions .btn { width: 100%; box-sizing: border-box; }
.meta-row > span { overflow-wrap: anywhere; word-break: break-word; }

/* ---------- Baholar jurnali: qat'iy ustunlar + yopishqoq o'quvchi ustuni ---------- */
.bj { table-layout: fixed; border-collapse: separate; border-spacing: 0; width: max-content; }
.bj th.col-student, .bj td.col-student {
  width: 195px !important;
  min-width: 195px !important;
  max-width: 195px !important;
  position: sticky;
  left: 0;
  z-index: 20;
  background-color: #ffffff;
  border-right: 2px solid #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 12px;
}
.bj thead th.col-student { z-index: 21; }
.bj-date, .bj-cell { width: 56px !important; min-width: 56px !important; max-width: 56px !important; text-align: center; }
.bj-sum { width: 72px; min-width: 72px; text-align: center; }
.bj td.col-student .bj-name-cell, .bj .s-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
