/* ============================================================
   Burgutali LMS/CRM — asosiy uslublar
   ============================================================ */

:root {
  --nav-w: 260px;
  --topbar-h: 66px;

  --brand: #1e3a5f;
  --brand-light: #2c5282;
  --accent: #2f855a;
  --accent-light: #38a169;

  --bg: #f4f6fa;
  --surface: #ffffff;
  --border: #e4e8ef;
  --text: #1f2937;
  --muted: #6b7280;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-md: 0 4px 12px rgba(16, 24, 40, .08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; }

/* ============================================================ Karkas */
.app-shell { display: flex; min-height: 100vh; }

.app-main {
  flex: 1;
  min-width: 0;
  margin-left: var(--nav-w);
  display: flex;
  flex-direction: column;
}

/* ============================================================ Yon panel */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--nav-w);
  background: var(--brand);
  color: #cbd7e6;
  display: flex;
  flex-direction: column;
  z-index: 1040;
  transition: transform .25s ease;
}

.sidebar-brand {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  flex-shrink: 0;
}

.sidebar-brand a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
}

.brand-mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, .12);
  border-radius: 8px;
  color: #fff;
  flex-shrink: 0;
}

.brand-mark svg { width: 20px; height: 20px; display: block; }

.btn-close-sidebar {
  background: none;
  border: 0;
  color: #cbd7e6;
  font-size: 1.1rem;
  padding: 4px;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 10px 0 20px;
}

.sidebar-nav::-webkit-scrollbar { width: 5px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .15); border-radius: 3px; }

.nav-section {
  padding: 16px 20px 6px;
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: rgba(255, 255, 255, .38);
  font-weight: 600;
}

/* Yig'iladigan bo'lim sarlavhasi */
.nav-section.nav-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 20px;
  font-size: .74rem;
  color: rgba(255, 255, 255, .6);
  cursor: pointer;
  user-select: none;
  transition: background .15s, color .15s;
}

.nav-section.nav-toggle:hover,
.nav-section.nav-toggle.open { color: #fff; }
.nav-section.nav-toggle:hover { background: rgba(255, 255, 255, .06); }
.nav-section.nav-toggle:focus-visible { outline: 2px solid var(--accent-light); outline-offset: -2px; }
.nav-section.nav-toggle i { font-size: .8rem; transition: transform .2s; }
.nav-section.nav-toggle.open i { transform: rotate(180deg); }
.nav-item[hidden] { display: none; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  color: #cbd7e6;
  font-size: .9rem;
  border-left: 3px solid transparent;
  transition: background .15s, color .15s;
}

.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }

.nav-item.active {
  background: rgba(255, 255, 255, .1);
  color: #fff;
  border-left-color: var(--accent-light);
  font-weight: 600;
}

.nav-item i { font-size: 1.05rem; width: 20px; text-align: center; flex-shrink: 0; }

.sidebar-footer {
  border-top: 1px solid rgba(255, 255, 255, .08);
  padding: 8px 0;
  flex-shrink: 0;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .5);
  z-index: 1035;
}

.sidebar-backdrop.show { display: block; }

/* ============================================================ Yuqori panel */
.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 22px;
  position: sticky;
  top: 0;
  z-index: 1020;
}

.btn-toggle-sidebar {
  background: none;
  border: 0;
  font-size: 1.45rem;
  color: var(--brand);
  padding: 0;
  line-height: 1;
}

.topbar-title { flex: 1; min-width: 0; }

.topbar-title h1 {
  font-size: 1.12rem;
  font-weight: 650;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-subtitle { font-size: .8rem; color: var(--muted); }

.topbar-actions { display: flex; align-items: center; gap: 8px; }

.btn-icon {
  background: none;
  border: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 1.15rem;
  color: var(--muted);
  display: grid;
  place-items: center;
}

.btn-icon:hover { background: var(--bg); color: var(--brand); }

.notif-dot {
  position: absolute;
  top: 3px;
  right: 3px;
  background: #dc3545;
  color: #fff;
  font-size: .62rem;
  min-width: 17px;
  height: 17px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  padding: 0 4px;
  font-weight: 600;
}

/* Foydalanuvchi chipi */
.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: 0;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}

