/* ===== RESET & BASE ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-light: #6366f1;
  --secondary: #8b5cf6;
  --accent: #06b6d4;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;

  --bg: #f8fafc;
  --bg-dark: #0f172a;
  --surface: #ffffff;
  --surface-2: #f1f5f9;

  --text: #1e293b;
  --text-light: #64748b;
  --text-lighter: #94a3b8;
  --border: #e2e8f0;

  --gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-2: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
  --gradient-3: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
  --gradient-4: linear-gradient(135deg, #06b6d4 0%, #10b981 100%);
  --gradient-bg: linear-gradient(135deg, #e0e7ff 0%, #f3e8ff 50%, #fce7f3 100%);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 20px 25px rgba(0, 0, 0, 0.1), 0 10px 10px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 25px 50px rgba(0, 0, 0, 0.25);

  --radius-sm: 8px;
  --radius: 12px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;

  --sidebar-width: 260px;
  --navbar-height: 70px;

  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; outline: none; }

/* ===== AUTH PAGES (Login/Register) ===== */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-bg);
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.auth-wrapper::before,
.auth-wrapper::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.6;
  z-index: 0;
}

.auth-wrapper::before {
  width: 400px;
  height: 400px;
  background: var(--primary);
  top: -100px;
  left: -100px;
  animation: float 6s ease-in-out infinite;
}

.auth-wrapper::after {
  width: 500px;
  height: 500px;
  background: var(--secondary);
  bottom: -150px;
  right: -150px;
  animation: float 8s ease-in-out infinite reverse;
}

.auth-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 460px;
  box-shadow: var(--shadow-xl);
  position: relative;
  z-index: 1;
  animation: slideUp 0.6s ease-out;
}

.auth-logo {
  text-align: center;
  margin-bottom: 28px;
}

.auth-logo-img {
  display: block;
  width: 132px;
  height: auto;
  margin: 0 auto 14px;
  filter: drop-shadow(0 8px 18px rgba(11, 42, 74, 0.28));
}

.auth-logo-img[width="96"] { width: 96px; }

.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;
}

.auth-logo-icon {
  width: 70px;
  height: 70px;
  background: var(--gradient-2);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 32px;
  color: white;
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.4);
}

.auth-title {
  font-size: 26px;
  font-weight: 700;
  background: var(--gradient-2);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
}

.auth-subtitle {
  color: var(--text-light);
  font-size: 14px;
}

.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  background: rgba(255, 255, 255, 0.8);
  transition: var(--transition);
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
  background: white;
}

.form-input.error {
  border-color: var(--danger);
}

.input-with-icon {
  position: relative;
}

.input-with-icon .form-input { padding-left: 44px; }

.input-with-icon i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-lighter);
  font-size: 18px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: var(--gradient-2);
  color: white;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.4);
}

.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
}

.btn-secondary:hover {
  background: var(--border);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: white;
}

.btn-danger { background: var(--danger); color: white; }
.btn-success { background: var(--success); color: white; }
.btn-warning { background: var(--warning); color: white; }

.btn-block { width: 100%; }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-lg { padding: 16px 32px; font-size: 16px; }

.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 14px;
  color: var(--text-light);
}

.auth-footer a {
  color: var(--primary);
  font-weight: 600;
}

.role-selector {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}

.role-option {
  flex: 1;
  padding: 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: rgba(255, 255, 255, 0.5);
}

.role-option.active {
  border-color: var(--primary);
  background: rgba(79, 70, 229, 0.1);
  color: var(--primary);
}

.role-option i {
  font-size: 22px;
  margin-bottom: 4px;
  display: block;
}

.role-option span { font-weight: 600; font-size: 13px; }

.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert-error { background: rgba(239, 68, 68, 0.1); color: var(--danger); }
.alert-success { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.alert-info { background: rgba(59, 130, 246, 0.1); color: var(--info); }
.alert-warning { background: rgba(245, 158, 11, 0.1); color: var(--warning); }

/* ===== APP LAYOUT (with Sidebar+Navbar) ===== */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  background: white;
  border-right: 1px solid var(--border);
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo {
  width: 44px;
  height: 44px;
  display: block;
  object-fit: contain;
  flex-shrink: 0;
}

.sidebar-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
}

.sidebar-subtitle {
  font-size: 11px;
  color: var(--text-light);
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
}

.nav-section-title {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-lighter);
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 12px 12px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius);
  color: var(--text-light);
  font-weight: 500;
  font-size: 14px;
  margin-bottom: 3px;
  transition: var(--transition);
  cursor: pointer;
}

.nav-item:hover {
  background: var(--surface-2);
  color: var(--text);
}

.nav-item.active {
  background: var(--gradient-2);
  color: white;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.nav-item i { font-size: 18px; width: 20px; text-align: center; }

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
}

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: var(--surface-2);
  border-radius: var(--radius);
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--gradient-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: var(--text-light); }

/* Main content area */
.main-wrapper {
  flex: 1;
  min-width: 0; /* keng kontent (jadval, karusel) sahifani ekrandan kengaytirmasin */
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.navbar {
  height: var(--navbar-height);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.navbar-left { display: flex; align-items: center; gap: 16px; }

.menu-toggle {
  display: none;
  font-size: 22px;
  color: var(--text);
  padding: 6px;
}

.navbar-title {
  font-size: 18px;
  font-weight: 700;
}

.navbar-search {
  position: relative;
  width: 320px;
  max-width: 100%;
}

.navbar-search input {
  width: 100%;
  padding: 9px 14px 9px 38px;
  background: var(--surface-2);
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 14px;
  transition: var(--transition);
}

.navbar-search input:focus {
  background: white;
  border-color: var(--primary);
}

.navbar-search i {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-lighter);
}

.navbar-right { display: flex; align-items: center; gap: 16px; }

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  font-size: 18px;
  position: relative;
  transition: var(--transition);
}

.icon-btn:hover { background: var(--border); }

