/* ============================================================
   Kelajak Mutaxasisi — dizayn tizimi
   Yorug', toza, tiniq ranglar; ingichka Inter; biroz qirrali burchaklar
   ============================================================ */

:root {
  --bg: #F4F6FA;
  --surface: #FFFFFF;
  --surface-2: #F8FAFC;
  --surface-3: #F1F4F9;
  --border: #E5E9F0;
  --border-strong: #D5DBE5;

  --text: #0F172A;
  --text-2: #334155;
  --muted: #64748B;
  --faint: #94A3B8;

  --primary: #2F74F5;
  --primary-hover: #1E62E6;
  --primary-press: #1955CC;
  --primary-soft: #EAF1FF;
  --primary-ring: rgba(47, 116, 245, .22);

  --accent: #F97316;
  --accent-soft: #FFF1E6;
  --success: #16A34A;
  --success-soft: #E8F7EE;
  --danger: #E11D48;
  --danger-soft: #FDECF0;
  --warning: #D97706;
  --warning-soft: #FEF5E7;
  --violet: #7C3AED;
  --violet-soft: #F1EBFE;

  --r-xs: 3px;
  --r-sm: 5px;
  --r: 6px;
  --r-lg: 8px;
  --r-pill: 999px;

  --sh-xs: 0 1px 2px rgba(15, 23, 42, .04);
  --sh-sm: 0 1px 2px rgba(15, 23, 42, .04), 0 2px 6px -2px rgba(15, 23, 42, .06);
  --sh-md: 0 2px 4px -2px rgba(15, 23, 42, .05), 0 12px 24px -10px rgba(15, 23, 42, .12);
  --sh-lg: 0 4px 10px -4px rgba(15, 23, 42, .08), 0 24px 48px -16px rgba(15, 23, 42, .20);
  --sh-primary: 0 1px 2px rgba(30, 98, 230, .25), 0 8px 18px -8px rgba(47, 116, 245, .65);

  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-in: cubic-bezier(.4, 0, 1, 1);
  --t-fast: 150ms;
  --t: 240ms;
  --t-slow: 360ms;

  --topbar-h: 68px;
  --sidebar-w: 248px;
  --gutter: 28px;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 14.5px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body.no-scroll { overflow: hidden; }

h1, h2, h3, h4 { margin: 0; font-weight: 500; letter-spacing: -0.02em; color: var(--text); }
h1 { font-size: 24px; line-height: 1.25; }
h2 { font-size: 18px; line-height: 1.3; }
h3 { font-size: 15.5px; line-height: 1.35; }
p { margin: 0; }
a { color: var(--primary); text-decoration: none; transition: color var(--t-fast) var(--ease); }
a:hover { color: var(--primary-hover); }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
::selection { background: var(--primary-soft); color: var(--primary-press); }

.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.xsmall { font-size: 12px; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.grow { flex: 1; min-width: 0; }
.hidden { display: none !important; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Ikonkalar ---------- */
.ic { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.ic-sm { width: 15px; height: 15px; }
.ic-lg { width: 22px; height: 22px; }

/* ---------- Tugmalar ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px;
  border: 1px solid transparent; border-radius: var(--r);
  background: var(--surface); color: var(--text-2);
  font-weight: 500; font-size: 14px; white-space: nowrap;
  cursor: pointer; user-select: none;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease),
              color var(--t-fast) var(--ease), box-shadow var(--t) var(--ease), transform var(--t-fast) var(--ease);
}
.btn:active { transform: translateY(1px) scale(.985); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--primary-ring); }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }

.btn-primary { background: var(--primary); color: #fff; box-shadow: var(--sh-primary); }
.btn-primary:hover { background: var(--primary-hover); box-shadow: 0 1px 2px rgba(30, 98, 230, .3), 0 12px 24px -10px rgba(47, 116, 245, .75); }
.btn-primary:active { background: var(--primary-press); }

.btn-outline { border-color: var(--border); box-shadow: var(--sh-xs); }
.btn-outline:hover { border-color: var(--border-strong); background: var(--surface-2); color: var(--text); }

.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }

.btn-soft { background: var(--primary-soft); color: var(--primary); }
.btn-soft:hover { background: #DCE8FF; }

.btn-danger { background: var(--danger); color: #fff; box-shadow: 0 8px 18px -10px rgba(225, 29, 72, .7); }
.btn-danger:hover { background: #C8133D; }
.btn-danger-soft { background: var(--danger-soft); color: var(--danger); }
.btn-danger-soft:hover { background: #FBDCE4; }
.btn-success-soft { background: var(--success-soft); color: var(--success); }
.btn-success-soft:hover { background: #D7F1E1; }

.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; gap: 6px; }
.btn-xs { height: 28px; padding: 0 10px; font-size: 12.5px; gap: 5px; }
.btn-block { width: 100%; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px; flex: none;
  border: 1px solid var(--border); border-radius: var(--r);
  background: var(--surface); color: var(--muted);
  cursor: pointer; position: relative;
  box-shadow: var(--sh-xs);
  transition: all var(--t-fast) var(--ease);
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); background: var(--surface-2); }
.icon-btn:active { transform: scale(.95); }
.icon-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--primary-ring); }
.icon-btn.sm { width: 30px; height: 30px; box-shadow: none; }
.icon-btn.bare { border-color: transparent; box-shadow: none; background: transparent; }
.icon-btn.bare:hover { background: var(--surface-3); }
.icon-btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: var(--sh-primary); }
.icon-btn.primary:hover { background: var(--primary-hover); }
.icon-btn .dot { position: absolute; top: 8px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 2px var(--surface); }

/* ---------- Formalar ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 13px; color: var(--text-2); font-weight: 500; }
.field .hint { font-size: 12px; color: var(--faint); }
.req { color: var(--danger); margin-left: 2px; }

.input, .select, .textarea {
  width: 100%; height: 40px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: var(--r);
  background: var(--surface); color: var(--text);
  font-size: 14px; outline: none;
  box-shadow: var(--sh-xs);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t) var(--ease), background var(--t-fast);
}
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--border-strong); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.input.invalid { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(225, 29, 72, .12); }
.textarea { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.select {
  appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='1.8' 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 10px center;
}
.input[type="date"] { min-width: 0; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap .input { padding-left: 38px; }
.input-wrap > .ic { position: absolute; left: 12px; color: var(--faint); pointer-events: none; }
.input-wrap .trail { position: absolute; right: 4px; }
.input-wrap.trail-pad .input { padding-right: 44px; }

.checkbox { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; font-size: 14px; }
.checkbox input { position: absolute; opacity: 0; pointer-events: none; }
.checkbox .box {
  width: 38px; height: 22px; border-radius: var(--r-pill); background: var(--border-strong);
  position: relative; transition: background var(--t) var(--ease); flex: none;
}
.checkbox .box::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform var(--t) var(--ease);
}
.checkbox input:checked + .box { background: var(--primary); }
.checkbox input:checked + .box::after { transform: translateX(16px); }
.checkbox input:focus-visible + .box { box-shadow: 0 0 0 3px var(--primary-ring); }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

/* ---------- Belgilar (badge) ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 24px; padding: 0 9px; border-radius: var(--r-xs);
  font-size: 12px; font-weight: 500; white-space: nowrap;
  background: var(--surface-3); color: var(--text-2);
}
.badge.blue { background: var(--primary-soft); color: var(--primary); }
.badge.green { background: var(--success-soft); color: var(--success); }
.badge.red { background: var(--danger-soft); color: var(--danger); }
.badge.orange { background: var(--accent-soft); color: #C2560C; }
.badge.amber { background: var(--warning-soft); color: var(--warning); }
.badge.violet { background: var(--violet-soft); color: var(--violet); }
.badge.solid { background: var(--primary); color: #fff; }
.badge .bdot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.pill-tag {
  position: absolute; top: 12px; right: 12px; z-index: 1;
  height: 24px; padding: 0 10px; border-radius: var(--r-pill);
  display: inline-flex; align-items: center;
  background: var(--primary); color: #fff; font-size: 12px; font-weight: 500;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .9), 0 6px 14px -6px rgba(47, 116, 245, .8);
}
.pill-tag.amaliy { background: var(--accent); box-shadow: 0 0 0 2px rgba(255, 255, 255, .9), 0 6px 14px -6px rgba(249, 115, 22, .8); }

.counter {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--r-pill);
  display: inline-grid; place-items: center;
  background: var(--danger); color: #fff; font-size: 11px; font-weight: 600;
}

/* ---------- Kartochka ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
}
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-head h2, .card-head h3 { display: flex; align-items: center; gap: 8px; }
.card-body { padding: 20px; }

/* ============================================================
   Login sahifasi
   ============================================================ */
.login-page {
  min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background:
    radial-gradient(900px 500px at 10% -10%, rgba(47, 116, 245, .10), transparent 60%),
    radial-gradient(700px 400px at 110% 110%, rgba(249, 115, 22, .08), transparent 60%),
    var(--bg);
}
.login-card {
  width: 100%; max-width: 400px; padding: 36px 32px 28px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--sh-lg);
  animation: rise var(--t-slow) var(--ease) both;
}
.login-card .brand { justify-content: center; margin-bottom: 8px; }
.login-card .sub { text-align: center; color: var(--muted); margin-bottom: 28px; font-size: 14px; }
.login-card form { display: flex; flex-direction: column; gap: 16px; }
.login-card .foot { margin-top: 20px; text-align: center; font-size: 13px; color: var(--faint); }
.login-error {
  display: flex; gap: 8px; align-items: flex-start;
  padding: 10px 12px; border-radius: var(--r); background: var(--danger-soft); color: var(--danger); font-size: 13.5px;
  animation: shake .4s var(--ease);
}

/* ---------- Brend ---------- */
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 17px; letter-spacing: -0.02em; color: var(--text); }
.brand:hover { color: var(--text); }
.brand-mark { display: grid; grid-template-columns: repeat(2, 9px); gap: 3px; flex: none; }
.brand-mark i { width: 9px; height: 9px; border-radius: 50%; background: var(--primary); transition: transform var(--t) var(--ease); }
.brand-mark i:last-child { background: var(--accent); }
.brand:hover .brand-mark i:nth-child(1) { transform: translate(-1px, -1px); }
.brand:hover .brand-mark i:nth-child(4) { transform: translate(1px, 1px); }
.brand-name { white-space: nowrap; }

/* ============================================================
   Shell: yuqori panel, yon menyu
   ============================================================ */
.shell { min-height: 100vh; display: flex; }
.shell-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--topbar-h); display: flex; align-items: center; gap: 14px;
  padding: 0 var(--gutter);
  background: rgba(255, 255, 255, .86);
  backdrop-filter: saturate(180%) blur(12px); -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar .spacer { flex: 1; }
.topbar-search { flex: 0 1 300px; min-width: 0; }
.topbar-search .input { border-color: transparent; box-shadow: none; background: transparent; padding-left: 36px; }
.topbar-search .input:hover { background: var(--surface-2); }
.topbar-search .input:focus { background: var(--surface); border-color: var(--primary); }

.date-pill {
  display: inline-flex; align-items: center; gap: 10px;
  height: 40px; padding: 0 14px; border-radius: var(--r);
  background: var(--surface-3); color: var(--text-2); font-size: 14px; white-space: nowrap;
  transition: background var(--t-fast);
}
.date-pill b { font-weight: 500; color: var(--text); }
.date-pill:hover { background: #E8ECF3; }

.user-chip {
  display: inline-flex; align-items: center; gap: 10px;
  height: 44px; padding: 3px 12px 3px 3px; border-radius: var(--r-pill);
  border: 1px solid var(--border); background: var(--surface); cursor: default;
  transition: box-shadow var(--t) var(--ease), border-color var(--t-fast);
}
.user-chip:hover { box-shadow: var(--sh-sm); border-color: var(--border-strong); }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 600; color: #fff; letter-spacing: 0;
  background: linear-gradient(135deg, #5B8DEF, #2F74F5);
}
.avatar.orange { background: linear-gradient(135deg, #FDBA74, #F97316); }
.avatar.sm { width: 30px; height: 30px; font-size: 11.5px; }
.avatar.lg { width: 52px; height: 52px; font-size: 17px; }
.user-chip .uname { font-weight: 500; font-size: 14px; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip .urole { font-size: 12px; color: var(--muted); line-height: 1.1; }

/* Yon menyu */
.sidebar {
  position: sticky; top: 0; height: 100vh; width: var(--sidebar-w); flex: none;
  display: flex; flex-direction: column;
  background: var(--surface); border-right: 1px solid var(--border);
  z-index: 40;
}
.sidebar-head { height: var(--topbar-h); display: flex; align-items: center; justify-content: space-between; padding: 0 20px; border-bottom: 1px solid transparent; }
.sidebar-nav { padding: 12px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; }
.nav-label { padding: 14px 12px 6px; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); font-weight: 500; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  height: 42px; padding: 0 12px; border-radius: var(--r);
  color: var(--muted); font-weight: 400; font-size: 14.5px;
  position: relative;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.nav-item:hover { background: var(--surface-3); color: var(--text); }
.nav-item:hover .ic { transform: translateX(1px); }
.nav-item .ic { transition: transform var(--t) var(--ease); }
.nav-item.active { background: var(--primary-soft); color: var(--primary); font-weight: 500; }
.nav-item.active::before {
  content: ''; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--primary);
}
.nav-item .counter { margin-left: auto; }
.sidebar-foot { padding: 12px; border-top: 1px solid var(--border); }
.sidebar-collapse, .sidebar-collapse > div { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.menu-toggle { display: none; }
.menu-toggle .ic { transition: transform var(--t) var(--ease); }
.sidebar.open .menu-toggle .ic { transform: rotate(90deg); }

/* ---------- Sahifa ---------- */
.page { padding: 28px var(--gutter) 56px; width: 100%; max-width: 1440px; margin: 0 auto; animation: pageIn var(--t-slow) var(--ease) backwards; }
.page-narrow { max-width: 960px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head .actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin-top: 4px; font-size: 14px; }
.section { margin-top: 28px; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }

.back-link {
  display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; margin-bottom: 14px;
  padding: 6px 10px 6px 6px; margin-left: -6px; border-radius: var(--r);
  transition: all var(--t-fast) var(--ease);
}
.back-link:hover { color: var(--text); background: var(--surface-3); }
.back-link:hover .ic { transform: translateX(-3px); }
.back-link .ic { transition: transform var(--t) var(--ease); }

/* ---------- Tablar ---------- */
.tabs {
  display: inline-flex; gap: 4px; padding: 4px; border-radius: var(--r-lg);
  background: var(--surface-3); border: 1px solid var(--border);
  position: relative; max-width: 100%; overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 16px; border-radius: var(--r);
  color: var(--muted); font-weight: 500; font-size: 14px; white-space: nowrap;
  border: 0; background: transparent; cursor: pointer;
  transition: color var(--t-fast) var(--ease), background var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.tab:hover { color: var(--text); }
.tab.active { background: var(--surface); color: var(--text); box-shadow: var(--sh-sm); }
.tab .cnt {
  min-width: 22px; height: 20px; padding: 0 6px; border-radius: var(--r-xs);
  display: inline-grid; place-items: center; font-size: 12px;
  background: var(--border); color: var(--muted); transition: all var(--t) var(--ease);
}
.tab.active .cnt { background: var(--primary); color: #fff; }

/* ---------- Progress ---------- */
.progress-card { display: flex; align-items: center; gap: 18px; padding: 16px 20px; }
.progress-card .ring { flex: none; }
.progress-text { font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.progress-text b { color: var(--text); font-weight: 500; }
.progress { height: 4px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), #5B9BFF); width: 0; transition: width .9s var(--ease); }
.progress.green > i { background: linear-gradient(90deg, #16A34A, #4ADE80); }

/* ============================================================
   Dars kartochkalari (suratdagi kurs kartochkalari uslubida)
   ============================================================ */
.lesson-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px; }
.lesson-card {
  display: flex; flex-direction: column; padding: 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--sh-xs); color: var(--text); cursor: pointer;
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease), border-color var(--t) var(--ease);
  animation: rise var(--t-slow) var(--ease) both;
}
.lesson-card:hover { transform: translateY(-4px); box-shadow: var(--sh-md); border-color: var(--border-strong); color: var(--text); }
.lesson-card:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--primary-ring), var(--sh-md); }
.thumb { position: relative; aspect-ratio: 16 / 10; border-radius: var(--r); overflow: hidden; background: var(--surface-3); }
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease), filter var(--t); }
.lesson-card:hover .thumb img { transform: scale(1.045); }
.thumb .play {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0) 40%, rgba(15, 23, 42, .35));
  opacity: 0; transition: opacity var(--t) var(--ease);
}
.thumb .play span {
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255, 255, 255, .95); color: var(--primary); box-shadow: var(--sh-md);
  transform: scale(.85); transition: transform var(--t) var(--ease);
}
.thumb .play .ic { fill: currentColor; stroke: none; margin-left: 3px; }
.lesson-card:hover .thumb .play { opacity: 1; }
.lesson-card:hover .thumb .play span { transform: scale(1); }
.thumb .num-tag {
  position: absolute; left: 12px; bottom: 12px;
  height: 24px; min-width: 24px; padding: 0 8px; border-radius: var(--r-xs);
  display: inline-grid; place-items: center;
  background: rgba(15, 23, 42, .72); color: #fff; font-size: 12px; font-weight: 500;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.lesson-card .lc-body { padding: 16px 2px 2px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.lesson-card .lc-title { font-size: 16.5px; font-weight: 500; line-height: 1.35; letter-spacing: -0.015em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lc-meta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; color: var(--text-2); font-size: 14px; }
.lc-meta .mi { display: inline-flex; align-items: center; gap: 7px; }
.mi-ic { width: 20px; height: 20px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; }
.mi-ic .ic { width: 12px; height: 12px; stroke-width: 2.2; }
.mi-ic.blue { background: var(--primary-soft); color: var(--primary); }
.mi-ic.violet { background: var(--violet-soft); color: var(--violet); }
.mi-ic.green { background: var(--success-soft); color: var(--success); }
.mi-ic.orange { background: var(--accent-soft); color: var(--accent); }
.lc-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.seen { display: inline-flex; align-items: center; gap: 6px; color: var(--success); font-weight: 500; font-size: 13.5px; }
.unseen { color: var(--faint); font-size: 13.5px; }
.lc-go { color: var(--primary); font-size: 13.5px; font-weight: 500; display: inline-flex; align-items: center; gap: 4px; opacity: 0; transform: translateX(-6px); transition: all var(--t) var(--ease); }
.lesson-card:hover .lc-go { opacity: 1; transform: none; }

/* ---------- Video ---------- */
.lesson-head { max-width: 860px; margin: 0 auto 18px; }
.lesson-head h1 { margin-top: 8px; }
.lesson-head .meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.video-wrap {
  width: 100%; max-width: 860px; margin: 0 auto;
  aspect-ratio: 16 / 9; border-radius: var(--r-lg); overflow: hidden;
  background: #0B1220; box-shadow: var(--sh-lg);
  position: relative;
}
.video-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
.lesson-body { max-width: 860px; margin: 22px auto 0; display: flex; flex-direction: column; gap: 22px; }
.description { white-space: pre-wrap; color: var(--text-2); line-height: 1.65; font-size: 15px; }
.lesson-nav { display: flex; gap: 12px; justify-content: space-between; }
.lesson-nav .btn { flex: 1; max-width: 260px; }
.lesson-nav .btn:last-child { margin-left: auto; }
.preview-banner {
  display: flex; align-items: center; gap: 10px; max-width: 860px; margin: 0 auto 16px;
  padding: 10px 14px; border-radius: var(--r); background: var(--warning-soft); color: var(--warning); font-size: 13.5px;
}

/* ---------- Fikrlar ---------- */
.comment-form { display: flex; flex-direction: column; gap: 10px; }
.comment-form .row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.comment-list { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; }
.comment {
  display: flex; gap: 12px; padding: 14px 12px; border-radius: var(--r);
  transition: background var(--t-fast) var(--ease);
  animation: rise var(--t) var(--ease) both;
}
.comment:hover { background: var(--surface-2); }
.comment.is-admin { background: linear-gradient(90deg, var(--primary-soft), transparent 70%); }
.comment .c-main { flex: 1; min-width: 0; }
.comment .c-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.comment .c-name { font-weight: 500; font-size: 14px; }
.comment .c-time { font-size: 12.5px; color: var(--faint); }
.comment .c-text { white-space: pre-wrap; word-break: break-word; color: var(--text-2); font-size: 14.5px; }
.comment .c-del { opacity: 0; transition: opacity var(--t-fast); }
.comment:hover .c-del, .comment .c-del:focus-visible { opacity: 1; }

/* ============================================================
   Admin: statistikalar, grafik, jadvallar
   ============================================================ */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 16px; }
