/* =============================================================================
   EduAITracker - dizayn tizimi
   Prototipdagi (Next.js + Tailwind v4) ranglar, radiuslar va komponentlar
   aynan takrorlangan. Hech qanday build qadami kerak emas.
   ========================================================================== */

/* ---------- 1. Tokenlar --------------------------------------------------- */

:root {
  color-scheme: light;

  /* Sahifa foni #F8F9FB */
  --background: #f8f9fb;
  --foreground: #222733;
  --card: #ffffff;
  --card-foreground: #222733;
  --popover: #ffffff;
  --popover-foreground: #222733;

  /* Ko'k-indigo #4F6EF7 */
  --primary: #4f6ef7;
  --primary-foreground: #ffffff;

  --secondary: #f1f2f6;
  --secondary-foreground: #3a4050;

  --muted: #f1f2f6;
  --muted-foreground: #6b7280;

  --accent: #e9ecfe;
  --accent-foreground: #3b54d6;

  --destructive: #ef4444;
  --destructive-foreground: #ffffff;

  --warning: #f0a93b;
  --warning-foreground: #7a5119;

  --success: #35b87c;
  --success-foreground: #146341;

  --border: #e5e7eb;
  --input: #e5e7eb;
  --ring: #4f6ef7;

  --chart-1: #4f6ef7;
  --chart-2: #35b87c;
  --chart-3: #f0a93b;
  --chart-4: #ef4444;
  --chart-5: #6b7280;

  --radius: 0.75rem;
  --radius-sm: calc(var(--radius) * 0.6);
  --radius-md: calc(var(--radius) * 0.8);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) * 1.4);
  --radius-2xl: calc(var(--radius) * 1.8);

  --sidebar: #ffffff;
  --sidebar-foreground: #4a5162;
  --sidebar-border: #e5e7eb;
  --sidebar-accent: #e9ecfe;
  --sidebar-accent-foreground: #3b54d6;

  --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.08), 0 1px 2px -1px rgb(0 0 0 / 0.06);
  --shadow-md: 0 4px 12px -2px rgb(16 24 40 / 0.1), 0 2px 6px -2px rgb(16 24 40 / 0.05);
  --shadow-lg: 0 12px 32px -8px rgb(16 24 40 / 0.18), 0 4px 12px -4px rgb(16 24 40 / 0.08);

  --font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto,
    'Helvetica Neue', Arial, 'Noto Sans', sans-serif;

  --sidebar-width: 16rem;
  --topbar-height: 4rem;
}

/* Zamonaviy brauzerlarda aniqroq ranglar (prototipdagi oklch qiymatlari) */
@supports (color: oklch(0.5 0.1 200)) {
  :root {
    --background: oklch(0.98 0.003 264);
    --foreground: oklch(0.22 0.02 264);
    --card-foreground: oklch(0.22 0.02 264);
    --popover-foreground: oklch(0.22 0.02 264);
    --primary: oklch(0.58 0.19 268);
    --secondary: oklch(0.96 0.006 264);
    --secondary-foreground: oklch(0.3 0.02 264);
    --muted: oklch(0.96 0.006 264);
    --muted-foreground: oklch(0.52 0.02 264);
    --accent: oklch(0.95 0.03 268);
    --accent-foreground: oklch(0.45 0.18 268);
    --destructive: oklch(0.6 0.21 25);
    --warning: oklch(0.75 0.16 70);
    --warning-foreground: oklch(0.35 0.1 60);
    --success: oklch(0.68 0.16 150);
    --success-foreground: oklch(0.32 0.09 150);
    --border: oklch(0.92 0.006 264);
    --input: oklch(0.92 0.006 264);
    --ring: oklch(0.58 0.19 268);
    --chart-1: oklch(0.58 0.19 268);
    --chart-2: oklch(0.68 0.16 150);
    --chart-3: oklch(0.75 0.16 70);
    --chart-4: oklch(0.6 0.21 25);
    --chart-5: oklch(0.52 0.02 264);
    --sidebar-foreground: oklch(0.4 0.02 264);
    --sidebar-border: oklch(0.92 0.006 264);
    --sidebar-accent: oklch(0.95 0.03 268);
    --sidebar-accent-foreground: oklch(0.45 0.18 268);
  }
}

/* ---------- 2. Reset ------------------------------------------------------ */

*,
*::before,
*::after {
  box-sizing: border-box;
  border: 0 solid var(--border);
}

* {
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  tab-size: 4;
}

body {
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--foreground);
  background-color: var(--background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
svg,
video,
canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

svg { flex-shrink: 0; }

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
  background: none;
}

button { cursor: pointer; }

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

ul, ol { list-style: none; }

table { border-collapse: collapse; width: 100%; }

h1, h2, h3, h4, h5, h6 { font-size: inherit; font-weight: inherit; }

:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--ring) 50%, transparent);
  outline-offset: 2px;
}

::selection { background: color-mix(in srgb, var(--primary) 22%, transparent); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--muted-foreground) 28%, transparent);
  border: 3px solid transparent;
  background-clip: padding-box;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--muted-foreground) 45%, transparent);
  background-clip: padding-box;
}

/* ---------- 3. Ilova karkasi --------------------------------------------- */

.app-shell {
  display: flex;
  min-height: 100vh;
  background-color: var(--background);
}

.app-main {
  display: flex;
  flex-direction: column;
  flex: 1 1 0%;
  min-width: 0;
  gap: 1.5rem;
  padding: 1.5rem 1rem;
}

@media (min-width: 640px) {
  .app-main { padding-left: 2rem; padding-right: 2rem; }
}

@media (min-width: 1024px) {
  .app-main { padding: 2rem 2.5rem; }
}

/* --- Yon panel --- */