.user-chip:hover { background: var(--bg); }

.user-chip img,
.avatar-initials {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.avatar-initials {
  background: var(--brand-light);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: .8rem;
  font-weight: 600;
}

.user-meta { text-align: left; line-height: 1.25; }
.user-name { display: block; font-size: .86rem; font-weight: 600; }
.user-role { display: block; font-size: .72rem; color: var(--muted); }

/* Bildirishnoma dropdown */
.notif-dropdown { width: 330px; padding: 0; max-width: calc(100vw - 24px); }

.notif-head {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.notif-item {
  display: flex;
  gap: 12px;
  padding: 11px 16px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

.notif-item:hover { background: var(--bg); }
.notif-item i { font-size: 1.1rem; margin-top: 2px; }
.notif-title { font-size: .85rem; font-weight: 550; }
.notif-time { font-size: .74rem; color: var(--muted); }
.notif-empty { padding: 24px 16px; text-align: center; color: var(--muted); font-size: .86rem; }
.notif-all { display: block; padding: 11px; text-align: center; font-size: .85rem; font-weight: 600; color: var(--brand); }

/* ============================================================ Kontent */
.app-content { flex: 1; padding: 22px; max-width: 1500px; width: 100%; }

.app-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: .8rem;
}

.messages { margin-bottom: 16px; }
.messages .alert { border: 0; border-radius: var(--radius-sm); box-shadow: var(--shadow); }

/* ============================================================ Kartalar */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 14px 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  border-radius: var(--radius) var(--radius) 0 0 !important;
}

.card-body { padding: 18px; }

/* Statistika kartalari */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 14px;
  transition: transform .15s, box-shadow .15s;
}

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

