/* Ichki sahifalar uslubi. Ranglar bosh sahifa (bosh.css) bilan bir oiladan: ko'k siyoh, to'q yashil doska, sariq bo'r;
   bu yerda ular sokinroq: nuqtali fon, ingichka chegaralar, yumshoq soyalar. Sarlavha — Unbounded, matn — Onest. */
@import url("https://fonts.googleapis.com/css2?family=Onest:wght@400..700&family=Unbounded:wght@700;800&display=swap");
:root {
  --bg: #f6f7fb;
  --grid: #dde2ee;
  --fg: #111c44;
  --muted: #5b6788;
  --card: #ffffff;
  --border: #e4e8f2;
  --accent: #1e3a8a;
  --accent-2: var(--accent);
  --amber: #f59e0b;
  --danger: #dc2626;
  --soft: #eef1fb;
  --soft-2: #fff4e0;
  --surface-2: #f1f3fa;
  --ok: #15803d;
  --on-accent: #fff;
  --ok-bg: #dcfce7;
  --warn: #b45309;
  --warn-bg: #fef3c7;
  --side: #0f2a20;
  --side-fg: #cfdcd3;
  --side-muted: #7f9a8b;
  --side-hover: rgba(255, 255, 255, 0.06);
  --sun: #ffc93c;
  --paper: radial-gradient(circle, var(--grid) 1px, transparent 1.5px) 0 0 / 22px 22px, var(--bg);
  --chalkboard: radial-gradient(90% 60% at 15% 0%, #1f4d3a, var(--side) 75%);
  --shadow: 0 1px 1px rgba(17, 28, 68, 0.04), 0 2px 4px rgba(17, 28, 68, 0.04), 0 14px 28px -10px rgba(17, 28, 68, 0.1);
  --radius: 16px;
  --display: "Unbounded", "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, sans-serif;
  --text: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a1020; --fg: #e3e9fb; --muted: #94a2c7; --card: #111a30; --border: #1f2a47; --grid: #18223c;
    --accent: #a9bfff; --soft: #18233f; --soft-2: #2a2213; --surface-2: #151f38; --ok: #4ade80; --ok-bg: #12301f;
    --warn: #fbbf24; --warn-bg: #33280f; --danger: #f87171; --side: #0a1c15; --on-accent: #0a1020;
    --shadow: 0 1px 1px rgba(0, 0, 0, 0.3), 0 16px 32px -12px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a1020; --fg: #e3e9fb; --muted: #94a2c7; --card: #111a30; --border: #1f2a47; --grid: #18223c;
  --accent: #a9bfff; --soft: #18233f; --soft-2: #2a2213; --surface-2: #151f38; --ok: #4ade80; --ok-bg: #12301f;
  --warn: #fbbf24; --warn-bg: #33280f; --danger: #f87171; --side: #0a1c15; --on-accent: #0a1020;
  --shadow: 0 1px 1px rgba(0, 0, 0, 0.3), 0 16px 32px -12px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body.app {
  font-family: var(--text);
  -webkit-font-smoothing: antialiased;
  background: var(--paper);
  color: var(--fg);
  line-height: 1.5;
  display: grid;
  grid-template-columns: 256px minmax(0, 1fr);
  min-height: 100vh;
}
[hidden] { display: none !important; }
h1 { font-family: var(--display); letter-spacing: -0.02em; line-height: 1.15; }
/* Unbounded faqat sahifa sarlavhasida; karta ichidagi sarlavhalar matn shriftida — sokinroq */
h2, h3 { font-family: inherit; font-weight: 700; letter-spacing: -0.01em; line-height: 1.25; }
a { color: var(--accent); }
.ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* Yon menyu */
.side {
  position: sticky; top: 0; height: 100vh;
  background: var(--chalkboard); color: var(--side-fg); box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.06);
  display: flex; flex-direction: column; padding: 18px 14px;
}
.side-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; color: #fff; text-decoration: none; font-family: var(--display); font-weight: 800; line-height: 1.2; }
.side-brand img { flex: none; }
.side-head { display: flex; align-items: flex-start; gap: 6px; }
.side-head .side-brand { flex: 1; min-width: 0; }
.side-toggle { flex: none; width: 30px; height: 30px; margin-top: 4px; display: grid; place-items: center; border-radius: 8px; border: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent; color: var(--side-muted); cursor: pointer; transition: .15s; }
.side-toggle:hover { color: #fff; border-color: rgba(255, 255, 255, 0.3); background: var(--side-hover); }
.side-toggle .ico { width: 16px; height: 16px; transition: transform .2s; }
/* yig'ilgan menyu: faqat ikonkalar, nomi — sichqoncha ustiga borganda (title) */
@media (min-width: 761px) {
  html.side-mini body.app { grid-template-columns: 76px minmax(0, 1fr); }
  html.side-mini .side { padding: 18px 10px; }
  html.side-mini .side-head { flex-direction: column; align-items: center; gap: 10px; padding-bottom: 14px; }
  html.side-mini .side-brand { padding: 4px 0 0; justify-content: center; flex: none; }
  html.side-mini .side-brand span,
  html.side-mini .nav-item span,
  html.side-mini .side-user .who,
  html.side-mini .logout-btn span { display: none; }
  html.side-mini .side-toggle .ico { transform: rotate(180deg); }
  html.side-mini .nav-item { justify-content: center; padding: 11px 0; }
  html.side-mini .side-user { flex-direction: column; padding: 12px 0 0; }
  html.side-mini .logout-btn { padding: 9px 0; }
}
.side-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.side-label { margin: 14px 10px 6px; font-size: 0.72em; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--side-muted); }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px;
  color: var(--side-fg); text-decoration: none; font-weight: 500; transition: background-color .15s, color .15s;
}
.nav-item:hover { background: var(--side-hover); color: #fff; }
.nav-item[aria-current="page"] { position: relative; background: rgba(255, 255, 255, 0.09); color: #fff; font-weight: 600; }
.side .nav-item[aria-current="page"]::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--sun); }
.side .nav-item[aria-current="page"] .ico { color: var(--sun); }
.nav-item.soon { opacity: 0.55; pointer-events: none; }
.nav-item .pill-soon { margin-left: auto; font-size: 0.68em; font-weight: 800; padding: 2px 7px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); }