.sidebar {
  display: none;
  width: var(--sidebar-width);
  flex-shrink: 0;
  flex-direction: column;
  background-color: var(--sidebar);
  border-right: 1px solid var(--sidebar-border);
}

@media (min-width: 1024px) {
  .sidebar { display: flex; }
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  height: var(--topbar-height);
  padding: 0 1.5rem;
}

/* Brend: belgi (navy = currentColor) + Edu[AI]Tracker */
:root { --brand-navy: #1e3a5f; --brand-sky: #38bdf8; }

.brand { display: inline-flex; align-items: center; gap: 0.625rem; color: var(--foreground); text-decoration: none; min-width: 0; }
.brand-mark { display: block; flex-shrink: 0; color: var(--brand-navy); width: 2.25rem; height: 2.25rem; }
.brand__text { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.brand__word { font-size: 1.05rem; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; color: var(--brand-navy); }
.brand__word em { font-style: normal; color: var(--brand-sky); }
.brand__tagline { margin-top: 0.2rem; font-size: 0.58rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted-foreground); white-space: nowrap; }
.brand--sm .brand-mark { width: 1.75rem; height: 1.75rem; }
.brand--sm .brand__word { font-size: 0.95rem; }
.brand--lg { flex-direction: column; gap: 0.5rem; text-align: center; }
.brand--lg .brand-mark { width: 3.5rem; height: 3.5rem; }
.brand--lg .brand__text { align-items: center; }
.brand--lg .brand__word { font-size: 1.5rem; }
.brand--lg .brand__tagline { font-size: 0.66rem; }
.brand:hover .brand__word { color: var(--primary); }


.sidebar__nav {
  display: flex;
  flex: 1 1 0%;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem 0.75rem 0;
  overflow-y: auto;
}

.sidebar__link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--sidebar-foreground);
  transition: background-color 0.15s, color 0.15s;
}

.sidebar__link svg { width: 1.25rem; height: 1.25rem; }

.sidebar__link:hover {
  background-color: var(--secondary);
  color: var(--foreground);
}

.sidebar__link.is-active {
  background-color: var(--sidebar-accent);
  color: var(--sidebar-accent-foreground);
}

.sidebar__link .badge-count {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.375rem;
  border-radius: 9999px;
  background-color: var(--destructive);
  color: var(--destructive-foreground);
  font-size: 0.6875rem;
  font-weight: 600;
}

.sidebar__section {
  padding: 0.75rem;
  border-top: 1px solid var(--sidebar-border);
}

.sidebar__user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  border-radius: var(--radius);
}

.sidebar__user-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--foreground);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar__user-role {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Mobil yon panel */
.sidebar--mobile {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 60;
  display: flex;
  transform: translateX(-100%);
  transition: transform 0.25s ease;
  box-shadow: var(--shadow-lg);
}

.sidebar--mobile.is-open { transform: translateX(0); }

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 55;
  background-color: color-mix(in srgb, var(--foreground) 35%, transparent);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}

.sidebar-backdrop.is-open { opacity: 1; visibility: visible; }

.mobile-menu-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background-color: var(--card);
  box-shadow: var(--shadow-xs);
}

@media (min-width: 1024px) {
  .mobile-menu-button { display: none; }
}

/* --- Yuqori panel --- */

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.topbar__heading {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.topbar__title {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--foreground);
  text-wrap: balance;
}

@media (min-width: 640px) {
  .topbar__title { font-size: 1.875rem; }
}

.topbar__subtitle {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* ---------- 4. Kartalar --------------------------------------------------- */

.card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem 0;
  overflow: hidden;
  border-radius: var(--radius);
  background-color: var(--card);
  color: var(--card-foreground);
  font-size: 0.875rem;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--foreground) 10%, transparent), var(--shadow-xs);
}

.card--flat { box-shadow: 0 0 0 1px color-mix(in srgb, var(--foreground) 10%, transparent); }

.card--row {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
}

.card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0 1rem;
}

.card__header--stack {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
}

.card__title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--foreground);
}

.card__title--with-icon {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card__title--with-icon svg { width: 1rem; height: 1rem; color: var(--primary); }

.card__description { font-size: 0.875rem; color: var(--muted-foreground); }

.card__content { padding: 0 1rem; }
.card__content--flush { padding: 0; }
.card__content--tight { padding: 0 0.5rem; }

.card__footer {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  border-top: 1px solid var(--border);
  background-color: color-mix(in srgb, var(--muted) 50%, transparent);
}

.card__link { font-size: 0.875rem; font-weight: 500; color: var(--primary); }
.card__link:hover { text-decoration: underline; }

/* Statistika kartalari */

.stat-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stat-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  .stat-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.stat-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius);
  background-color: var(--card);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--foreground) 10%, transparent), var(--shadow-xs);
}

.stat-card__label { font-size: 0.875rem; color: var(--muted-foreground); }

.stat-card__value {
  margin-top: 0.25rem;
  font-size: 1.875rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--foreground);
}

.stat-card__value--danger { color: var(--destructive); }
.stat-card__value--success { color: var(--success-foreground); }

.stat-card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  flex-shrink: 0;
  border-radius: var(--radius);
  background-color: var(--accent);
  color: var(--accent-foreground);
}

.stat-card__icon svg { width: 1.25rem; height: 1.25rem; }
.stat-card__icon--danger {
  background-color: color-mix(in srgb, var(--destructive) 10%, transparent);
  color: var(--destructive);
}
.stat-card__icon--success {
  background-color: color-mix(in srgb, var(--success) 15%, transparent);
  color: var(--success-foreground);
}
.stat-card__icon--warning {
  background-color: color-mix(in srgb, var(--warning) 20%, transparent);
  color: var(--warning-foreground);
}

