/* Mustaqil Ta'lim — Design System 2026 */

:root {
  --brand: #1A6DB5;
  --brand-dark: #0E4A85;
  --brand-light: #E8F2FA;
  --brand-muted: #4A8FC4;
  --brand-soft: rgba(26, 109, 181, 0.08);

  --grey-0: #FFFFFF;
  --grey-5: #F4F7FA;
  --grey-10: #EAEFF4;
  --grey-20: #D8E0E8;
  --grey-30: #C1CCD8;
  --grey-40: #8B9AAB;
  --grey-50: #64748B;
  --grey-60: #475569;
  --grey-70: #334155;
  --grey-80: #1E293B;
  --grey-90: #0F172A;

  --success: #059669;
  --success-soft: #ECFDF5;
  --warning: #D97706;
  --warning-soft: #FFFBEB;
  --danger: #DC2626;
  --danger-soft: #FEF2F2;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.1);

  --header-h: 4rem;
  --sidebar-w: 16rem;
  --footer-h: 3.75rem;
  --chrome-line: rgba(216, 224, 232, 0.95);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  background-color: var(--grey-5);
  color: var(--grey-90);
  line-height: 1.5;
  min-height: 100dvh;
  overflow-x: hidden;
}

body.app-authenticated {
  background:
    radial-gradient(ellipse 90% 45% at 0% -5%, rgba(26, 109, 181, 0.07), transparent 55%),
    radial-gradient(ellipse 70% 40% at 100% 0%, rgba(14, 74, 133, 0.045), transparent 50%),
    linear-gradient(180deg, #F7FAFC 0%, var(--grey-5) 40%, #F2F6FA 100%);
}

/* Sticky footer: kontent kam bo'lsa ham footer viewport pastida */
.app-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  transition: margin 0.3s var(--ease);
}

.app-shell-main {
  flex: 1 0 auto;
  width: 100%;
}

.app-shell > footer {
  flex-shrink: 0;
  margin-top: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
}

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

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

/* ——— Layout ——— */
.content-container {
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

/* Teacher panel: to'liq kenglik (yarim-bo'sh layout yo'q) */
.content-container.page-full {
  max-width: none;
  width: 100%;
  margin: 0;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

@media (min-width: 640px) {
  .content-container {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  .content-container.page-full {
    padding-left: 1.75rem;
    padding-right: 1.75rem;
  }
}

@media (min-width: 1280px) {
  .content-container.page-full {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

.page-shell {
  padding-top: 1.35rem;
  padding-bottom: 3rem;
}

@media (min-width: 768px) {
  .page-shell {
    padding-top: 1.75rem;
    padding-bottom: 3.25rem;
  }
}

.page-header {
  margin-bottom: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1.15rem;
  border-bottom: 1px solid rgba(216, 224, 232, 0.9);
}

.page-header-text {
  min-width: 0;
  flex: 1 1 16rem;
}

.page-header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.page-title {
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--grey-90);
  line-height: 1.2;
}

.page-subtitle {
  margin-top: 0.4rem;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--grey-50);
  max-width: 40rem;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  margin-bottom: 0.5rem;
  font-size: 0.75rem;
  color: var(--grey-40);
}

.breadcrumb a {
  color: var(--brand);
  font-weight: 600;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb-sep {
  color: var(--grey-30);
}

/* Tabs */
.panel-tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid var(--grey-20);
  margin-bottom: 1.25rem;
  overflow-x: auto;
}

.panel-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--grey-50);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  transition: color 0.15s var(--ease), border-color 0.15s var(--ease);
}

.panel-tab:hover {
  color: var(--grey-80);
}

.panel-tab.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
}

/* Form grid — to'liq kenglik, 2 ustun */
.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem 1.25rem;
}

@media (min-width: 768px) {
  .form-grid {
    grid-template-columns: 1fr 1fr;
  }

  .form-grid .form-span-2 {
    grid-column: 1 / -1;
  }
}

/* Yangi guruh — bitta qator */
.group-create-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem 1rem;
  align-items: end;
}

@media (min-width: 900px) {
  .group-create-row {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.2fr) minmax(0, 0.9fr) auto;
  }
}

.group-create-row__action {
  display: flex;
  align-items: end;
}

.group-create-row__action .btn-primary {
  width: 100%;
  min-height: 2.75rem;
}

@media (min-width: 900px) {
  .group-create-row__action .btn-primary {
    width: auto;
  }
}

.form-field label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--grey-60);
  margin-bottom: 0.35rem;
}

.form-field .errorlist {
  list-style: none;
  margin: 0.35rem 0 0;
  padding: 0;
  font-size: 0.75rem;
  color: var(--danger);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.25rem;
}

@media (max-width: 639px) {
  .form-actions .btn-primary,
  .form-actions .btn-secondary,
  .form-actions .btn-danger {
    flex: 1 1 100%;
    width: 100%;
  }
}

.form-actions.form-span-2 {
  grid-column: 1 / -1;
}