.badge {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  background: var(--danger);
  color: white;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-menu {
  position: relative;
}

.user-menu-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 6px 6px;
  border-radius: var(--radius-full);
  background: var(--surface-2);
  transition: var(--transition);
}

.user-menu-trigger:hover { background: var(--border); }

.user-menu-trigger .user-avatar { width: 32px; height: 32px; font-size: 12px; }
.user-menu-trigger span { font-size: 13px; font-weight: 600; }

.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 220px;
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: var(--transition);
  z-index: 100;
}

.user-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-header {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}

.dropdown-header .name { font-weight: 600; font-size: 14px; }
.dropdown-header .email { font-size: 12px; color: var(--text-light); }

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text);
  transition: var(--transition);
  cursor: pointer;
}

.dropdown-item:hover { background: var(--surface-2); }
.dropdown-item i { font-size: 16px; color: var(--text-light); }
.dropdown-item.danger { color: var(--danger); }
.dropdown-item.danger i { color: var(--danger); }

.dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 0;
}

/* Main content */
.main-content {
  flex: 1;
  padding: 30px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.page-title-wrap h1 {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 4px;
}

.page-title-wrap p {
  color: var(--text-light);
  font-size: 14px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 6px;
}

.breadcrumb a:hover { color: var(--primary); }
.breadcrumb i { font-size: 11px; }

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--surface-2);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  transition: var(--transition);
}

.back-btn:hover {
  background: var(--primary);
  color: white;
  transform: translateX(-3px);
}

/* ===== CARDS ===== */
.card {
  background: white;
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.card:hover { box-shadow: var(--shadow-md); }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: white;
  border-radius: var(--radius-md);
  padding: 22px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.stat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 4px;
  height: 100%;
  background: var(--gradient-2);
}

