/* =====================================================================
   app.css — komponentlar. Faqat tokens.css o'zgaruvchilari ishlatiladi.

   Tuzilma: chapda doimiy yon panel (sidebar), o'ngda kontent.
   Telefonda yon panel siljib chiqadigan panelga aylanadi.
   ===================================================================== */

/* =====================================================================
   1. HARAKAT KUTUBXONASI
   Bir nechta aniq maqsadli animatsiya. Har biri qisqa va bir martalik —
   administrator kuni bo'yi shu ekranda, chalg'itish emas, interfeys
   tirik ekanini sezdirish kerak.
   ===================================================================== */
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes rise-sm {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes pop-in {
  0%   { opacity: 0; transform: scale(.94); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes slide-right {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes tap-pulse {
  0%   { transform: scale(1); }
  35%  { transform: scale(.985); }
  100% { transform: scale(1); }
}
@keyframes shimmer {
  from { background-position: -200% 0; }
  to   { background-position: 200% 0; }
}
@keyframes bar-grow {
  from { transform: scaleY(0); }
  to   { transform: scaleY(1); }
}

/* Zinapoyali kirish: har element `--i` indeksiga qarab kechikadi.
   Inline style="--i:3" bilan ham, quyidagi nth-child bilan ham ishlaydi. */
.stagger > * {
  animation: rise var(--dur-slow) var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 45ms);
}

/* =====================================================================
   2. IKONKALAR
   ===================================================================== */
.icon {
  width: 1.15em;
  height: 1.15em;
  flex: none;
  vertical-align: -0.22em;
}
.icon--lg { width: 22px; height: 22px; }

/* =====================================================================
   3. TUZILMA — SHELL + SIDEBAR
   ===================================================================== */
.shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
}
.shell--bare { grid-template-columns: minmax(0, 1fr); }

/* --- Yon panel ---------------------------------------------------- */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 12px 12px;
  background: var(--surface-sunk);
  border-right: 1px solid var(--line);
  overflow-y: auto;
  z-index: 40;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 18px;
  font-weight: 650;
  font-size: var(--size-md);
  letter-spacing: var(--tracking-tight);
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Doira — logotipdagi halqa motivi: markaz identifikatori davra ichida. */
.brand__mark {
  width: 32px; height: 32px;
  flex: none;
  border-radius: 10px;
  background: linear-gradient(145deg, var(--accent), var(--accent-hover));
  color: var(--on-accent);
  display: grid; place-items: center;
  font-size: var(--size-sm);
  font-weight: 700;
  letter-spacing: 0;
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, .22);
}

/* Logotip tasvir sifatida: gradient kvadrat o'rniga haqiqiy belgi.
   Fon oq — belgi ikkala mavzuda ham bir xil o'qiladi. */
.brand__mark--img {
  display: block;
  background: #fff;
  padding: 3px;
  object-fit: contain;
  box-shadow: var(--shadow-sm);
}

.auth-brandpane__mark .brand__mark--img {
  background: rgba(255, 255, 255, .92);
  padding: 4px;
}

.sidebar__nav { display: flex; flex-direction: column; gap: 18px; flex: 1; }

.sidebar__group { display: flex; flex-direction: column; gap: 1px; }

.sidebar__group-title {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-faint);
  padding: 0 10px 6px;
}

.sidebar__link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-soft);
  text-decoration: none;
  font-size: var(--size-sm);
  font-weight: 500;
  white-space: nowrap;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
  animation: slide-right var(--dur-slow) var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 22ms);
}
.sidebar__link .icon { width: 17px; height: 17px; color: var(--text-faint); transition: color var(--dur) var(--ease); }
.sidebar__link:hover { background: var(--surface-hover); color: var(--text); }
.sidebar__link:hover .icon { color: var(--text-soft); }

.sidebar__link[aria-current="page"] {
  background: var(--surface-card);
  color: var(--accent);
  font-weight: 600;
  box-shadow: var(--shadow-xs);
}
.sidebar__link[aria-current="page"] .icon { color: var(--accent); }

/* Faol havolaning chap chiziq belgisi — o'sib chiqadi. */
.sidebar__link[aria-current="page"]::before {
  content: '';
  position: absolute;
  left: -12px; top: 50%;
  width: 3px; height: 20px;
  margin-top: -10px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
  transform-origin: center;
  animation: bar-grow var(--dur-slow) var(--ease-spring) both;
}

.sidebar__foot {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar__user {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px 10px;
  min-width: 0;
}
.sidebar__avatar {
  width: 30px; height: 30px; flex: none;
  border-radius: 50%;
  background: var(--accent-tint);
  color: var(--accent);
  display: grid; place-items: center;
  font-size: var(--size-xs); font-weight: 700;
}
.sidebar__user-name {
  font-size: var(--size-sm); font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar__user-role { font-size: var(--size-xs); color: var(--text-faint); }

/* --- Asosiy ustun -------------------------------------------------- */
.shell__main { display: flex; flex-direction: column; min-width: 0; }

/* --- Yuqori panel (sidebar bilan birga ishlaydi) -------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 10px;
  height: var(--topbar-h);
  padding: 0 clamp(16px, 3vw, 28px);
  background: var(--glass-bg-strong);
  backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  border-bottom: 1px solid var(--line);
}
.topbar__title {
  font-size: var(--size-sm);
  font-weight: 600;
  color: var(--text-soft);
  letter-spacing: var(--tracking-tight);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.topbar__spacer { margin-left: auto; }

/* Telefonda yon panelni ochadigan tugma */
.nav-toggle { display: none; }

/* Ikonka tugmasi — topbar uchun kvadrat, ikonkasi markazda */
.icon-btn {
  display: inline-grid; place-items: center;
  width: var(--control-h); height: var(--control-h);
  flex: none;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), transform var(--dur-fast) var(--ease);
}
.icon-btn:hover { background: var(--surface-hover); color: var(--text); }
.icon-btn:active { transform: scale(.94); }

/* Ctrl+K maslahati — topbarda qidiruv "maydoni" ko'rinishida */
.search-hint {
  display: inline-flex; align-items: center; gap: 8px;
  height: var(--control-h);
  padding: 0 10px 0 12px;
  min-width: 200px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-card);
  color: var(--text-faint);
  font: inherit;
  font-size: var(--size-sm);
  cursor: pointer;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), color var(--dur) var(--ease);
}
.search-hint:hover { border-color: var(--line-strong); color: var(--text-soft); box-shadow: var(--shadow-xs); }
.search-hint kbd {
  margin-left: auto;
  font: inherit; font-size: 11px;
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--surface-sunk);
  color: var(--text-faint);
}

/* --- Kontent ------------------------------------------------------- */
.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 26px clamp(16px, 3vw, 28px) 72px;
  animation: rise var(--dur-slow) var(--ease-out) both;
}

/* Sarlavha bloki — har sahifada bir xil joyda */
.row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--gap);
  flex-wrap: wrap;
}

h1 {
  font-size: var(--size-xl);
  font-weight: 700;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tighter);
  margin: 0 0 5px;
}
h2 {
  font-size: var(--size-lg);
  font-weight: 650;
  letter-spacing: var(--tracking-tight);
  margin: 30px 0 12px;
}
h3 { font-size: var(--size-md); font-weight: 600; letter-spacing: var(--tracking-tight); }

.sub { color: var(--text-soft); font-size: var(--size-sm); margin: 0 0 22px; }

/* Superadmin markaz nomidan kirgan (impersonate) holati */
.impersonate-bar {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; flex-wrap: wrap;
  background: linear-gradient(180deg, var(--warn-tint), var(--surface-card));
  color: var(--warn);
  padding: 9px 20px;
  text-align: center;
  font-size: var(--size-sm);
  font-weight: 500;
  border-bottom: 1px solid var(--line);
  animation: rise-sm var(--dur-slow) var(--ease-out) both;
}
.impersonate-bar .icon { vertical-align: -3px; }
.impersonate-bar form { display: inline; }

/* =====================================================================
   3b. KIRISH / OCHIQ SAHIFALAR
   Yon panelsiz: ekran markazida bitta karta. Tepada juda xira brend
   yog'dusi — toza oq fon "tugallanmagan" ko'rinmasin.
   ===================================================================== */