/* Panel sections */
.panel-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(216, 224, 232, 0.95);
  border-radius: var(--radius-xl);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03), 0 10px 30px -18px rgba(15, 23, 42, 0.12);
  overflow: visible;
  backdrop-filter: blur(8px);
}

.panel-card > .panel-card-header:first-child {
  border-top-left-radius: var(--radius-xl);
  border-top-right-radius: var(--radius-xl);
}

.panel-card > .panel-card-body:last-child,
.panel-card > .desktop-table:last-child,
.panel-card > .mobile-cards:last-child {
  border-bottom-left-radius: var(--radius-xl);
  border-bottom-right-radius: var(--radius-xl);
}

.panel-card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.35rem;
  border-bottom: 1px solid var(--grey-20);
  background: linear-gradient(180deg, #FBFDFF 0%, #F5F8FB 100%);
}

.panel-card-body {
  padding: 1.35rem;
}

.panel-card-body.flush {
  padding: 0;
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.625rem;
  padding: 0.55rem 1.15rem;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  border-radius: 9999px;
  cursor: pointer;
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid rgba(220, 38, 38, 0.2);
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.15s var(--ease);
}

.btn-danger:hover {
  background: #fee2e2;
  border-color: rgba(220, 38, 38, 0.35);
  transform: translateY(-1px);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 2.35rem;
  padding: 0.4rem 0.85rem;
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: 9999px;
  color: var(--grey-60);
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease), border-color 0.15s var(--ease);
}

.btn-ghost:hover {
  background: var(--grey-5);
  color: var(--grey-90);
  border-color: var(--grey-20);
}

.split-panels {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

/* Planshet va undan yuqori: 2 ustun */
@media (min-width: 768px) {
  .split-panels {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .split-panels.split-panels-stack-tablet {
    grid-template-columns: 1fr;
  }
}

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

.empty-state .stat-icon {
  margin: 0 auto 0.75rem;
}

/* ——— Typography helpers ——— */
.text-xsmall-regular { font-size: 0.625rem; line-height: 1rem; font-weight: 400; }
.text-small-regular { font-size: 0.75rem; line-height: 1.25rem; font-weight: 400; }
.text-small-semi { font-size: 0.75rem; line-height: 1.25rem; font-weight: 600; }
.text-base-regular { font-size: 0.875rem; line-height: 1.5rem; font-weight: 400; }
.text-base-semi { font-size: 0.875rem; line-height: 1.5rem; font-weight: 600; }
.text-large-regular { font-size: 1rem; line-height: 1.5rem; font-weight: 400; }
.text-large-semi { font-size: 1rem; line-height: 1.5rem; font-weight: 600; }
.text-xl-regular { font-size: 1.5rem; line-height: 2rem; font-weight: 400; }
.text-xl-semi { font-size: 1.5rem; line-height: 2rem; font-weight: 700; letter-spacing: -0.02em; }
.text-2xl-semi { font-size: 1.75rem; line-height: 2.25rem; font-weight: 700; letter-spacing: -0.02em; }
.text-3xl-semi { font-size: 1.875rem; line-height: 2.25rem; font-weight: 700; letter-spacing: -0.025em; }

/* ——— Buttons ——— */
.btn-primary,
.btn-secondary,
.btn-soft,
.contrast-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.625rem;
  padding: 0.55rem 1.15rem;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  border-radius: 9999px;
  cursor: pointer;
  transition:
    background-color 0.2s var(--ease),
    border-color 0.2s var(--ease),
    color 0.2s var(--ease),
    box-shadow 0.2s var(--ease),
    transform 0.15s var(--ease);
}

.btn-primary {
  background: var(--brand);
  color: #fff;
  border: 1px solid transparent;
  box-shadow: 0 1px 2px rgba(14, 74, 133, 0.12), 0 8px 20px -10px rgba(14, 74, 133, 0.45);
}

.btn-primary:hover {
  background: var(--brand-dark);
  box-shadow: 0 2px 4px rgba(14, 74, 133, 0.14), 0 12px 24px -12px rgba(14, 74, 133, 0.5);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(14, 74, 133, 0.16);
}

.btn-primary i {
  font-size: 0.8em;
  opacity: 0.95;
}

.btn-secondary {
  background: var(--grey-0);
  color: var(--grey-80);
  border: 1px solid var(--grey-20);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.btn-secondary:hover {
  background: var(--grey-5);
  border-color: var(--grey-30);
  color: var(--grey-90);
  transform: translateY(-1px);
}

.btn-soft {
  background: var(--brand-soft);
  color: var(--brand-dark);
  border: 1px solid rgba(26, 109, 181, 0.14);
  box-shadow: none;
}

.btn-soft:hover {
  background: rgba(26, 109, 181, 0.14);
  border-color: rgba(26, 109, 181, 0.28);
  transform: translateY(-1px);
}

.contrast-btn {
  border: 1px solid var(--grey-90);
  background: transparent;
  color: var(--grey-90);
  border-radius: 9999px;
}

.contrast-btn:hover {
  background: var(--grey-90);
  color: var(--grey-0);
}

/* ——— Cards ——— */
.card {
  background: var(--grey-0);
  border: 1px solid var(--grey-20);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

@media (min-width: 768px) {
  .card {
    padding: 1.5rem;
  }
}

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

.stat-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(216, 224, 232, 0.95);
  border-radius: var(--radius-xl);
  padding: 1.2rem 1.25rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03), 0 10px 28px -18px rgba(15, 23, 42, 0.14);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
}

a.stat-card:hover,
.stat-card.interactive:hover {
  border-color: rgba(26, 109, 181, 0.35);
  box-shadow: 0 8px 28px -12px rgba(14, 74, 133, 0.25);
  transform: translateY(-2px);
}

.stat-card .stat-icon {
  width: 2.85rem;
  height: 2.85rem;
  border-radius: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  flex-shrink: 0;
  background: linear-gradient(145deg, #EEF6FC, #E2EFF9);
  color: var(--brand);
  border: 1px solid rgba(26, 109, 181, 0.1);
}

.stat-card .stat-icon.success {
  background: var(--success-soft);
  color: var(--success);
}

.stat-card .stat-icon.warning {
  background: var(--warning-soft);
  color: var(--warning);
}

.stat-card .stat-icon.muted {
  background: var(--grey-10);
  color: var(--grey-50);
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--grey-90);
}

.stat-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--grey-50);
  margin-bottom: 0.25rem;
}