.stat {
  padding: 18px 20px; display: flex; flex-direction: column; gap: 14px;
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease);
  animation: rise var(--t-slow) var(--ease) both;
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--sh-md); }
.stat .s-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 13.5px; }
.stat .s-ic { width: 34px; height: 34px; border-radius: var(--r); display: grid; place-items: center; }
.stat .s-ic.blue { background: var(--primary-soft); color: var(--primary); }
.stat .s-ic.green { background: var(--success-soft); color: var(--success); }
.stat .s-ic.orange { background: var(--accent-soft); color: var(--accent); }
.stat .s-ic.violet { background: var(--violet-soft); color: var(--violet); }
.stat .s-ic.red { background: var(--danger-soft); color: var(--danger); }
.stat .s-ic.amber { background: var(--warning-soft); color: var(--warning); }
.stat .s-val { font-size: 26px; font-weight: 400; letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat .s-val small { font-size: 14px; color: var(--muted); font-weight: 400; letter-spacing: 0; }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 20px; margin-top: 20px; align-items: start; }

.bar-chart { display: flex; align-items: flex-end; gap: 8px; height: 200px; padding-top: 24px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; min-width: 0; }
.bar-track { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; position: relative; }
.bar {
  width: 100%; max-width: 30px; border-radius: 4px 4px 2px 2px;
  background: linear-gradient(180deg, #5B9BFF, var(--primary));
  height: 0; min-height: 3px; position: relative;
  transition: height .8s var(--ease), filter var(--t-fast), transform var(--t) var(--ease);
  transform-origin: bottom;
}
.bar.zero { background: var(--border); }
.bar.today { background: linear-gradient(180deg, #FDBA74, var(--accent)); }
.bar-col:hover .bar { filter: brightness(1.08); transform: scaleX(1.08); }
.bar .tip {
  position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translate(-50%, 4px);
  padding: 3px 7px; border-radius: var(--r-xs); background: var(--text); color: #fff; font-size: 11.5px; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: all var(--t-fast) var(--ease);
}
.bar-col:hover .tip { opacity: 1; transform: translate(-50%, 0); }
.bar-lbl { font-size: 11px; color: var(--faint); white-space: nowrap; }

.feed { display: flex; flex-direction: column; }
.feed-item { display: flex; gap: 12px; padding: 12px 20px; transition: background var(--t-fast); align-items: flex-start; }
.feed-item:hover { background: var(--surface-2); }
.feed-item + .feed-item { border-top: 1px solid var(--border); }
.feed-ic { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.feed-ic .ic { width: 15px; height: 15px; }
.feed-text { font-size: 13.5px; color: var(--text-2); line-height: 1.45; min-width: 0; word-break: break-word; }
.feed-text b { font-weight: 500; color: var(--text); }
.feed-time { font-size: 12px; color: var(--faint); margin-top: 2px; }

/* Jadval */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.table th {
  text-align: left; font-weight: 500; font-size: 12.5px; color: var(--muted);
  padding: 12px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table th:first-child { border-top-left-radius: var(--r-lg); }
.table th:last-child { border-top-right-radius: var(--r-lg); }
.table th.sortable { cursor: pointer; user-select: none; transition: color var(--t-fast); }
.table th.sortable:hover { color: var(--text); }
.table th .sort-ic { display: inline-block; margin-left: 4px; transition: transform var(--t) var(--ease); }
.table td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; color: var(--text-2); }
.table tbody tr { transition: background var(--t-fast) var(--ease); animation: fadeIn var(--t) var(--ease) both; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr:hover { background: var(--surface-2); }
.table .t-name { font-weight: 500; color: var(--text); }
.table .t-right { text-align: right; }
.table .t-actions { display: flex; gap: 4px; justify-content: flex-end; }
.login-cell { display: inline-flex; align-items: center; gap: 4px; font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 13px; }

/* Filtrlar paneli */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar .input-wrap { flex: 1 1 240px; }
.toolbar .select { width: auto; min-width: 150px; }
.filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; align-items: end; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.chip {
  height: 32px; padding: 0 12px; border-radius: var(--r-pill);
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
  font-size: 13px; cursor: pointer; transition: all var(--t-fast) var(--ease);
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.active { background: var(--text); border-color: var(--text); color: #fff; }

/* Darslar ro'yxati (admin) */
.lesson-rows { display: flex; flex-direction: column; }
.lesson-row {
  display: grid; grid-template-columns: 34px 120px minmax(0, 1fr) auto; gap: 16px; align-items: center;
  padding: 12px 20px; transition: background var(--t-fast);
}
.lesson-row + .lesson-row { border-top: 1px solid var(--border); }
.lesson-row:hover { background: var(--surface-2); }
.lesson-row .lr-num { font-size: 13px; color: var(--faint); font-variant-numeric: tabular-nums; text-align: center; }
.lesson-row .lr-thumb { width: 120px; aspect-ratio: 16 / 9; border-radius: var(--r-sm); overflow: hidden; background: var(--surface-3); }
.lesson-row .lr-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.lesson-row:hover .lr-thumb img { transform: scale(1.06); }
.lesson-row .lr-title { font-weight: 500; color: var(--text); margin-bottom: 6px; }
.lesson-row .lr-stats { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.lesson-row .lr-stats span { display: inline-flex; align-items: center; gap: 5px; }
.lesson-row.unpublished .lr-thumb img { filter: grayscale(1) opacity(.6); }
.lr-actions { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

/* YouTube preview */
.yt-preview {
  aspect-ratio: 16 / 9; border-radius: var(--r); overflow: hidden; background: var(--surface-3);
  border: 1px dashed var(--border-strong); display: grid; place-items: center; color: var(--faint); font-size: 13px; text-align: center; padding: 8px;
  transition: border-color var(--t);
}
.yt-preview img { width: 100%; height: 100%; object-fit: cover; animation: fadeIn var(--t) var(--ease); }
.yt-preview.ok { border-style: solid; border-color: var(--border); padding: 0; }

/* Kalendar to'ri */
.heat { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 16px); grid-auto-columns: 16px; justify-content: start; gap: 4px; padding: 4px; overflow-x: auto; padding-bottom: 4px; }
.heat-wrap { display: flex; gap: 8px; }
.heat-days { display: grid; grid-template-rows: repeat(7, 16px); gap: 4px; padding: 4px 0; font-size: 10.5px; color: var(--faint); }
.heat-days span { line-height: 16px; }
.heat i { width: 16px; height: 16px; border-radius: 3px; background: var(--surface-3); border: 1px solid var(--border); transition: transform var(--t-fast) var(--ease); }
.heat i.on { background: var(--success); border-color: #12873D; }
.heat i.today { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--primary); }
.heat i.empty { visibility: hidden; }
.heat i:hover { transform: scale(1.25); }
.legend { display: flex; gap: 14px; align-items: center; font-size: 12px; color: var(--muted); margin-top: 10px; }
.legend i { display: inline-block; width: 11px; height: 11px; border-radius: 2px; vertical-align: -1px; margin-right: 5px; background: var(--surface-3); border: 1px solid var(--border); }
.legend i.on { background: var(--success); border-color: #12873D; }

.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; font-size: 13.5px; }
.list-item + .list-item { border-top: 1px solid var(--border); }
.scroll-y { max-height: 320px; overflow-y: auto; margin-right: -8px; padding-right: 8px; }

.kv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.kv > div { padding: 12px 14px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--border); }
.kv .k { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.kv .v { font-size: 16px; font-weight: 500; font-variant-numeric: tabular-nums; }

/* Moliya: taqsimot */
.dist { display: flex; flex-direction: column; gap: 12px; }
.dist-row { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; gap: 12px; align-items: center; font-size: 13.5px; }
.dist-bar { height: 8px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; }
.dist-bar i { display: block; height: 100%; border-radius: inherit; width: 0; transition: width .8s var(--ease); }

/* Combobox */
.combo { position: relative; }
.combo-list {
  position: absolute; z-index: 60; left: 0; right: 0; top: calc(100% + 6px);
  max-height: 260px; overflow-y: auto; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-lg);
  animation: dropIn var(--t-fast) var(--ease) both;
}
.combo-opt { padding: 9px 10px; border-radius: var(--r-sm); cursor: pointer; display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.combo-opt:hover, .combo-opt.hl { background: var(--primary-soft); color: var(--primary); }
.combo-opt small { color: var(--faint); font-size: 12px; }
.combo-empty { padding: 10px; color: var(--faint); font-size: 13px; }

/* ============================================================
   Modal, drawer, toast
   ============================================================ */
.overlay {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center; padding: 16px;
  background: rgba(15, 23, 42, .42);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  animation: fadeIn var(--t) var(--ease) both;
  overflow-y: auto;
}
.overlay.closing { animation: fadeOut var(--t) var(--ease-in) both; }
.modal {
  width: 100%; max-width: 480px; max-height: calc(100vh - 32px); overflow-y: auto;
  background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--sh-lg);
  animation: modalIn var(--t-slow) var(--ease) both;
}
.modal.wide { max-width: 640px; }
.overlay.closing .modal { animation: modalOut var(--t) var(--ease-in) both; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px 0; }
.modal-body { padding: 18px 22px; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 0 22px 20px; flex-wrap: wrap; }
.modal-ic { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 14px; }
.modal-ic.green { background: var(--success-soft); color: var(--success); }
.modal-ic.red { background: var(--danger-soft); color: var(--danger); }

.cred-box {
  position: relative; padding: 16px 18px; border-radius: var(--r);
  background: var(--surface-2); border: 1px solid var(--border);
  font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 13.5px; line-height: 1.7;
  white-space: pre-wrap; word-break: break-word; color: var(--text);
}
.cred-box .copied-flag {
  position: absolute; top: 10px; right: 10px;
  font-family: 'Inter', sans-serif; font-size: 12px;
}

.drawer-overlay {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(15, 23, 42, .32);
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
  animation: fadeIn var(--t) var(--ease) both;
}
.drawer-overlay.closing { animation: fadeOut var(--t) var(--ease-in) both; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 91;
  width: min(820px, 100vw);
  background: var(--bg); box-shadow: -24px 0 60px -20px rgba(15, 23, 42, .35);
  display: flex; flex-direction: column;
  animation: drawerIn var(--t-slow) var(--ease) both;
  border-left: 1px solid var(--border);
}
.drawer.closing { animation: drawerOut var(--t) var(--ease-in) both; }
.drawer-head {
  display: flex; align-items: center; gap: 14px; padding: 16px 24px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.drawer-body { flex: 1; overflow-y: auto; padding: 22px 24px 40px; display: flex; flex-direction: column; gap: 18px; }

.toasts {
  position: fixed; z-index: 200; left: 50%; bottom: 24px; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none;
  width: max-content; max-width: calc(100vw - 32px);
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px 11px 12px; border-radius: var(--r);
  background: #0F172A; color: #fff; font-size: 14px; box-shadow: var(--sh-lg);
  animation: toastIn var(--t-slow) var(--ease) both; pointer-events: auto;
}
.toast.closing { animation: toastOut var(--t) var(--ease-in) both; }
.toast .t-ic { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.toast.success .t-ic { background: var(--success); }
.toast.error .t-ic { background: var(--danger); }
.toast.info .t-ic { background: var(--primary); }
.toast .t-ic .ic { width: 13px; height: 13px; stroke-width: 2.6; color: #fff; }

/* ---------- Yuklanish va bo'sh holat ---------- */
.skeleton {
  background: linear-gradient(90deg, var(--surface-3) 0%, #E9EDF4 40%, var(--surface-3) 80%);
  background-size: 300% 100%; animation: shimmer 1.4s linear infinite; border-radius: var(--r-sm);
}
.sk-card { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.sk-line { height: 12px; }
.spinner {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--border); border-top-color: var(--primary);
  animation: spin .7s linear infinite;
}
.btn .spinner { width: 16px; height: 16px; border-color: rgba(255, 255, 255, .4); border-top-color: #fff; }
.btn-outline .spinner, .btn-ghost .spinner { border-color: var(--border); border-top-color: var(--primary); }
.center-load { display: grid; place-items: center; padding: 60px 0; }

.empty {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px;
  padding: 48px 20px; color: var(--muted);
  animation: fadeIn var(--t-slow) var(--ease) both;
}
.empty .e-ic { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--faint); margin-bottom: 4px; }
.empty .e-title { color: var(--text); font-weight: 500; font-size: 15px; }

/* ---------- Animatsiyalar ---------- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pageIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes modalOut { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes drawerIn { from { transform: translateX(100%); } to { transform: none; } }
@keyframes drawerOut { from { transform: none; } to { transform: translateX(100%); } }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toastOut { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(8px) scale(.97); } }
@keyframes dropIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shake { 0%, 100% { transform: none; } 20% { transform: translateX(-5px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(3px); } }

.stagger > * { animation-delay: calc(var(--i, 0) * 40ms); }

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

/* ============================================================
   Moslashuvchanlik
   ============================================================ */
@media (max-width: 1180px) {
  .dash-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 980px) {
  :root { --gutter: 20px; --topbar-h: 60px; }
  .shell { flex-direction: column; }
  .sidebar {
    position: sticky; top: 0; height: auto; width: 100%;
    border-right: 0; border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, .92);
    backdrop-filter: saturate(180%) blur(12px); -webkit-backdrop-filter: saturate(180%) blur(12px);
  }
  .sidebar-head { height: var(--topbar-h); padding: 0 var(--gutter); }
  .menu-toggle { display: inline-grid; }
  .sidebar-collapse { display: grid; grid-template-rows: 0fr; flex: none; transition: grid-template-rows var(--t-slow) var(--ease); }
  .sidebar-collapse > div { overflow: hidden; display: block; min-height: 0; }
  .sidebar.open .sidebar-collapse { grid-template-rows: 1fr; }
  .sidebar-nav { padding: 4px 12px 8px; }
  .sidebar-foot { padding: 8px 12px 12px; }
  .nav-label { display: none; }
  .nav-item.active::before { display: none; }
  .shell-admin .topbar { display: none; }
}

@media (max-width: 760px) {
  body { font-size: 14px; }
  h1 { font-size: 21px; }
  .page { padding: 20px 16px 48px; }
  .topbar { padding: 0 16px; gap: 10px; }
  .topbar .date-pill, .topbar-search { display: none; }
  .user-chip { padding-right: 3px; }
  .user-chip .u-text { display: none; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .kv { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .stat { padding: 14px; gap: 10px; }
  .stat .s-val { font-size: 20px; }
  .stat .s-ic { width: 30px; height: 30px; }
  .page-head .actions { width: 100%; }
  .page-head .actions .btn-primary { flex: 1; }
  .bar-chart { gap: 4px; height: 170px; }
  .bar-lbl { font-size: 9.5px; }
  .bar-col:nth-child(even) .bar-lbl { visibility: hidden; }
  .bar-col { overflow: visible; }
  .card-head { padding: 14px 16px; }
  .card-body, .card-pad { padding: 16px; }
  .feed-item { padding: 12px 16px; }
  .drawer-body { padding: 16px 16px 40px; }
  .drawer-head { padding: 12px 16px; }
  .modal-head { padding: 16px 18px 0; }
  .modal-body { padding: 16px 18px; }
  .modal-foot { padding: 0 18px 18px; }
  .modal-foot .btn { flex: 1; }
  .toolbar .select { flex: 1 1 140px; }
  .dist-row { grid-template-columns: 90px minmax(0, 1fr) auto; }

  /* Telefonda dars kartochkalari: suratning o'ng panelidagidek gorizontal */
  .lesson-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .lesson-card { flex-direction: row; gap: 14px; padding: 12px; align-items: stretch; }
  .lesson-card:hover { transform: none; }
  .lesson-card .thumb { width: 42%; max-width: 170px; flex: none; aspect-ratio: auto; min-height: 96px; }
  .lesson-card .pill-tag { top: 8px; right: 8px; left: auto; height: 20px; padding: 0 8px; font-size: 11px; }
  .thumb .num-tag { left: 8px; bottom: 8px; height: 20px; min-width: 20px; font-size: 11px; padding: 0 6px; }
  .lesson-card .lc-body { padding: 2px 0; gap: 8px; }
  .lesson-card .lc-title { font-size: 14.5px; -webkit-line-clamp: 3; }
  .lc-go { display: none; }
  .thumb .play span { width: 38px; height: 38px; }

  .lesson-nav .btn { max-width: none; }
  .video-wrap { border-radius: var(--r); }

  .lesson-row { grid-template-columns: 88px minmax(0, 1fr); gap: 12px; padding: 14px 16px; }
  .lesson-row .lr-num { display: none; }
  .lesson-row .lr-thumb { width: 88px; }
  .lr-actions { grid-column: 1 / -1; justify-content: flex-start; }

  /* Jadvallar telefonda kartochkaga aylanadi */
  .table-wrap { overflow: visible; }
  .table.responsive, .table.responsive tbody, .table.responsive tr, .table.responsive td { display: block; width: 100%; }
  .table.responsive thead { display: none; }
  .table.responsive tbody { display: flex; flex-direction: column; gap: 10px; padding: 12px; }
  .table.responsive tr {
    border: 1px solid var(--border); border-radius: var(--r-lg); padding: 6px 14px;
    background: var(--surface); box-shadow: var(--sh-xs);
  }
  .table.responsive tbody tr:hover { background: var(--surface); box-shadow: var(--sh-sm); }
  .table.responsive td {
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    padding: 8px 0; border-bottom: 1px dashed var(--border); text-align: right; min-width: 0;
  }
  .table.responsive td:last-child { border-bottom: 0; }
  .table.responsive td::before { content: attr(data-label); color: var(--muted); font-size: 12.5px; text-align: left; flex: none; }
  .table.responsive td[data-label=""]::before { display: none; }
  .table.responsive td.t-primary { font-size: 15px; padding-top: 10px; }
  .table.responsive td.t-primary::before { display: none; }
  .table.responsive td.t-text { display: block; text-align: left; }
  .table.responsive td.t-text::before { display: block; margin-bottom: 4px; }
  .table.responsive .t-actions { justify-content: flex-end; width: 100%; }
}

@media (max-width: 400px) {
  .stat-grid { gap: 10px; }
  .stat .s-val { font-size: 18px; }
  .tab { padding: 0 12px; font-size: 13.5px; }
  .brand { font-size: 15.5px; }
  .kv { grid-template-columns: minmax(0, 1fr); }
  .login-card { padding: 28px 20px 22px; }
}

/* Grafik chetidagi tooltiplar konteynerdan chiqmasin */
.bar-col:first-child .tip, .bar-col:nth-child(2) .tip { left: 0; transform: translate(0, 4px); }
.bar-col:last-child .tip, .bar-col:nth-last-child(2) .tip { left: auto; right: 0; transform: translate(0, 4px); }
.bar-col:first-child:hover .tip, .bar-col:nth-child(2):hover .tip,
.bar-col:last-child:hover .tip, .bar-col:nth-last-child(2):hover .tip { transform: none; }
.bar-chart { overflow: hidden; }

/* ============================================================
   Kategoriya kartochkalari (Nazariy / Amaliy)
   ============================================================ */
.cat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.cat-card {
  display: flex; flex-direction: column; padding: 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--sh-sm); color: var(--text); position: relative; overflow: hidden;
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease), border-color var(--t) var(--ease);
  animation: rise var(--t-slow) var(--ease) both;
}
.cat-card::after {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: var(--primary); transform: scaleX(0); transform-origin: left;
  transition: transform var(--t-slow) var(--ease);
}
.cat-card.amaliy::after { background: var(--accent); }
.cat-card:hover { transform: translateY(-5px); box-shadow: var(--sh-lg); border-color: var(--border-strong); color: var(--text); }
.cat-card:hover::after { transform: scaleX(1); }
.cat-card:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--primary-ring), var(--sh-md); }

.cat-top { position: relative; }
.cat-cover {
  display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; gap: 6px;
  aspect-ratio: 16 / 8; border-radius: var(--r); overflow: hidden;
}
.cat-cover .cc-img { overflow: hidden; background: var(--surface-3); }
.cat-cover .cc-img:first-child { grid-row: 1 / 3; }
.cat-cover.single { grid-template-columns: 1fr; grid-template-rows: 1fr; }
.cat-cover.single .cc-img:first-child { grid-row: auto; }
.cat-cover .cc-img:only-child, .cat-cover .cc-img:first-child:nth-last-child(2) { grid-row: 1 / 3; }
.cat-cover .cc-img:nth-child(2):last-child { grid-row: 1 / 3; }
.cat-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease); }
.cat-card:hover .cat-cover img { transform: scale(1.06); }
.cat-cover.empty { display: grid; place-items: center; background: var(--surface-3); color: var(--faint); grid-template-columns: 1fr; }

.cat-body { padding: 18px 4px 4px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.cat-title { font-size: 20px; font-weight: 500; letter-spacing: -0.02em; }
.cat-desc { color: var(--muted); font-size: 14px; line-height: 1.55; }
.cat-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 4px; }
.cat-go {
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 14px; border-radius: var(--r);
  background: var(--primary-soft); color: var(--primary); font-weight: 500; font-size: 14px;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease), box-shadow var(--t) var(--ease);
}
.cat-go .ic { transition: transform var(--t) var(--ease); }
.cat-card:hover .cat-go { background: var(--primary); color: #fff; box-shadow: var(--sh-primary); }
.cat-card:hover .cat-go .ic { transform: translateX(3px); }
.cat-card.amaliy .cat-go { background: var(--accent-soft); color: #C2560C; }
.cat-card.amaliy:hover .cat-go { background: var(--accent); color: #fff; box-shadow: 0 8px 18px -8px rgba(249, 115, 22, .7); }
.cat-card.amaliy .progress > i { background: linear-gradient(90deg, var(--accent), #FDBA74); }
.cat-card .progress.green > i { background: linear-gradient(90deg, #16A34A, #4ADE80); }

@media (max-width: 760px) {
  .cat-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .cat-card { padding: 12px; }
  .cat-card:hover { transform: none; }
  .cat-title { font-size: 18px; }
  .cat-body { padding: 14px 2px 2px; gap: 10px; }
}

/* ============================================================
   Maxsus video pleyer
   ============================================================ */
.vp { outline: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.vp:focus-visible { box-shadow: 0 0 0 3px var(--primary-ring), var(--sh-lg); }
.vp button { -webkit-tap-highlight-color: transparent; }

/* Sahna: video har doim 16:9 va markazda (to'liq ekranda ham) */
.vp-stage { position: absolute; inset: 0; display: grid; place-items: center; container-type: size; background: #000; }
.vp-frame { position: relative; width: min(100cqw, calc(100cqh * 16 / 9)); aspect-ratio: 16 / 9; }
.vp-frame > div, .vp-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }

/* YouTube'ning sarlavha va logosiga bosib bo'lmasin — butun maydonni qatlam yopadi */
.vp-shield { position: absolute; inset: 0; z-index: 2; cursor: pointer; background: transparent; transition: background var(--t) var(--ease); }
.vp.playing.idle .vp-shield { cursor: none; }
.vp.needs-tap .vp-shield { pointer-events: none; }
.vp.paused .vp-shield { background: linear-gradient(180deg, rgba(0,0,0,.45), rgba(0,0,0,.12) 40%, rgba(0,0,0,.12) 60%, rgba(0,0,0,.5)); }

.vp-poster {
  position: absolute; inset: 0; z-index: 6; border: 0; padding: 0; cursor: pointer;
  background: #000; display: grid; place-items: center;
}
.vp-poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .85; transition: opacity var(--t), transform .8s var(--ease); }
.vp-poster::after { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at center, rgba(15,23,42,.05), rgba(15,23,42,.45)); }
.vp-poster:hover img { opacity: 1; transform: scale(1.02); }
.vp-big {
  position: relative; z-index: 1; width: 74px; height: 74px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(255,255,255,.96); color: var(--primary);
  box-shadow: 0 10px 30px -6px rgba(0,0,0,.45); transition: transform var(--t) var(--ease);
}
.vp-big .ic { width: 28px; height: 28px; fill: currentColor; stroke: none; margin-left: 4px; }
.vp-poster:hover .vp-big { transform: scale(1.08); }
.vp-poster:active .vp-big { transform: scale(.96); }

/* Markaziy ijro / pauza tugmasi */
.vp-center {
  position: absolute; left: 50%; top: 50%; z-index: 5; width: 64px; height: 64px; margin: -32px 0 0 -32px;
  border: 0; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  background: rgba(15,23,42,.55); color: #fff; opacity: 0; transform: scale(.85); pointer-events: none;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  transition: opacity var(--t) var(--ease), transform var(--t) var(--ease), background var(--t-fast);
}
.vp-center .ic { width: 26px; height: 26px; fill: currentColor; stroke: none; }
.vp-center:hover { background: rgba(15,23,42,.75); }
.vp-center:active { transform: scale(.92) !important; }
.vp.paused .vp-center { opacity: 1; transform: none; pointer-events: auto; }
.vp-center.flash { animation: vpFlash .6s var(--ease) both; }
@keyframes vpFlash { 0% { opacity: 0; transform: scale(.7); } 30% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.25); } }
@media (hover: none) {
  /* Telefonda: boshqaruv ko'ringanda markaziy tugma ham ko'rinadi va bosiladi */
  .vp.playing:not(.idle) .vp-center { opacity: 1; transform: none; pointer-events: auto; }
  .vp.playing:not(.idle) .vp-shield { background: rgba(0,0,0,.28); }
}

/* Ikki marta bosib ±10 s */
.vp-seekflash { position: absolute; top: 0; bottom: 0; width: 38%; z-index: 4; display: grid; place-items: center; pointer-events: none; opacity: 0; }
.vp-seekflash.left { left: 0; border-radius: 0 50% 50% 0 / 0 100% 100% 0; }
.vp-seekflash.right { right: 0; border-radius: 50% 0 0 50% / 100% 0 0 100%; }
.vp-seekflash span { padding: 6px 12px; border-radius: var(--r-pill); background: rgba(0,0,0,.55); color: #fff; font-size: 13px; font-weight: 500; }
.vp-seekflash.show { animation: vpSeek .7s var(--ease) both; background: rgba(255,255,255,.08); }
@keyframes vpSeek { 0% { opacity: 0; } 20% { opacity: 1; } 100% { opacity: 0; } }

.vp-loading { position: absolute; inset: 0; z-index: 4; display: grid; place-items: center; pointer-events: none; }
.vp-loading .spinner { width: 40px; height: 40px; border-width: 3px; border-color: rgba(255,255,255,.25); border-top-color: #fff; }

.vp-hint {
  position: absolute; left: 50%; bottom: 70px; transform: translateX(-50%); z-index: 7;
  padding: 8px 14px; border-radius: var(--r); background: rgba(15,23,42,.85); color: #fff; font-size: 13px;
  white-space: nowrap; pointer-events: none; animation: rise var(--t) var(--ease) both;
}

.vp-end {
  position: absolute; inset: 0; z-index: 7; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  background: rgba(11,18,32,.92); color: #fff; animation: fadeIn var(--t-slow) var(--ease) both;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); padding: 16px; text-align: center;
}
.vp-end-title { font-size: 18px; font-weight: 500; }
.vp-end-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.vp-end .btn-outline { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.2); color: #fff; box-shadow: none; }
.vp-end .btn-outline:hover { background: rgba(255,255,255,.16); color: #fff; }

/* To'liq ekrandagi yuqori panel (chiqish tugmasi + sarlavha) */
.vp-top {
  position: absolute; left: 0; right: 0; top: 0; z-index: 8; display: none; align-items: center; gap: 8px;
  padding: 10px 14px 28px; color: #fff;
  background: linear-gradient(180deg, rgba(0,0,0,.7), transparent);
  transition: opacity var(--t) var(--ease), transform var(--t) var(--ease);
}
.vp.is-fs .vp-top { display: flex; }
.vp-title { font-size: 15px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.vp-exit { width: 40px; height: 40px; background: rgba(255,255,255,.12); }
.vp-exit .ic { width: 22px; height: 22px; }

/* Boshqaruv paneli */
.vp-controls {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 8;
  padding: 28px 12px 8px;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,.75));
  color: #fff; transition: opacity var(--t) var(--ease), transform var(--t) var(--ease);
}
.vp.idle.playing .vp-controls { opacity: 0; transform: translateY(8px); pointer-events: none; }
.vp.idle.playing .vp-top { opacity: 0; transform: translateY(-8px); pointer-events: none; }
.vp-poster:not(.hidden) ~ .vp-controls, .vp-poster:not(.hidden) ~ .vp-top .vp-title { opacity: 0; pointer-events: none; }
.vp-row { display: flex; align-items: center; gap: 2px; }
.vp-btn {
  width: 38px; height: 38px; border: 0; border-radius: var(--r); background: transparent; color: #fff;
  display: inline-grid; place-items: center; cursor: pointer; flex: none;
  transition: background var(--t-fast), transform var(--t-fast);
}
.vp-btn:hover { background: rgba(255,255,255,.14); }
.vp-btn:active { transform: scale(.92); }
.vp-btn:focus-visible { outline: none; box-shadow: 0 0 0 2px rgba(255,255,255,.7); }
.vp-btn .ic { width: 20px; height: 20px; }
.vp-play .ic { fill: currentColor; stroke: none; }
.vp-skip span, .vp-speed { font-size: 12.5px; font-weight: 500; font-variant-numeric: tabular-nums; }
.vp-speed { width: auto; min-width: 42px; padding: 0 8px; }
.vp-time { font-size: 13px; margin-left: 8px; white-space: nowrap; opacity: .92; }

/* Vaqt chizig'i */
.vp-seek-row { padding: 0 6px 4px; }
.vp-seek, .vp-vol {
  -webkit-appearance: none; appearance: none; width: 100%; height: 16px; background: transparent; cursor: pointer; margin: 0; display: block;
  --p: 0%; --b: 0%;
}
.vp-seek::-webkit-slider-runnable-track {
  height: 4px; border-radius: 4px;
  background: linear-gradient(90deg, var(--primary) var(--p), rgba(255,255,255,.45) var(--p), rgba(255,255,255,.45) var(--b), rgba(255,255,255,.2) var(--b));
  transition: height var(--t-fast);
}
.vp-seek::-moz-range-track, .vp-vol::-moz-range-track { height: 4px; border-radius: 4px; background: rgba(255,255,255,.25); }
.vp-seek::-moz-range-progress, .vp-vol::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--primary); }
.vp-seek::-webkit-slider-thumb, .vp-vol::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: #fff; margin-top: -5px;
  box-shadow: 0 0 0 3px rgba(47,116,245,.5); transition: transform var(--t-fast) var(--ease);
}
.vp-seek::-webkit-slider-thumb { transform: scale(0); }
.vp-seek::-moz-range-thumb, .vp-vol::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: #fff; }
.vp-seek-row:hover .vp-seek::-webkit-slider-thumb, .vp-seek:focus::-webkit-slider-thumb, .vp-seek:active::-webkit-slider-thumb { transform: scale(1); }
@media (hover: none) { .vp-seek::-webkit-slider-thumb { transform: scale(1); } }

/* Ovoz balandligi */
.vp-volwrap { display: flex; align-items: center; }
.vp-vol { width: 0; opacity: 0; transition: width var(--t) var(--ease), opacity var(--t) var(--ease), margin var(--t); margin: 0; }
.vp-vol::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(90deg, #fff var(--p), rgba(255,255,255,.3) var(--p)); }
.vp-volwrap:hover .vp-vol, .vp-vol:focus, .vp.is-fs .vp-vol { width: 80px; opacity: 1; margin: 0 8px 0 4px; }
@media (hover: none) { .vp-vol { width: 70px; opacity: 1; margin: 0 6px 0 2px; } }

/* ---------- To'liq ekran ---------- */
.vp:fullscreen, .vp:-webkit-full-screen { max-width: none; width: 100vw; height: 100vh; aspect-ratio: auto; border-radius: 0; background: #000; box-shadow: none; }
.vp.pseudo-fs {
  position: fixed; top: 0; left: 0; z-index: 1000; max-width: none; aspect-ratio: auto;
  border-radius: 0; margin: 0; background: #000; box-shadow: none;
}
/* Telefon tik turganda: pleyer 90° buriladi va yotiq ko'rinishda butun ekranni egallaydi */
.vp.pseudo-fs.rotated { transform-origin: top left; transform: rotate(90deg) translateY(-100%); }
.vp.is-fs .vp-controls { padding: 36px max(20px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left)); }
.vp.is-fs .vp-btn { width: 44px; height: 44px; }
.vp.is-fs .vp-btn .ic { width: 22px; height: 22px; }
.vp.is-fs .vp-time { font-size: 14px; }
.vp.is-fs .vp-center { width: 76px; height: 76px; margin: -38px 0 0 -38px; }
.vp.is-fs .vp-center .ic { width: 30px; height: 30px; }
.vp.is-fs .vp-skip { display: inline-grid; }
/* To'liq ekran ochiq paytda sahifadagi animatsiyalar fixed qatlamni "qamab" qo'ymasin */
body.vp-fs-open .page, body.vp-fs-open .shell-main, body.vp-fs-open .lesson-body { animation: none !important; transform: none !important; }
body.vp-fs-open .topbar, body.vp-fs-open .sidebar { visibility: hidden; }

@media (max-width: 760px) {
  .vp-btn { width: 36px; height: 36px; }
  .vp-skip { display: none; }
  .vp-time { font-size: 12px; margin-left: 4px; }
  .vp-controls { padding: 22px 6px 4px; }
  .vp-big { width: 60px; height: 60px; }
  .vp-big .ic { width: 24px; height: 24px; }
  .vp-hint { bottom: 56px; font-size: 12px; }
  .vp:not(.is-fs) .vp-vol { display: none; }
  .vp:not(.is-fs) .vp-center { width: 54px; height: 54px; margin: -27px 0 0 -27px; }
}

/* Login takliflari */
.input-wrap.no-lead .input { padding-left: 12px; }
.login-chips { display: flex; flex-wrap: wrap; gap: 6px; min-height: 0; }
.login-chips .chip { height: 28px; font-size: 12.5px; font-family: ui-monospace, 'SF Mono', Menlo, monospace; animation: fadeIn var(--t) var(--ease) both; }
.icon-btn.spinning .ic { animation: spin .8s linear infinite; }

/* Yangi o'quvchi: to'lov bo'limi */
.form-section {
  display: flex; align-items: center; gap: 8px; padding-top: 6px; margin-bottom: -4px;
  font-size: 12px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--faint);
  border-top: 1px solid var(--border); padding-top: 16px;
}
.pay-extra { grid-template-columns: repeat(2, minmax(0, 1fr)); animation: rise var(--t) var(--ease) both; }
.balance-box {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px 14px; border-radius: var(--r); font-size: 14px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--muted);
  transition: background var(--t) var(--ease), color var(--t) var(--ease), border-color var(--t) var(--ease);
}
.balance-box b { font-size: 17px; font-weight: 500; }
.balance-box.red { background: var(--danger-soft); border-color: #F9C9D4; color: var(--danger); }
.balance-box.amber { background: var(--warning-soft); border-color: #FBE0B4; color: var(--warning); }
.balance-box.green { background: var(--success-soft); border-color: #BFE8CF; color: var(--success); }
@media (max-width: 760px) { .pay-extra { grid-template-columns: minmax(0, 1fr); } }

/* Qurilma bo'limi */
.device-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.device-ic { width: 40px; height: 40px; border-radius: var(--r); display: grid; place-items: center; background: var(--success-soft); color: var(--success); flex: none; }
.device-alert { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: var(--r); background: var(--danger-soft); color: var(--danger); font-size: 13.5px; line-height: 1.45; }
.device-alert .ic { margin-top: 2px; }

/* Kategoriya cover (admin) */
.cover-wrap { padding: 16px 20px 4px; }
.cover-empty {
  width: 100%; max-width: 380px; aspect-ratio: 2 / 1; border: 1.5px dashed var(--border-strong); border-radius: var(--r);
  background: var(--surface-2); color: var(--muted); cursor: pointer; font: inherit;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 12px; text-align: center;
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease), color var(--t-fast);
}
.cover-empty:hover { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.cover-empty .ce-title { font-weight: 500; font-size: 14px; }
.cover-empty .spinner { width: 26px; height: 26px; border-color: var(--border); border-top-color: var(--primary); }
.cover-preview { position: relative; max-width: 380px; aspect-ratio: 2 / 1; border-radius: var(--r); overflow: hidden; background: var(--surface-3); }
.cover-preview img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease), filter var(--t); }
.cover-preview:hover img { transform: scale(1.02); filter: brightness(.85); }
.cover-actions { position: absolute; right: 10px; bottom: 10px; display: flex; gap: 6px; }
.cover-btn { background: rgba(15, 23, 42, .72); color: #fff; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.cover-btn:hover { background: rgba(15, 23, 42, .9); color: #fff; }
.cat-cover.custom img { object-position: center; }
@media (max-width: 760px) { .cover-wrap { padding: 14px 16px 2px; } .cover-preview, .cover-empty { max-width: none; } }