/* Ikki ustun: chapda forma, o'ngda brend paneli. Keng ekranda bitta
   kichik karta bo'm-bo'sh oq maydonda yolg'iz qolib ketmasin. */
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  background: var(--surface-page);
}
@media (min-width: 900px) {
  .auth-shell { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

.auth-pane {
  display: grid;
  place-items: center;
  padding: 44px 20px;
  background:
    radial-gradient(620px 360px at 50% -10%, var(--accent-tint), transparent 70%),
    var(--surface-page);
}
/* Grid elementi kontent kengligiga siqiladi — kenglik ANIQ shu yerda
   beriladi, aks holda karta ichidagi `100%` aylanma hisobga tushadi. */
.auth-pane > * { width: min(400px, 100%); }

.auth-card {
  width: 100%;
  background: var(--surface-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  padding: 30px;
  animation: rise var(--dur-slow) var(--ease-out) both;
}

/* --- Brend paneli (faqat keng ekranda) --- */
.auth-brandpane { display: none; }

@media (min-width: 900px) {
  .auth-brandpane {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 30px;
    padding: 56px clamp(40px, 5vw, 72px);
    background: linear-gradient(155deg, var(--accent), var(--accent-hover));
    color: var(--on-accent);
  }
  /* Yumshoq yorug'lik dog'lari — tekis to'ldirish yassi ko'rinmasin */
  .auth-brandpane::before,
  .auth-brandpane::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, .09);
    pointer-events: none;
  }
  .auth-brandpane::before { width: 420px; height: 420px; top: -150px; right: -130px; }
  .auth-brandpane::after  { width: 300px; height: 300px; bottom: -120px; left: -90px; }
}

.auth-brandpane > * { position: relative; z-index: 1; }

.auth-brandpane__mark {
  display: flex; align-items: center; gap: 12px;
  font-size: var(--size-lg);
  font-weight: 700;
  letter-spacing: var(--tracking-tight);
  animation: slide-right var(--dur-slow) var(--ease-out) both;
}
.auth-brandpane__mark .brand__mark {
  width: 40px; height: 40px;
  background: rgba(255, 255, 255, .2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3);
  font-size: var(--size-md);
}

.auth-brandpane__title {
  font-size: clamp(26px, 2.6vw, 36px);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: var(--tracking-tighter);
  max-width: 15ch;
  text-wrap: balance;
  animation: rise var(--dur-slow) var(--ease-out) 80ms both;
}
.auth-brandpane__sub {
  font-size: var(--size-md);
  opacity: .85;
  max-width: 34ch;
  margin-top: -14px;
  animation: rise var(--dur-slow) var(--ease-out) 140ms both;
}

.auth-feats { display: flex; flex-direction: column; gap: 13px; margin: 0; padding: 0; list-style: none; }
.auth-feat {
  display: flex; align-items: center; gap: 12px;
  font-size: var(--size-sm);
  font-weight: 500;
  animation: slide-right var(--dur-slow) var(--ease-out) both;
  animation-delay: calc(220ms + var(--i, 0) * 70ms);
}
.auth-feat__ic {
  width: 30px; height: 30px; flex: none;
  border-radius: 9px;
  background: rgba(255, 255, 255, .17);
  display: grid; place-items: center;
}
.auth-feat__ic .icon { width: 16px; height: 16px; }
.auth-card h1 { font-size: var(--size-lg); margin-bottom: 4px; }
.auth-card .sub { margin-bottom: 22px; }
.auth-card .btn { width: 100%; margin-top: 4px; }

.auth-brand {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 22px;
  font-weight: 650;
  font-size: var(--size-md);
  letter-spacing: var(--tracking-tight);
}

.auth-foot {
  margin-top: 18px;
  text-align: center;
  font-size: var(--size-xs);
  color: var(--text-faint);
  animation: fade-in var(--dur-slower) var(--ease) both;
  animation-delay: 160ms;
}

/* =====================================================================
   4. KARTALAR
   Oq yuza + hairline chegara + qatlamli soya. Shisha emas: oq fonda
   shaffoflik loyqa ko'rinadi, toza yuza esa premium.
   ===================================================================== */
.card {
  background: var(--surface-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 18px;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

/* Faqat interaktiv kartalar ko'tariladi. */
a.card:hover, button.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--line-strong);
}
a.card:active, button.card:active { transform: translateY(0); transition-duration: var(--dur-fast); }

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: var(--gap);
}
.stats .card { animation: rise var(--dur-slow) var(--ease-out) both; }
.stats .card:nth-child(1) { animation-delay: 0ms; }
.stats .card:nth-child(2) { animation-delay: 60ms; }
.stats .card:nth-child(3) { animation-delay: 120ms; }
.stats .card:nth-child(4) { animation-delay: 180ms; }
.stats .card:nth-child(5) { animation-delay: 240ms; }

.stat__label {
  display: flex; align-items: center; gap: 7px;
  font-size: var(--size-xs);
  font-weight: 500;
  color: var(--text-soft);
  margin-bottom: 8px;
}
.stat__label .icon { width: 15px; height: 15px; color: var(--text-faint); }
.stat__value {
  font-size: var(--size-2xl);
  font-weight: 700;
  letter-spacing: var(--tracking-tighter);
  line-height: 1.05;
  animation: pop-in var(--dur-slow) var(--ease-spring) both;
  animation-delay: 120ms;
}
.stat__value--bad { color: var(--bad); }

/* --- Rangli statistika nishonlari ---------------------------------
   Oq + ko'kdan tashqari: har karta doiraviy rangli belgi bilan boyitiladi.
   `.stats .card` ichida tartib bo'yicha aylanadi (nth-child), shuning
   uchun markuplarga qo'shimcha klass qo'shmasdan avtomatik ishlaydi. */
.stat__ic {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: grid; place-items: center;
  margin-bottom: 10px;
  transition: transform var(--dur) var(--ease);
}
.stat__ic .icon { width: 18px; height: 18px; }
a.card:hover .stat__ic, button.card:hover .stat__ic { transform: scale(1.08) rotate(-4deg); }

.stats .card:nth-child(4n+1) .stat__ic { background: var(--accent-tint);        color: var(--accent); }
.stats .card:nth-child(4n+2) .stat__ic { background: var(--brand-teal-tint);    color: var(--brand-teal); }
.stats .card:nth-child(4n+3) .stat__ic { background: var(--brand-violet-tint);  color: var(--brand-violet); }
.stats .card:nth-child(4n+4) .stat__ic { background: var(--brand-amber-tint);   color: var(--brand-amber); }

/* --- Xush kelibsiz banneri ------------------------------------------
   Yumshoq, kam to'yingan gradient — uzoq boqilganda ko'zni charchatmaydi.
   Qorong'i-quyuq burchaklar o'rniga ikki yaqin rang orasida silliq o'tish. */
.welcome-banner {
  position: relative;
  overflow: hidden;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 22px 26px;
  margin-bottom: 20px;
  border-radius: var(--radius-xl);
  background: linear-gradient(115deg, var(--brand-blue), var(--brand-teal-soft) 130%);
  color: #fff;
  box-shadow: var(--shadow-sm);
  animation: rise var(--dur-slow) var(--ease-out) both;
}
.welcome-banner::before, .welcome-banner::after {
  content: ''; position: absolute; border-radius: 50%; pointer-events: none;
  background: rgba(255,255,255,.08);
}
.welcome-banner::before { width: 220px; height: 220px; top: -120px; right: 30px; }
.welcome-banner::after  { width: 130px; height: 130px; bottom: -85px; right: 170px; background: rgba(255,255,255,.06); }
.welcome-banner__title  { font-size: var(--size-lg); font-weight: 700; margin: 0 0 3px; position: relative; z-index: 1; }
.welcome-banner__sub    { font-size: var(--size-sm); opacity: .88; margin: 0; position: relative; z-index: 1; }
.welcome-banner__ic     { position: relative; z-index: 1; width: 44px; height: 44px; flex: none; opacity: .85; }

/* =====================================================================
   5. JADVAL
   Zich ro'yxatlar karta emas, chegarali qator.
   ===================================================================== */
.data { width: 100%; border-collapse: collapse; }

.data th {
  text-align: left;
  font-size: var(--size-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-faint);
  padding: 0 var(--pad-x) 9px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.data td {
  height: var(--row-h);
  padding: 0 var(--pad-x);
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}

.data tbody tr {
  transition: background var(--dur-fast) var(--ease);
  animation: rise-sm var(--dur-slow) var(--ease-out) both;
}
.data tbody tr:hover { background: var(--surface-hover); }
.data tbody tr:nth-child(n+11) { animation: none; }
.data tbody tr:nth-child(1)  { animation-delay: 0ms; }
.data tbody tr:nth-child(2)  { animation-delay: 30ms; }
.data tbody tr:nth-child(3)  { animation-delay: 60ms; }
.data tbody tr:nth-child(4)  { animation-delay: 90ms; }
.data tbody tr:nth-child(5)  { animation-delay: 120ms; }
.data tbody tr:nth-child(6)  { animation-delay: 150ms; }
.data tbody tr:nth-child(7)  { animation-delay: 180ms; }
.data tbody tr:nth-child(8)  { animation-delay: 210ms; }
.data tbody tr:nth-child(9)  { animation-delay: 240ms; }
.data tbody tr:nth-child(10) { animation-delay: 270ms; }

.data a { color: var(--text); text-decoration: none; font-weight: 500; }
.data a:hover { color: var(--accent); }

.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Karta ichidagi jadval chetlarigacha cho'ziladi */
.card > .data { margin: 0 -18px; width: calc(100% + 36px); }
.card > .data th:first-child, .card > .data td:first-child { padding-left: 18px; }
.card > .data th:last-child,  .card > .data td:last-child  { padding-right: 18px; }
.card > .data tbody tr:last-child td { border-bottom: none; }

@media (max-width: 640px) {
  .data .hide-sm { display: none; }
}

/* =====================================================================
   6. HOLAT BELGILARI
   Faqat rangga tayanilmaydi: matn bor, nuqta shakli ham farq qiladi.
   ===================================================================== */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: var(--size-xs);
  font-weight: 600;
  white-space: nowrap;
  animation: pop-in var(--dur) var(--ease-spring) both;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.badge--ok   { background: var(--ok-tint);   color: var(--ok); }
.badge--warn { background: var(--warn-tint); color: var(--warn); }
.badge--bad  { background: var(--bad-tint);  color: var(--bad); }
.badge--info { background: var(--info-tint); color: var(--info); }
.badge--bad::before  { border-radius: 0; }      /* qarzdor: kvadrat nuqta */
.badge--warn::before { border-radius: 2px; }

.badge--icon::before { display: none; }
.badge--icon .icon { width: 13px; height: 13px; }

/* =====================================================================
   7. TUGMALAR
   ===================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: var(--control-h);
  padding: 0 15px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-card);
  color: var(--text);
  font: inherit;
  font-size: var(--size-sm);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease),
              transform var(--dur-fast) var(--ease), box-shadow var(--dur) var(--ease),
              border-color var(--dur) var(--ease);
}
.btn:hover { background: var(--surface-hover); border-color: var(--n-400); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.985); box-shadow: none; transition-duration: var(--dur-fast); }
.btn .icon { width: 16px; height: 16px; }

/* Sahifada bitta asosiy tugma. Accent shu yerda ishlaydi. */
.btn--primary {
  background: linear-gradient(180deg, rgba(255, 255, 255, .17), rgba(255, 255, 255, 0) 55%), var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, .2);
}
.btn--primary:hover {
  background: linear-gradient(180deg, rgba(255, 255, 255, .17), rgba(255, 255, 255, 0) 55%), var(--accent-hover);
  border-color: var(--accent-hover);
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, .2);
}