/* ——— Inputs ——— */
.medusa-input {
  position: relative;
  width: 100%;
}

.medusa-input input {
  width: 100%;
  padding: 1.1rem 1rem 0.35rem;
  height: 3.25rem;
  background: var(--grey-0);
  border: 1px solid var(--grey-20);
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  font-family: inherit;
  color: var(--grey-90);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.medusa-input input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.medusa-input input:focus ~ label,
.medusa-input input:not(:placeholder-shown) ~ label {
  transform: translateY(-0.55rem);
  font-size: 0.625rem;
  color: var(--brand);
  font-weight: 600;
}

.medusa-input label {
  position: absolute;
  left: 1rem;
  top: 1rem;
  color: var(--grey-50);
  font-size: 0.875rem;
  pointer-events: none;
  transition: transform 0.2s var(--ease), font-size 0.2s var(--ease), color 0.2s var(--ease);
}

.field-control {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.5rem 1rem;
  background: var(--grey-0);
  border: 1px solid var(--grey-20);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--grey-90);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), background-color 0.2s var(--ease);
}

.field-control:hover {
  background: var(--grey-5);
}

.field-control:focus {
  outline: none;
  border-color: var(--brand);
  background: var(--grey-0);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

/* ——— Badges ——— */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  font-size: 0.6875rem;
  font-weight: 600;
  border-radius: 9999px;
  border: 1px solid transparent;
  white-space: nowrap;
}

.badge-success {
  background: var(--success-soft);
  color: var(--success);
  border-color: rgba(5, 150, 105, 0.2);
}

.badge-pending {
  background: var(--warning-soft);
  color: var(--warning);
  border-color: rgba(217, 119, 6, 0.2);
}

.badge-neutral {
  background: var(--grey-10);
  color: var(--grey-60);
  border-color: var(--grey-20);
}

.badge-danger {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: rgba(220, 38, 38, 0.2);
}

.deadline-date {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--grey-60);
  white-space: nowrap;
}

.deadline-date.deadline-overdue {
  color: var(--danger);
}

.deadline-date.deadline-soon {
  color: var(--warning);
}

.deadline-swatch {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  display: inline-block;
}

.deadline-swatch.deadline-overdue {
  background: var(--danger);
}

.deadline-swatch.deadline-soon {
  background: var(--warning);
}

.assign-table .field-control {
  min-width: 10rem;
}

/* ——— Tables / mobile lists ——— */
.data-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -0.25rem;
  padding: 0 0.25rem;
}

.data-table {
  min-width: 100%;
  border-collapse: collapse;
}

.data-table th {
  padding: 0.85rem 1.15rem;
  text-align: left;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--grey-40);
  white-space: nowrap;
  border-bottom: 1px solid var(--grey-20);
}

.data-table td {
  padding: 1rem 1.15rem;
  font-size: 0.875rem;
  border-top: 1px solid rgba(234, 239, 244, 0.95);
  vertical-align: middle;
}

.data-table thead {
  background: linear-gradient(180deg, #FBFDFF 0%, #F5F8FB 100%);
}

.data-table tbody tr {
  transition: background-color 0.15s var(--ease);
}

.data-table tbody tr:hover {
  background: rgba(26, 109, 181, 0.035);
}

.data-table tbody tr.table-row-link {
  cursor: pointer;
}

.data-table tbody tr.table-row-link:hover {
  background: rgba(26, 109, 181, 0.06);
}

.data-table tbody tr.table-row-link:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}

.data-table th.table-num,
.data-table td.table-num {
  width: 3rem;
  text-align: center;
  color: var(--grey-40);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  white-space: nowrap;
}

/* Desktop table / mobile cards */
.desktop-table {
  display: none;
}