/* ---------- 5. Tugmalar --------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  flex-shrink: 0;
  height: 2.25rem;
  padding: 0 0.875rem;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  user-select: none;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.btn svg { width: 1rem; height: 1rem; }

.btn:disabled,
.btn[aria-disabled='true'] { pointer-events: none; opacity: 0.5; }

.btn:active:not([aria-haspopup]) { transform: translateY(1px); }

.btn--primary { background-color: var(--primary); color: var(--primary-foreground); }
.btn--primary:hover { background-color: color-mix(in srgb, var(--primary) 85%, black); }

.btn--outline {
  border-color: var(--border);
  background-color: var(--card);
  color: var(--foreground);
}
.btn--outline:hover { background-color: var(--muted); }

.btn--secondary { background-color: var(--secondary); color: var(--secondary-foreground); }
.btn--secondary:hover { background-color: color-mix(in srgb, var(--secondary) 80%, black); }

.btn--ghost { color: var(--foreground); }
.btn--ghost:hover { background-color: var(--muted); }

.btn--destructive {
  background-color: color-mix(in srgb, var(--destructive) 10%, transparent);
  color: var(--destructive);
}
.btn--destructive:hover { background-color: color-mix(in srgb, var(--destructive) 20%, transparent); }

.btn--link { height: auto; padding: 0; color: var(--primary); }
.btn--link:hover { text-decoration: underline; }

.btn--lg { height: 2.75rem; padding: 0 1.5rem; border-radius: var(--radius); }
.btn--md { height: 2.5rem; padding: 0 1rem; border-radius: var(--radius); }
.btn--sm { height: 2rem; padding: 0 0.75rem; font-size: 0.8125rem; border-radius: var(--radius-md); }
.btn--xs { height: 1.75rem; padding: 0 0.625rem; font-size: 0.75rem; border-radius: var(--radius-sm); }

.btn--icon { width: 2.25rem; padding: 0; }
.btn--icon-md { width: 2.5rem; height: 2.5rem; padding: 0; border-radius: var(--radius); }
.btn--icon-lg { width: 2.75rem; height: 2.75rem; padding: 0; border-radius: var(--radius); }
.btn--icon-sm { width: 2rem; height: 2rem; padding: 0; }

.btn--block { width: 100%; }
.btn--shadow { box-shadow: var(--shadow-xs); }

.btn--notify { position: relative; }

.btn--notify .notify-dot {
  position: absolute;
  top: -0.25rem;
  right: -0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.25rem;
  border-radius: 9999px;
  background-color: var(--destructive);
  color: var(--destructive-foreground);
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1;
}

/* Segmentli tugmalar guruhi */
.segment {
  display: inline-flex;
  flex-shrink: 0;
  height: 2.5rem;
  padding: 0.25rem;
  border-radius: var(--radius);
  background-color: var(--secondary);
}

.segment__btn {
  display: inline-flex;
  align-items: center;
  height: 2rem;
  padding: 0 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted-foreground);
  white-space: nowrap;
  transition: background-color 0.15s, color 0.15s;
}

.segment__btn.is-active {
  background-color: var(--card);
  color: var(--foreground);
  box-shadow: var(--shadow-xs);
}

/* ---------- 6. Nishonlar (badge) ------------------------------------------ */

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  width: fit-content;
  height: 1.25rem;
  padding: 0.125rem 0.625rem;
  border: 1px solid transparent;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
}

.badge svg { width: 0.75rem; height: 0.75rem; }

.badge--primary { background-color: var(--primary); color: var(--primary-foreground); }
.badge--secondary { background-color: var(--secondary); color: var(--secondary-foreground); border-radius: var(--radius-sm); }
.badge--outline { border-color: var(--border); color: var(--foreground); }

.badge--good {
  background-color: color-mix(in srgb, var(--success) 15%, transparent);
  color: var(--success-foreground);
}
.badge--attention {
  background-color: color-mix(in srgb, var(--warning) 20%, transparent);
  color: var(--warning-foreground);
}
.badge--danger {
  background-color: color-mix(in srgb, var(--destructive) 10%, transparent);
  color: var(--destructive);
}
.badge--info { background-color: var(--accent); color: var(--accent-foreground); }
.badge--muted { background-color: var(--secondary); color: var(--muted-foreground); }

/* ---------- 7. Avatar ----------------------------------------------------- */

.avatar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  background-color: var(--accent);
  color: var(--accent-foreground);
  font-size: 0.75rem;
  font-weight: 600;
  overflow: hidden;
  user-select: none;
}

.avatar::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  border: 1px solid var(--border);
  mix-blend-mode: darken;
  pointer-events: none;
}

.avatar img { width: 100%; height: 100%; object-fit: cover; }

.avatar--sm { width: 1.5rem; height: 1.5rem; font-size: 0.6875rem; }
.avatar--md { width: 2.25rem; height: 2.25rem; }
.avatar--lg { width: 2.5rem; height: 2.5rem; font-size: 0.875rem; }
.avatar--xl { width: 3.5rem; height: 3.5rem; font-size: 1rem; }
.avatar--2xl { width: 4rem; height: 4rem; font-size: 1.125rem; }

/* ---------- 8. Formalar --------------------------------------------------- */

.field { display: flex; flex-direction: column; gap: 0.375rem; }

.label { display: block; font-size: 0.875rem; font-weight: 500; color: var(--foreground); }

.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.input,
.select,
.textarea {
  width: 100%;
  min-width: 0;
  height: 2.5rem;
  padding: 0 0.75rem;
  border: 1px solid var(--input);
  border-radius: var(--radius);
  background-color: var(--card);
  font-size: 0.875rem;
  color: var(--foreground);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.textarea {
  height: auto;
  min-height: 5rem;
  padding: 0.625rem 0.75rem;
  resize: vertical;
  line-height: 1.6;
}

.input::placeholder,
.textarea::placeholder { color: var(--muted-foreground); }

.input:focus-visible,
.select:focus-visible,
.textarea:focus-visible {
  outline: none;
  border-color: var(--ring);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 25%, transparent);
}