.btn--quiet { border-color: transparent; background: transparent; box-shadow: none; color: var(--text-soft); font-weight: 500; }
.btn--quiet:hover { background: var(--surface-hover); color: var(--text); border-color: transparent; box-shadow: none; }

.btn--danger { color: var(--bad); }
.btn--danger:hover { background: var(--bad-tint); border-color: var(--bad); color: var(--bad); }

.btn--sm { min-height: 30px; padding: 0 10px; font-size: var(--size-xs); }

/* =====================================================================
   8. MAYDONLAR
   ===================================================================== */
/* `type` atributi yozilmagan <input> ham matn maydoni — shuning uchun
   ro'yxat emas, istisno bo'yicha tanlanadi. Aks holda u brauzerning
   standart (tizim mavzusidagi) ko'rinishini oladi va oq yuzada qora
   quti bo'lib chiqadi. */
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="submit"]):not([type="button"]):not([type="hidden"]),
select, textarea {
  width: 100%;
  min-height: var(--control-h);
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-card);
  color: var(--text);
  font: inherit;
  font-size: var(--size-sm);
  box-shadow: var(--shadow-xs);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
input:hover:not(:disabled), select:hover:not(:disabled), textarea:hover:not(:disabled) { border-color: var(--n-400); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
textarea { padding: 10px 12px; line-height: var(--leading-body); min-height: 90px; }

select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 32px;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-faint) 50%),
                    linear-gradient(135deg, var(--text-faint) 50%, transparent 50%);
  background-position: calc(100% - 15px) center, calc(100% - 10px) center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

label { display: block; font-size: var(--size-sm); font-weight: 500; color: var(--text-soft); margin-bottom: 5px; }

.field { margin-bottom: 15px; }

.grid { display: flex; flex-direction: column; }
.cols { display: flex; gap: var(--gap); flex-wrap: wrap; align-items: flex-end; }
.cols > * { flex: 1; min-width: 150px; }
.cols > .field { margin-bottom: 0; }

.search { max-width: 380px; margin-bottom: 18px; }

.icon-field { position: relative; }
.icon-field .icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-faint); pointer-events: none;
}
.icon-field input { padding-left: 36px !important; }

/* =====================================================================
   9. DAVOMAT — tizimdagi eng ko'p ochiladigan ekran.
   ===================================================================== */
.att { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }

.att__row {
  display: flex; align-items: center; gap: var(--gap);
  min-height: max(var(--row-h), var(--tap-min));
  padding: 0 var(--pad-x);
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface-card);
  cursor: pointer;
  user-select: none;
  transition: background var(--dur-fast) var(--ease), box-shadow var(--dur) var(--ease);
  animation: rise-sm var(--dur-slow) var(--ease-out) both;
}
.att__row:hover { background: var(--surface-hover); }
.att__row.tap { animation: tap-pulse 200ms var(--ease); }

.att__row:nth-child(n+17) { animation: none; }
.att__row:nth-child(1)  { animation-delay: 0ms; }
.att__row:nth-child(2)  { animation-delay: 20ms; }
.att__row:nth-child(3)  { animation-delay: 40ms; }
.att__row:nth-child(4)  { animation-delay: 60ms; }
.att__row:nth-child(5)  { animation-delay: 80ms; }
.att__row:nth-child(6)  { animation-delay: 100ms; }
.att__row:nth-child(7)  { animation-delay: 120ms; }
.att__row:nth-child(8)  { animation-delay: 140ms; }
.att__row:nth-child(9)  { animation-delay: 160ms; }
.att__row:nth-child(10) { animation-delay: 180ms; }
.att__row:nth-child(11) { animation-delay: 200ms; }
.att__row:nth-child(12) { animation-delay: 220ms; }
.att__row:nth-child(13) { animation-delay: 240ms; }
.att__row:nth-child(14) { animation-delay: 260ms; }
.att__row:nth-child(15) { animation-delay: 280ms; }
.att__row:nth-child(16) { animation-delay: 300ms; }

.att__name { flex: 1; font-weight: 500; }

.att__state {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--size-sm);
  font-weight: 500;
  color: var(--text-faint);
  min-width: 82px;
  justify-content: flex-end;
}
.att__state .icon { width: 16px; height: 16px; }

/* Kelmagan: fon + matn + chap chegara. Uch signal, bittasi rang. */
.att__row[data-state="absent"] {
  background: var(--bad-tint);
  box-shadow: inset 3px 0 0 var(--bad);
}
.att__row[data-state="absent"] .att__state { color: var(--bad); }

.att__row[data-state="excused"] {
  background: var(--warn-tint);
  box-shadow: inset 3px 0 0 var(--warn);
}
.att__row[data-state="excused"] .att__state { color: var(--warn); }

/* Davomat qatoridagi tanga tugmalari — qator bosilishiga xalaqit
   bermasligi uchun o'z tegish maydoni bor. */
.att__coins { display: flex; gap: 5px; flex: none; }

.coin-btn {
  display: inline-flex; align-items: center; gap: 4px;
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-card);
  color: var(--text-soft);
  font: inherit;
  font-size: var(--size-xs);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease),
              border-color var(--dur) var(--ease), transform var(--dur-fast) var(--ease);
}
.coin-btn .icon { width: 14px; height: 14px; }
.coin-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); background: var(--accent-tint); }
.coin-btn:active:not(:disabled) { transform: scale(.93); }
.coin-btn.is-done {
  background: var(--ok-tint);
  border-color: var(--ok);
  color: var(--ok);
  cursor: default;
}
.coin-btn:disabled:not(.is-done) { opacity: .5; cursor: default; }

@media (max-width: 640px) {
  /* Telefonda ism va tugmalar sig'ishi uchun qator ikki qavat bo'ladi */
  .att__row { flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
  .att__name { flex: 1 1 100%; }
  .att__coins { order: 3; }
  .att__state { order: 2; margin-left: auto; }
  .coin-btn span { display: none; }
  .coin-btn { padding: 0 10px; }
}

.att__summary {
  display: flex; gap: 18px;
  padding: 14px var(--pad-x);
  font-size: var(--size-sm);
  color: var(--text-soft);
  font-variant-numeric: tabular-nums;
}

/* =====================================================================
   10. DARS JADVALI (haftalik to'r)
   ===================================================================== */
/* Kunlar ustun bo'lib turadi; joy yetmasa gorizontal siljish emas,
   keyingi qatorga o'raladi — jadval hech qachon kesilib qolmaydi. */
.timetable {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: var(--gap) 10px;
  align-items: start;
}
.timetable__day { display: flex; flex-direction: column; gap: 8px; min-width: 0; }

.timetable__head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 6px;
  padding: 0 4px 8px;
  border-bottom: 2px solid var(--line);
}
.timetable__day.is-today .timetable__head { border-bottom-color: var(--accent); }
.timetable__dayname { font-size: var(--size-sm); font-weight: 650; letter-spacing: var(--tracking-tight); }
.timetable__day.is-today .timetable__dayname { color: var(--accent); }
.timetable__count { font-size: var(--size-xs); color: var(--text-faint); font-variant-numeric: tabular-nums; }

.lesson-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--surface-card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  box-shadow: var(--shadow-xs);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
  animation: rise-sm var(--dur-slow) var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 30ms);
}
.lesson-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.lesson-card__time {
  font-size: var(--size-xs);
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  letter-spacing: var(--tracking-tight);
}
.lesson-card__name { font-size: var(--size-sm); font-weight: 600; margin: 2px 0 1px; }
.lesson-card__meta { font-size: var(--size-xs); color: var(--text-soft); display: flex; align-items: center; gap: 5px; }
.lesson-card__meta .icon { width: 13px; height: 13px; color: var(--text-faint); }

.timetable__empty {
  font-size: var(--size-xs);
  color: var(--text-faint);
  padding: 10px 4px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  text-align: center;
}

/* =====================================================================
   10b. TANGA DO'KONI (mukofotlar boshqaruvi)
   ===================================================================== */
.shop {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: var(--gap);
}

.shop-item {
  display: flex;
  flex-direction: column;
  background: var(--surface-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  animation: rise var(--dur-slow) var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 45ms);
}
.shop-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.shop-item.is-off { opacity: .58; }

.shop-item__media {
  aspect-ratio: 4 / 3;
  background: var(--surface-sunk);
  display: grid; place-items: center;
  border-bottom: 1px solid var(--line);
}
.shop-item__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shop-item__media .icon { width: 34px; height: 34px; color: var(--text-faint); }