.mobile-cards {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.75rem;
}

@media (min-width: 768px) {
  .desktop-table {
    display: block;
  }

  .mobile-cards {
    display: none;
  }
}

.task-card-mobile {
  display: block;
  padding: 1rem;
  background: var(--grey-5);
  border: 1px solid var(--grey-20);
  border-radius: var(--radius-md);
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}

a.task-card-mobile:hover,
.task-card-mobile:hover {
  border-color: var(--brand-muted);
  background: var(--grey-0);
}

.task-card-mobile .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-top: 0.75rem;
  font-size: 0.75rem;
  color: var(--grey-50);
}

.task-card-mobile .card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.875rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--grey-20);
}

.task-card-mobile .card-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--grey-90);
  line-height: 1.35;
  word-break: break-word;
}

/* Status matrix: sticky first column + scroll hint */
.status-matrix-wrap {
  position: relative;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

.status-matrix-wrap::after {
  content: '';
  position: sticky;
  right: 0;
  top: 0;
  float: right;
  width: 2rem;
  height: 0;
  pointer-events: none;
  box-shadow: inset -1.25rem 0 1rem -1rem rgba(15, 23, 42, 0.12);
}

.status-matrix th:first-child,
.status-matrix td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--grey-0);
  box-shadow: 4px 0 8px -4px rgba(15, 23, 42, 0.12);
}

.status-matrix thead th:first-child {
  background: var(--grey-5);
  z-index: 3;
}

.status-matrix th:not(:first-child),
.status-matrix td:not(:first-child) {
  min-width: 7.5rem;
}

.grade-pdf-frame {
  width: 100%;
  height: min(50vh, 28rem);
  border-radius: var(--radius-md);
  border: 1px solid var(--grey-20);
  background: var(--grey-5);
}

@media (min-width: 768px) {
  .grade-pdf-frame {
    height: min(70vh, 40rem);
  }
}

@media (min-width: 1024px) {
  .grade-pdf-frame {
    height: 70vh;
  }
}

/* ——— Filter bar ——— */
.filter-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  align-items: end;
}

@media (min-width: 640px) {
  .filter-form {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .filter-form.cols-3 {
    grid-template-columns: repeat(3, 1fr);
  }

  .filter-form.cols-4 {
    grid-template-columns: repeat(4, 1fr);
  }

  .filter-form.cols-5 {
    grid-template-columns: repeat(5, 1fr);
  }
}

.filter-actions {
  display: flex;
  gap: 0.75rem;
}

.filter-actions .btn-primary,
.filter-actions .btn-secondary {
  flex: 1;
}

@media (min-width: 1024px) {
  .filter-actions .btn-primary,
  .filter-actions .btn-secondary {
    flex: none;
    width: 100%;
  }
}

/* ——— Sidebar ——— */
#sidebar {
  scrollbar-width: thin;
  scrollbar-color: var(--grey-30) transparent;
}

#sidebar::-webkit-scrollbar {
  width: 5px;
}

#sidebar::-webkit-scrollbar-thumb {
  background: var(--grey-30);
  border-radius: 999px;
}

.sidebar-nav-item {
  position: relative;
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease), transform 0.15s var(--ease);
  border: 1px solid transparent;
}

.sidebar-nav-item:hover {
  background-color: rgba(26, 109, 181, 0.06);
  color: var(--brand-dark);
}

.sidebar-nav-item.active {
  background: linear-gradient(90deg, rgba(26, 109, 181, 0.12), rgba(26, 109, 181, 0.05));
  color: var(--brand-dark);
  font-weight: 700;
  border-color: rgba(26, 109, 181, 0.1);
}

.sidebar-nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 18%;
  bottom: 18%;
  width: 3px;
  background: var(--brand);
  border-radius: 0 3px 3px 0;
}

.sidebar-nav-item i {
  width: 1.25rem;
  text-align: center;
  opacity: 0.9;
}

.sidebar-nav-item.active i {
  color: var(--brand);
}

.sidebar-nav-item:active {
  transform: scale(0.98);
}

@media (max-width: 1023px) {
  #sidebar {
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
    z-index: 60;
  }

  #sidebar.open {
    transform: translateX(0);
  }

  #sidebar-overlay:not(.hidden) {
    display: block;
    z-index: 55;
  }
}

@media (min-width: 1024px) {
  #nav-menu-btn {
    display: none !important;
  }

  #sidebar-overlay {
    display: none !important;
  }
}

/* Touch-friendly controls */
@media (max-width: 1023px) {
  .btn-primary,
  .btn-secondary,
  .btn-danger,
  .btn-ghost {
    min-height: 2.75rem;
  }

  .panel-tab {
    min-height: 2.75rem;
    padding-inline: 0.875rem;
  }

  .page-header-actions {
    width: 100%;
  }

  .page-header-actions > * {
    flex: 1 1 auto;
  }

  .page-header-actions .btn-primary,
  .page-header-actions .btn-secondary,
  .page-header-actions .btn-danger {
    width: 100%;
  }

  .page-header-actions form {
    flex: 1 1 auto;
  }

  .page-header-actions form button {
    width: 100%;
  }
}