.input:disabled,
.select:disabled,
.textarea:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  background-color: color-mix(in srgb, var(--input) 40%, transparent);
}

.input--lg { height: 2.75rem; }
.input--sm { height: 2.25rem; font-size: 0.8125rem; }
.input--flush { background-color: var(--background); }

.input.has-error,
.select.has-error,
.textarea.has-error { border-color: var(--destructive); }

.input.has-error:focus-visible {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--destructive) 20%, transparent);
}

.field-error { font-size: 0.75rem; color: var(--destructive); }
.field-hint { font-size: 0.75rem; color: var(--muted-foreground); }

/* Ikonkali kiritish maydoni */
.input-group { position: relative; }

/* Ikonka to'g'ridan-to'g'ri yoki <span> ichida bo'lishi mumkin */
.input-group > svg,
.input-group > [data-contact-icon] {
  position: absolute;
  top: 50%;
  left: 0.75rem;
  width: 1rem;
  height: 1rem;
  transform: translateY(-50%);
  color: var(--muted-foreground);
  pointer-events: none;
}

.input-group > [data-contact-icon] {
  display: block;
  line-height: 0;
}

.input-group > [data-contact-icon] > svg {
  width: 1rem;
  height: 1rem;
}

.input-group .input { padding-left: 2.25rem; }

.input-group__action {
  position: absolute;
  top: 50%;
  right: 0.5rem;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: var(--radius-sm);
  color: var(--muted-foreground);
}

.input-group__action:hover { background-color: var(--muted); color: var(--foreground); }

/* Tanlash (select) */
.select {
  appearance: none;
  padding-right: 2.25rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.625rem center;
  background-size: 1rem;
  cursor: pointer;
}

.select--auto { width: auto; }

/* Rol tanlash (ro'yxatdan o'tish) */
.role-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

.role-option {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.375rem;
  padding: 0.75rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted-foreground);
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
  cursor: pointer;
  text-align: center;
}

.role-option svg { width: 1.25rem; height: 1.25rem; }
.role-option:hover { background-color: var(--secondary); }

.role-option input { position: absolute; opacity: 0; pointer-events: none; }

.role-option.is-selected {
  border-color: var(--primary);
  background-color: var(--accent);
  color: var(--foreground);
}

/* Kontakt turi almashtirgich */
.contact-switch {
  display: flex;
  padding: 0.125rem;
  border-radius: var(--radius-md);
  background-color: var(--secondary);
  font-size: 0.75rem;
}

.contact-switch__btn {
  padding: 0.25rem 0.625rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
  color: var(--muted-foreground);
  transition: background-color 0.15s, color 0.15s;
}

.contact-switch__btn.is-active {
  background-color: var(--card);
  color: var(--foreground);
  box-shadow: var(--shadow-xs);
}

/* Kalit (toggle switch) */
.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  width: 2.5rem;
  height: 1.5rem;
  border-radius: 9999px;
  background-color: var(--secondary);
  transition: background-color 0.2s;
}

.switch.is-on { background-color: var(--primary); }

.switch__thumb {
  display: block;
  width: 1.125rem;
  height: 1.125rem;
  margin-left: 0.25rem;
  border-radius: 9999px;
  background-color: var(--card);
  box-shadow: var(--shadow-xs);
  transition: transform 0.2s;
}

.switch.is-on .switch__thumb { transform: translateX(1.25rem); }

.checkbox {
  width: 1rem;
  height: 1rem;
  border: 1px solid var(--input);
  border-radius: calc(var(--radius) * 0.4);
  accent-color: var(--primary);
  cursor: pointer;
}

/* ---------- 9. Jadvallar -------------------------------------------------- */

.table-wrap { overflow-x: auto; }

.table { width: 100%; min-width: 720px; font-size: 0.875rem; }

.table thead tr { border-bottom: 1px solid var(--border); text-align: left; }

.table th {
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted-foreground);
  text-align: left;
  white-space: nowrap;
}

.table th:first-child,
.table td:first-child { padding-left: 1.5rem; }

.table th:last-child,
.table td:last-child { padding-right: 1.5rem; }

.table td { padding: 0.75rem 1rem; vertical-align: middle; }

.table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background-color 0.15s;
}

.table tbody tr:last-child { border-bottom: 0; }

.table tbody tr:hover { background-color: color-mix(in srgb, var(--secondary) 60%, transparent); }

.table .cell-right { text-align: right; }
.table .cell-center { text-align: center; }
.table .cell-num { font-variant-numeric: tabular-nums; font-weight: 500; }
.table .cell-muted { color: var(--muted-foreground); }

.table__empty { padding: 3rem 1.5rem; text-align: center; color: var(--muted-foreground); }

.table__user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 500;
  color: var(--foreground);
}

.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

/* ---------- 10. Ro'yxatlar ------------------------------------------------ */

.list-head {
  display: none;
  grid-template-columns: 1fr auto auto auto 1.5rem;
  align-items: center;
  gap: 1rem;
  padding: 0 1rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted-foreground);
}

@media (min-width: 640px) {
  .list-head { display: grid; }
}

.list-row {
  display: grid;
  grid-template-columns: 1fr auto 1.5rem;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  transition: background-color 0.15s;
}

@media (min-width: 640px) {
  .list-row { grid-template-columns: 1fr auto auto auto 1.5rem; gap: 1rem; }
}

.list-row:hover { background-color: var(--secondary); }

.list-row__person { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }

.list-row__name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--foreground);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-row__meta { font-size: 0.75rem; color: var(--muted-foreground); }

@media (min-width: 640px) {
  .list-row__meta--mobile { display: none; }
}