.shop-item__body { padding: 13px 14px 14px; display: flex; flex-direction: column; gap: 7px; }
.shop-item__name { font-weight: 650; letter-spacing: var(--tracking-tight); }
.shop-item__price {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--size-lg); font-weight: 700;
  color: var(--accent);
  letter-spacing: var(--tracking-tighter);
}
.shop-item__price .icon { width: 17px; height: 17px; }
.shop-item__meta {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: var(--size-xs); color: var(--text-soft);
}
.shop-item__actions { display: flex; gap: 6px; }
.shop-item__actions form { flex: 1; }
.shop-item__actions form:last-child { flex: none; }
.shop-item__actions .btn { width: 100%; }

/* =====================================================================
   10c. VIKTORINA ("Kahoot" uslubidagi o'yin)
   To'rt variant — to'rt doimiy rang. Rang yolg'iz signal emas: har
   variantda harf (A/B/C/D) ham bor.
   ===================================================================== */
.quiz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: var(--gap); }

.quiz-stage { margin-bottom: 22px; }

.quiz-pin {
  font-size: clamp(48px, 11vw, 96px);
  font-weight: 800;
  letter-spacing: .14em;
  line-height: 1.05;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  animation: pop-in var(--dur-slow) var(--ease-spring) both;
}

.quiz-q {
  font-size: clamp(20px, 3.2vw, 34px);
  font-weight: 700;
  letter-spacing: var(--tracking-tighter);
  line-height: 1.25;
  margin-bottom: 20px;
  animation: rise var(--dur-slow) var(--ease-out) both;
}

.quiz-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; }
.quiz-opts--big { gap: 14px; }

.quiz-opt {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface-card);
  font-weight: 600;
  overflow: hidden;
  transition: opacity var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  animation: pop-in var(--dur-slow) var(--ease-spring) both;
}
.quiz-opts--big .quiz-opt { padding: 20px; font-size: var(--size-md); }

.quiz-opt__letter {
  width: 30px; height: 30px; flex: none;
  border-radius: 8px;
  display: grid; place-items: center;
  font-weight: 800;
  color: #fff;
}
.quiz-opt--a .quiz-opt__letter { background: #C8372D; }
.quiz-opt--b .quiz-opt__letter { background: #1668C4; }
.quiz-opt--c .quiz-opt__letter { background: #C8892D; }
.quiz-opt--d .quiz-opt__letter { background: #1F8A55; }

/* Mini App'da variant — bosiladigan tugma */
button.quiz-opt {
  width: 100%;
  font: inherit;
  font-weight: 600;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  min-height: var(--tap-min);
}
button.quiz-opt:not(:disabled):hover { box-shadow: var(--shadow-md); }
button.quiz-opt:not(:disabled):active { transform: scale(.985); }
button.quiz-opt:disabled { cursor: default; }

.quiz-opt.is-correct { border-color: var(--ok); box-shadow: inset 0 0 0 2px var(--ok); }
.quiz-opt.is-correct .icon { margin-left: auto; color: var(--ok); }
/* `opacity` emas `filter`: pop-in animatsiyasi opacity'ni oxirgi
   kadrda 1 ga qo'yadi va animatsiya kaskadda oddiy qoidadan ustun —
   shuning uchun xiralashtirish animatsiya tegmaydigan xususiyat bilan. */
.quiz-opt.is-dim { filter: opacity(.45); }

/* Javoblar taqsimoti ustuni — variant ichida, matn ostida */
.quiz-opt__bar {
  position: absolute; left: 0; bottom: 0;
  height: 22px;
  min-width: 26px;
  display: flex; align-items: center; justify-content: flex-end;
  padding-right: 7px;
  background: var(--accent-tint);
  color: var(--accent);
  font-size: var(--size-xs); font-weight: 700;
  border-top-right-radius: 6px;
  transition: width var(--dur-slow) var(--ease-out);
}

.quiz-meta {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-top: 18px;
}
.quiz-timer {
  font-size: var(--size-xl);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: var(--tracking-tighter);
}
.quiz-timer.is-low { color: var(--bad); }

.quiz-players { list-style: none; margin: 0; padding: 0; counter-reset: qp; }
.quiz-player {
  counter-increment: qp;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 2px;
  border-bottom: 1px solid var(--line-soft);
  animation: rise-sm var(--dur-slow) var(--ease-out) both;
}
.quiz-player:last-child { border-bottom: none; }
.quiz-player::before {
  content: counter(qp);
  width: 26px; height: 26px; flex: none;
  border-radius: 50%;
  background: var(--surface-sunk);
  color: var(--text-soft);
  display: grid; place-items: center;
  font-size: var(--size-xs); font-weight: 700;
}
.quiz-player.is-top::before { background: var(--accent); color: var(--on-accent); }
.quiz-player span { flex: 1; font-weight: 500; }
.quiz-player b { font-variant-numeric: tabular-nums; }

/* =====================================================================
   10d. TELEGRAM MINI APP
   Telefon uchun: bitta ustun, katta tegish maydonlari, jadval emas —
   qatorli ro'yxat. Barmoq bilan ishlanadi, sichqoncha bilan emas.
   ===================================================================== */

/* --- Sarlavha: kim, qayerda --- */
.ma-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.ma-avatar {
  width: 46px; height: 46px; flex: none;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--accent), var(--accent-hover));
  color: var(--on-accent);
  display: grid; place-items: center;
  font-size: var(--size-lg); font-weight: 700;
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.ma-head__box { min-width: 0; }
.ma-head__name {
  font-size: var(--size-lg); font-weight: 700;
  letter-spacing: var(--tracking-tight); line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ma-head__sub { font-size: var(--size-sm); color: var(--text-soft); }

/* --- Tanga kartasi: ekranning hissiy markazi --- */
.ma-hero {
  position: relative;
  overflow: hidden;
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  font: inherit;
  cursor: pointer;
  background: linear-gradient(140deg, var(--accent), var(--accent-hover));
  color: var(--on-accent);
  border-radius: var(--radius-xl);
  padding: 20px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-lg);
  animation: rise var(--dur-slow) var(--ease-out) both;
  transition: transform var(--dur-fast) var(--ease);
}
.ma-hero:active { transform: scale(.985); }
/* Yumshoq yorug'lik dog'i — tekis to'ldirish "yassi" ko'rinmasin */
.ma-hero::after {
  content: '';
  position: absolute;
  top: -55%; right: -22%;
  width: 190px; height: 190px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .13);
  pointer-events: none;
}
.ma-hero__label {
  display: flex; align-items: center; gap: 7px;
  font-size: var(--size-sm); font-weight: 500;
  opacity: .82;
  position: relative; z-index: 1;
}
.ma-hero__value, .ma-hero__rank { position: relative; z-index: 1; }
.ma-hero__value {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--size-3xl);
  font-weight: 800;
  letter-spacing: var(--tracking-tighter);
  line-height: 1.05;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}
/* Raqam yonidagi tanga — oq doira ichida, ko'zga darhol tashlansin */
.ma-hero__coin {
  width: 38px; height: 38px; flex: none;
  border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3);
}
.ma-hero__coin .icon { width: 21px; height: 21px; }
.ma-hero__rank {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 10px;
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .18);
  font-size: var(--size-xs); font-weight: 600;
}
.ma-hero__rank .icon { width: 14px; height: 14px; }