@media (min-width: 640px) and (max-width: 1023px) {
  .content-container.page-full {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

/* ——— Toast ——— */
@keyframes slide-in-right {
  from { transform: translateX(1.5rem); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slide-out-right {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(1.5rem); opacity: 0; }
}

.animate-slide-in-right {
  animation: slide-in-right 0.35s var(--ease);
}

.message-toast {
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-md);
}

@media (max-width: 640px) {
  #messages-container {
    left: 0.75rem;
    right: 0.75rem;
    max-width: none;
  }
}

/* ——— Login ——— */
.login-page {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse 120% 70% at 50% -10%, rgba(26, 109, 181, 0.5), transparent 55%),
    linear-gradient(180deg, #0B3A66 0%, #1A6DB5 26%, #E8F2FA 26.05%, #F4F7FA 100%);
}

@media (min-width: 768px) {
  .login-page {
    background:
      radial-gradient(ellipse 50% 80% at 0% 50%, rgba(26, 109, 181, 0.35), transparent 55%),
      linear-gradient(105deg, #0B3A66 0%, #1A6DB5 38%, #F4F7FA 38.05%, #F4F7FA 100%);
  }
}

.login-card {
  width: 100%;
  max-width: 26rem;
  margin-inline: auto;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-xl);
  padding: 2rem 1.5rem;
  box-shadow: var(--shadow-lg);
  animation: login-rise 0.55s var(--ease);
}

@media (min-width: 640px) {
  .login-card {
    padding: 2.5rem 2rem;
  }
}

@keyframes login-rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.login-brand {
  text-align: center;
  margin-bottom: 1.75rem;
}

.login-logo {
  display: block;
  width: 6.5rem;
  height: 6.5rem;
  margin: 0 auto 1.125rem;
  object-fit: contain;
  border-radius: 50%;
  animation: logo-in 0.55s var(--ease) both;
}

@keyframes logo-in {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

.login-brand .brand-name {
  font-size: 1.125rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--grey-90);
  line-height: 1.25;
  max-width: 18rem;
  margin-left: auto;
  margin-right: auto;
}

.login-brand .brand-department {
  margin-top: 0.625rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--brand-dark);
  line-height: 1.4;
  max-width: 20rem;
  margin-left: auto;
  margin-right: auto;
}

.login-brand .brand-tag {
  margin-top: 0.375rem;
  font-size: 0.75rem;
  color: var(--grey-50);
  line-height: 1.45;
  max-width: 22rem;
  margin-left: auto;
  margin-right: auto;
}

/* ——— Empty state ——— */
.empty-state {
  text-align: center;
  padding: 3.25rem 1.5rem 3.5rem;
  color: var(--grey-50);
}

.empty-state i {
  font-size: inherit;
  color: inherit;
  margin-bottom: 0;
}

.empty-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--grey-20);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(ellipse 70% 55% at 50% 0%, rgba(26, 109, 181, 0.08), transparent 60%),
    linear-gradient(180deg, #FFFFFF 0%, #F7FAFC 100%);
  box-shadow: var(--shadow-sm);
  padding: 2.75rem 1.5rem 2.5rem;
  text-align: center;
}

.empty-panel::before {
  content: '';
  position: absolute;
  inset: auto 12% -40% 12%;
  height: 55%;
  background: radial-gradient(ellipse at center, rgba(26, 109, 181, 0.06), transparent 70%);
  pointer-events: none;
}

.empty-visual {
  position: relative;
  width: 5.5rem;
  height: 5.5rem;
  margin: 0 auto 1.35rem;
  border-radius: 1.5rem;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #EEF6FC, #E2EFF9);
  border: 1px solid rgba(26, 109, 181, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  color: var(--brand);
  font-size: 1.65rem;
}

.empty-visual::after {
  content: '';
  position: absolute;
  inset: -0.55rem;
  border-radius: 1.85rem;
  border: 1px dashed rgba(26, 109, 181, 0.18);
  pointer-events: none;
}

.empty-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  color: var(--grey-90);
}

.empty-text {
  margin: 0.45rem auto 0;
  max-width: 22rem;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--grey-50);
}

.empty-actions {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem;
  margin-top: 1.35rem;
}

.empty-hint {
  margin-top: 1rem;
  font-size: 0.75rem;
  color: var(--grey-40);
}

/* ——— Info callout ——— */
.callout {
  padding: 1rem 1.125rem;
  border-radius: var(--radius-md);
  background: var(--brand-soft);
  border: 1px solid rgba(26, 109, 181, 0.15);
  font-size: 0.8125rem;
  color: var(--grey-70);
  line-height: 1.55;
}

.callout strong {
  color: var(--brand-dark);
}

/* ——— Header glass ——— */
.app-header {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px) saturate(1.2);
  border-bottom: 1px solid rgba(216, 224, 232, 0.9);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset;
}