.list-row__col { display: none; font-size: 0.875rem; color: var(--muted-foreground); }

@media (min-width: 640px) {
  .list-row__col { display: block; }
  .list-row__col--w12 { width: 3rem; }
  .list-row__col--w16 {
    width: 4rem;
    text-align: right;
    font-weight: 500;
    color: var(--foreground);
    font-variant-numeric: tabular-nums;
  }
}

.list-row__status { display: flex; justify-content: center; }

@media (min-width: 640px) {
  .list-row__status { width: 7rem; }
}

.list-row__chevron { width: 1rem; height: 1rem; color: var(--muted-foreground); }

/* Vaqt chizig'i (faollik lentasi) */
.timeline { display: flex; flex-direction: column; }

.timeline__item { display: flex; gap: 1rem; }

.timeline__rail { display: flex; flex-direction: column; align-items: center; }

.timeline__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  border-radius: 9999px;
  background-color: var(--accent);
  color: var(--accent-foreground);
}

.timeline__icon svg { width: 1rem; height: 1rem; }
.timeline__icon--attendance {
  background-color: color-mix(in srgb, var(--success) 15%, transparent);
  color: var(--success-foreground);
}
.timeline__icon--message {
  background-color: color-mix(in srgb, var(--warning) 20%, transparent);
  color: var(--warning-foreground);
}

.timeline__line { flex: 1 1 0%; width: 1px; margin: 0.25rem 0; background-color: var(--border); }

.timeline__body {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  padding-bottom: 1.5rem;
}

.timeline__item:last-child .timeline__body { padding-bottom: 0; }

.timeline__text { font-size: 0.875rem; color: var(--foreground); text-wrap: pretty; }
.timeline__time { font-size: 0.75rem; color: var(--muted-foreground); }

/* ---------- 11. AI tavsiya kartalari -------------------------------------- */

.rec-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background-color: var(--background);
}

.rec-card__head { display: flex; align-items: center; gap: 0.5rem; }

.rec-card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  background-color: var(--accent);
  color: var(--accent-foreground);
}

.rec-card__icon svg { width: 0.875rem; height: 0.875rem; }

.rec-card__name { font-size: 0.875rem; font-weight: 500; color: var(--foreground); }

.rec-card__text {
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--muted-foreground);
  text-wrap: pretty;
}

.rec-card__link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--primary);
}

.rec-card__link:hover { text-decoration: underline; }
.rec-card__link svg { width: 0.875rem; height: 0.875rem; }

/* ---------- 12. Filtr paneli ---------------------------------------------- */

.filter-bar { display: flex; flex-direction: column; gap: 0.75rem; padding: 1rem; }

@media (min-width: 768px) {
  .filter-bar { flex-direction: row; align-items: center; }
}

.filter-bar__search { position: relative; flex: 1 1 0%; }

/* ---------- 13. Chat ------------------------------------------------------ */

.chat {
  display: flex;
  flex-direction: row;
  height: calc(100vh - 11rem);
  min-height: 28rem;
  overflow: hidden;
  padding: 0;
}

.chat__list {
  display: none;
  width: 18rem;
  flex-shrink: 0;
  flex-direction: column;
  border-right: 1px solid var(--border);
}

@media (min-width: 768px) {
  .chat__list { display: flex; }
}

.chat__list-header { padding: 0.75rem; border-bottom: 1px solid var(--border); }
.chat__list-body { flex: 1 1 0%; overflow-y: auto; }

.chat__item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  transition: background-color 0.15s;
}

.chat__item:hover { background-color: color-mix(in srgb, var(--secondary) 50%, transparent); }
.chat__item.is-active { background-color: color-mix(in srgb, var(--accent) 60%, transparent); }

.chat__item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.chat__item-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--foreground);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat__item-time { flex-shrink: 0; font-size: 0.6875rem; color: var(--muted-foreground); }

.chat__item-preview {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat__unread {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-width: 1.125rem;
  height: 1.125rem;
  padding: 0 0.25rem;
  border-radius: 9999px;
  background-color: var(--primary);
  color: var(--primary-foreground);
  font-size: 0.625rem;
  font-weight: 500;
}

.chat__thread { display: flex; flex: 1 1 0%; flex-direction: column; min-width: 0; }

.chat__header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}

.chat__messages {
  flex: 1 1 0%;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
  overflow-y: auto;
}

.chat__row { display: flex; }
.chat__row--out { justify-content: flex-end; }
.chat__row--in { justify-content: flex-start; }

.chat__bubble {
  max-width: 75%;
  padding: 0.5rem 0.875rem;
  border-radius: 1rem;
  font-size: 0.875rem;
  line-height: 1.55;
  text-wrap: pretty;
  word-break: break-word;
}

.chat__row--out .chat__bubble {
  border-bottom-right-radius: 0.25rem;
  background-color: var(--primary);
  color: var(--primary-foreground);
}

.chat__row--in .chat__bubble {
  border-bottom-left-radius: 0.25rem;
  background-color: var(--secondary);
  color: var(--foreground);
}

.chat__time { margin-top: 0.25rem; font-size: 0.625rem; opacity: 0.7; }

.chat__composer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  border-top: 1px solid var(--border);
}

.chat__avatar-ai {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  margin-right: 0.5rem;
  flex-shrink: 0;
  border-radius: 9999px;
  background-color: var(--accent);
  color: var(--accent-foreground);
}

.chat__avatar-ai svg { width: 0.875rem; height: 0.875rem; }

.chat__suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--border);
}

.chat__suggestion {
  padding: 0.375rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 9999px;
  font-size: 0.75rem;
  color: var(--muted-foreground);
  transition: background-color 0.15s, color 0.15s;
  text-align: left;
}

.chat__suggestion:hover { background-color: var(--secondary); color: var(--foreground); }