/* --- Ikki kichik ko'rsatkich yonma-yon --- */
.ma-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.ma-tile {
  display: flex; flex-direction: column; gap: 4px;
  text-align: left;
  font: inherit;
  color: var(--text);
  background: var(--surface-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 14px;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  animation: rise var(--dur-slow) var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 50ms);
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur) var(--ease);
}
.ma-tile:active { transform: scale(.98); }
.ma-tile__l {
  display: flex; align-items: center; gap: 6px;
  font-size: var(--size-xs); color: var(--text-soft); font-weight: 500;
}
.ma-tile__l .icon { width: 14px; height: 14px; color: var(--text-faint); }
.ma-tile__v {
  font-size: var(--size-xl); font-weight: 700;
  letter-spacing: var(--tracking-tighter); line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.ma-tile__v--bad { color: var(--bad); }

/* --- Amallar to'ri --- */
.ma-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ma-action {
  display: flex; align-items: center; gap: 11px;
  font: inherit; font-weight: 600; font-size: var(--size-sm);
  color: var(--text);
  text-align: left;
  background: var(--surface-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 14px;
  min-height: 58px;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  animation: rise-sm var(--dur-slow) var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 45ms);
  transition: transform var(--dur-fast) var(--ease), border-color var(--dur) var(--ease);
}
.ma-action:active { transform: scale(.98); }
.ma-action__ic {
  width: 34px; height: 34px; flex: none;
  border-radius: 10px;
  background: var(--accent-tint);
  color: var(--accent);
  display: grid; place-items: center;
}
.ma-action__ic .icon { width: 18px; height: 18px; }

/* --- Qatorli ro'yxat: jadval o'rniga --- */
.ma-list {
  list-style: none; margin: 0; padding: 0;
  background: var(--surface-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}
.ma-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
  min-height: var(--tap-min);
  animation: rise-sm var(--dur-slow) var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 28ms);
}
.ma-row:last-child { border-bottom: none; }
.ma-row__lead {
  flex: none;
  min-width: 42px;
  font-size: var(--size-xs);
  font-weight: 700;
  color: var(--text-soft);
  font-variant-numeric: tabular-nums;
}
.ma-row__main { flex: 1; min-width: 0; }
/* Ikkalasi ham <span> — alohida qatorga tushishi uchun block bo'lishi shart. */
.ma-row__t {
  display: block;
  font-size: var(--size-sm); font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ma-row__s { display: block; font-size: var(--size-xs); color: var(--text-soft); }
.ma-row__v {
  flex: none;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: var(--size-sm);
}
.ma-row__v--up   { color: var(--ok); }
.ma-row__v--down { color: var(--bad); }
.ma-row.is-me { background: var(--accent-tint); }
.ma-row.is-me .ma-row__t { color: var(--accent); }

/* Reytingdagi o'rin belgisi */
.ma-rank {
  width: 26px; height: 26px; flex: none;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: var(--size-xs); font-weight: 700;
  background: var(--surface-sunk);
  color: var(--text-soft);
  font-variant-numeric: tabular-nums;
}
.ma-rank--1 { background: #F2C230; color: #4A3708; }
.ma-rank--2 { background: #D3D8E0; color: #3E4450; }
.ma-rank--3 { background: #E0B183; color: #4B3117; }

/* --- Do'kon: ikki ustun --- */
.ma-shop { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ma-item {
  display: flex; flex-direction: column;
  background: var(--surface-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  animation: rise var(--dur-slow) var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 45ms);
}
.ma-item__media {
  aspect-ratio: 1 / 1;
  background: var(--surface-sunk);
  display: grid; place-items: center;
}
.ma-item__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ma-item__media .icon { width: 30px; height: 30px; color: var(--text-faint); }
.ma-item__body { padding: 11px 12px 12px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.ma-item__n {
  font-size: var(--size-sm); font-weight: 600; line-height: 1.3;
}
.ma-item__p {
  display: inline-flex; align-items: center; gap: 5px;
  font-weight: 700; color: var(--accent);
  font-variant-numeric: tabular-nums;
  margin-top: auto;
}
.ma-item__p .icon { width: 15px; height: 15px; }
.ma-item .btn { width: 100%; }

/* --- Ma'lumot juftliklari (profil) --- */
.ma-facts {
  background: var(--surface-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}
.ma-fact {
  display: flex; align-items: baseline; justify-content: space-between; gap: 14px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line-soft);
  font-size: var(--size-sm);
}
.ma-fact:last-child { border-bottom: none; }
.ma-fact__k { color: var(--text-soft); flex: none; }
.ma-fact__v { font-weight: 600; text-align: right; min-width: 0; overflow-wrap: anywhere; }

.ma-section {
  font-size: var(--size-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 22px 0 8px;
}

/* --- Segment almashtirgich (Guruh / Markaz) --- */
.ma-seg {
  display: flex;
  gap: 3px;
  padding: 3px;
  background: var(--surface-sunk);
  border-radius: 999px;
  margin-bottom: 14px;
}
.ma-seg button {
  flex: 1;
  font: inherit;
  font-size: var(--size-sm);
  font-weight: 600;
  padding: 8px 12px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.ma-seg button[aria-pressed="true"] {
  background: var(--surface-card);
  color: var(--accent);
  box-shadow: var(--shadow-xs);
}

/* =====================================================================
   10e. MINI APP — PASTKI NAVIGATSIYA (liquid glass)
   Ekranning pastida doimiy turadi, kontent ustidan suziladi. Shaffof +
   xiralashgan qatlam: ortidan ro'yxat o'tib turgani ko'rinadi, shu
   "shisha" tuyg'usini beradi.
   ===================================================================== */
.tg-app .container {
  /* Nav bar kontentni yopib qolmasin */
  padding-bottom: calc(86px + env(safe-area-inset-bottom, 0px));
}

.ma-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 60;
  display: flex;
  padding: 7px 8px calc(7px + env(safe-area-inset-bottom, 0px));

  background: var(--glass-bg);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  border-top: 1px solid var(--glass-border);
  box-shadow: 0 -8px 28px rgba(16, 24, 40, .07);

  animation: nav-in var(--dur-slower) var(--ease-out) both;
}
@keyframes nav-in {
  from { opacity: 0; transform: translateY(100%); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Faol elementning orqasida sirpanuvchi tabletka */
.ma-nav__ind {
  position: absolute;
  top: 7px;
  left: 0;
  height: 46px;
  border-radius: 14px;
  background: var(--accent-tint);
  transform: translateX(var(--x, 0)) scaleX(var(--s, 1));
  width: var(--w, 60px);
  transition: transform var(--dur-slow) var(--ease-spring), width var(--dur-slow) var(--ease-spring);
  pointer-events: none;
}
.ma-nav__ind.is-hidden { opacity: 0; }

.ma-nav__item {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 46px;
  min-width: 0;
  padding: 0 2px;
  border: none;
  background: none;
  font: inherit;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--text-faint);
  cursor: pointer;
  border-radius: 14px;
  -webkit-tap-highlight-color: transparent;
  transition: color var(--dur) var(--ease);
}
.ma-nav__item .icon {
  width: 21px; height: 21px;
  transition: transform var(--dur-slow) var(--ease-spring);
}
.ma-nav__item span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ma-nav__item[aria-current="page"] { color: var(--accent); }
/* Bosilganda ikonka sakraydi — tegish sezilsin */
.ma-nav__item[aria-current="page"] .icon { transform: translateY(-1px) scale(1.12); }
.ma-nav__item:active .icon { transform: scale(.88); transition-duration: var(--dur-fast); }

/* --- "Yana" paneli --- */
.ma-sheet {
  position: fixed;
  inset: 0;
  z-index: 70;
  visibility: hidden;
  transition: visibility 0s var(--dur-slow);
}
.ma-sheet.is-open { visibility: visible; transition-delay: 0s; }

.ma-sheet__bd {
  position: absolute; inset: 0;
  background: rgba(12, 16, 23, .38);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity var(--dur-slow) var(--ease);
}
.ma-sheet.is-open .ma-sheet__bd { opacity: 1; }

.ma-sheet__panel {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 10px 16px calc(20px + env(safe-area-inset-bottom, 0px));
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;

  background: var(--glass-bg-strong);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border-top: 1px solid var(--glass-border);
  box-shadow: 0 -16px 44px rgba(16, 24, 40, .16);

  transform: translateY(100%);
  transition: transform var(--dur-slow) var(--ease-out);
}
.ma-sheet.is-open .ma-sheet__panel { transform: translateY(0); }

.ma-sheet__grip {
  width: 38px; height: 4px;
  margin: 0 auto 14px;
  border-radius: 999px;
  background: var(--line-strong);
}

/* Panel ichidagi elementlar zinapoya bilan chiqadi */
.ma-sheet.is-open .ma-action {
  animation: rise-sm var(--dur-slow) var(--ease-out) both;
  animation-delay: calc(60ms + var(--i, 0) * 45ms);
}

/* =====================================================================
   10f. MINI APP — MUVAFFAQIYAT BELGISI
   Do'kondan mukofot olinganda: doira chiziladi, keyin ✔ chiziladi.
   Bir necha soniyadan keyin o'zi yo'qoladi.
   ===================================================================== */
.ma-ok {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  gap: 0;
  background: var(--glass-bg-strong);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  animation: fade-in var(--dur) var(--ease) both;
}
.ma-ok.is-out { animation: fade-in var(--dur-slow) var(--ease) reverse both; }

.ma-ok__box { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 24px; }

.ma-ok__svg { width: 96px; height: 96px; }
.ma-ok__circle {
  fill: none;
  stroke: var(--ok);
  stroke-width: 3;
  stroke-dasharray: 145;
  stroke-dashoffset: 145;
  animation: ok-ring 520ms var(--ease-out) forwards;
}
.ma-ok__check {
  fill: none;
  stroke: var(--ok);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 38;
  stroke-dashoffset: 38;
  animation: ok-check 340ms var(--ease-out) 380ms forwards;
}
@keyframes ok-ring  { to { stroke-dashoffset: 0; } }
@keyframes ok-check { to { stroke-dashoffset: 0; } }

.ma-ok__t {
  font-size: var(--size-xl);
  font-weight: 700;
  letter-spacing: var(--tracking-tighter);
  text-align: center;
  animation: rise var(--dur-slow) var(--ease-spring) 420ms both;
}
.ma-ok__s {
  font-size: var(--size-sm);
  color: var(--text-soft);
  text-align: center;
  animation: rise var(--dur-slow) var(--ease-spring) 520ms both;
}
.ma-ok__bal {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 15px;
  border-radius: 999px;
  background: var(--accent-tint);
  color: var(--accent);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  animation: pop-in var(--dur-slow) var(--ease-spring) 620ms both;
}
.ma-ok__bal .icon { width: 16px; height: 16px; }

/* Reduced-motion: chizilish o'rniga darhol to'liq ko'rinadi */
@media (prefers-reduced-motion: reduce) {
  .ma-ok__circle, .ma-ok__check { stroke-dashoffset: 0; }
}

/* =====================================================================
   10g. O'QUVCHI TANLAGICH (qo'lda tanga berish)
   ===================================================================== */
.picker {
  position: absolute;
  z-index: 20;
  left: 0; right: 0;
  margin-top: 4px;
  max-height: 260px;
  overflow-y: auto;
  background: var(--surface-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  animation: rise-sm var(--dur) var(--ease-out) both;
}
.picker__item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%;
  padding: 10px 13px;
  border: none;
  background: none;
  font: inherit;
  font-size: var(--size-sm);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  border-bottom: 1px solid var(--line-soft);
}
.picker__item:last-child { border-bottom: none; }
.picker__item:hover { background: var(--accent-tint); color: var(--accent); }
.picker__item b { font-variant-numeric: tabular-nums; color: var(--text-soft); flex: none; }
.picker__empty { padding: 12px 13px; font-size: var(--size-sm); color: var(--text-faint); }

.picked {
  display: flex; align-items: center; gap: 10px;
  margin-top: 8px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: var(--accent-tint);
  animation: pop-in var(--dur) var(--ease-spring) both;
}
.picked__name { font-weight: 650; color: var(--accent); flex: 1; }
.picked__bal {
  font-size: var(--size-xs); font-weight: 600; color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.pick-row { margin-left: 10px; vertical-align: middle; }

/* =====================================================================
   11. BO'SH HOLAT
   Taklif, uzr emas. Har bo'sh ekranda keyingi qadam tugmasi bor.
   ===================================================================== */
.empty { text-align: center; padding: 48px 20px; animation: rise var(--dur-slow) var(--ease-out) both; color: var(--text-soft); }
.empty .icon {
  width: 38px; height: 38px;
  color: var(--text-faint);
  margin-bottom: 12px;
}
.empty__title { font-weight: 650; color: var(--text); margin-bottom: 5px; }
.empty__text  { color: var(--text-soft); font-size: var(--size-sm); margin-bottom: 18px; }

/* Yuklanish skeleti */
.skeleton {
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--surface-sunk) 25%, var(--n-100) 37%, var(--surface-sunk) 63%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
  min-height: 14px;
}

/* =====================================================================
   12. BILDIRISHNOMA
   ===================================================================== */
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 14px) scale(.97); }
  to   { opacity: 1; transform: translate(-50%, 0) scale(1); }
}
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px;
  background: var(--surface-card);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xl);
  font-size: var(--size-sm);
  font-weight: 500;
  z-index: 50;
  animation: toast-in var(--dur-slow) var(--ease-spring);
}
.toast .icon { color: var(--ok); }
.toast code { font-size: var(--size-xs); color: var(--text-soft); }
.toast button { background: none; border: none; color: inherit; font: inherit; text-decoration: underline; cursor: pointer; }

/* =====================================================================
   13. CTRL+K QIDIRUV
   ===================================================================== */
@keyframes palette-in {
  from { opacity: 0; transform: scale(.96) translateY(-6px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.palette {
  position: fixed; inset: 0;
  background: rgba(12, 16, 23, .4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: grid; place-items: start center;
  padding-top: 12vh;
  z-index: 60;
  animation: fade-in var(--dur) var(--ease);
}
.palette__box {
  width: min(560px, 92vw);
  background: var(--surface-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  animation: palette-in var(--dur-slow) var(--ease-out);
}
.palette__input {
  border: none; border-bottom: 1px solid var(--line); border-radius: 0;
  min-height: 52px; background: transparent; box-shadow: none;
  font-size: var(--size-md);
}
.palette__input:focus { box-shadow: none; border-color: var(--line); }
.palette__input:focus-visible { box-shadow: none; }
.palette__list { list-style: none; margin: 0; padding: 7px; max-height: 340px; overflow-y: auto; }
.palette__item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 11px; border-radius: var(--radius-sm); cursor: pointer;
  transition: background var(--dur-fast) var(--ease);
}
.palette__item[aria-selected="true"] { background: var(--accent-tint); color: var(--accent); }

/* =====================================================================
   14. LIDLAR DOSKASI (Kanban)
   ===================================================================== */
.board { display: flex; gap: var(--gap); overflow-x: auto; padding-bottom: 12px; }
.board__col { flex: 0 0 272px; display: flex; flex-direction: column; gap: 10px; }
.board__col-head { display: flex; align-items: center; justify-content: space-between; padding: 0 2px 8px; border-bottom: 2px solid var(--line); }
.board__col-head h3 { margin: 0; font-size: var(--size-sm); font-weight: 650; }
.board__count {
  font-size: var(--size-xs); font-weight: 600; color: var(--text-soft);
  background: var(--surface-sunk); border-radius: 999px; padding: 2px 9px;
}
.board__col-body { display: flex; flex-direction: column; gap: 9px; min-height: 40px; }

.overdue-list { display: flex; flex-direction: column; gap: 9px; }

.lead-card {
  background: var(--surface-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 13px;
  box-shadow: var(--shadow-xs);
  display: flex; flex-direction: column; gap: 5px;
  transition: box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease), border-color var(--dur) var(--ease);
  animation: rise-sm var(--dur-slow) var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 30ms);
}
.lead-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--line-strong); }
.lead-card.is-overdue { box-shadow: inset 3px 0 0 var(--bad), var(--shadow-xs); }
.lead-card__name { font-weight: 650; }
.lead-card__meta {
  display: flex; align-items: center; gap: 5px;
  font-size: var(--size-xs); color: var(--text-soft);
}
.lead-card__next { font-size: var(--size-xs); display: flex; align-items: center; gap: 5px; color: var(--text-faint); }
.lead-card__next.is-overdue { color: var(--bad); font-weight: 600; }
.lead-card__actions { display: flex; gap: 6px; margin-top: 7px; flex-wrap: wrap; }
.lead-card__actions .btn { min-height: 30px; padding: 0 10px; font-size: var(--size-xs); width: auto; }

.lead-card details { width: 100%; }
.lead-card details[open] summary { margin-bottom: 8px; }
.lead-card details form { display: flex; gap: 6px; flex-wrap: wrap; }
.lead-card details input, .lead-card details select { min-height: 32px; flex: 1; min-width: 110px; }
.lead-card details .btn { flex: none; }

details.lead-disclosure summary,
.lead-card summary {
  cursor: pointer;
  list-style: none;
  display: inline-flex;
}
details.lead-disclosure summary::-webkit-details-marker,
.lead-card summary::-webkit-details-marker { display: none; }
details.lead-disclosure[open] > summary { margin-bottom: 4px; }

/* =====================================================================
   15. MOBIL — yon panel siljib chiquvchi panelga aylanadi
   ===================================================================== */
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }

  .nav-toggle { display: inline-grid; }

  .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: min(280px, 84vw);
    height: 100dvh;
    transform: translateX(-102%);
    transition: transform var(--dur-slow) var(--ease-out);
    box-shadow: var(--shadow-xl);
    background: var(--surface-card);
  }
  .shell.is-open .sidebar { transform: translateX(0); }

  .sidebar__backdrop {
    position: fixed; inset: 0;
    background: rgba(12, 16, 23, .38);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 35;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--dur-slow) var(--ease);
  }
  .shell.is-open .sidebar__backdrop { opacity: 1; pointer-events: auto; }

  .search-hint { min-width: 0; }
  .search-hint span, .search-hint kbd { display: none; }
}