.app-footer {
  height: var(--footer-h);
  min-height: var(--footer-h);
  display: flex;
  align-items: center;
  border-top: 1px solid var(--chrome-line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(247, 250, 252, 0.95));
  backdrop-filter: blur(10px);
}

.app-footer > .content-container {
  padding-top: 0;
  padding-bottom: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
}

.sidebar-foot {
  height: var(--footer-h);
  min-height: var(--footer-h);
  display: flex;
  align-items: center;
  flex-shrink: 0;
  padding: 0 1.25rem;
  border-top: 1px solid var(--chrome-line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(247, 250, 252, 0.95));
}

#sidebar {
  background: rgba(255, 255, 255, 0.96) !important;
  border-right-color: var(--chrome-line) !important;
  box-shadow: 8px 0 28px -20px rgba(15, 23, 42, 0.18);
}

@media (min-width: 1024px) {
  body.app-authenticated #sidebar {
    height: calc(100dvh - var(--header-h));
  }
}

.field-control {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.55rem 1rem;
  background: var(--grey-0);
  border: 1px solid var(--grey-20);
  border-radius: 0.85rem;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--grey-90);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), background-color 0.2s var(--ease);
}

.field-control:hover {
  background: #FBFCFD;
  border-color: var(--grey-30);
}

.field-control:focus {
  outline: none;
  border-color: var(--brand);
  background: var(--grey-0);
  box-shadow: 0 0 0 4px var(--brand-soft);
}

.task-card-mobile {
  display: block;
  padding: 1.05rem 1.1rem;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(216, 224, 232, 0.95);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease), box-shadow 0.2s var(--ease), transform 0.15s var(--ease);
}

a.task-card-mobile:hover,
.task-card-mobile:hover {
  border-color: rgba(26, 109, 181, 0.35);
  background: #fff;
  box-shadow: 0 8px 24px -14px rgba(14, 74, 133, 0.28);
  transform: translateY(-1px);
}

.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* Safe area helpers */
.safe-fab {
  bottom: max(1rem, env(safe-area-inset-bottom));
  left: max(1rem, env(safe-area-inset-left));
}

/* Prevent iOS input zoom on small screens */
@media (max-width: 767px) {
  .field-control,
  .medusa-input input,
  select.field-control,
  textarea.field-control {
    font-size: 16px;
  }
}

/* ——— Motion / polish ——— */
@keyframes page-enter {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes reveal-up {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.page-enter {
  animation: page-enter 0.45s var(--ease) both;
}

.reveal-item {
  animation: reveal-up 0.4s var(--ease) both;
  animation-delay: calc(var(--delay, 0) * 45ms);
}

.page-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.35rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand);
}

#route-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  z-index: 100;
  background: linear-gradient(90deg, var(--brand), var(--brand-muted));
  opacity: 0;
  transition: width 0.35s var(--ease), opacity 0.2s;
  pointer-events: none;
}

#route-progress.is-active {
  opacity: 1;
  width: 78%;
}

#route-progress.is-done {
  width: 100%;
  opacity: 0;
  transition: width 0.2s ease, opacity 0.35s ease 0.15s;
}

.btn-loading-capable.is-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.btn-loading-capable.is-loading::after {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  width: 1.1rem;
  height: 1.1rem;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.btn-secondary.btn-loading-capable.is-loading::after,
.btn-ghost.btn-loading-capable.is-loading::after {
  border-color: rgba(26, 109, 181, 0.2);
  border-top-color: var(--brand);
}

.filter-chip-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.25rem;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  border: 1px solid var(--grey-20);
  background: var(--grey-0);
  color: var(--grey-60);
  font-size: 0.75rem;
  font-weight: 600;
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease), transform 0.15s var(--ease);
}

.filter-chip:hover {
  border-color: var(--brand-muted);
  color: var(--brand-dark);
  transform: translateY(-1px);
}

.filter-chip.is-active {
  background: var(--brand-soft);
  border-color: rgba(26, 109, 181, 0.35);
  color: var(--brand-dark);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.filter-chip-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.35rem;
  border-radius: 9999px;
  background: var(--grey-10);
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--grey-60);
}

.filter-chip.is-active .filter-chip-count {
  background: var(--brand);
  color: #fff;
}

.filter-chip--overdue.is-active {
  background: var(--warning-soft);
  border-color: rgba(217, 119, 6, 0.35);
  color: var(--warning);
}

.filter-chip--graded.is-active {
  background: var(--success-soft);
  border-color: rgba(5, 150, 105, 0.3);
  color: var(--success);
}

.filter-chip--ungraded.is-active {
  background: #FFF7ED;
  border-color: rgba(234, 88, 12, 0.3);
  color: #C2410C;
}

.students-toolbar-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  align-items: end;
}

@media (min-width: 768px) {
  .students-toolbar-grid {
    grid-template-columns: 1.4fr 1fr auto;
  }
}

.students-toolbar-actions {
  margin-top: 0;
}