/* ---------- 14. Modal ----------------------------------------------------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background-color: color-mix(in srgb, var(--foreground) 30%, transparent);
  overflow-y: auto;
}

.modal-backdrop.is-open { display: flex; }

.modal {
  width: 100%;
  max-width: 32rem;
  margin: auto;
  padding: 1.5rem;
  border-radius: var(--radius);
  background-color: var(--card);
  box-shadow: var(--shadow-lg);
  animation: modal-in 0.16s ease-out;
}

.modal--wide { max-width: 44rem; }

@keyframes modal-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.modal__title { font-size: 1.125rem; font-weight: 600; color: var(--foreground); }

.modal__body { display: flex; flex-direction: column; gap: 1rem; }

.modal__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

/* ---------- 15. Ovoz yozish maydoni --------------------------------------- */

.voice-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1.5rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  text-align: center;
}

.voice-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 9999px;
  background-color: var(--primary);
  color: var(--primary-foreground);
  transition: background-color 0.15s, transform 0.15s;
}

.voice-btn svg { width: 1.375rem; height: 1.375rem; }
.voice-btn:hover { transform: scale(1.04); }

.voice-btn.is-recording {
  background-color: var(--destructive);
  animation: pulse-ring 1.4s ease-out infinite;
}

@keyframes pulse-ring {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--destructive) 45%, transparent); }
  70%  { box-shadow: 0 0 0 14px color-mix(in srgb, var(--destructive) 0%, transparent); }
  100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--destructive) 0%, transparent); }
}

.voice-hint { font-size: 0.875rem; color: var(--muted-foreground); }

.voice-wave {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 1.5rem;
}

.voice-wave span {
  width: 3px;
  height: 20%;
  border-radius: 9999px;
  background-color: var(--primary);
  animation: wave 1s ease-in-out infinite;
}

.voice-wave span:nth-child(2) { animation-delay: 0.1s; }
.voice-wave span:nth-child(3) { animation-delay: 0.2s; }
.voice-wave span:nth-child(4) { animation-delay: 0.3s; }
.voice-wave span:nth-child(5) { animation-delay: 0.4s; }
.voice-wave span:nth-child(6) { animation-delay: 0.5s; }
.voice-wave span:nth-child(7) { animation-delay: 0.6s; }

@keyframes wave {
  0%, 100% { height: 20%; }
  50% { height: 100%; }
}

/* ---------- 16. Diagrammalar ---------------------------------------------- */

.bars { display: flex; align-items: flex-end; gap: 0.75rem; height: 9rem; }

.bars__col {
  display: flex;
  flex: 1 1 0%;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.bars__value {
  font-size: 0.75rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--muted-foreground);
}

.bars__track {
  display: flex;
  align-items: flex-end;
  width: 100%;
  height: 6rem;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background-color: var(--secondary);
}

.bars__fill {
  width: 100%;
  border-radius: var(--radius-sm);
  background-color: var(--success);
  transition: height 0.4s ease;
}

.bars__fill--warning { background-color: var(--warning); }
.bars__fill--danger { background-color: var(--destructive); }

.bars__label { font-size: 0.6875rem; color: var(--muted-foreground); }

/* Progress */
.progress {
  width: 100%;
  height: 0.5rem;
  overflow: hidden;
  border-radius: 9999px;
  background-color: var(--secondary);
}

.progress__fill {
  height: 100%;
  border-radius: 9999px;
  background-color: var(--primary);
  transition: width 0.4s ease;
}

.progress--lg { height: 0.625rem; }

/* Chiziqli diagramma */
.linechart { width: 100%; height: 10rem; }
.linechart .line {
  fill: none;
  stroke: var(--primary);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.linechart .area { fill: color-mix(in srgb, var(--primary) 12%, transparent); stroke: none; }
.linechart .grid { stroke: var(--border); stroke-width: 1; }
.linechart .dot { fill: var(--primary); }
.linechart .axis-label { font-size: 10px; fill: var(--muted-foreground); }

/* ---------- 17. Bildirishnomalar ro'yxati --------------------------------- */

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  width: 100%;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  transition: background-color 0.15s;
}

.notif-item:last-child { border-bottom: 0; }
.notif-item:hover { background-color: color-mix(in srgb, var(--secondary) 50%, transparent); }
.notif-item.is-unread { background-color: color-mix(in srgb, var(--accent) 40%, transparent); }

.notif-item__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  margin-top: 0.125rem;
  flex-shrink: 0;
  border-radius: 9999px;
  background-color: var(--accent);
  color: var(--accent-foreground);
}

.notif-item__icon svg { width: 1rem; height: 1rem; }

.notif-item__type { font-size: 0.75rem; font-weight: 500; color: var(--muted-foreground); }

.notif-item__dot {
  display: inline-block;
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 9999px;
  background-color: var(--primary);
}

.notif-item__text {
  margin-top: 0.125rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
  text-wrap: pretty;
}

.notif-item.is-unread .notif-item__text { font-weight: 500; color: var(--foreground); }

.notif-item__time {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

/* ---------- 18. Flash xabarlari ------------------------------------------- */

.flash-stack {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 24rem;
}

.flash {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  background-color: var(--card);
  box-shadow: var(--shadow-md);
  font-size: 0.875rem;
  animation: flash-in 0.2s ease-out;
}

@keyframes flash-in {
  from { opacity: 0; transform: translateX(16px); }
  to { opacity: 1; transform: none; }
}

.flash svg { width: 1.125rem; height: 1.125rem; flex-shrink: 0; margin-top: 0.0625rem; }
.flash--success { border-left: 3px solid var(--success); color: var(--success-foreground); }
.flash--error { border-left: 3px solid var(--destructive); color: var(--destructive); }
.flash--warning { border-left: 3px solid var(--warning); color: var(--warning-foreground); }
.flash--info { border-left: 3px solid var(--primary); color: var(--accent-foreground); }
.flash__close { margin-left: auto; color: var(--muted-foreground); }

/* Sahifa ichidagi ogohlantirish */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  line-height: 1.5;
}