@media (min-width: 901px) {
  .sidebar__backdrop { display: none; }
}

/* =====================================================================
   17. BAHOLAR JURNALI VA ESLATMA BLOKI
   ===================================================================== */

/* --- Eslatma (saqlandi / xato) --- */
.note {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-card);
  font-size: var(--size-sm); font-weight: 600;
  animation: rise-sm var(--dur) var(--ease-out) both;
}
.note .icon { flex: none; }
.note--ok   { border-color: var(--ok);   background: var(--ok-tint);   color: var(--ok); }
.note--warn { border-color: var(--warn); background: var(--warn-tint); color: var(--warn); }
.note--bad  { border-color: var(--bad);  background: var(--bad-tint);  color: var(--bad); }

/* --- Faqat ikonkali tugma --- */
.btn--icon { width: 36px; min-width: 36px; padding: 0; justify-content: center; }
.btn.is-off { opacity: .35; pointer-events: none; }

/* --- Jurnal joylashuvi: chapda kiritish, o'ngda tarix --- */
.gb {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 18px;
  align-items: start;
}

.gb__nav {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 16px;
}
.gb__nav input[type="date"] {
  width: auto; flex: 1 1 150px; min-width: 140px;
  font-weight: 650; cursor: pointer;
}

.gb__max {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px;
}
.gb__max label { margin: 0; font-size: var(--size-xs); color: var(--text-soft); white-space: nowrap; }
.gb__max input { width: 96px; text-align: center; }

/* Kiritilgan katak ko'zga tashlanib tursin — qaysi bola qolganini ko'rish uchun */
.gb__score {
  width: 84px !important;
  text-align: center; font-weight: 650;
  transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.gb__score.is-set {
  border-color: var(--ok) !important;
  background: var(--ok-tint) !important;
  color: var(--ok);
}

/* --- Tarix jadvali: ustunlar ko'payganda gorizontal aylanadi --- */
.gb__scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -18px; padding: 0 18px; }
.gb__grid { min-width: max-content; font-size: var(--size-xs); }
.gb__grid th, .gb__grid td { padding: 7px 10px; white-space: nowrap; }
.gb__grid th.num, .gb__grid td.num { text-align: center; }
.gb__name { position: sticky; left: 0; z-index: 1; background: var(--surface-card); text-align: left; font-weight: 600; }
.gb__max-label { display: block; font-size: 10px; font-weight: 400; opacity: .6; }
.gb__grid .is-now { background: var(--accent-tint); }
.gb__chip {
  display: inline-block; min-width: 30px; padding: 2px 8px;
  border-radius: 999px; background: var(--accent-tint); color: var(--accent);
  font-weight: 700;
}
.gb__none { color: var(--text-faint); }

@media (max-width: 900px) {
  .gb { grid-template-columns: minmax(0, 1fr); }
}

/* =====================================================================
   18. DAVOMAT VA BAHOLASH KARTOCHKALARI
   ===================================================================== */

.att__nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.att__nav input[type="date"] { width: auto !important; flex: 0 1 170px; font-weight: 650; cursor: pointer; }

.attg {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}