.side-user { display: flex; align-items: center; gap: 10px; padding: 12px 8px 0; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.side-user .who { flex: 1; min-width: 0; line-height: 1.3; }
.side-user strong { display: block; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user small { color: var(--side-muted); }
.side-btn {
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px;
  background: transparent; border: 1px solid rgba(255, 255, 255, 0.12); color: var(--side-fg); cursor: pointer;
}
.side-btn:hover { color: #fff; border-color: rgba(255, 255, 255, 0.3); }
.logout-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 10px; padding: 9px 12px; border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12); background: transparent; color: #f0cfcf; font: inherit; font-weight: 600; cursor: pointer; transition: background-color .15s, border-color .15s; }
.logout-btn:hover { background: rgba(248, 113, 113, 0.18); border-color: rgba(248, 113, 113, 0.5); color: #fff; }
.logout-btn .ico { width: 17px; height: 17px; }
.logout-item { width: 100%; border: 0; background: transparent; font: inherit; cursor: pointer; text-align: left; color: var(--danger) !important; }
.side-btn .ico { width: 17px; height: 17px; }

/* Asosiy qism */
.main { min-width: 0; display: flex; flex-direction: column; }
.mtop { display: none; }
.content { width: 100%; max-width: 1120px; margin: 0 auto; padding: 36px 40px 56px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.page-head h1 { margin: 0; font-size: clamp(1.6rem, 2.4vw, 2.1rem); }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.eyebrow { margin: 0 0 6px; font-size: 0.88em; font-weight: 600; color: var(--muted); }

.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.card h2 { margin: 0 0 14px; font-size: 1.08em; display: flex; align-items: center; gap: 8px; }
.card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.card-head h2 { margin: 0; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.stack { display: grid; gap: 16px; }

/* Ko'rsatkichlar */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-bottom: 20px; }
.stat {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px;
  box-shadow: var(--shadow); display: flex; gap: 14px; align-items: center;
}
.stat .si { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; flex: none; }
.stat strong { display: block; font-family: var(--display); font-size: 1.6em; line-height: 1.15; letter-spacing: -0.02em; }
.stat span { color: var(--muted); font-size: 0.9em; }
.stat { transition: box-shadow 0.15s, transform 0.15s; }
.stat:hover { box-shadow: var(--shadow), 0 10px 28px -10px rgba(17, 28, 68, 0.18); transform: translateY(-2px); }
.t1 { color: #2563eb; background: rgba(37, 99, 235, 0.12); }
.t2 { color: #d97706; background: rgba(245, 158, 11, 0.15); }
.t3 { color: #7c3aed; background: rgba(124, 58, 237, 0.13); }
.t4 { color: #059669; background: rgba(5, 150, 105, 0.13); }
.t5 { color: #db2777; background: rgba(219, 39, 119, 0.12); }

.hello {
  border-radius: 20px; border: 1px solid rgba(255, 201, 60, 0.35); padding: 30px 32px; margin-bottom: 20px; color: #f4f1e8;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.07) 1px, transparent 1.5px) 0 0 / 22px 22px, var(--chalkboard);
  box-shadow: 0 24px 48px -22px rgba(15, 42, 32, 0.6);
}
.hello h1 { margin: 0 0 6px; font-size: clamp(1.4rem, 2.6vw, 1.9rem); }
.hello p { margin: 0; color: var(--side-fg); }
.hello .actions { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 10px; }

/* Bosh sahifa: tez boshlash (dashboard.js) */
.quick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.quick-item {
  display: flex; align-items: center; gap: 14px; padding: 16px 18px; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); color: var(--fg); text-decoration: none;
  transition: transform .18s cubic-bezier(.2, .8, .2, 1), border-color .18s;
}
.quick-item:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.quick-item .si { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; flex: none; }
.quick-item strong { display: block; }
.quick-item small { color: var(--muted); font-size: 0.88em; }
.quick-item > .ico { width: 18px; height: 18px; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .quick-item { transition: none; } .quick-item:hover { transform: none; } }

/* Tugmalar */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 12px; border: 1px solid transparent;
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap;
  background: var(--accent); color: var(--on-accent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 1px 2px rgba(17, 28, 68, 0.18);
  transition: transform 180ms cubic-bezier(.2, .8, .2, 1), background-color 250ms ease, box-shadow 250ms ease, border-color 250ms ease;
  -webkit-tap-highlight-color: transparent;
}
/* only .btn: some game buttons are placed with transform (3D poyga nitro), a rule on every button would move them */
@media (hover: hover) {
  .btn:hover { transform: translateY(-1px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 10px 22px -8px rgba(30, 58, 138, 0.5); }
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.6; cursor: default; transform: none; box-shadow: none; }
@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
  .btn:hover, .btn:active { transform: none; }
}
.btn .ico { width: 17px; height: 17px; }
.btn-ghost { background: var(--card); color: var(--fg); border-color: var(--border); box-shadow: 0 1px 2px rgba(17, 28, 68, 0.06); }
.btn-ghost:hover { border-color: var(--accent); box-shadow: 0 1px 2px rgba(17, 28, 68, 0.06); }
.btn-light { background: var(--sun); color: #173b2c; }
.btn-glass { background: rgba(255, 255, 255, 0.16); color: #fff; border-color: rgba(255, 255, 255, 0.3); }
.btn-sm { padding: 6px 12px; font-size: 0.88em; border-radius: 10px; }
.btn-danger { background: transparent; color: var(--muted); border-color: var(--border); box-shadow: none; }
.btn-danger:hover { color: var(--danger); border-color: var(--danger); box-shadow: none; }
.icon-only { padding: 6px; width: 32px; height: 32px; }

/* Formalar */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; font-weight: 600; font-size: 0.93em; }
.field.wide { grid-column: 1 / -1; }
.input, .field input:not([type="checkbox"]), .field select, .field textarea, .input-plain {
  font: inherit; font-weight: 400; font-size: 1rem; width: 100%;
  padding: 11px 14px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--bg); color: var(--fg); transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus, .input-plain:focus { outline: 3px solid var(--soft); border-color: var(--accent); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 500; margin: 6px 0 12px; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.form-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.hint { color: var(--muted); font-size: 0.88em; font-weight: 400; margin: 0 0 12px; }

/* Ro'yxatlar va belgilar */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); flex-wrap: wrap; }
.list > li:first-child { border-top: none; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.small { font-size: 0.88em; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: 0.78em; font-weight: 600; background: var(--soft); color: var(--accent); white-space: nowrap; }
.chip.ok { background: var(--ok-bg); color: var(--ok); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.gray { background: var(--bg); color: var(--muted); border: 1px solid var(--border); }
.avatar {
  width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center;
  font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); font-size: 0.95em;
}
.avatar.sm { width: 32px; height: 32px; font-size: 0.8em; }
.avatar.amber { background: linear-gradient(135deg, #f59e0b, #f97316); }
.code { font-family: ui-monospace, Consolas, monospace; font-weight: 800; letter-spacing: 0.12em; padding: 3px 10px; border-radius: 8px; background: var(--soft); color: var(--accent); }

.empty { text-align: center; padding: 48px 20px; border: 1px dashed var(--border); border-radius: var(--radius); color: var(--muted); background: var(--card); }
.empty strong { display: block; color: var(--fg); margin-bottom: 4px; font-size: 1.05em; }

/* Lenta */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filter { font: inherit; font-size: 0.92em; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--card); color: var(--fg); cursor: pointer; }
.filter[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.filter-select { width: auto; min-width: 150px; padding: 7px 12px; border-radius: 999px; font-size: 0.92em; }
.filter-select.on { border-color: var(--accent); color: var(--accent); font-weight: 700; }
.feed { display: grid; gap: 14px; }
.post { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.post-head { display: flex; align-items: center; gap: 12px; }
.post-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.post-meta .muted { font-size: 0.85em; }
.post h3 { margin: 14px 0 6px; font-size: 1.12em; }
.post-body { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.post-foot { margin-top: 12px; display: flex; justify-content: flex-end; }

.composer textarea { min-height: 96px; }

/* Top-5 rank badges */
.rank-badge {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.88em; flex-shrink: 0;
  position: relative; overflow: hidden;
}
.rank-1 { background: linear-gradient(135deg,#f7d04a,#e09400); color:#fff; box-shadow:0 2px 8px rgba(224,148,0,.45); }
.rank-2 { background: linear-gradient(135deg,#d4d4d4,#9a9a9a); color:#fff; box-shadow:0 2px 6px rgba(100,100,100,.35); }
.rank-3 { background: linear-gradient(135deg,#d4895a,#a0522d); color:#fff; box-shadow:0 2px 6px rgba(140,70,30,.35); }
.rank-4, .rank-5 { background: var(--border); color: var(--muted); }
@keyframes badge-shine {
  0%   { transform: translateX(-120%) skewX(-20deg); }
  100% { transform: translateX(220%)  skewX(-20deg); }
}
.rank-1::after, .rank-2::after, .rank-3::after {
  content:''; position:absolute; inset:0;
  background: linear-gradient(90deg,transparent 0%,rgba(255,255,255,.45) 50%,transparent 100%);
  animation: badge-shine 2.8s ease-in-out infinite;
}
.rank-1::after { animation-delay: 0s; }
.rank-2::after { animation-delay: .4s; }
.rank-3::after { animation-delay: .8s; }

.event { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--border); }
.event:first-child { border-top: none; padding-top: 0; }
.ev-date { width: 50px; flex: none; text-align: center; border-radius: 12px; background: var(--soft); color: var(--accent); padding: 6px 0; line-height: 1.1; }
.ev-date strong { display: block; font-size: 1.35em; font-family: var(--display); }
.ev-date span { font-size: 0.72em; font-weight: 800; text-transform: uppercase; }
.ev-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ev-info p { margin: 4px 0 0; color: var(--muted); font-size: 0.9em; }

.soon-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.soon-list li { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.soon-list .si { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; }
.soon-list .ico { width: 17px; height: 17px; }

.info-banner { display: flex; gap: 14px; align-items: center; padding: 16px 18px; border-radius: var(--radius); background: var(--soft); color: var(--fg); margin-bottom: 16px; }
.info-banner .si { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--card); color: var(--accent); flex: none; }
.info-banner p { margin: 0; }

/* Sinflar */
.class-card { padding: 0; overflow: hidden; }
.class-top { display: flex; align-items: center; gap: 14px; padding: 18px 20px; flex-wrap: wrap; }
.class-badge { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; font-family: var(--display); font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); flex: none; font-size: 0.95em; text-align: center; line-height: 1.1; padding: 2px; }
.class-stats { display: flex; gap: 8px; flex-wrap: wrap; }
.class-top > .grow { flex: 1 1 200px; }
.class-body { border-top: 1px solid var(--border); padding: 4px 20px 12px; background: color-mix(in srgb, var(--bg) 60%, var(--card)); }
.teacher-pick { margin: 0; min-width: 220px; font-size: 0.85em; }
.teacher-pick select { padding: 7px 10px; font-size: 0.95rem; }
.start-pick { margin: 0; width: 130px; font-size: 0.85em; }
.start-pick input { padding: 6px 10px !important; font-size: 0.95rem !important; }
/* Xodim qatori: tor ekranda ism siqilib harfma-harf tushmasin — chiplar va tugma keyingi qatorga o'tadi */
.staff-row { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; }
.staff-row .staff-name { flex: 1 1 180px; min-width: 0; overflow-wrap: anywhere; }
.student-row .actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.parent-tag { display: inline-flex; align-items: center; gap: 2px; padding: 2px 4px 2px 10px; border-radius: 999px; background: var(--ok-bg); color: var(--ok); font-size: 0.82em; font-weight: 650; }
.parent-tag button { border: none; background: transparent; color: inherit; cursor: pointer; font-size: 1.1em; line-height: 1; padding: 0 4px; }
.code-reveal { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 12px; border-radius: 10px; background: var(--warn-bg); color: var(--warn); font-size: 0.88em; width: 100%; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-size: 0.82em; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }

.toast-box { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: grid; gap: 8px; }
.toast { padding: 12px 16px; border-radius: 12px; background: #0f172a; color: #fff; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25); font-weight: 600; animation: toast-in 0.2s ease; max-width: 340px; }
.toast.err { background: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.list .si { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; }

/* Davomat */
.privacy-note { display: inline-flex; align-items: center; gap: 8px; }
.privacy-note .ico { width: 16px; height: 16px; color: var(--ok); }
.toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 20px; margin-bottom: 16px; }
.toolbar .field { margin: 0; min-width: 180px; }
.toolbar .seg { margin: 0; align-self: flex-end; }
.board-key { display: flex; flex-wrap: wrap; gap: 8px 32px; margin-bottom: 12px; }
.board-key > div { display: flex; flex-direction: column; gap: 2px; }
.board-code { font-family: ui-monospace, Consolas, monospace; font-size: 1.5em; letter-spacing: 0.15em; }
.board-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.att-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.att-stat { border-radius: 14px; padding: 12px 16px; border: 1px solid var(--border); background: var(--card); display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; }
.att-stat strong { font-family: var(--display); font-size: 1.6em; line-height: 1; }
.att-stat span { color: var(--muted); font-weight: 600; font-size: 0.82em; }
.att-stat.ok strong { color: var(--ok); }
.att-stat.err strong { color: var(--danger); }
.att-stat.warn strong { color: var(--warn); }
.att-stat.info strong { color: var(--accent); }
button.att-stat { font: inherit; color: inherit; cursor: pointer; }
button.att-stat:hover { border-color: var(--accent); }
button.att-stat[aria-pressed="true"] { border-color: var(--accent); background: var(--soft); }
.att-num { min-width: 1.6em; text-align: right; color: var(--muted); font-weight: 700; font-variant-numeric: tabular-nums; }
.att-row { gap: 10px 12px; }
.att-seg { display: inline-flex; padding: 3px; gap: 3px; border-radius: 11px; background: var(--bg); border: 1px solid var(--border); }
.att-seg button { font: inherit; font-size: 0.86em; font-weight: 650; padding: 6px 11px; border: none; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.att-seg button:disabled { cursor: default; }
.att-seg button[aria-checked="true"].s-present { background: var(--ok-bg); color: var(--ok); }
.att-seg button[aria-checked="true"].s-absent { background: rgba(220, 38, 38, 0.12); color: var(--danger); }
.att-seg button[aria-checked="true"].s-late { background: var(--warn-bg); color: var(--warn); }
.att-seg button[aria-checked="true"].s-excused { background: var(--soft); color: var(--accent); }
.att-note { flex: 1 1 100%; padding: 7px 10px; font-size: 0.92em; }
.save-bar {
  position: sticky; bottom: 0; z-index: 5; margin-top: 16px;
  display: flex; justify-content: flex-end; align-items: center; gap: 14px;
  padding: 12px 16px; border-radius: 14px; background: color-mix(in srgb, var(--card) 92%, transparent);
  border: 1px solid var(--border); box-shadow: var(--shadow); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.roster-form { margin-top: 12px; padding-top: 14px; border-top: 1px dashed var(--border); }
.chip.err-chip { background: rgba(220, 38, 38, 0.12); color: var(--danger); }

.att-card .att-mini { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.att-mini div { text-align: center; padding: 10px 4px; border-radius: 12px; background: var(--bg); }
.att-mini strong { display: block; font-family: var(--display); font-size: 1.4em; line-height: 1.1; }
.att-mini span { font-size: 0.78em; color: var(--muted); font-weight: 600; }
.att-day { display: flex; align-items: center; gap: 6px 10px; padding: 8px 0; border-top: 1px solid var(--border); font-size: 0.93em; flex-wrap: wrap; }
.att-day .grow { white-space: nowrap; }
.att-day .muted { flex-basis: 100%; }
.att-day:first-child { border-top: none; }

/* Dars jadvali */
.seg.days { margin: 0; flex-wrap: wrap; }
.seg.days button { flex: 1 0 auto; padding: 8px 12px; }
.seg.days button.is-today:not([aria-selected="true"]) { color: var(--accent); }
.sched-row { align-items: flex-start; flex-wrap: nowrap; }
.sched-row.now { margin: 0 -12px; padding-left: 12px; padding-right: 12px; border-radius: 12px; background: var(--soft); }
.sched-num { width: 32px; height: 32px; flex: none; border-radius: 10px; display: grid; place-items: center; font-weight: 800; background: var(--soft); color: var(--accent); }
.sched-row.now .sched-num { background: var(--accent); color: var(--on-accent); }
/* O'qituvchi jadvali: 2-smena darslari boshqa rangda, smenalar orasida sarlavha */
.sched-row.shift-2 .sched-num { background: var(--warn-bg); color: var(--warn); }
.sched-row.now.shift-2 .sched-num { background: var(--warn); color: var(--on-accent); }
.sched-list > li.sched-shift { padding: 6px 0 2px; min-height: 0; border-top: none; font-size: 0.8em; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--accent); }
.sched-list > li.sched-shift.shift-2 { color: var(--warn); border-top: 2px solid var(--warn-bg); margin-top: 6px; padding-top: 10px; }
.d-row.shift-2 .sched-num { background: var(--warn-bg); color: var(--warn); }
.d-shift { padding: 8px 0 2px; font-size: 0.8em; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--accent); }
.d-shift.shift-2 { color: var(--warn); border-top: 2px solid var(--warn-bg); margin-top: 6px; padding-top: 10px; }
.sched-week tr.shift-2 td { background: color-mix(in srgb, var(--warn-bg) 45%, transparent); }
.sched-time { width: 96px; flex: none; padding-top: 5px; color: var(--muted); font-size: 0.9em; font-variant-numeric: tabular-nums; }
.sched-items { display: grid; gap: 8px; padding-top: 4px; }
.sched-lesson { display: flex; flex-direction: column; line-height: 1.3; }
.sched-week td { vertical-align: top; min-width: 130px; }
.sched-week td .sched-lesson + .sched-lesson { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--border); }
.sched-week .sched-lesson strong { font-size: 0.93em; }
.sched-week-num { min-width: 64px !important; }
.sched-week-num strong { display: block; }
.import-pick { min-width: 180px; }

/* Kirish sahifalari */
body.auth {
  font-family: var(--text); -webkit-font-smoothing: antialiased; color: var(--fg); line-height: 1.5;
  min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background: var(--paper);
}
.auth-box { width: min(100%, 420px); }
.auth-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--fg); text-decoration: none; font-family: var(--display); font-weight: 800; font-size: 1.1em; margin-bottom: 18px; }
.auth-box .card { padding: 26px; }
.auth-box h1 { margin: 0 0 6px; font-size: 1.6em; }
.auth-box .lead { margin: 0 0 20px; color: var(--muted); }
.auth-box .btn[type="submit"] { width: 100%; padding: 12px; margin-top: 4px; }
.auth-foot { text-align: center; color: var(--muted); margin-top: 16px; font-size: 0.93em; }
.seg { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--bg); border: 1px solid var(--border); margin-bottom: 18px; }
.seg button { flex: 1; font: inherit; font-weight: 650; padding: 9px; border: none; border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer; white-space: nowrap; }
.seg button[aria-selected="true"], .seg button[aria-pressed="true"], .seg button.active { background: var(--card); color: var(--accent); box-shadow: var(--shadow); }
.form-error { margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; background: rgba(220, 38, 38, 0.1); color: var(--danger); font-size: 0.93em; }
.code-input { font-family: ui-monospace, Consolas, monospace !important; font-weight: 800 !important; letter-spacing: 0.2em; text-transform: uppercase; }

/* Ism + vaqt ustuni (davomat ro'yxati) */
.att-name-col { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.att-name-col strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att-name-col .small { font-size: 0.8em; }

/* Qisqa/uzun yorliq (toolbar seg) */
.tab-short { display: none; }

/* Mobil */
.tabbar { display: none; }

@media (max-width: 960px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-main, .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  body.app { display: block; padding-bottom: 72px; }
  .side { display: none; }
  .mtop {
    display: flex; position: sticky; top: 0; z-index: 20; align-items: center; gap: 10px;
    padding: 10px 16px; background: color-mix(in srgb, var(--card) 86%, transparent); border-bottom: 1px solid var(--border);
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  }
  .mtop .side-brand { color: var(--fg); padding: 0; flex: 1; min-width: 0; font-size: 0.98em; }
  .mtop .side-brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mtop .side-btn { border-color: var(--border); color: var(--fg); }
  .mtop .logout-btn { width: auto; margin: 0; padding: 7px 12px; color: var(--danger); background: transparent; border-color: var(--danger); }
  .content { padding: 18px 16px 32px; }
  .page-head { margin-bottom: 14px; }
  .page-head h1 { font-size: 1.4rem; }
  .eyebrow { display: none; }
  .page-head > div > p { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: color-mix(in srgb, var(--card) 88%, transparent); border-top: 1px solid var(--border); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  }
  .tab {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px;
    text-decoration: none; color: var(--muted); font-size: 0.7em; font-weight: 650; border-radius: 10px; min-width: 0;
  }
  .tab span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tab[aria-current="page"] { color: var(--accent); background: var(--soft); }
  button.tab { font: inherit; font-size: 0.7em; border: 0; background: none; cursor: pointer; }
  .tab-more {
    position: fixed; right: 8px; bottom: calc(72px + env(safe-area-inset-bottom)); z-index: 31; min-width: 210px;
    display: flex; flex-direction: column; gap: 2px; padding: 6px; border-radius: 16px;
    background: var(--card); border: 1px solid var(--border); box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
  }
  .tab-more[hidden] { display: none; }
  .tab-more .nav-item { color: var(--fg); }
  .tab-more .nav-item:hover { background: var(--soft); color: var(--fg); }
  .tab-more .nav-item[aria-current="page"] { background: var(--soft); color: var(--accent); }
  .stat { padding: 12px 14px; gap: 10px; }
  .quick { grid-template-columns: 1fr; }
  .att-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .att-seg { width: 100%; }
  .att-seg button { flex: 1; padding: 8px 2px; }
  .att-row { flex-wrap: nowrap; align-items: center; }
  .tab-long { display: none; }
  .tab-short { display: inline; }
  .list > li { padding: 10px 0; min-height: 52px; }
  .save-bar { bottom: 76px; }
  .toolbar .field { flex: 1 1 100%; }
  .seg.days button { padding: 8px 4px; flex: 1 0 13%; font-size: 0.9em; }
  .sched-row { flex-wrap: wrap; }
  .sched-time { width: auto; }
  .sched-items { flex-basis: 100%; padding-left: 44px; }
  .import-pick, .teacher-pick { flex: 1 1 100%; }
  .start-pick { flex: 1 1 100%; width: auto; }
  .stat .si { width: 32px; height: 32px; border-radius: 9px; }
  .stat strong { font-size: 1.25em; }
  .hello { padding: 20px 20px; margin-bottom: 14px; border-radius: 16px; }
  .hello h1 { font-size: 1.2rem; }
  .hello p { font-size: 0.88em; }
  .toast-box { left: 16px; right: 16px; bottom: 84px; }
}

@media (prefers-reduced-motion: reduce) {
  .btn, .toast { transition: none; animation: none; }
}

/* ── Chat / Xabarlar — Telegram style ───────────────────────── */
.chat-layout { display: flex; height: calc(100vh - 60px); overflow: hidden; }
.chat-sidebar { width: 300px; flex-shrink: 0; display: flex; flex-direction: column; border-right: 1px solid var(--border); background: var(--card); }
.chat-tabs { display: flex; flex-direction: column; gap: 8px; padding: 10px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.kj-tabs { max-width: 420px; }
.kj-leader { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.kj-leader-field { margin: 0; flex: 0 1 280px; font-size: 0.85em; }
.kj-add { margin-bottom: 16px; }
.kj-add summary { list-style: none; display: inline-flex; }
.kj-add summary::-webkit-details-marker { display: none; }
.kj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.kj-grid > .empty { grid-column: 1 / -1; }
.kj-card { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.kj-top { display: flex; align-items: center; gap: 12px; }
.kj-top h2 { margin: 0; font-size: 1.08em; }
.kj-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.kj-desc { margin: 0; color: var(--muted); }
.kj-meta { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 0.92em; }
.kj-meta li { display: flex; align-items: center; gap: 8px; }
.kj-meta .ico { width: 16px; height: 16px; color: var(--accent); flex: none; }
.kj-member { flex-direction: row; align-items: center; gap: 14px; }
.kj-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.chat-seg { margin: 0; }
.chat-seg button { padding: 7px 6px; font-size: 0.85em; }
.chat-class { padding: 8px 10px; font-size: 0.92em; }
.chat-tabs::-webkit-scrollbar { display: none; }
.chat-tab { flex: none; padding: 7px 10px; border: none; background: none; cursor: pointer; font: inherit; font-size: .78em; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; transition: color .12s; white-space: nowrap; }
.chat-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.chat-list { list-style: none; margin: 0; padding: 0; flex: 1; overflow-y: auto; }
.chat-thread { display: flex; align-items: center; gap: 12px; padding: 8px 14px; cursor: pointer; transition: background .1s; min-height: 62px; }
.chat-thread:hover { background: var(--soft); }
.chat-thread.active { background: var(--soft); }
.thread-avatar { flex-shrink: 0; }
.thread-info { flex: 1; min-width: 0; }
.thread-row1 { display: flex; justify-content: space-between; align-items: baseline; gap: 4px; }
.thread-row2 { display: flex; justify-content: space-between; align-items: center; gap: 4px; margin-top: 3px; }
.thread-name { font-weight: 600; font-size: .91em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.thread-time { font-size: .72em; color: var(--muted); flex-shrink: 0; }
.thread-last { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .82em; color: var(--muted); }
.badge { background: var(--accent); color: var(--on-accent); border-radius: 999px; font-size: .71em; padding: 2px 7px; font-weight: 700; line-height: 1.5; flex-shrink: 0; }
.chat-main { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--bg); }
.chat-empty { flex: 1; display: flex; align-items: center; justify-content: center; }
#chat-open { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.chat-header { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--border); background: var(--card); flex-shrink: 0; min-height: 56px; }
.chat-back { display: none; align-items: center; justify-content: center; background: none; border: none; cursor: pointer; padding: 4px 8px 4px 0; color: var(--accent); font-size: 1.3em; line-height: 1; }
.chat-header-info { flex: 1; min-width: 0; }
.chat-header-name { font-weight: 700; font-size: .95em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-header-sub { font-size: .75em; color: var(--muted); margin-top: 1px; }
.chat-messages { flex: 1; overflow-y: auto; padding: 10px 16px 6px; display: flex; flex-direction: column; gap: 3px; }
.chat-date-sep { align-self: center; background: var(--border); color: var(--muted); font-size: .72em; font-weight: 500; padding: 3px 12px; border-radius: 999px; margin: 6px 0 4px; user-select: none; pointer-events: none; }
.bubble { max-width: 70%; display: flex; flex-direction: column; margin-bottom: 1px; }
.bubble.mine { align-self: flex-end; align-items: flex-end; }
.bubble.theirs { align-self: flex-start; align-items: flex-start; }
.bubble-sender { font-size: .73em; font-weight: 700; color: var(--accent); margin-bottom: 2px; padding-left: 12px; }
.bubble-body { padding: 8px 12px 7px; border-radius: 18px; font-size: .91em; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.bubble.mine .bubble-body { background: var(--accent); color: var(--on-accent); border-bottom-right-radius: 5px; }
.bubble.theirs .bubble-body { background: var(--card); border: 1px solid var(--border); color: var(--fg); border-bottom-left-radius: 5px; }
.bubble-meta { display: flex; justify-content: flex-end; align-items: center; gap: 4px; margin-top: 2px; padding: 0 4px; }
.bubble-time { font-size: .69em; color: var(--muted); }
.bubble.mine .bubble-time { color: color-mix(in srgb, var(--on-accent) 70%, transparent); }
.chat-form { display: flex; align-items: flex-end; gap: 8px; padding: 8px 12px 10px; background: var(--card); border-top: 1px solid var(--border); flex-shrink: 0; }
.chat-input { flex: 1; resize: none; border: 1.5px solid var(--border); border-radius: 22px; padding: 9px 16px; font: inherit; font-size: .92em; background: var(--bg); color: var(--fg); line-height: 1.4; overflow: hidden; box-sizing: border-box; outline: none; transition: border-color .15s; }
.chat-input:focus { border-color: var(--accent); }
.chat-send { width: 40px; height: 40px; border-radius: 50%; border: none; background: var(--accent); color: var(--on-accent); cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; padding: 0; transition: opacity .15s, transform .1s; }
.chat-send:hover { opacity: .88; }
.chat-send:active { transform: scale(.9); }
.chat-send svg { width: 17px; height: 17px; fill: currentColor; }
/* ── Profil bar (sidebar yuqorisi) ────────────────────────────── */
.chat-me-bar { display:flex; align-items:center; gap:10px; padding:10px 14px; border-bottom:1px solid var(--border); background:var(--card); flex-shrink:0; }
.chat-me-name { font-weight:600; font-size:.88em; flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--fg); }

/* ── Avatar: rasm va online nuqta ─────────────────────────────── */
.avatar-wrap { position:relative; flex-shrink:0; display:inline-flex; }
.avatar-img { border-radius:50%; object-fit:cover; width:40px; height:40px; display:block; }
.avatar-img.sm { width:32px; height:32px; }
.online-dot { position:absolute; bottom:0; right:0; width:11px; height:11px; border-radius:50%; background:#22c55e; border:2.5px solid var(--card); pointer-events:none; }
.avatar-cam { position:absolute; inset:0; border-radius:50%; background:rgba(0,0,0,.38); display:flex; align-items:center; justify-content:center; opacity:0; transition:opacity .15s; cursor:pointer; font-size:.8em; line-height:1; }
.avatar-wrap:hover .avatar-cam { opacity:1; }
.online-label { font-size:.7em; color:#22c55e; font-weight:600; flex-shrink:0; }

@media (max-width: 660px) {
  .chat-layout { position: relative; height: calc(100vh - 56px - 72px); overflow: hidden; }
  .chat-sidebar { position: absolute; inset: 0; width: 100%; z-index: 2; transition: transform .22s cubic-bezier(.4,0,.2,1); }
  .chat-sidebar.slide-out { transform: translateX(-100%); }
  .chat-main { position: absolute; inset: 0; transform: translateX(100%); transition: transform .22s cubic-bezier(.4,0,.2,1); }
  .chat-main.slide-in { transform: translateX(0); }
  .chat-back { display: flex !important; }
}

/* ── Virtual laboratoriya (iframe) ────────────────────────────── */
.content.lab-content { max-width: 1400px; padding-bottom: 20px; }
.lab-content .page-head { margin-bottom: 14px; }
.lab-frame { display: block; width: 100%; height: calc(100vh - 170px); min-height: 480px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); }
@media (max-width: 760px) {
  .content.lab-content { padding: 8px 0 0; }
  .lab-content .page-head { padding: 0 16px; margin-bottom: 8px; align-items: center; flex-wrap: nowrap; }
  .lab-content .page-head > div { min-width: 0; }
  .lab-content .page-head h1 { font-size: 1.15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .lab-content .page-head .btn { flex-shrink: 0; }
  .lab-frame { height: calc(100dvh - 56px - 72px - 56px); min-height: 360px; border-radius: 0; border-width: 1px 0 0; }
}

/* ── Uyga vazifa: havolalar va rasmlar ─────────────────────────── */
.hw-link-add { display: flex; gap: 8px; flex-wrap: wrap; font-weight: 400; }
.hw-link-add input { flex: 1 1 180px; min-width: 0; }
.hw-links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-weight: 400; }
.hw-links li { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); min-width: 0; }
.hw-links li span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hw-links li button { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 1.1em; padding: 0 4px; }
.hw-thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.hw-thumbs:empty { display: none; }
.hw-thumb { position: relative; width: 84px; height: 84px; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); background: var(--bg); }
.hw-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hw-thumb button { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; line-height: 1; }
.hw-pick { align-self: flex-start; font-weight: 600; }
.hw-mats { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 8px; }
.hw-mats a { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 5px 12px; border-radius: 999px; background: var(--soft); color: var(--accent); font-size: 0.85em; font-weight: 600; text-decoration: none; }
.hw-mats a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hw-mats a:hover { text-decoration: underline; }
.hw-imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin: 0 0 8px; }
.hw-imgs button { padding: 0; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--bg); aspect-ratio: 4 / 3; cursor: zoom-in; }
.hw-imgs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hw-body a { color: var(--accent); word-break: break-all; }
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.85); display: flex; align-items: center; justify-content: center; padding: 16px; cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; background: #fff; }

/* ── Uyga vazifa: javoblar va baholash ─────────────────────────── */
.hw-answer { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); }
.hw-answer-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hw-answer-body { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.hw-answer-body textarea { width: 100%; }
.sub-files { display: flex; gap: 6px; flex-wrap: wrap; }
.sub-files:empty { display: none; }
.sub-file { display: inline-flex; align-items: center; max-width: 100%; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); overflow: hidden; }
.sub-file-open { display: inline-flex; align-items: center; gap: 6px; min-width: 0; padding: 5px 10px; border: 0; background: none; color: var(--fg); font: inherit; font-size: 0.85em; cursor: pointer; }
button.sub-file-open:hover { color: var(--accent); }
.sub-file-open span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.sub-file-open small { color: var(--muted); }
.sub-file-x { border: 0; border-left: 1px solid var(--border); background: none; color: var(--muted); cursor: pointer; padding: 5px 9px; font-size: 1em; }
.sub-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.sub-row { padding: 10px 0; border-bottom: 1px solid var(--border); }
.sub-row:last-child { border-bottom: 0; }
.sub-row.muted-row { padding: 6px 0; opacity: 0.75; }
.sub-row-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; min-width: 0; }
.sub-row-head strong { flex: 1 1 140px; min-width: 0; overflow-wrap: anywhere; font-size: 0.95em; }
.grade-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.grade-line .input-plain { flex: 1 1 160px; min-width: 0; padding: 6px 10px; }
.grade-btn { width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--border); background: var(--card); color: var(--fg); font: inherit; font-weight: 700; cursor: pointer; }
.grade-btn:hover { border-color: var(--accent); }
.grade-btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.doc-modal { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.6); display: flex; flex-direction: column; padding: 16px; }
.doc-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; max-width: 900px; width: 100%; margin: 0 auto; padding: 10px 14px; background: var(--card); border-radius: 12px 12px 0 0; }
.doc-frame { flex: 1; max-width: 900px; width: 100%; margin: 0 auto; border: 0; background: #fff; border-radius: 0 0 12px 12px; }
.pick-card { max-width: 560px; width: 100%; margin: auto; max-height: 100%; overflow: auto; }
.pick-list { display: flex; flex-direction: column; gap: 6px; }
.pick-item { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; font-weight: 400; }
.pick-item:has(input:checked) { border-color: var(--accent); background: var(--soft); }
.pick-item input { margin-top: 4px; }
.pick-group { margin: 12px 0 6px; font-weight: 600; font-size: 0.9em; color: var(--muted); }
.pick-item.is-disabled { opacity: 0.55; cursor: not-allowed; }
.doc-notes { max-width: 900px; width: 100%; margin: 8px auto 0; max-height: 32vh; overflow: auto; background: var(--card); border-radius: 12px; padding: 10px 14px; }
.doc-notes ol { margin: 0; padding-left: 20px; }
.doc-notes li { margin: 4px 0; cursor: pointer; }

/* Umumiy: klaviatura fokusi, uzun matn, telefon */
:where(a, button, .btn, .nav-item, [tabindex]):focus-visible,
:where(input, select, textarea):focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.card, .post, td, th { overflow-wrap: anywhere; }
img, video, iframe { max-width: 100%; }
@media (max-width: 640px) {
  .btn, .side-btn, .filter-select { min-height: 40px; }
  .btn { white-space: normal; max-width: 100%; }
  .btn-sm { min-height: 36px; }
  .input, .field input:not([type="checkbox"]), .field select, .field textarea { font-size: 16px; } /* iOS zoom bo'lmasin */
}
.live-notes { margin-bottom: 10px; }
.live-notes ol { margin: 6px 0 0; padding-left: 20px; }

/* Umumiy yordamchi klasslar (inline style o'rniga) */
.m-0 { margin: 0; }
.my-8 { margin-top: 8px; margin-bottom: 8px; }
.mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; }
.mb-0 { margin-bottom: 0; } .mb-4 { margin-bottom: 4px; } .mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; }
.p-0 { padding: 0; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row.nowrap { flex-wrap: nowrap; }
.row-between { justify-content: space-between; }
.gap-6 { gap: 6px; } .gap-16 { gap: 16px; }
.col { display: flex; flex-direction: column; gap: 6px; }
.grow-1 { flex: 1; }
.shrink-0 { flex-shrink: 0; }
.self-start { align-self: flex-start; }
.inline-block { display: inline-block; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fw-600 { font-weight: 600; }
.xsmall { font-size: 0.8em; }
.text-danger { color: var(--danger); }
.clickable { cursor: pointer; }
.grab { cursor: grab; }
.narrow { max-width: 640px; margin-left: auto; margin-right: auto; }
.list-plain { list-style: none; margin: 0; padding: 0; }
.list-empty { padding: 12px 20px; }
.card.flat { box-shadow: none; }
.card-tight { padding: 8px 20px; }
.card-head-tight { margin: 12px 0 4px; }
.h-sm { font-size: 1.05em; margin: 0; }
.cover { width: 100%; height: 100%; object-fit: cover; }
.sub-section { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.sub-title { margin: 0 0 6px; font-size: 1em; }
.field-time { min-width: 140px; }
.group-label { margin: 10px 0 4px; }
.note-box { padding: 12px 16px; background: var(--surface-2); border-radius: 8px; border: 1px solid var(--border); }
.note-steps { margin: 6px 0 8px; padding-left: 20px; font-size: 0.9em; }
.avatar-pick { width: 72px; height: 72px; border-radius: 50%; overflow: hidden; background: var(--soft); color: var(--accent); display: grid; place-items: center; font-size: 1.5rem; font-weight: 600; flex-shrink: 0; }
.avatar-xl { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; font-size: 1.6rem; }
.avatar-text { font-size: 0.75em; }
/* Bosh sahifa: dars / reyting qatorlari, ochiladigan guruhlar */
.d-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.d-row:last-child { border-bottom: 0; }
.d-row.live { background: color-mix(in srgb, var(--ok) 8%, transparent); margin: 0 -12px; padding: 10px 12px; border-radius: 8px; border-bottom: 0; }
.d-time { flex-shrink: 0; min-width: 52px; display: flex; flex-direction: column; gap: 1px; font-variant-numeric: tabular-nums; }
.card.acc { padding: 0; overflow: hidden; }
.acc-body { padding: 0 8px; }
.acc-head { display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 16px; background: none; border: none; border-top: 1px solid var(--border); cursor: pointer; text-align: left; font: inherit; color: var(--fg); }
.acc-head strong { font-size: 0.95em; }
.acc-sub { font-weight: 400; margin-left: 6px; }
.chev { display: inline-block; transition: transform .15s; }
/* Chat: ochiq suhbat, profil kartasi */
.chat-open { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.chat-member { padding: 20px; }
.pc-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 200; display: flex; align-items: center; justify-content: center; }
.pc-box { background: var(--card); color: var(--fg); border-radius: 16px; padding: 28px 24px 24px; width: min(300px, 90vw); text-align: center; position: relative; box-shadow: var(--shadow); }
.pc-close { position: absolute; top: 10px; right: 12px; background: var(--surface-2); color: var(--fg); border: none; border-radius: 50%; width: 28px; height: 28px; cursor: pointer; font-size: 1.1rem; }
.pc-avatar { display: flex; justify-content: center; margin-bottom: 12px; }
.pc-name { font-size: 1.05rem; font-weight: 600; line-height: 1.3; }
.pc-meta { font-size: .85rem; color: var(--muted); margin-top: 2px; }
#pc-role { margin-top: 4px; }
.pc-link { display: inline-block; margin-top: 12px; font-size: .85rem; color: var(--accent); }
/* Jadvallar: telefonda ichida suriladi, birinchi ustun joyida turadi */
.table-wrap { -webkit-overflow-scrolling: touch; max-width: 100%; }
.table-wrap :is(th, td):first-child { position: sticky; left: 0; z-index: 1; background: var(--card); }
@media (max-width: 640px) {
  th, td { padding: 8px 6px; }
  .table-wrap :is(th, td):first-child { box-shadow: 1px 0 0 var(--border); }
}
.avatar-pick-lg { width: 88px; height: 88px; font-size: 2rem; }

/* 🔑 Darsga kalit so'z (classkey.js, Bosh sahifa) */
.ck-box { padding: 12px 14px; border-radius: 14px; border: 1px solid var(--border); background: var(--bg); }
.ck-word { font-size: 1.9em; font-weight: 800; letter-spacing: .04em; color: var(--accent); }
.ck-warn { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-top: 8px; padding: 6px 10px;
  border-radius: 10px; background: rgba(220, 38, 38, .1); color: #dc2626; font-weight: 600; }
.ck-names { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ck-show { position: fixed; inset: 0; z-index: 1000; background: var(--bg); color: var(--fg); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2vh; padding: 24px; text-align: center; }
.ck-close { position: absolute; top: 16px; right: 16px; }
.ck-show-class { font-size: clamp(1.2em, 3.5vh, 2.4em); color: var(--muted); }
.ck-show-word { font-size: clamp(3em, min(16vw, 22vh), 14em); font-weight: 900; letter-spacing: .04em; color: var(--accent); line-height: 1.05; word-break: break-all; }
.ck-steps { font-size: clamp(1.1em, 3.4vh, 2.2em); text-align: left; margin: 0; line-height: 1.6; }
.ck-show-foot { font-size: clamp(1em, 2.8vh, 1.8em); color: var(--muted); }