.student-card {
  background: var(--grey-0);
  border: 1px solid var(--grey-20);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.student-card:hover {
  border-color: var(--grey-30);
  box-shadow: var(--shadow-md);
}

.student-card.is-open {
  border-color: rgba(26, 109, 181, 0.35);
  box-shadow: 0 8px 28px rgba(14, 74, 133, 0.08);
}

.student-card-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 1rem 1.15rem;
  text-align: left;
  background: transparent;
  border: 0;
  cursor: pointer;
  transition: background-color 0.15s var(--ease);
}

.student-card-head:hover {
  background: var(--grey-5);
}

.student-avatar {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--brand-dark);
  background: linear-gradient(145deg, #E8F2FA, #D6E8F6);
  border: 1px solid rgba(26, 109, 181, 0.15);
  vertical-align: middle;
}

.student-avatar--sm {
  width: 2.1rem;
  height: 2.1rem;
  font-size: 0.8rem;
}

.students-table td .students-table-name {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  white-space: nowrap;
}

.students-table-fullname {
  display: block;
  font-weight: 650;
  color: var(--grey-90);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.students-table-num {
  text-align: center;
  color: var(--grey-40);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.students-table th.students-table-num {
  text-align: center;
}

.students-table {
  width: 100%;
  min-width: 100%;
  table-layout: fixed;
}

.students-table th:nth-child(1),
.students-table td:nth-child(1) {
  width: 4%;
}

.students-table th:nth-child(2),
.students-table td:nth-child(2) {
  width: 32%;
}

.students-table th:nth-child(3),
.students-table td:nth-child(3) {
  width: 18%;
}

.students-table th:nth-child(4),
.students-table td:nth-child(4) {
  width: 22%;
}

.students-table th:nth-child(5),
.students-table td:nth-child(5) {
  width: 24%;
}

.students-tg-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #229ED9;
  text-decoration: none;
  white-space: nowrap;
  border-radius: 0.4rem;
  padding: 0.2rem 0.4rem;
  margin: -0.2rem -0.4rem;
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
}

.students-tg-link:hover {
  background: rgba(34, 158, 217, 0.1);
  color: #1a7fb0;
  text-decoration: underline;
}

.student-card-meta {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.75rem;
  min-width: 0;
}

.student-card-name {
  font-size: 0.975rem;
  font-weight: 700;
  color: var(--grey-90);
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.student-card-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.6rem;
  margin-top: 0.3rem;
}

.student-card-stats {
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
  margin-right: 0.5rem;
}

.status-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--grey-30);
}

.status-dot--no_topic { background: var(--grey-30); }
.status-dot--not_uploaded { background: var(--brand-muted); }
.status-dot--overdue { background: var(--warning); }
.status-dot--ungraded { background: #EA580C; }
.status-dot--graded { background: var(--success); }

.student-card-chevron {
  color: var(--grey-40);
  font-size: 0.75rem;
  transition: transform 0.25s var(--ease);
}

.student-card.is-open .student-card-chevron {
  transform: rotate(180deg);
}

.student-card-link {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.student-card-link:hover {
  border-color: rgba(26, 109, 181, 0.4);
}

.student-card-link .student-card-chevron {
  transform: none;
}

.student-avatar--lg {
  width: 4rem;
  height: 4rem;
  font-size: 1.5rem;
}

.student-profile-grid {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .student-profile-grid {
    grid-template-columns: 1.2fr 1fr;
    align-items: center;
  }
}

.student-profile-identity {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.student-profile-facts {
  display: grid;
  gap: 0.85rem;
  margin: 0;
}

.student-profile-facts dt {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--grey-40);
  margin-bottom: 0.2rem;
}

.student-profile-facts dt i {
  margin-right: 0.35rem;
  color: var(--brand);
}

.student-profile-facts dd {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--grey-80);
}

.student-work-row {
  display: grid;
  gap: 1rem;
  padding: 1.15rem 1.25rem;
  border-bottom: 1px solid var(--grey-20);
}

.student-work-row:last-child {
  border-bottom: 0;
}

@media (min-width: 900px) {
  .student-work-row {
    grid-template-columns: 1fr auto;
    align-items: start;
  }
}

.student-work-main {
  display: flex;
  gap: 0.85rem;
  min-width: 0;
}

.student-work-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.submission-file-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.submission-file-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-md);
  background: #F8FBFE;
  border: 1px solid rgba(26, 109, 181, 0.12);
}

.student-card-body {
  border-top: 1px solid var(--grey-20);
  background: linear-gradient(180deg, var(--grey-5), var(--grey-0));
  padding: 0.75rem 1rem 1rem;
  animation: page-enter 0.3s var(--ease);
}

.subject-tree {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.subject-tree-item {
  border: 1px solid var(--grey-20);
  border-radius: var(--radius-md);
  background: var(--grey-0);
  overflow: hidden;
}

.subject-tree-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--grey-10);
}

.subject-tree-icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-soft);
  color: var(--brand);
  flex-shrink: 0;
}

.badge-cat {
  font-size: 0.65rem;
  text-transform: none;
  letter-spacing: 0;
}

.badge-cat--no_topic {
  background: var(--grey-10);
  color: var(--grey-50);
  border-color: var(--grey-20);
}