.attc {
  display: flex; flex-direction: column; gap: 12px;
  padding: 16px;
  background: var(--surface-card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  animation: rise-sm var(--dur) var(--ease-out) both;
}
.attc:hover { box-shadow: var(--shadow-sm); }

/* Chap chiziq holatni bir qarashda ko'rsatadi */
.attc[data-state="present"] { border-left-color: var(--ok); }
.attc[data-state="late"]    { border-left-color: var(--warn); }
.attc[data-state="absent"]  { border-left-color: var(--bad); }
.attc[data-state="excused"] { border-left-color: var(--accent); }

.attc__head { display: flex; align-items: center; gap: 10px; }
.attc__av {
  flex: none; width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent-tint); color: var(--accent);
  font-weight: 700; font-size: var(--size-sm);
}
.attc__who { min-width: 0; display: flex; flex-direction: column; }
.attc__who b { font-size: var(--size-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attc__who .sub { font-size: var(--size-xs); }
.attc__earned {
  margin-left: auto; flex: none;
  padding: 3px 9px; border-radius: 999px;
  background: var(--ok-tint); color: var(--ok);
  font-size: var(--size-xs); font-weight: 700;
}
.attc__earned.is-bad { background: var(--bad-tint); color: var(--bad); }

.attc__state {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  width: 100%; min-height: 38px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface-sunk); color: var(--text);
  font-size: var(--size-sm); font-weight: 650; cursor: pointer;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.attc[data-state="present"] .attc__state { background: var(--ok-tint);     color: var(--ok);     border-color: var(--ok); }
.attc[data-state="late"]    .attc__state { background: var(--warn-tint);   color: var(--warn);   border-color: var(--warn); }
.attc[data-state="absent"]  .attc__state { background: var(--bad-tint);    color: var(--bad);    border-color: var(--bad); }
.attc[data-state="excused"] .attc__state { background: var(--accent-tint); color: var(--accent); border-color: var(--accent); }

.attc__rate { display: flex; flex-direction: column; gap: 12px; }
.attc__rate[hidden] { display: none; }

.rate__head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.rate__head span { font-size: var(--size-xs); font-weight: 600; color: var(--text-soft); }
.rate__hint { font-size: 11px; color: var(--text-faint); font-weight: 600; }

.rate__scale { display: flex; gap: 5px; }
.rate__btn, .rate__sign {
  flex: 1 1 0; min-width: 0; height: 32px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface-card); color: var(--text-soft);
  font-size: var(--size-sm); font-weight: 700; cursor: pointer;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.rate__btn:hover, .rate__sign:hover { border-color: var(--line-strong); }
.rate__btn:active { transform: scale(.92); }
.rate__sign { flex: 0 0 34px; }
.rate__sign.is-on { background: var(--bad-tint); color: var(--bad); border-color: var(--bad); }
.rate__btn.is-on.is-good { background: var(--ok-tint);  color: var(--ok);  border-color: var(--ok); }
.rate__btn.is-on.is-bad  { background: var(--bad-tint); color: var(--bad); border-color: var(--bad); }

.attc__note { font-size: var(--size-xs) !important; min-height: 34px !important; }

@media (max-width: 520px) {
  .attg { grid-template-columns: minmax(0, 1fr); }
}

/* --- Tezkor miqdor tugmalari (tanga berish) --- */
.quick { display: flex; gap: 8px; flex-wrap: wrap; }
.quick__btn {
  min-height: 34px; padding: 0 13px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface-card); color: var(--text-soft);
  font-size: var(--size-xs); font-weight: 700; cursor: pointer;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.quick__btn:hover { border-color: var(--line-strong); }
.quick__btn:active { transform: scale(.94); }
.quick__btn.is-on { background: var(--accent-tint); color: var(--accent); border-color: var(--accent); }
.quick__btn.is-bad.is-on { background: var(--bad-tint); color: var(--bad); border-color: var(--bad); }

/* --- Oylik reyting --- */
.board { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.board__row {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.board__row:last-child { border-bottom: 0; }
.board__rank {
  flex: none; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface-sunk); color: var(--text-soft);
  font-size: var(--size-xs); font-weight: 700;
}
.board__rank.is-top { background: var(--accent); color: var(--text-on); }
.board__name { flex: 1 1 auto; min-width: 0; font-size: var(--size-sm); font-weight: 600; }
.board__pts { flex: none; font-size: var(--size-sm); font-weight: 700; color: var(--ok); }
.board__pts.is-bad { color: var(--bad); }

/* =====================================================================
   19. O'QUVCHILAR: RO'YXAT VA KARTOCHKA
   ===================================================================== */

/* --- Ro'yxat --- */
.tscroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.stu { min-width: 760px; }
.stu td, .stu th { padding: 11px 14px; }

.stu__who { display: flex; align-items: center; gap: 10px; }
.stu__av {
  flex: none; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent-tint); color: var(--accent);
  font-weight: 700; font-size: var(--size-xs);
}
.stu__who .sub { font-size: var(--size-xs); }

.pager {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px; border-top: 1px solid var(--line);
}

/* --- Kartochka: ikki ustun --- */
.sv {
  display: grid;
  grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.sv__side, .sv__main { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

.sv__head {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding-bottom: 16px; margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
  text-align: center;
}
.sv__av {
  width: 56px; height: 56px; border-radius: 50%;
  display: grid; place-items: center; margin-bottom: 6px;
  background: var(--accent-tint); color: var(--accent);
  font-size: 22px; font-weight: 700;
}
.sv__head b { font-size: var(--size-md); overflow-wrap: anywhere; }
.sv__acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.sv__acts .btn { width: auto; }

/* --- Ta'rif ro'yxati --- */
.dl { margin: 0; display: flex; flex-direction: column; }
.dl > div {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 8px 0; border-bottom: 1px solid var(--line);
}
.dl > div:last-child { border-bottom: 0; }
.dl dt { margin: 0; font-size: var(--size-xs); color: var(--text-soft); }
.dl dd { margin: 0; font-size: var(--size-sm); text-align: right; }

/* --- Tanga hamyoni --- */
.wallet {
  padding: 18px; border-radius: var(--radius);
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: var(--text-on);
}
.wallet__lbl { font-size: var(--size-xs); font-weight: 700; opacity: .85; }
.wallet__amt { font-size: 30px; font-weight: 800; line-height: 1.1; margin: 4px 0 12px; }
.wallet__amt small { font-size: 15px; font-weight: 600; opacity: .8; }
.wallet__row { display: flex; gap: 20px; }
.wallet__row div { display: flex; flex-direction: column; }
.wallet__row b { font-size: var(--size-md); font-weight: 700; }
.wallet__row span { font-size: 11px; opacity: .8; }

.wallet__give { display: flex; gap: 8px; margin-top: 14px; }
.wallet__give input { min-height: 34px !important; font-size: var(--size-xs) !important; }

/* --- Tanga tranzaksiyasi qatori --- */
.ctx { display: flex; align-items: center; gap: 10px; padding: 7px 0; }
.ctx__ic {
  flex: none; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 800; font-size: var(--size-sm);
}
.ctx__ic.is-up   { background: var(--ok-tint);  color: var(--ok); }
.ctx__ic.is-down { background: var(--bad-tint); color: var(--bad); }
.ctx__body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.ctx__lbl  { font-size: var(--size-xs); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctx__date { font-size: 11px; color: var(--text-faint); }
.ctx__amt  { flex: none; font-size: var(--size-sm); font-weight: 700; }
.ctx__amt.is-up   { color: var(--ok); }
.ctx__amt.is-down { color: var(--bad); }

/* --- Yozilgan guruhlar --- */
.enr { display: flex; flex-direction: column; }
.enr__row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.enr__row:last-child { border-bottom: 0; }
.enr__row .sub { font-size: var(--size-xs); }

/* --- Ball chizig'i --- */
.scorebar {
  display: inline-block; vertical-align: middle;
  width: 54px; height: 5px; margin-right: 7px;
  border-radius: 999px; background: var(--surface-sunk); overflow: hidden;
}
.scorebar span { display: block; height: 100%; border-radius: 999px; background: var(--ok); }

@media (max-width: 900px) {
  .sv { grid-template-columns: minmax(0, 1fr); }
}

/* --- Reyting medallari va chegirma formasi --- */
.board__medal { flex: none; width: 26px; text-align: center; font-size: 17px; line-height: 1; }
.feeform { display: flex; gap: 5px; justify-content: flex-end; margin-bottom: 5px; }
.feeform input {
  width: 96px !important; min-height: 28px !important;
  font-size: 11px !important; text-align: right;
}
.feeform .btn { min-height: 28px; padding: 0 8px; }

/* --- Do'kon: emoji va tavsif --- */
.shop-item__desc {
  font-size: var(--size-xs); color: var(--text-soft);
  margin-top: 2px; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* --- Dashboard: pastki ikki ustun --- */
.dash2 {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px; margin-top: 24px;
}
.dash2 .ctx__lbl { color: var(--text); text-decoration: none; }
.dash2 .ctx__lbl:hover { color: var(--accent); }

/* --- Kartochkadagi davomat xulosasi --- */
.attsum { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.attsum__head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 6px; font-size: var(--size-xs); color: var(--text-soft);
}
.attsum__head b { font-size: var(--size-md); }
.attsum__head b.is-ok   { color: var(--ok); }
.attsum__head b.is-warn { color: var(--warn); }
.attsum__head b.is-bad  { color: var(--bad); }
.attsum .scorebar { height: 7px; margin: 0 0 8px; }

.attsum__legend {
  display: flex; flex-wrap: wrap; gap: 4px 12px;
  font-size: 11px; color: var(--text-faint);
}

/* Oxirgi 30 kun — har dars bitta nuqta */
.attdots { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 10px; }
.attdot { width: 9px; height: 9px; border-radius: 2px; background: var(--surface-sunk); }
.attdot.is-present { background: var(--ok); }
.attdot.is-late    { background: var(--warn); }
.attdot.is-absent  { background: var(--bad); }
.attdot.is-excused { background: var(--accent); }

/* --- Guruh kartochkalari --- */
.grps { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.grp {
  display: flex; flex-direction: column;
  padding: 16px; background: var(--surface-card);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
  animation: rise-sm var(--dur) var(--ease-out) both;
}
.grp:hover { box-shadow: var(--shadow-sm); border-color: var(--line-strong); }
.grp__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.grp__head b { font-size: var(--size-md); }
.grp__head .sub { font-size: var(--size-xs); }
.grp__count {
  flex: none; padding: 3px 10px; border-radius: 999px;
  background: var(--accent-tint); color: var(--accent);
  font-size: var(--size-xs); font-weight: 700;
}
.grp .scorebar { height: 5px; }
.grp__dl { flex: 1 1 auto; margin-bottom: 12px; }
.grp__dl > div { padding: 6px 0; }
.grp__acts { display: flex; gap: 6px; }
.grp__acts .btn { width: auto; flex: 0 0 auto; }
.grp__acts .btn--primary { flex: 1 1 auto; }

/* --- To'lov doskasi filtrlari --- */
.payf { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.payf select { width: auto !important; min-width: 150px; }
.payf .icon-field { margin: 0; }

/* --- Kartochkadagi to'lov formasi --- */
.payform { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.payform .field { flex: 0 1 140px; }
.payform .btn { flex: none; }

/* --- Medal ikonkasi: o'rin bo'yicha rang (tizim emojisi emas) --- */
.board__medal { flex: none; width: 26px; display: grid; place-items: center; }
.board__medal .icon { width: 20px; height: 20px; }
.board__medal.is-1 { color: #D9A406; }   /* oltin */
.board__medal.is-2 { color: #9AA3AF; }   /* kumush */
.board__medal.is-3 { color: #B4702F; }   /* bronza */

/* Tanga ikonkasi matn ichida — raqam bilan bir tekisda tursin */
.icon { vertical-align: -0.14em; }
.shop-item__emoji .icon { width: 40px; height: 40px; color: var(--text-faint); }

/* --- Tanga berish sahifasi --- */
.give { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.give .ctx__lbl { color: var(--text); text-decoration: none; }
.give .ctx__lbl:hover { color: var(--accent); }

/* Davomat tanlash kartochkasi havola bo'lgani uchun matn rangi meros olinsin */
a.grp { text-decoration: none; color: inherit; }

@media (max-width: 900px) {
  .give { grid-template-columns: minmax(0, 1fr); }
}

/* =====================================================================
   16. BOSMA
   ===================================================================== */
@media print {
  .sidebar, .topbar, .btn, .search, .impersonate-bar { display: none !important; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .container { max-width: none; padding: 0; animation: none; }
  .card { background: #fff; box-shadow: none; border-color: #ccc; }
  .data td, .data th { border-color: #999; }
  * { animation: none !important; }
}

/* =====================================================================
   SANDIQ (til o'yini mukofoti)

   To'g'ri javobdan keyin uchta sandiq chiqadi. Tanlash faqat vizual —
   mukofot serverda aniqlanadi, shuning uchun bu yerdagi hamma narsa
   dramaturgiya: silkinish, ochilish, raqamning o'sishi.
   ===================================================================== */
.chest-stage { text-align: center; padding: 8px 0 4px; }

.chest-stage__title {
  font-size: var(--size-lg);
  font-weight: 800;
  letter-spacing: var(--tracking-tighter);
  margin: 0 0 4px;
}
.chest-stage__sub { color: var(--text-soft); margin: 0 0 22px; font-size: var(--size-sm); }

.chests {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 460px;
  margin: 0 auto;
}

.chest {
  position: relative;
  aspect-ratio: 1 / 1.08;
  border: 0;
  padding: 0;
  border-radius: var(--radius-lg, 16px);
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(255, 255, 255, .18), transparent 60%),
    linear-gradient(160deg, #3A2A18, #241708);
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, .14);
  cursor: pointer;
  overflow: hidden;
  display: grid;
  place-items: center;
  /* Kirish: bittalab sakrab chiqadi. */
  animation: pop-in var(--dur-slow) var(--ease-spring) both;
  animation-delay: calc(var(--i, 0) * 90ms);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.chest:nth-child(1) { --i: 0; }
.chest:nth-child(2) { --i: 1; }
.chest:nth-child(3) { --i: 2; }

.chest:not(:disabled):hover { transform: translateY(-4px); box-shadow: var(--shadow-lg, 0 14px 32px rgba(0,0,0,.28)); }
.chest:not(:disabled):active { transform: translateY(-1px) scale(.98); }
.chest:disabled { cursor: default; }

.chest svg { width: 58%; height: auto; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .45)); }

/* Yaltirash — sandiq ustidan o'tadigan yorug'lik chizig'i */
.chest::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, .34) 50%, transparent 62%);
  transform: translateX(-120%);
  animation: chest-shine 3.2s var(--ease-out) infinite;
  animation-delay: calc(var(--i, 0) * 420ms);
  pointer-events: none;
}

@keyframes chest-shine {
  0%, 62% { transform: translateX(-120%); }
  86%, 100% { transform: translateX(120%); }
}

/* Tanlangan sandiq: avval titraydi, keyin qopqoq ochiladi */
.chest.is-picked { animation: chest-shake 480ms var(--ease) both; }
.chest.is-picked .chest__lid { animation: chest-open 620ms 420ms var(--ease-spring) both; }
.chest.is-picked::after { animation: none; opacity: 0; }

.chest.is-other { animation: chest-fade 380ms var(--ease-out) both; }

@keyframes chest-shake {
  0%, 100% { transform: rotate(0); }
  15% { transform: rotate(-5deg); }
  35% { transform: rotate(5deg); }
  55% { transform: rotate(-4deg); }
  75% { transform: rotate(3deg); }
}

@keyframes chest-open {
  to { transform: translateY(-46%) rotate(-24deg); opacity: .92; }
}

@keyframes chest-fade {
  to { opacity: .25; transform: scale(.9); filter: grayscale(1); }
}

.chest__lid { transform-origin: 18% 78%; transition: none; }

/* --- Mukofot kartasi ------------------------------------------------ */
.prize {
  max-width: 460px;
  margin: 0 auto;
  text-align: center;
  padding: 26px 20px;
  border-radius: var(--radius-lg, 16px);
  animation: pop-in var(--dur-slow) var(--ease-spring) both;
}
.prize--steal { background: linear-gradient(155deg, #4A1420, #2A0B12); }
.prize--boost { background: linear-gradient(155deg, #123A2A, #08201A); }
.prize--flat  { background: linear-gradient(155deg, #1B3350, #0C1B2E); }

.prize__kind {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  font-size: var(--size-xs);
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.prize__amount {
  font-size: clamp(40px, 12vw, 64px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: var(--tracking-tighter);
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.prize__amount small { font-size: .42em; font-weight: 700; opacity: .7; margin-left: 4px; }

.prize__note { color: rgba(255, 255, 255, .72); margin: 12px 0 0; font-size: var(--size-sm); line-height: 1.5; }
.prize__note b { color: #fff; }

/* --- Jonli lenta (host ekrani) -------------------------------------- */
.feed { list-style: none; margin: 0; padding: 0; }
.feed__row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 2px;
  border-bottom: 1px solid var(--line-soft);
  font-size: var(--size-sm);
  animation: rise-sm var(--dur-slow) var(--ease-out) both;
}
.feed__row:last-child { border-bottom: none; }
.feed__tag {
  flex: none;
  min-width: 68px;
  text-align: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: var(--size-xs);
  font-weight: 700;
  color: #fff;
}
.feed__tag--steal { background: #B03A50; }
.feed__tag--boost { background: #1F8A55; }
.feed__tag--flat  { background: #2C6BB0; }
.feed__row span { flex: 1; color: var(--text-soft); }
.feed__row b { color: var(--text); }
.feed__amt { font-weight: 800; font-variant-numeric: tabular-nums; color: var(--ok); }

/* --- Host ekrani: katta PIN va ustunlar ------------------------------ */
.hostgrid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: var(--gap);
  align-items: start;
}
@media (max-width: 860px) { .hostgrid { grid-template-columns: 1fr; } }

.pincard {
  text-align: center;
  padding: 26px 20px;
  background:
    radial-gradient(130% 100% at 50% 0%, var(--accent-tint), transparent 70%),
    var(--surface-card);
}
.pincard__label {
  font-size: var(--size-xs);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 0 0 8px;
}
.pincard__pin {
  font-size: clamp(40px, 9vw, 72px);
  font-weight: 800;
  letter-spacing: .12em;
  line-height: 1.05;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.pincard__hint { color: var(--text-soft); font-size: var(--size-sm); margin: 10px 0 0; }

.hoststat {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line-soft);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 16px;
}
.hoststat > div { background: var(--surface-card); padding: 12px 8px; text-align: center; }
.hoststat dt { font-size: var(--size-xs); color: var(--text-faint); margin-bottom: 3px; }
.hoststat dd { margin: 0; font-size: var(--size-lg); font-weight: 800; font-variant-numeric: tabular-nums; }