.alert svg { width: 1rem; height: 1rem; flex-shrink: 0; margin-top: 0.125rem; }
.meta-row svg { width: 1rem; height: 1rem; vertical-align: -0.125em; }
.meta-row > span { display: inline-flex; align-items: center; gap: 0.35rem; }
.alert--success {
  background-color: color-mix(in srgb, var(--success) 15%, transparent);
  color: var(--success-foreground);
}
.alert--error {
  background-color: color-mix(in srgb, var(--destructive) 10%, transparent);
  color: var(--destructive);
}
.alert--warning {
  background-color: color-mix(in srgb, var(--warning) 18%, transparent);
  color: var(--warning-foreground);
}
.alert--info { background-color: var(--accent); color: var(--accent-foreground); }

/* ---------- 19. Sahifalash ------------------------------------------------ */

.pagination { display: flex; align-items: center; gap: 0.25rem; }

.pagination__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.5rem;
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted-foreground);
  transition: background-color 0.15s, color 0.15s;
}

.pagination__link:hover { background-color: var(--secondary); color: var(--foreground); }

.pagination__link.is-active { background-color: var(--primary); color: var(--primary-foreground); }
.pagination__link.is-disabled { opacity: 0.4; pointer-events: none; }
.pagination__gap { padding: 0 0.25rem; color: var(--muted-foreground); }

/* ---------- 20. Autentifikatsiya sahifalari ------------------------------- */

.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2.5rem 1rem;
  background-color: var(--background);
}

.auth-box { width: 100%; max-width: 28rem; }

.auth-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 2rem;
  text-align: center;
}

.auth-head__brand { display: flex; justify-content: center; margin-bottom: 1rem; }
.auth-head__title { font-size: 1.25rem; font-weight: 600; color: var(--foreground); }
.auth-head__subtitle { margin-top: 0.25rem; font-size: 0.875rem; color: var(--muted-foreground); }

.auth-card {
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background-color: var(--card);
  box-shadow: var(--shadow-xs);
}

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

.auth-foot {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.auth-foot a { font-weight: 500; color: var(--primary); }
.auth-foot a:hover { text-decoration: underline; }

/* ---------- 21. Marketing (bosh sahifa) ----------------------------------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
}

@media (min-width: 640px) {
  .site-header { padding-left: 2.5rem; padding-right: 2.5rem; }
}


.hero { max-width: 48rem; margin: 0 auto; padding: 4rem 1.5rem 5rem; text-align: center; }

.hero__pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  margin-bottom: 1.25rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  background-color: var(--accent);
  color: var(--accent-foreground);
  font-size: 0.75rem;
  font-weight: 500;
}

.hero__pill svg { width: 0.875rem; height: 0.875rem; }

.hero__title {
  font-size: 1.875rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--foreground);
  text-wrap: balance;
}

@media (min-width: 640px) {
  .hero__title { font-size: 2.5rem; }
}

.hero__text {
  max-width: 36rem;
  margin: 1rem auto 0;
  color: var(--muted-foreground);
  text-wrap: pretty;
  font-size: 1rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 2rem;
}

.feature-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  max-width: 64rem;
  margin: 0 auto;
  padding: 0 1.5rem 5rem;
}

@media (min-width: 640px) {
  .feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-left: 2.5rem;
    padding-right: 2.5rem;
  }
}

@media (min-width: 1024px) {
  .feature-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.feature {
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background-color: var(--card);
  box-shadow: var(--shadow-xs);
}

.feature__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  margin-bottom: 0.75rem;
  border-radius: var(--radius-md);
  background-color: var(--accent);
  color: var(--accent-foreground);
}

.feature__icon svg { width: 1.125rem; height: 1.125rem; }
.feature__title { font-weight: 500; color: var(--foreground); }
.feature__text { margin-top: 0.25rem; font-size: 0.875rem; color: var(--muted-foreground); }

.site-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

.site-footer svg { width: 0.875rem; height: 0.875rem; }

/* ---------- 22. Xato sahifasi --------------------------------------------- */

.error-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem 1.5rem;
  text-align: center;
}

.error-code {
  font-size: 4rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--primary);
  line-height: 1;
}

.error-title { margin-top: 0.75rem; font-size: 1.25rem; font-weight: 600; color: var(--foreground); }
.error-text { margin-top: 0.5rem; color: var(--muted-foreground); max-width: 32rem; }

.error-trace {
  margin-top: 1.5rem;
  padding: 1rem;
  max-width: 60rem;
  max-height: 20rem;
  overflow: auto;
  border-radius: var(--radius);
  background-color: #0b0f1e;
  color: #cbd5e1;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.75rem;
  line-height: 1.6;
  text-align: left;
  white-space: pre-wrap;
}

/* ---------- 23. Yordamchi klasslar ---------------------------------------- */

.grid-main { display: grid; gap: 1.5rem; grid-template-columns: 1fr; }

@media (min-width: 1024px) {
  .grid-main { grid-template-columns: 65fr 35fr; }
  .grid-main--55 { grid-template-columns: 55fr 45fr; }
  .grid-main--half { grid-template-columns: 1fr 1fr; }
}

.stack { display: flex; flex-direction: column; }
.stack-1 { gap: 0.25rem; } .stack-2 { gap: 0.5rem; } .stack-3 { gap: 0.75rem; }
.stack-4 { gap: 1rem; } .stack-5 { gap: 1.25rem; } .stack-6 { gap: 1.5rem; }