.stat-card .stat-icon {
  width: 50px;
  height: 50px;
  border-radius: var(--radius);
  background: var(--gradient-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 22px;
  margin-bottom: 14px;
}

.stat-card.green .stat-icon, .stat-card.green::before { background: var(--gradient-4); }
.stat-card.purple .stat-icon, .stat-card.purple::before { background: var(--gradient-3); }
.stat-card.orange .stat-icon { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.stat-card.orange::before { background: linear-gradient(180deg, #f59e0b, #ef4444); }

.stat-card .stat-label {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 4px;
}

.stat-card .stat-value {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 4px;
}

.stat-card .stat-change {
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* Section grid */
.section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.feature-card {
  background: white;
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  display: block;
  color: inherit;
}

.feature-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.feature-icon {
  width: 60px;
  height: 60px;
  border-radius: var(--radius);
  background: var(--gradient-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 26px;
  margin-bottom: 16px;
}

.feature-icon.green { background: var(--gradient-4); }
.feature-icon.purple { background: var(--gradient-3); }
.feature-icon.orange { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.feature-icon.cyan { background: linear-gradient(135deg, #06b6d4, #3b82f6); }

.feature-card h3 {
  font-size: 18px;
  margin-bottom: 8px;
  font-weight: 700;
}

.feature-card p {
  color: var(--text-light);
  font-size: 14px;
  margin-bottom: 16px;
  line-height: 1.5;
}

.feature-card .feature-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.feature-card .feature-meta span {
  font-size: 12px;
  color: var(--text-lighter);
}

.feature-card .arrow {
  color: var(--primary);
  font-size: 20px;
  transition: var(--transition);
}

.feature-card:hover .arrow { transform: translateX(4px); }

/* Lecture/Practice cards */
.lecture-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.lecture-card {
  background: white;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

.lecture-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.lecture-card-image {
  height: 140px;
  background: var(--gradient-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 50px;
  position: relative;
}

.lecture-card-image.g1 { background: linear-gradient(135deg, #667eea, #764ba2); }
.lecture-card-image.g2 { background: linear-gradient(135deg, #f093fb, #f5576c); }
.lecture-card-image.g3 { background: linear-gradient(135deg, #4facfe, #00f2fe); }
.lecture-card-image.g4 { background: linear-gradient(135deg, #43e97b, #38f9d7); }
.lecture-card-image.g5 { background: linear-gradient(135deg, #fa709a, #fee140); }
.lecture-card-image.g6 { background: linear-gradient(135deg, #30cfd0, #330867); }
.lecture-card-image.g7 { background: linear-gradient(135deg, #a8edea, #fed6e3); color: #4f46e5; }
.lecture-card-image.g8 { background: linear-gradient(135deg, #ff9a9e, #fad0c4); color: #4f46e5; }
.lecture-card-image.g9 { background: linear-gradient(135deg, #5ee7df, #b490ca); }
.lecture-card-image.g10 { background: linear-gradient(135deg, #d299c2, #fef9d7); color: #4f46e5; }

.lecture-card-number {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(8px);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 700;
}

.lecture-card-status {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(8px);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.lecture-card-body {
  padding: 18px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.lecture-card-body h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.4;
}

.lecture-card-body p {
  color: var(--text-light);
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 14px;
  flex: 1;
}

.lecture-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-lighter);
}

.lecture-card-footer i { margin-right: 4px; }

/* Locked card */
.lecture-card.locked {
  opacity: 0.65;
  cursor: not-allowed;
  position: relative;
}

.lecture-card.locked::after {
  content: '\f023';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 50px;
  color: rgba(0, 0, 0, 0.4);
}

.lecture-card.completed .lecture-card-status {
  background: var(--success);
  color: white;
}

/* ===== CAROUSEL ===== */
.carousel {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 30px;
  box-shadow: var(--shadow);
  height: 320px;
}

.carousel-track {
  display: flex;
  height: 100%;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.carousel-slide {
  min-width: 100%;
  height: 100%;
  background: var(--gradient-2);
  display: flex;
  align-items: center;
  padding: 50px 84px; /* strelkalar (16px + 44px) matnga tushmasin */
  color: white;
  position: relative;
  overflow: hidden;
}

.carousel-slide:nth-child(3) { background: linear-gradient(135deg, #667eea, #764ba2); }
.carousel-slide:nth-child(4) { background: linear-gradient(135deg, #4facfe, #00f2fe); }
.carousel-slide:nth-child(5) { background: linear-gradient(135deg, #fa709a, #fee140); }
.carousel-slide:nth-child(6) { background: linear-gradient(135deg, #30cfd0, #330867); }
.carousel-slide.slide-author { background: linear-gradient(135deg, #312e81, #4f46e5 55%, #06b6d4); }
.carousel-slide.slide-topic { background: linear-gradient(135deg, #0f172a, #3730a3 60%, #7c3aed); }
.carousel-slide.slide-author h2 { font-size: 36px; }
.carousel-slide.slide-topic .carousel-slide-content { max-width: 880px; }
.carousel-slide.slide-topic h2 { font-size: 24px; line-height: 1.35; margin-bottom: 0; }

.carousel-slide::before {
  content: '';
  position: absolute;
  width: 300px;
  height: 300px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  right: -80px;
  top: -80px;
}

.carousel-slide-content {
  max-width: 600px;
  position: relative;
  z-index: 1;
}

.carousel-slide-tag {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 14px;
}

.carousel-slide h2 {
  font-size: 30px;
  margin-bottom: 12px;
  font-weight: 700;
  line-height: 1.2;
}

.carousel-slide p {
  font-size: 15px;
  opacity: 0.95;
  margin-bottom: 22px;
  line-height: 1.5;
}

.carousel-slide .btn {
  background: white;
  color: var(--primary);
}

.carousel-slide-icon {
  position: absolute;
  right: 60px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 130px;
  opacity: 0.2;
}

.carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 18px;
  cursor: pointer;
  transition: var(--transition);
  z-index: 2;
}

.carousel-nav:hover { background: rgba(255, 255, 255, 0.35); }
.carousel-nav.prev { left: 16px; }
.carousel-nav.next { right: 16px; }

.carousel-dots {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 2;
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: var(--transition);
}

.carousel-dot.active { background: white; width: 28px; border-radius: 5px; }

/* ===== PROGRESS ===== */
.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--surface-2);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: var(--gradient-2);
  border-radius: var(--radius-full);
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  animation: shimmer 2s infinite;
}

.progress-section {
  background: white;
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.progress-item {
  margin-bottom: 18px;
}

.progress-item:last-child { margin-bottom: 0; }

.progress-info {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 14px;
}

.progress-info .label { font-weight: 600; }
.progress-info .value { color: var(--text-light); }

.section-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title i { color: var(--primary); }

/* ===== Dashboard activity ===== */
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

.activity-list { display: flex; flex-direction: column; gap: 12px; }

.activity-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  background: var(--surface-2);
  border-radius: var(--radius);
  transition: var(--transition);
}

.activity-item:hover { background: var(--border); }

.activity-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 16px;
  flex-shrink: 0;
  background: var(--gradient-2);
}

.activity-icon.success { background: var(--success); }
.activity-icon.warning { background: var(--warning); }
.activity-icon.info { background: var(--info); }
.activity-icon.danger { background: var(--danger); }

.activity-content { flex: 1; }
.activity-title { font-size: 14px; font-weight: 600; }
.activity-meta { font-size: 12px; color: var(--text-light); }

/* ===== LECTURE DETAIL ===== */
.lecture-hero {
  background: var(--gradient-2);
  color: white;
  padding: 40px;
  border-radius: var(--radius-md);
  margin-bottom: 30px;
  position: relative;
  overflow: hidden;
}

.lecture-hero::before {
  content: '';
  position: absolute;
  right: -50px;
  top: -50px;
  width: 250px;
  height: 250px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
}

.lecture-hero h1 {
  font-size: 28px;
  margin-bottom: 10px;
  position: relative;
}

.lecture-hero p {
  font-size: 15px;
  opacity: 0.95;
  max-width: 700px;
  position: relative;
}

.lecture-meta {
  display: flex;
  gap: 20px;
  margin-top: 20px;
  position: relative;
  flex-wrap: wrap;
}

.lecture-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.2);
  padding: 6px 14px;
  border-radius: var(--radius-full);
}

.lecture-content {
  background: white;
  border-radius: var(--radius-md);
  padding: 30px;
  box-shadow: var(--shadow);
  line-height: 1.8;
}

.lecture-content h2 {
  font-size: 22px;
  margin: 28px 0 14px;
  color: var(--text);
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary);
  display: inline-block;
}

.lecture-content h2:first-child { margin-top: 0; }

.lecture-content h3 {
  font-size: 18px;
  margin: 22px 0 12px;
  color: var(--primary);
}

.lecture-content p {
  margin-bottom: 14px;
  color: var(--text);
  font-size: 15px;
}

.lecture-content ul, .lecture-content ol {
  margin: 14px 0 14px 24px;
}

.lecture-content li { margin-bottom: 6px; }

.info-box {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.05), rgba(139, 92, 246, 0.05));
  border-left: 4px solid var(--primary);
  padding: 16px 20px;
  border-radius: var(--radius);
  margin: 20px 0;
}

.info-box.success { background: rgba(16, 185, 129, 0.08); border-color: var(--success); }
.info-box.warning { background: rgba(245, 158, 11, 0.08); border-color: var(--warning); }
.info-box.danger { background: rgba(239, 68, 68, 0.08); border-color: var(--danger); }

.info-box h4 {
  font-size: 15px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.example-block {
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 18px;
  margin: 18px 0;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  border-left: 4px solid var(--primary);
}

.lecture-image {
  width: 100%;
  border-radius: var(--radius);
  margin: 20px 0;
  background: var(--gradient-bg);
  height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 80px;
  position: relative;
  overflow: hidden;
}

.lecture-image.gradient-1 { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; }
.lecture-image.gradient-2 { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); color: white; }
.lecture-image.gradient-3 { background: linear-gradient(135deg, #fa709a 0%, #fee140 100%); color: white; }
.lecture-image.gradient-4 { background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); color: white; }

.lecture-image .image-caption {
  position: absolute;
  bottom: 12px;
  left: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-family: inherit;
  text-align: center;
}

.lecture-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 24px;
  gap: 12px;
}

.nav-prev, .nav-next {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  background: white;
  border-radius: var(--radius);
  transition: var(--transition);
  box-shadow: var(--shadow);
  color: var(--text);
}

.nav-prev:hover, .nav-next:hover {
  background: var(--gradient-2);
  color: white;
  transform: translateY(-2px);
}

.nav-next { justify-content: flex-end; text-align: right; }

.nav-prev .nav-label, .nav-next .nav-label {
  font-size: 11px;
  color: var(--text-light);
  text-transform: uppercase;
}

.nav-prev:hover .nav-label, .nav-next:hover .nav-label { color: rgba(255,255,255,0.85); }

.nav-prev .nav-title, .nav-next .nav-title {
  font-weight: 600;
  font-size: 14px;
}

/* ===== PRACTICE PAGE ===== */
.theory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  margin-bottom: 30px;
}

.theory-card {
  background: white;
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: var(--transition);
  border-top: 4px solid var(--primary);
}

.theory-card:nth-child(2) { border-color: var(--secondary); }
.theory-card:nth-child(3) { border-color: var(--accent); }
.theory-card:nth-child(4) { border-color: var(--success); }

.theory-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.theory-card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  background: rgba(79, 70, 229, 0.1);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 12px;
}

.theory-card h3 {
  font-size: 15px;
  margin-bottom: 6px;
  font-weight: 700;
}

.theory-card p {
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.5;
}

.task-section {
  background: white;
  border-radius: var(--radius-md);
  padding: 26px;
  box-shadow: var(--shadow);
}

.task-card {
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 18px;
}

.task-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.task-number {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gradient-2);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.task-title {
  font-size: 15px;
  font-weight: 700;
  flex: 1;
}

.task-description {
  font-size: 14px;
  color: var(--text);
  margin-bottom: 12px;
  line-height: 1.6;
}

.task-input {
  width: 100%;
  min-height: 100px;
  padding: 12px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  background: white;
  transition: var(--transition);
  resize: vertical;
}

.task-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

/* ===== TEST PAGE ===== */
.test-info-card {
  background: var(--gradient-2);
  color: white;
  border-radius: var(--radius-md);
  padding: 26px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.test-info-card h2 {
  font-size: 22px;
  margin-bottom: 6px;
}

.test-info-card p { opacity: 0.9; font-size: 14px; }

.test-timer {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  padding: 14px 24px;
  border-radius: var(--radius);
  font-size: 24px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.test-timer.warning { background: rgba(245, 158, 11, 0.4); }
.test-timer.danger { background: rgba(239, 68, 68, 0.5); animation: pulse 1s infinite; }

.question-card {
  background: white;
  border-radius: var(--radius-md);
  padding: 26px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.question-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 18px;
}

.question-number {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gradient-2);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

.question-text {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  flex: 1;
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  background: white;
}

.option:hover {
  border-color: var(--primary);
  background: rgba(79, 70, 229, 0.05);
}

.option.selected {
  border-color: var(--primary);
  background: rgba(79, 70, 229, 0.1);
}

.option.selected .option-marker {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.option-marker {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
  transition: var(--transition);
}

.option-text { font-size: 14px; flex: 1; }

.test-progress-bar {
  position: sticky;
  top: var(--navbar-height);
  background: white;
  border-radius: var(--radius);
  padding: 14px 18px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  z-index: 10;
}

.test-progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 6px;
}

.test-progress-info span:first-child { font-weight: 600; }

.test-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
}

/* Test result */
.result-card {
  background: white;
  border-radius: var(--radius-md);
  padding: 40px;
  box-shadow: var(--shadow);
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.result-icon {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: var(--gradient-4);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 50px;
  margin: 0 auto 20px;
}

.result-icon.fail { background: linear-gradient(135deg, #f59e0b, #ef4444); }

.result-card h2 {
  font-size: 26px;
  margin-bottom: 10px;
}

.result-score {
  font-size: 60px;
  font-weight: 800;
  background: var(--gradient-2);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 20px 0;
}

.result-stats {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin: 24px 0;
  flex-wrap: wrap;
}

.result-stat .num {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
}

.result-stat .lbl {
  font-size: 12px;
  color: var(--text-light);
}

.result-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 24px;
  flex-wrap: wrap;
}

/* Independent learning - resource cards */
.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 22px;
}

.resource-card {
  background: white;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.resource-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.resource-image {
  height: 160px;
  background: var(--gradient-2);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 50px;
  overflow: hidden;
}

.resource-image .resource-type {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.resource-body { padding: 18px; flex: 1; display: flex; flex-direction: column; }
.resource-body h3 { font-size: 16px; font-weight: 700; margin-bottom: 6px; line-height: 1.4; }
.resource-body p { font-size: 13px; color: var(--text-light); line-height: 1.5; flex: 1; margin-bottom: 14px; }
.resource-link { display: inline-flex; align-items: center; gap: 6px; color: var(--primary); font-weight: 600; font-size: 13px; }
.resource-link:hover { gap: 10px; }

/* Programs page */
.program-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 26px;
}

.program-card {
  background: white;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.program-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

.program-header {
  height: 180px;
  background: var(--gradient-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 80px;
  position: relative;
}

.program-header.antivirus { background: linear-gradient(135deg, #ef4444, #f59e0b); }
.program-header.crypto { background: linear-gradient(135deg, #4f46e5, #06b6d4); }

.program-body { padding: 26px; }
.program-body h3 { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.program-version { font-size: 12px; color: var(--text-light); margin-bottom: 14px; }
.program-body > p { color: var(--text-light); margin-bottom: 16px; line-height: 1.6; }
.program-features { margin: 16px 0; }
.program-features li {
  list-style: none;
  padding: 6px 0;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.program-features li i { color: var(--success); }

.program-stats {
  display: flex;
  gap: 14px;
  margin: 16px 0;
  padding: 14px;
  background: var(--surface-2);
  border-radius: var(--radius);
}

.program-stat {
  flex: 1;
  text-align: center;
}

.program-stat .num { font-size: 18px; font-weight: 700; color: var(--primary); }
.program-stat .lbl { font-size: 11px; color: var(--text-light); }

/* ===== ADMIN ===== */
.admin-table {
  width: 100%;
  background: white;
  border-radius: var(--radius);
  overflow-x: auto; /* telefonda jadval kesilmasdan, gorizontal suriladi */
  -webkit-overflow-scrolling: touch;
  box-shadow: var(--shadow);
}

.admin-table table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th {
  background: var(--surface-2);
  padding: 14px;
  white-space: nowrap;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

.admin-table td {
  padding: 14px;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}

.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover { background: var(--surface-2); }

.table-actions {
  display: flex;
  gap: 6px;
}

.table-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  font-size: 14px;
  transition: var(--transition);
}

.table-btn:hover { background: var(--primary); color: white; }
.table-btn.danger:hover { background: var(--danger); }

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
}

.status-badge.active { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.status-badge.inactive { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.status-badge.pending { background: rgba(245, 158, 11, 0.15); color: var(--warning); }

.toolbar {
  background: white;
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 18px;
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
}

.toolbar-search { flex: 1; min-width: 200px; position: relative; }
.toolbar-search input {
  width: 100%;
  padding: 9px 14px 9px 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
}
.toolbar-search i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text-lighter); }

select.form-input {
  cursor: pointer;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2364748b' viewBox='0 0 16 16'%3e%3cpath d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  appearance: none;
  -webkit-appearance: none;
  padding-right: 36px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open { transform: translateX(0); }
  .main-wrapper { margin-left: 0; }
  .menu-toggle { display: flex; }
  .navbar-search { display: none; }
  .navbar { padding: 0 16px; }
  .main-content { padding: 18px; }
  .auth-card { padding: 28px 20px; }
  .carousel { height: auto; }
  .carousel-track { height: auto; align-items: stretch; }
  .carousel-slide { min-height: 260px; height: auto; }
  .carousel-slide { padding: 30px 24px 56px; } /* pastda nuqtalar uchun joy */
  .carousel-slide h2 { font-size: 22px; }
  .carousel-slide.slide-author h2 { font-size: 24px; }
  .carousel-slide.slide-topic h2 { font-size: 15px; line-height: 1.4; }
  .carousel-slide-icon { font-size: 80px; right: 20px; }
  .carousel-nav { display: none; } /* telefonda strelkalar matnni to'sadi; nuqtalar va avto-aylanish qoladi */
  .lecture-hero { padding: 24px; }
  .lecture-hero h1 { font-size: 22px; }
  .lecture-content { padding: 20px; }
  .test-info-card { flex-direction: column; align-items: flex-start; }
  .user-menu-trigger span { display: none; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .section-grid { grid-template-columns: 1fr; }
  .lecture-grid { grid-template-columns: 1fr; }
  .resource-grid { grid-template-columns: 1fr; }
  .program-grid { grid-template-columns: 1fr; }
  .lecture-nav { flex-direction: column; }
}

/* Overlay for mobile sidebar */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
}

.sidebar-overlay.show { display: block; }

/* ============================================================
   EMBEDS - Google Drive / Canva / Prezi materiallari
   ============================================================ */
.embed-list { display: flex; flex-direction: column; gap: 24px; margin-bottom: 16px; }

.embed-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.embed-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.embed-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: var(--primary);
  white-space: nowrap;
}
.embed-drive  .embed-badge { background: #1a73e8; }
.embed-docs   .embed-badge { background: #4285f4; }
.embed-slides .embed-badge { background: #f4b400; color: #1e293b; }
.embed-sheets .embed-badge { background: #0f9d58; }
.embed-forms  .embed-badge { background: #7248b9; }
.embed-canva  .embed-badge { background: linear-gradient(135deg, #00c4cc, #7d2ae8); }
.embed-prezi  .embed-badge { background: #3181ff; }

.embed-title { flex: 1; min-width: 160px; font-weight: 600; color: var(--text); }

.embed-open {
  font-size: 13px;
  font-weight: 500;
  color: var(--primary);
  text-decoration: none;
  white-space: nowrap;
}
.embed-open:hover { text-decoration: underline; }

.embed-fs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  background: rgba(79, 70, 229, 0.08);
  white-space: nowrap;
}
.embed-fs:hover { background: rgba(79, 70, 229, 0.15); }
.embed-frame:fullscreen { width: 100% !important; height: 100% !important; max-width: none; aspect-ratio: auto; margin: 0; background: #000; }
.embed-frame:-webkit-full-screen { width: 100% !important; height: 100% !important; max-width: none; margin: 0; background: #000; }

.embed-frame { position: relative; width: 100%; background: #f1f5f9; }
.embed-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.embed-frame.layout-wide   { aspect-ratio: 16 / 9; width: min(100%, calc((100vh - 150px) * 16 / 9)); margin: 0 auto; }
.embed-frame.layout-doc    { height: 75vh; min-height: 480px; max-height: 900px; }
.embed-frame.layout-folder { height: 460px; }
.embed-frame.layout-form   { height: 820px; }

.embed-hint { font-size: 13px; color: var(--text-light); margin: 0 0 24px; }
.embed-hint i { color: var(--info); }

@media (max-width: 640px) {
  .embed-head { padding: 12px 14px; gap: 8px; }
  .embed-title { flex-basis: 100%; order: -1; }
  .embed-frame.layout-doc  { height: 70vh; min-height: 380px; }
  .embed-frame.layout-form { height: 680px; }
}
.table-btn:disabled { opacity: .35; cursor: not-allowed; }

/* ===== Navbar qidiruv va bildirishnomalar ===== */
.nav-search-results, .notif-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  padding: 6px;
  z-index: 120;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: var(--transition);
}
.nav-search-results { left: 0; right: 0; max-height: 380px; overflow-y: auto; }
.nav-search-results.show, .notif-dropdown.show { opacity: 1; visibility: visible; transform: translateY(0); }
.nav-search-item, .notif-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 9px 10px; border-radius: var(--radius-sm);
  color: var(--text); font-size: 13px; line-height: 1.35;
}
.nav-search-item:hover, .notif-item:hover { background: var(--surface-2); }
.nav-search-item i, .notif-item i { color: var(--primary); margin-top: 2px; width: 16px; text-align: center; }
.nav-search-item b { display: block; font-weight: 600; }
.nav-search-item small { color: var(--text-light); font-size: 12px; }
.nav-search-empty { padding: 12px; color: var(--text-light); font-size: 13px; text-align: center; }
.notif-wrap { position: relative; }
.notif-dropdown { right: 0; width: 320px; max-width: calc(100vw - 24px); }
.notif-head { padding: 8px 10px; font-weight: 700; font-size: 14px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
@media (max-width: 768px) { .notif-dropdown { position: fixed; top: 64px; right: 12px; left: 12px; width: auto; } }

/* ===== Backend bilan ishlaydigan sahifalar: umumiy elementlar ===== */
.mini-meter { display:flex; align-items:center; gap:8px; min-width:96px; }
.mini-meter .bar { flex:1; height:6px; background:var(--border); border-radius:99px; overflow:hidden; }
.mini-meter .fill { height:100%; border-radius:99px; background:linear-gradient(135deg, #4f46e5, #06b6d4); }
.mini-meter .num { font-size:12px; color:var(--text-light); white-space:nowrap; }
.score-pill { display:inline-block; min-width:48px; text-align:center; padding:3px 10px; border-radius:99px; font-weight:600; font-size:13px; white-space:nowrap; }
.score-hi { background:rgba(16,185,129,.12); color:#047857; }
.score-good { background:rgba(59,130,246,.12); color:#1d4ed8; }
.score-mid { background:rgba(245,158,11,.15); color:#b45309; }
.score-lo { background:rgba(239,68,68,.12); color:#b91c1c; }
.score-none { background:var(--surface-2); color:var(--text-lighter); }
.status-badge.info { background: rgba(59,130,246,.12); color:#1d4ed8; }
.u-name { font-weight:500; color:var(--text); }
.u-mail { font-size:12px; color:var(--text-light); }
.empty-cell { text-align:center; color:var(--text-light); padding:30px !important; }
.form-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap:14px; align-items:end; }
.form-grid .full { grid-column: 1 / -1; }
.panel { background: var(--surface); border:1px solid var(--border); border-radius: var(--radius-md); padding:22px; margin-bottom:24px; box-shadow: var(--shadow-sm); }
.panel h3 { font-size:17px; margin:0 0 14px; display:flex; align-items:center; gap:8px; }
.panel h3 i { color: var(--primary); }
.panel-head { display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap; margin-bottom:14px; }
.panel-head h3 { margin:0; }
.muted { color: var(--text-light); font-size:13px; }
.kv-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap:12px; }
.kv { background: var(--surface-2); border-radius: var(--radius); padding:14px; }
.kv .k { font-size:12px; color: var(--text-light); }
.kv .v { font-size:22px; font-weight:700; color: var(--text); margin-top:2px; }
.chip { display:inline-block; padding:3px 10px; border-radius:99px; background:var(--surface-2); font-size:12px; color:var(--text-light); margin:2px 4px 2px 0; }
.table-btn.text { width:auto; padding:0 10px; font-size:12px; font-weight:600; }
.pre-wrap { white-space: pre-wrap; line-height:1.6; }
.task-text { background: var(--surface-2); border-radius: var(--radius); padding:16px; white-space: pre-wrap; line-height:1.65; }
.crit-list { display:flex; flex-direction:column; gap:8px; margin:10px 0; }
.crit-row { display:flex; justify-content:space-between; gap:12px; padding:10px 12px; border:1px solid var(--border); border-radius: var(--radius-sm); }
.crit-row .c-name { font-weight:600; }
.crit-row .c-comment { font-size:13px; color: var(--text-light); margin-top:2px; }
.big-score { font-size:42px; font-weight:800; color: var(--primary); line-height:1; }
/* modal */
.modal-backdrop { position:fixed; inset:0; background:rgba(15,23,42,.5); z-index:300; display:flex; align-items:flex-start; justify-content:center; padding:40px 16px; overflow-y:auto; }
.modal-box { background:white; border-radius: var(--radius-md); width:100%; max-width:560px; box-shadow: var(--shadow-xl); animation: fadeIn .2s ease; }
.modal-box.wide { max-width:900px; }
.modal-head { display:flex; justify-content:space-between; align-items:center; padding:16px 20px; border-bottom:1px solid var(--border); }
.modal-head h3 { font-size:17px; margin:0; }
.modal-x { width:34px; height:34px; border-radius:50%; background: var(--surface-2); }
.modal-body { padding:20px; }
.hint-box { background: rgba(79,70,229,.06); border-left:4px solid var(--primary); padding:12px 14px; border-radius: var(--radius-sm); font-size:13px; color: var(--text); }
@media (max-width: 640px) { .modal-backdrop { padding: 12px 8px; } .panel { padding:16px; } }
/* SI vazifalari kartalari */
.assign-list { display:grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap:16px; }
.assign-card { background: var(--surface); border:1px solid var(--border); border-radius: var(--radius-md); padding:18px; cursor:pointer; transition: transform .15s, box-shadow .15s; display:flex; flex-direction:column; gap:8px; }
.assign-card:hover, .assign-card:focus { transform: translateY(-2px); box-shadow: var(--shadow-md); outline:none; }
.assign-card.open { border-left:4px solid var(--primary); }
.ac-top { display:flex; flex-wrap:wrap; gap:6px; align-items:center; }
.ac-title { font-weight:600; font-size:15px; color: var(--text); }
.ac-score { margin-top:auto; font-size:14px; color: var(--primary); }
.grade-hero { display:flex; justify-content:space-between; align-items:center; gap:16px; background: linear-gradient(135deg, rgba(79,70,229,.08), rgba(6,182,212,.08)); }
/* simulyatsiyalar */
.sim-grid { display:grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap:18px; }
.sim-card { display:flex; flex-direction:column; gap:10px; padding:22px; background: var(--surface); border:1px solid var(--border); border-radius: var(--radius-md); text-decoration:none; color: var(--text); transition: transform .15s, box-shadow .15s; border-top:4px solid var(--sim); }
.sim-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.sim-card p { color: var(--text-light); font-size:14px; line-height:1.55; margin:0; }
.sim-ico { width:48px; height:48px; border-radius:12px; display:flex; align-items:center; justify-content:center; font-size:22px; color:white; background: var(--sim); }
.sim-title { font-weight:700; font-size:17px; }
.sim-foot { margin-top:auto; display:flex; justify-content:space-between; align-items:center; }
.sim-tabs { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:18px; }
.sim-tab { padding:9px 16px; border-radius:99px; border:1px solid var(--border); background: var(--surface); font-weight:600; font-size:14px; cursor:pointer; color: var(--text); }
.sim-tab.active { background: var(--primary); color:white; border-color: var(--primary); }
.sim-tab .score-pill { margin-left:6px; min-width:0; padding:1px 8px; font-size:12px; }
.sim-table { width:100%; border-collapse:collapse; font-size:14px; }
.sim-table th, .sim-table td { border:1px solid var(--border); padding:7px 8px; text-align:left; vertical-align:middle; }
.sim-table th { background: var(--surface-2); font-weight:600; font-size:13px; }
.sim-table input, .sim-table select { width:100%; min-width:70px; padding:6px 8px; border:1px solid var(--border); border-radius:6px; font: inherit; background:white; }
.sim-table input.ok, .sim-table select.ok { border-color:#10b981; background: rgba(16,185,129,.07); }
.sim-table input.bad, .sim-table select.bad { border-color:#ef4444; background: rgba(239,68,68,.06); }
.sim-table td.num, .sim-table th.num { text-align:right; font-variant-numeric: tabular-nums; }
.sim-table tfoot td { font-weight:700; background: var(--surface-2); }
.scenario { background: #fffbeb; border:1px solid #fde68a; border-radius: var(--radius); padding:16px; line-height:1.6; }
.scenario h4 { margin:0 0 6px; }
.result-box { border-radius: var(--radius); padding:16px; margin-top:16px; }
.result-box.good { background: rgba(16,185,129,.08); border:1px solid rgba(16,185,129,.35); }
.result-box.bad { background: rgba(239,68,68,.06); border:1px solid rgba(239,68,68,.3); }
.result-box ul { margin:8px 0 0; padding-left:20px; }
.scroll-x { overflow-x:auto; -webkit-overflow-scrolling: touch; }
.sql-editor { width:100%; min-height:130px; font-family: 'JetBrains Mono', Consolas, monospace; font-size:14px; padding:12px; border:1px solid var(--border); border-radius: var(--radius); background:#0f172a; color:#e2e8f0; resize:vertical; }
.schema-box { font-family: Consolas, monospace; font-size:12.5px; background: var(--surface-2); border-radius: var(--radius); padding:12px; line-height:1.6; }
.sql-tasks { display:flex; flex-direction:column; gap:6px; }
.sql-task { text-align:left; padding:10px 12px; border:1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); cursor:pointer; font-size:13.5px; display:flex; gap:8px; align-items:flex-start; color: var(--text); }
.sql-task.active { border-color: var(--primary); background: rgba(79,70,229,.06); }
.sql-task .ck { color: var(--text-lighter); } .sql-task.done .ck { color:#10b981; }
.sim-2col { display:grid; grid-template-columns: 320px 1fr; gap:20px; align-items:start; }
@media (max-width: 900px) { .sim-2col { grid-template-columns: 1fr; } }
.invoice { background:white; border:1px solid var(--border); border-radius: var(--radius-md); padding:20px; }
.invoice-head { display:flex; justify-content:space-between; gap:12px; flex-wrap:wrap; border-bottom:2px solid var(--text); padding-bottom:10px; margin-bottom:14px; }
.party { border:1px solid var(--border); border-radius: var(--radius); padding:12px; }
.party h5 { margin:0 0 8px; font-size:13px; text-transform:uppercase; color: var(--text-light); letter-spacing:.04em; }
.eri-box { font-family: Consolas, monospace; font-size:12px; word-break: break-all; background: var(--surface-2); padding:10px; border-radius: var(--radius-sm); }
canvas.npv-chart { width:100%; height:280px; background:white; border:1px solid var(--border); border-radius: var(--radius); }
.table-wrapper { width:100%; max-width:100%; overflow-x:auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius); }
.table-wrapper > .admin-table { min-width: 560px; }
.panel .table-wrapper > .admin-table { min-width: 0; }
.sim-table td.num, .sim-table tfoot td { white-space:nowrap; }
/* Mavzu testlari */
.quiz-bar { position: sticky; top: calc(var(--navbar-height) + 8px); z-index: 20; display:flex; justify-content:space-between; align-items:center; gap:12px; background: var(--surface); border:1px solid var(--border); border-radius: var(--radius); padding:12px 16px; margin-bottom:16px; box-shadow: var(--shadow); }
.quiz-timer { font-size:20px; font-weight:800; color: var(--primary); font-variant-numeric: tabular-nums; white-space:nowrap; }
.quiz-timer.warn { color:#dc2626; }
.option.correct { border-color:#10b981; background: rgba(16,185,129,.08); }
.option.wrong { border-color:#ef4444; background: rgba(239,68,68,.07); }
/* Foydalanuvchilar va guruhlarni boshqarish */
.header-actions { display:flex; gap:10px; flex-wrap:wrap; align-items:center; }
.check-grid { display:grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap:6px 12px; max-height:220px; overflow:auto; padding:10px; border:1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.check-item { display:flex; gap:8px; align-items:center; font-size:14px; cursor:pointer; min-height:28px; }
.check-item input { width:16px; height:16px; flex-shrink:0; }
code.pw { font-family: Consolas, 'JetBrains Mono', monospace; font-size:14px; background: var(--surface-2); padding:2px 8px; border-radius:6px; user-select: all; white-space:nowrap; }

/* ===== RESPONSIVLIK TUZATISHLARI ===== */
/* Formalar: ustun eni ekrandan katta bo'lmasin; tor ekranda bitta ustun (span 2 maydonlar ham) */
.form-grid { grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); }
.form-grid > * { min-width: 0; }
.form-input { max-width: 100%; min-width: 0; }
@media (max-width: 560px) {
  .form-grid { grid-template-columns: 1fr; }
  .form-grid > [style*="grid-column"] { grid-column: 1 / -1 !important; }
}

/* Navbar: juda tor ekranda sarlavha qisqaradi, elementlar bir-biriga siqiladi */
.navbar-left { min-width: 0; }
.navbar-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 420px) {
  .navbar { padding: 0 12px; gap: 8px; }
  .navbar-left, .navbar-right { gap: 8px; }
  .navbar-title { font-size: 16px; }
  .main-content { padding: 16px 14px; }
}

/* Barmoq bilan bosiladigan elementlar telefonda kamida ~36px */
@media (pointer: coarse) {
  .embed-fs, .table-btn.text, .chip-btn { min-height: 36px; }
  .table-btn { min-width: 36px; min-height: 36px; }
}

/* Telefonda mayda yorliqlar o'qilishi uchun biroz kattaroq */
@media (max-width: 480px) {
  .status-badge, .lecture-card-status, .program-tag, .resource-type, .nav-label, .user-role,
  .lbl, .nav-section-title, .sidebar-subtitle,
  .nav-prev .nav-label, .nav-next .nav-label, .resource-image .resource-type, .program-tags .program-tag,
  .program-stat .lbl, .result-stat .lbl { font-size: 12px; }
}

/* Jadvallar telefonda kartochka ko'rinishida (main.js: setupResponsiveTables) */
@media (max-width: 640px) {
  .table-wrapper > .admin-table.stack { min-width: 0; }
  .admin-table.stack, .admin-table.stack tbody, .admin-table.stack tr, .admin-table.stack td { display: block; width: 100%; }
  .admin-table.stack thead { display: none; }
  .admin-table.stack tr { background: var(--surface, #fff); border: 1px solid var(--border); border-radius: var(--radius); padding: 6px 14px; margin-bottom: 10px; }
  .admin-table.stack tr:hover { background: var(--surface, #fff); }
  /* chapda ustun nomi, o'ngda katak tarkibi (bir nechta element bo'lsa — ustma-ust) */
  .admin-table.stack td { position: relative; padding: 9px 0 9px 42%; border-bottom: 1px dashed var(--border); text-align: right; min-height: 40px; overflow-wrap: anywhere; }
  .admin-table.stack tr td:last-child { border-bottom: none; }
  .admin-table.stack td::before { content: attr(data-label); position: absolute; left: 0; top: 10px; width: 40%; font-weight: 600; font-size: 12.5px; color: var(--text-light); text-align: left; overflow-wrap: normal; }
  .admin-table.stack td[data-label=""] { padding-left: 0; }
  .admin-table.stack td[data-label=""]::before { display: none; }
  .admin-table.stack td .mini-meter, .admin-table.stack td .table-actions { display: inline-flex; }
  .admin-table.stack td.empty-cell, .admin-table.stack td[colspan] { display: block; text-align: center; }
  .admin-table.stack td.empty-cell::before, .admin-table.stack td[colspan]::before { display: none; }
  .admin-table.stack td > * { max-width: 100%; }
  .admin-table.stack .table-actions { justify-content: flex-end; }
  .admin-table.stack .mini-meter { min-width: 0; }
  .table-wrapper:has(> .admin-table.stack) { overflow-x: visible; }
}

/* Profil: keng ekranda ikki ustun */
.profile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); gap: 20px; align-items: start; }
.profile-grid .panel { margin: 0; }

/* Vazifa berish: "kim beradi / kim tekshiradi" tanlovlari va mezonlar muharriri */
.step-title { margin: 20px 0 10px; font-size: 15px; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 10px; }
.choice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: var(--radius); cursor: pointer; background: var(--surface, #fff); transition: var(--transition); }
.choice:hover { border-color: var(--primary); }
.choice:has(input:checked) { border-color: var(--primary); background: rgba(79, 70, 229, .06); box-shadow: 0 0 0 3px rgba(79, 70, 229, .08); }
.choice input { margin-top: 3px; width: 16px; height: 16px; flex-shrink: 0; accent-color: var(--primary); }
.choice > span > b { display: block; font-size: 14px; margin-bottom: 3px; }
.choice > span > b i { color: var(--primary); margin-right: 4px; }
.choice small b { color: var(--text); }
.choice small { display: block; color: var(--text-light); font-size: 12.5px; line-height: 1.45; }
.choice.disabled { opacity: .5; cursor: not-allowed; }
.crit-edit { display: grid; grid-template-columns: 1fr 96px 36px; gap: 8px; align-items: center; margin-bottom: 8px; }