.stat-icon {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.stat-icon.blue   { background: #e0edff; color: #1d4ed8; }
.stat-icon.green  { background: #dcfce7; color: #15803d; }
.stat-icon.orange { background: #ffedd5; color: #c2410c; }
.stat-icon.red    { background: #fee2e2; color: #b91c1c; }
.stat-icon.purple { background: #ede9fe; color: #6d28d9; }
.stat-icon.teal   { background: #ccfbf1; color: #0f766e; }

.stat-value { font-size: 1.5rem; font-weight: 700; line-height: 1.15; }
.stat-label { font-size: .8rem; color: var(--muted); }
.stat-hint  { font-size: .74rem; color: var(--muted); margin-top: 2px; }

/* ============================================================ Jadvallar */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.table { margin: 0; font-size: .875rem; }

.table > thead > tr > th {
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--muted);
  white-space: nowrap;
  padding: 11px 14px;
}

.table > tbody > tr > td { padding: 11px 14px; vertical-align: middle; }
.table-hover > tbody > tr:hover > * { background: #f8fafc; }

/* ============================================================ Progress */
.progress { height: 7px; background: #eef1f6; border-radius: 4px; }
.progress-thin { height: 5px; }

/* ============================================================ Rozetkalar */
.badge-soft {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: .74rem;
  font-weight: 600;
}

.badge-soft.success { background: #dcfce7; color: #15803d; }
.badge-soft.danger  { background: #fee2e2; color: #b91c1c; }
.badge-soft.warning { background: #fef3c7; color: #b45309; }
.badge-soft.info    { background: #dbeafe; color: #1d4ed8; }
.badge-soft.muted   { background: #f1f5f9; color: #64748b; }
.badge-soft.purple  { background: #ede9fe; color: #6d28d9; }

/* ============================================================ Yo'qlama jadvali */
.att-table th, .att-table td { vertical-align: middle; padding: 8px 6px; }
.att-table .att-name {
  text-align: left;
  padding-left: 16px;
  min-width: 190px;
  font-weight: 600;
  white-space: nowrap;
  position: sticky;
  left: 0;
  background: #fff;
  z-index: 1;
}
.att-table thead .att-name { font-weight: 600; color: var(--muted); }
.att-table thead a { color: inherit; text-decoration: none; display: block; }
.att-table thead a:hover .att-date { text-decoration: underline; }
.att-date { font-size: .9rem; font-weight: 700; }
.att-weekday { font-size: .7rem; font-weight: 500; color: var(--muted); }
.att-today { background: #eff6ff; }
.att-me td, .att-me .att-name { background: #f0f9ff; }

.att-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 1.05rem;
  color: transparent;
}
.att-cell.present { color: #16a34a; background: #f0fdf4; border-color: #bbf7d0; }
.att-cell.late    { color: #d97706; background: #fffbeb; border-color: #fde68a; }
.att-cell.absent  { color: #dc2626; background: #fef2f2; border-color: #fecaca; }
.att-cell.pending { color: #94a3b8; }

.att-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .78rem; color: var(--muted); }
.att-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.att-legend .att-cell { width: 24px; height: 24px; border-radius: 7px; font-size: .8rem; }

/* ============================================================ Sahifa sarlavhasi */
.page-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 18px;
}

.page-actions .spacer { flex: 1; }

/* ============================================================ Filtrlar */
.filter-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}

.filter-bar .row { --bs-gutter-x: .75rem; --bs-gutter-y: .6rem; }

/* ============================================================ Kurs kartalari */
.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 18px;
}

.course-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform .15s, box-shadow .15s;
}

.course-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

.course-cover {
  height: 140px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-light) 100%);
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, .85);
  font-size: 2.6rem;
  position: relative;
}

.course-cover img { width: 100%; height: 100%; object-fit: cover; }
.course-body { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.course-title { font-size: 1rem; font-weight: 650; margin-bottom: 6px; color: var(--text); }
.course-meta { font-size: .8rem; color: var(--muted); display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.course-footer { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); }

/* ============================================================ Dars ro'yxati */
.module-block { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 14px; overflow: hidden; background: var(--surface); }

.module-head {
  padding: 13px 16px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.module-title { font-weight: 650; font-size: .95rem; }

.lesson-row {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  transition: background .12s;
}

.lesson-row:last-child { border-bottom: 0; }
.lesson-row:hover { background: #f8fafc; }

.lesson-num {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #eef2f7;
  color: var(--muted);
  display: grid;
  place-items: center;
  font-size: .78rem;
  font-weight: 650;
  flex-shrink: 0;
}

.lesson-num.done { background: #dcfce7; color: #15803d; }
.lesson-info { flex: 1; min-width: 0; }
.lesson-name { font-size: .9rem; font-weight: 550; }
.lesson-sub { font-size: .76rem; color: var(--muted); }

/* ============================================================ Video */
.video-wrap {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
}

.video-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.video-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #9ca3af;
  text-align: center;
  padding: 20px;
}

/* ============================================================ Test */
.question-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.question-head { display: flex; gap: 12px; margin-bottom: 16px; }

.question-num {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: .8rem;
  font-weight: 650;
  flex-shrink: 0;
}

.question-text { font-weight: 550; font-size: .97rem; }

.choice-label {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 9px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}

.choice-label:hover { border-color: #b8c4d6; background: #f8fafc; }
.choice-label input { margin-top: 3px; flex-shrink: 0; }
.choice-label.is-correct { border-color: #86efac; background: #f0fdf4; }
.choice-label.is-wrong   { border-color: #fca5a5; background: #fef2f2; }
.choice-label.is-selected { border-color: var(--brand-light); background: #eff6ff; }

.quiz-timer {
  position: sticky;
  top: calc(var(--topbar-h) + 10px);
  z-index: 1010;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 18px;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.timer-value { font-size: 1.2rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.timer-value.warning { color: #dc2626; animation: pulse 1s infinite; }

@keyframes pulse { 50% { opacity: .55; } }

/* Natija doirasi */
.score-ring {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
}

.score-ring.pass { background: linear-gradient(135deg, #22c55e, #16a34a); }
.score-ring.fail { background: linear-gradient(135deg, #f87171, #dc2626); }

/* ============================================================ Davomat jadvali */
.attendance-cell {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  display: inline-grid;
  place-items: center;
  font-size: .72rem;
  font-weight: 700;
}

.att-present { background: #dcfce7; color: #15803d; }
.att-late    { background: #fef3c7; color: #b45309; }
.att-absent  { background: #fee2e2; color: #b91c1c; }
.att-excused { background: #dbeafe; color: #1d4ed8; }
.att-none    { background: #f1f5f9; color: #cbd5e1; }

/* ============================================================ Kirish sahifasi */
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  background: linear-gradient(135deg, #1e3a5f 0%, #2c5282 55%, #2f855a 100%);
}

.login-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 55px rgba(0, 0, 0, .28);
  width: 100%;
  max-width: 420px;
  padding: 36px 30px;
}

.login-logo { text-align: center; margin-bottom: 26px; }
.login-mark {
  width: 64px;
  height: 64px;
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--brand-light), var(--brand));
  border-radius: 16px;
  color: #fff;
  box-shadow: 0 6px 18px rgba(30, 58, 95, .28);
}

.login-mark svg { width: 40px; height: 40px; display: block; }
.login-logo h1 { font-size: 1.25rem; font-weight: 700; margin: 0; color: var(--brand); }
.login-logo p { font-size: .84rem; color: var(--muted); margin: 4px 0 0; }

/* ============================================================ Formalar */
.form-label { font-size: .84rem; font-weight: 600; margin-bottom: 5px; color: #374151; }
.form-control, .form-select { border-radius: var(--radius-sm); border-color: #d9dee8; font-size: .9rem; padding: .5rem .8rem; }
.form-control:focus, .form-select:focus { border-color: var(--brand-light); box-shadow: 0 0 0 3px rgba(44, 82, 130, .12); }
.form-text { font-size: .77rem; }
.invalid-feedback, .errorlist { color: #dc2626; font-size: .8rem; list-style: none; padding: 0; margin: 4px 0 0; }

.btn { border-radius: var(--radius-sm); font-size: .88rem; font-weight: 550; padding: .5rem 1rem; }
.btn-primary { background: var(--brand); border-color: var(--brand); }
.btn-primary:hover, .btn-primary:focus { background: var(--brand-light); border-color: var(--brand-light); }
.btn-success { background: var(--accent); border-color: var(--accent); }
.btn-success:hover { background: var(--accent-light); border-color: var(--accent-light); }
.btn-sm { font-size: .8rem; padding: .3rem .65rem; }

/* ============================================================ Bo'sh holat */
.empty-state { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty-state i { font-size: 3rem; opacity: .35; display: block; margin-bottom: 12px; }
.empty-state h5 { color: var(--text); font-size: 1rem; margin-bottom: 6px; }

/* ============================================================ Telegram kodi */
.token-box {
  background: #0f172a;
  color: #4ade80;
  font-family: "SF Mono", Consolas, Monaco, monospace;
  font-size: 1.3rem;
  letter-spacing: .12em;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  text-align: center;
  word-break: break-all;
}

/* ============================================================ Mobil moslashuv */
@media (max-width: 991.98px) {
  .app-main { margin-left: 0; }
  .sidebar { transform: translateX(-100%); }
  .sidebar.show { transform: translateX(0); box-shadow: 0 0 40px rgba(0, 0, 0, .3); }
  .app-content { padding: 16px; }
  .topbar { padding: 0 14px; }
}

@media (max-width: 575.98px) {
  body { font-size: 14px; }
  .app-content { padding: 12px; }
  .stat-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 11px; }
  .stat-card { padding: 13px; gap: 10px; }
  .stat-icon { width: 38px; height: 38px; font-size: 1.05rem; }
  .stat-value { font-size: 1.22rem; }
  .card-body { padding: 14px; }
  .card-header { padding: 12px 14px; }
  .topbar-title h1 { font-size: .98rem; }
  .course-grid { grid-template-columns: 1fr; }
  .question-card { padding: 15px; }
  .score-ring { width: 104px; height: 104px; font-size: 1.6rem; }
  .login-card { padding: 26px 20px; }
  .table > thead > tr > th,
  .table > tbody > tr > td { padding: 9px 10px; }
}

/* ============================================================ Chop etish */
@media print {
  .sidebar, .topbar, .app-footer, .page-actions, .filter-bar, .btn { display: none !important; }
  .app-main { margin-left: 0; }
  .card { box-shadow: none; border: 1px solid #ddd; }
}

/* ============================================================ Uyga vazifalar */
.hw-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.hw-grid .grid-full { grid-column: 1 / -1; }

.hw-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.hw-card.pending   { border-left-color: #f59e0b; }
.hw-card.submitted { border-left-color: #16a34a; }
.hw-card.missed    { border-left-color: #dc2626; }
.hw-card.upcoming  { border-left-color: #3b82f6; }

.hw-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.hw-code {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--muted);
  text-transform: uppercase;
}

.hw-title { font-size: 1.02rem; font-weight: 700; color: var(--text); line-height: 1.3; }

.hw-meta { font-size: .84rem; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.hw-meta i { color: var(--brand-light); }

.hw-desc {
  font-size: .85rem;
  color: var(--text);
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  margin: 2px 0;
}

.hw-countdown {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-top: 4px;
}

.hw-countdown-label { font-size: .8rem; color: #b45309; display: flex; align-items: center; gap: 6px; }

.hw-countdown-value {
  font-size: 1.05rem;
  font-weight: 700;
  color: #b45309;
  font-variant-numeric: tabular-nums;
}

.hw-countdown.is-urgent { background: #fef2f2; border-color: #fecaca; }
.hw-countdown.is-urgent .hw-countdown-label,
.hw-countdown.is-urgent .hw-countdown-value { color: #b91c1c; }

.hw-note {
  font-size: .84rem;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 4px;
}

.hw-note.info   { background: #eff6ff; color: #1d4ed8; }
.hw-note.danger { background: #fef2f2; color: #b91c1c; }

.hw-result {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-top: 4px;
}

.hw-result .score-ring { width: 56px; height: 56px; font-size: .92rem; flex: 0 0 auto; }

.hw-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: auto;
  padding-top: 10px;
}

.hw-student-list {
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
}

.hw-student { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.hw-student .form-check-label { font-size: .88rem; }

/* ============================================================ Javob varaqasi */
.answer-sheet { padding: 4px 0; }

.answer-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 7px 18px;
  border-bottom: 1px solid var(--border);
}

.answer-row:last-child { border-bottom: 0; }
.answer-row.is-answered { background: #f8fafc; }

.answer-num {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 50%;
  background: var(--bg);
  color: var(--muted);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: .82rem;
}

.answer-row.is-answered .answer-num { background: var(--brand); color: #fff; }

.answer-choices { display: flex; gap: 8px; flex-wrap: wrap; }

.answer-choice input { position: absolute; opacity: 0; width: 0; height: 0; }

.answer-choice span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: all .12s;
  user-select: none;
}

.answer-choice span:hover { border-color: var(--brand-light); color: var(--brand); }

.answer-choice input:checked + span {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.answer-choice input:focus-visible + span { outline: 2px solid var(--brand-light); outline-offset: 2px; }

/* ============================================================ Dars jadvali */
.week-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

.day-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  min-height: 150px;
}

.day-card.is-today { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(47, 133, 90, .12); }
.day-card.is-past { opacity: .72; }

.day-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  border-radius: var(--radius) var(--radius) 0 0;
}

.day-weekday { font-weight: 700; font-size: .86rem; color: var(--text); }
.day-date { font-size: .76rem; color: var(--muted); }
.day-add { margin-left: auto; padding: 2px 7px; }

.day-body { padding: 8px; display: flex; flex-direction: column; gap: 8px; }

.day-entry {
  background: var(--bg);
  border-left: 3px solid var(--brand-light);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}

.entry-time { font-size: .78rem; font-weight: 700; color: var(--brand); }
.entry-title { font-size: .88rem; font-weight: 600; color: var(--text); margin: 2px 0; }
.entry-meta { font-size: .76rem; color: var(--muted); }
.entry-actions { display: flex; gap: 4px; margin-top: 6px; }
.entry-actions .btn { padding: 1px 7px; font-size: .74rem; }

.day-empty { font-size: .8rem; color: #9ca3af; text-align: center; padding: 14px 0; }

/* ============================================================ Qarzdorlik qutisi */
.debt-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 4px;
}

.debt-box.is-clear { background: #f0fdf4; border-color: #bbf7d0; }

.debt-label { font-size: .86rem; font-weight: 600; color: #b45309; }
.debt-box.is-clear .debt-label { color: #15803d; }
.debt-hint { font-size: .76rem; color: var(--muted); }

.debt-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: #b45309;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.debt-box.is-clear .debt-value { color: #15803d; }

/* ============================================================ Yangi hisob ma'lumotlari */
.credentials-card { border-color: #86efac; background: #f0fdf4; }

.credentials-grid {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
}

.credentials-label {
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}

.credentials-value {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .02em;
}

/* ============================================================ Vazifa ko'ruvchisi (PDF) */
.pdf-shell {
  position: relative;
  background: #e5e7eb;
  border-radius: var(--radius);
  padding: 12px;
  min-height: 320px;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.pdf-status { text-align: center; color: var(--muted); padding: 60px 12px; }

.pdf-pages { display: flex; flex-direction: column; align-items: center; gap: 12px; overflow-x: auto; }

.pdf-page {
  max-width: none;
  background: #fff;
  box-shadow: var(--shadow-md);
  pointer-events: none;
}

.pdf-guard {
  display: none;
  position: absolute;
  inset: 0;
  background: #f8fafc;
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
  padding: 80px 16px;
  cursor: pointer;
}

.pdf-shell.is-hidden .pdf-pages { visibility: hidden; }
.pdf-shell.is-hidden .pdf-guard { display: block; }

.lesson-row.is-locked { opacity: .6; cursor: not-allowed; }

@media print {
  .pdf-shell, .pdf-pages { display: none !important; }
}

/* Bosiladigan ko'rsatkich kartasi (masalan, Telegram bot holati) */
.stat-card-button { text-align: left; cursor: pointer; font: inherit; color: inherit; width: 100%; }
.stat-card-button:hover { border-color: var(--brand-light); box-shadow: var(--shadow-md); }
.stat-card-button:focus-visible { outline: 2px solid var(--brand-light); outline-offset: 2px; }

/* Bosiladigan ko'rsatkich kartasi — tegishli bo'limga olib boradi */
a.stat-card-link { text-decoration: none; color: inherit; cursor: pointer; }
a.stat-card-link:hover { border-color: var(--brand-light); }
a.stat-card-link:focus-visible { outline: 2px solid var(--brand-light); outline-offset: 2px; }

/* ============================================================ Nazorat testi */
.exam-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 10px 14px;
  margin-bottom: 14px;
}
.exam-save-status { font-size: .84rem; color: var(--muted); }
.exam-save-status.is-ok { color: #15803d; }
.exam-save-status.is-error { color: #b91c1c; }
.exam-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.exam-tabs .btn { flex: 1; }

@media (min-width: 992px) {
  .exam-pdf-scroll { max-height: calc(100vh - 210px); overflow-y: auto; border-radius: var(--radius); }
  .exam-sheet-sticky { position: sticky; top: 84px; }
  .exam-sheet-sticky .answer-sheet { max-height: calc(100vh - 300px); overflow-y: auto; }
}
@media (max-width: 991.98px) {
  .mobile-hidden { display: none !important; }
}

.rank-medal {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-weight: 700;
  font-size: .82rem;
}
.rank-medal.rank-1 { background: #fef3c7; color: #b45309; }
.rank-medal.rank-2 { background: #e5e7eb; color: #374151; }
.rank-medal.rank-3 { background: #ffedd5; color: #c2410c; }

/* ---------------------------------------------------------------- Oylik maosh */
.payout-box { display: inline-block; position: relative; }
.payout-box > summary { list-style: none; cursor: pointer; }
.payout-box > summary::-webkit-details-marker { display: none; }
.payout-box[open] .payout-form {
  position: absolute; right: 0; z-index: 20; margin-top: .4rem; min-width: 240px;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; padding: .75rem;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .12);
}
.salary-row { cursor: pointer; }
.salary-row:focus-visible { outline: 2px solid #3b82f6; outline-offset: -2px; }

/* ---------------------------------------------------------------- Sinov darslari (ochiq sahifalar) */
.trial-body { background: #f1f5f9; min-height: 100vh; }
.trial-top { background: #1e3a5f; color: #fff; padding: .6rem 0; position: sticky; top: 0; z-index: 30; }
.trial-wrap { max-width: 880px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }
.trial-brand { color: #fff; text-decoration: none; font-weight: 700; display: inline-flex; align-items: center; gap: .5rem; }
.trial-brand .brand-mark { width: 30px; height: 30px; display: inline-flex; }
.trial-brand .brand-mark svg { width: 100%; height: 100%; }
.trial-timer { font-size: .85rem; background: rgba(255,255,255,.14); border-radius: 999px; padding: .2rem .7rem; white-space: nowrap; }
.trial-lesson-card { transition: box-shadow .15s, transform .15s; }
.trial-lesson-card:hover { box-shadow: 0 6px 20px rgba(15,23,42,.08); transform: translateY(-1px); }
.trial-lesson-num { width: 38px; height: 38px; border-radius: 10px; background: #dbeafe; color: #1d4ed8; display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
.trial-score { font-size: 2.2rem; font-weight: 800; color: #15803d; line-height: 1; }
.trial-marks { display: flex; flex-wrap: wrap; gap: .35rem; }
.trial-mark { min-width: 42px; text-align: center; border-radius: 8px; padding: .2rem .3rem; font-size: .8rem; font-weight: 600; }
.trial-mark small { display: block; font-weight: 400; opacity: .8; }
.trial-mark.ok { background: #dcfce7; color: #15803d; }
.trial-mark.bad { background: #fee2e2; color: #b91c1c; }
.trial-message { background: #f8fafc; border: 1px dashed #cbd5e1; border-radius: 10px; padding: .8rem 1rem; white-space: pre-wrap; }
.trial-offer { border-color: #fde68a; }
.trial-offer .card-header { background: #fffbeb; }

/* ---------------------------------------------------------------- Face ID */
.face-card { max-width: 520px; }
.face-stage {
  position: relative; width: 100%; aspect-ratio: 4 / 3; background: #0f172a;
  border-radius: 16px; overflow: hidden; margin-bottom: .75rem;
}
.face-stage video {
  width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); /* oyna kabi */
  display: none;
}
.face-stage.is-live video { display: block; }
.face-placeholder {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center;
  justify-content: center; color: #94a3b8; font-size: .9rem; text-align: center;
}
.face-oval {
  position: absolute; left: 50%; top: 50%; width: 52%; height: 78%;
  transform: translate(-50%, -50%); border-radius: 50%;
  border: 3px dashed rgba(255, 255, 255, .75);
  box-shadow: 0 0 0 999px rgba(15, 23, 42, .35); pointer-events: none;
  transition: border-color .2s;
}
.face-stage.is-checking .face-oval { border-color: #60a5fa; border-style: solid; animation: face-pulse 1s infinite; }
.face-stage.is-success .face-oval { border-color: #22c55e; border-style: solid; }
.face-stage.is-failed .face-oval { border-color: #ef4444; border-style: solid; }
@keyframes face-pulse { 50% { opacity: .45; } }
.face-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); font-size: 2.6rem; color: #fff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .5); animation: face-nudge .9s ease-in-out infinite;
}
.face-arrow.is-left { left: 6%; }
.face-arrow.is-right { right: 6%; }
@keyframes face-nudge { 50% { transform: translateY(-50%) scale(1.15); } }
.face-instruction { text-align: center; font-weight: 700; font-size: 1.05rem; min-height: 1.6em; margin-bottom: .4rem; }
.face-progress { height: 6px; }
.face-tips { font-size: .8rem; padding-left: 1.1rem; }
.face-photo { width: 100%; max-width: 180px; border-radius: 12px; display: block; margin: 0 auto; }

/* Xodimlar ulushi: sana + foiz */
.rate-head { display:flex; justify-content:flex-end; gap:.5rem; font-size:.74rem; color:var(--muted); }
.rate-inputs { display:flex; align-items:center; gap:.5rem; flex-wrap:wrap; justify-content:flex-end; }