.badge-cat--not_uploaded {
  background: var(--brand-soft);
  color: var(--brand-dark);
  border-color: rgba(26, 109, 181, 0.2);
}

.badge-cat--overdue {
  background: var(--warning-soft);
  color: var(--warning);
  border-color: rgba(217, 119, 6, 0.25);
}

.badge-cat--ungraded {
  background: #FFF7ED;
  color: #C2410C;
  border-color: rgba(234, 88, 12, 0.25);
}

.badge-cat--graded {
  background: var(--success-soft);
  color: var(--success);
  border-color: rgba(5, 150, 105, 0.25);
}

.topic-leaf {
  padding: 0.75rem 1rem 0.9rem;
}

.topic-leaf-inner,
.topic-leaf-empty {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-md);
  background: var(--grey-5);
  border: 1px dashed var(--grey-20);
}

.topic-leaf-inner {
  border-style: solid;
  background: #F8FBFE;
  border-color: rgba(26, 109, 181, 0.15);
}

.topic-leaf-empty {
  color: var(--grey-50);
  font-size: 0.8125rem;
}

.topic-leaf-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  flex-shrink: 0;
}

.sidebar-nav-item.active i {
  color: var(--brand);
}

.sidebar-nav-item:active {
  transform: scale(0.98);
}

.skeleton {
  background: linear-gradient(90deg, var(--grey-10) 25%, var(--grey-5) 50%, var(--grey-10) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s ease infinite;
  border-radius: var(--radius-sm);
}

/* ——— Hisobotlar ——— */
.reports-filters-body {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.85rem 1rem;
}

.reports-filter-field {
  flex: 1 1 11rem;
  min-width: 10rem;
}

.reports-filter-field label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--grey-50);
  margin-bottom: 0.35rem;
}

.reports-filter-field .medusa-select,
.reports-filter-field select {
  width: 100%;
  height: 2.75rem;
  padding: 0 0.9rem;
  border: 1px solid var(--grey-20);
  border-radius: var(--radius-md);
  background: var(--grey-0);
  color: var(--grey-90);
  font-size: 0.9rem;
  font-family: inherit;
}

.reports-filter-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.reports-kpi .stat-value {
  font-size: 1.35rem;
}

.reports-mini-stat {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(216, 224, 232, 0.95);
  border-radius: var(--radius-lg);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.reports-mini-stat strong {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--grey-90);
  letter-spacing: -0.02em;
}

.reports-mini-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--grey-50);
}

.reports-mini-stat.accent strong { color: var(--brand); }
.reports-mini-stat.success strong { color: var(--success); }
.reports-mini-stat.warn strong { color: var(--warning); }

.reports-chart-card .panel-card-body {
  padding-top: 0.35rem;
}

.reports-chart-wrap {
  position: relative;
  height: 220px;
}

.reports-chart-wrap.tall {
  height: 280px;
}

.reports-chip {
  display: inline-flex;
  align-items: center;
  font-size: 0.7rem;
  font-weight: 650;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--brand-soft, rgba(26, 109, 181, 0.1));
  color: var(--brand);
}

.reports-chip.soft {
  background: var(--grey-10);
  color: var(--grey-60);
}

.reports-chip.success {
  background: var(--success-soft);
  color: var(--success);
}

.reports-chip.warn {
  background: var(--warning-soft);
  color: var(--warning);
}

.reports-eval-meta {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.85rem;
  font-size: 0.8rem;
  color: var(--grey-60);
}

.reports-eval-meta .dot {
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  margin-right: 0.35rem;
  vertical-align: middle;
}

.reports-eval-meta .dot.ai { background: var(--brand); }
.reports-eval-meta .dot.teacher { background: #0E4A85; }

.reports-bar-cell {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 7rem;
}

.reports-bar-cell > span {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--grey-60);
  min-width: 2.4rem;
}

.reports-bar {
  flex: 1;
  height: 0.4rem;
  border-radius: 999px;
  background: var(--grey-10);
  overflow: hidden;
}

.reports-bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1A6DB5, #4A8FC4);
  max-width: 100%;
}

.reports-rank-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.reports-rank-list li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.15rem;
  border-bottom: 1px solid var(--grey-10);
}

.reports-rank-list li:last-child {
  border-bottom: none;
}

.reports-rank-pos {
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  background: linear-gradient(145deg, #EEF6FC, #E2EFF9);
  color: var(--brand);
  flex-shrink: 0;
}

.reports-rank-pos.muted {
  background: var(--grey-10);
  color: var(--grey-50);
}

.reports-rank-score {
  font-size: 0.95rem;
  font-weight: 750;
  color: var(--success);
  flex-shrink: 0;
}

.reports-rank-score.low {
  color: var(--warning);
}

@media (max-width: 640px) {
  .reports-chart-wrap,
  .reports-chart-wrap.tall {
    height: 210px;
  }

  .reports-filter-actions {
    width: 100%;
  }

  .reports-filter-actions .btn-primary {
    flex: 1;
  }
}