.row { display: flex; align-items: center; }
.row-2 { gap: 0.5rem; } .row-3 { gap: 0.75rem; } .row-4 { gap: 1rem; }
.row--between { justify-content: space-between; }
.row--wrap { flex-wrap: wrap; }
.row--start { align-items: flex-start; }
.row--end { justify-content: flex-end; }

.grow { flex: 1 1 0%; min-width: 0; }
.shrink-0 { flex-shrink: 0; }

.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.text-muted { color: var(--muted-foreground); }
.text-primary { color: var(--primary); }
.text-danger { color: var(--destructive); }
.text-success { color: var(--success-foreground); }
.text-warning { color: var(--warning-foreground); }
.text-fg { color: var(--foreground); }

.text-center { text-align: center; }
.text-right { text-align: right; }
.tabular { font-variant-numeric: tabular-nums; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pretty { text-wrap: pretty; }
.capitalize-first::first-letter { text-transform: uppercase; }

.mt-1 { margin-top: 0.25rem; } .mt-2 { margin-top: 0.5rem; } .mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; } .mt-6 { margin-top: 1.5rem; } .mt-8 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.25rem; } .mb-2 { margin-bottom: 0.5rem; } .mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; } .mb-6 { margin-bottom: 1.5rem; }
.ml-auto { margin-left: auto; }

.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

@media (max-width: 767px) {
  .hide-mobile { display: none !important; }
}

@media (min-width: 768px) {
  .hide-desktop { display: none !important; }
}

.divider { height: 1px; background-color: var(--border); }

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--muted-foreground);
}

.empty-state__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 9999px;
  background-color: var(--secondary);
}

.empty-state__icon svg { width: 1.25rem; height: 1.25rem; }

.skeleton {
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--secondary) 25%, var(--muted) 50%, var(--secondary) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}

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

.spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid color-mix(in srgb, currentColor 25%, transparent);
  border-top-color: currentColor;
  border-radius: 9999px;
  animation: spin 0.7s linear infinite;
}

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

/* Rang tanlash (sozlamalar) */
.color-swatches { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.color-option { display: flex; flex-direction: column; align-items: center; gap: 0.35rem; cursor: pointer; }
.color-option__label { font-size: 0.7rem; color: var(--muted-foreground); }
.color-option input:checked + .color-swatch { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px currentColor; transform: scale(1.06); }
.color-option input:checked + .color-swatch::after { content: "✓"; color: #fff; font-size: 0.95rem; font-weight: 700; }
.color-option input:focus-visible + .color-swatch { outline: 2px solid var(--ring); outline-offset: 3px; }
.bg-preview { display: flex; align-items: center; justify-content: center; width: 6.5rem; height: 4.25rem; border-radius: var(--radius); border: 1px dashed var(--border); background: var(--muted) center / cover no-repeat; color: var(--muted-foreground); flex: none; }
.bg-preview.has-image { border-style: solid; }
.bg-preview.has-image svg { display: none; }
.bg-preview svg { width: 1.5rem; height: 1.5rem; }
.chat__bubble p { margin: 0; }
.chat__bubble p + p, .chat__bubble ul + p, .chat__bubble ol + p, .chat__bubble p + ul, .chat__bubble p + ol { margin-top: 0.5rem; }
.chat__bubble ul, .chat__bubble ol { margin: 0.25rem 0 0.25rem 1.15rem; padding: 0; }
.chat__bubble li { margin: 0.15rem 0; }

.color-swatch { display: inline-flex; align-items: center; justify-content: center; width: 2.25rem; height: 2.25rem; border-radius: 9999px; transition: box-shadow 0.15s, transform 0.15s; }

/* Chop etish */
@media print {
  .sidebar, .topbar__actions, .btn, .flash-stack { display: none !important; }
  .app-main { padding: 0; }
  .card { box-shadow: none; border: 1px solid #ddd; }
}

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

/* --- Egasi maktab ichida (acting) banneri ---------------------------------- */
.acting-banner {
  display: flex; align-items: center; gap: 0.75rem;
  margin: 0 0 1rem; padding: 0.6rem 1rem;
  background: color-mix(in oklab, var(--primary) 10%, var(--card));
  border: 1px solid var(--primary); border-radius: var(--radius);
  font-size: 0.875rem; color: var(--foreground);
}
.acting-banner svg { width: 1.1rem; height: 1.1rem; color: var(--primary); }
.acting-banner .btn { margin-left: auto; }

.select--sm { height: 2rem; padding-top: 0; padding-bottom: 0; font-size: 0.8125rem; }

/* Rolga qarab ko'rinadigan maydonlar (admin foydalanuvchi formasi) */
[data-role-only][hidden] { display: none !important; }

/* Audio yozish (dars hisoboti) */
.recorder { display: flex; flex-direction: column; gap: 0.75rem; }
.recorder__controls { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.recorder__timer { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 4ch; }
.recorder__status { font-size: 0.875rem; color: var(--muted-foreground); }
.recorder__btn--rec.is-recording { animation: recpulse 1.2s ease-in-out infinite; }
@keyframes recpulse { 0%,100% { box-shadow: 0 0 0 0 rgba(239,68,68,.45);} 50% { box-shadow: 0 0 0 10px rgba(239,68,68,0);} }
.report-table td .select, .report-table td .input { min-width: 7rem; }
.report-table .cell-note .input { min-width: 14rem; }

/* Yon paneldagi til tugmalari (mobilda ham ko'rinadi) */
.sidebar__langs { display: flex; gap: 0.35rem; margin-top: 0.75rem; }
.sidebar__lang {
  flex: 1; text-align: center; padding: 0.3rem 0; font-size: 0.72rem; font-weight: 600; letter-spacing: .04em;
  border: 1px solid var(--border); border-radius: var(--radius-md); color: var(--muted-foreground); text-decoration: none;
}
.sidebar__lang:hover { color: var(--foreground); border-color: var(--foreground); }
.sidebar__lang.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }
