/* ============================================================
   LMS Portal - Flutter Dark Theme
   Primary: #6366f1 | Secondary: #22c55e | Accent: #06b6d4
   BG: #0f172a | Card: #1e293b | Text: #f1f5f9
   ============================================================ */

:root {
  --primary: #6366f1;
  --primary-light: #818cf8;
  --primary-dark: #4f46e5;
  --secondary: #22c55e;
  --accent: #06b6d4;
  --warning: #f59e0b;
  --danger: #ef4444;
  --bg: #0f172a;
  --bg-2: #0b1120;
  --card: #1e293b;
  --card-2: #253047;
  --border: rgba(99, 102, 241, 0.15);
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  --shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.2);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --sidebar-w: 260px;
  --header-h: 64px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  font-size: 14px;
  line-height: 1.6;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 8px;
}

/* ===== TYPOGRAPHY ===== */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
}

a {
  color: var(--primary-light);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--primary);
}

p {
  color: var(--text-muted);
}

small {
  color: var(--text-dim);
}

/* ===== LAYOUT ===== */
.lms-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: linear-gradient(180deg, #13203a 0%, #0d1829 100%);
  border-right: 1px solid var(--border);
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-logo {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--header-h);
}

.sidebar-logo .logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.sidebar-logo .logo-text {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-logo .logo-sub {
  font-size: 11px;
  color: var(--text-dim);
}

.sidebar-nav {
  padding: 16px 12px;
  flex: 1;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: var(--text-dim);
  text-transform: uppercase;
  padding: 12px 12px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 3px;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-muted);
  font-weight: 500;
  font-size: 13.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  position: relative;
}

.nav-item:hover {
  background: rgba(99, 102, 241, 0.12);
  color: var(--text);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(6, 182, 212, 0.1));
  color: var(--primary-light);
  border-left: 3px solid var(--primary);
}

.nav-item .nav-icon {
  font-size: 16px;
  width: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-item .badge {
  margin-left: auto;
  background: var(--danger);
  color: white;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 20px;
  font-weight: 700;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
}

/* ===== MAIN CONTENT ===== */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: var(--transition);
}

/* ===== TOPBAR ===== */
.topbar {
  height: var(--header-h);
  background: rgba(30, 41, 59, 0.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
}

.topbar-title {
  font-size: 18px;
  font-weight: 700;
}

.topbar-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hamburger-btn {
  display: none;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 22px;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
}

.topbar-btn {
  background: var(--card-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: var(--transition);
}

.topbar-btn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  flex-shrink: 0;
}

.user-info-sm .name {
  font-size: 13px;
  font-weight: 600;
}

.user-info-sm .role {
  font-size: 11px;
  color: var(--text-dim);
}

/* ===== PAGE CONTENT ===== */
.page-content {
  flex: 1;
  padding: 28px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
}

.page-title {
  font-size: 22px;
  font-weight: 800;
}

.page-title small {
  display: block;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ===== CARDS ===== */
.card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.card:hover {
  border-color: rgba(99, 102, 241, 0.3);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ===== STAT CARDS ===== */
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 20px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: default;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  min-height: 180px;
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
  border-color: rgba(99, 102, 241, 0.4);
}

.stat-icon {
  width: 60px;
  height: 60px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.stat-icon i {
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.2));
}

.stat-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.stat-value {
  font-size: 36px;
  font-weight: 800;
  line-height: 1;
  color: var(--text);
  margin-bottom: 2px;
}

.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.stat-trend {
  font-size: 11px;
  margin-top: 4px;
}

.stat-trend {
  font-size: 11px;
  font-weight: 600;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: center;
}

.stat-trend.up {
  color: var(--secondary);
}

.stat-trend.neutral {
  color: var(--text-dim);
}

.stat-icon.purple {
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary-light);
}

.stat-icon.green {
  background: rgba(34, 197, 94, 0.15);
  color: var(--secondary);
}

.stat-icon.cyan {
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent);
}

.stat-icon.orange {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
}

.stat-icon.red {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

/* ===== COURSE CARDS ===== */
.course-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--transition);
}

.course-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.4);
}

.course-thumbnail {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: linear-gradient(135deg, var(--card-2), var(--bg));
}

.course-thumb-placeholder {
  width: 100%;
  height: 180px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(6, 182, 212, 0.1));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  color: var(--primary-light);
}

.course-card-body {
  padding: 18px;
}

.course-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 10px;
}

.badge-published {
  background: rgba(34, 197, 94, 0.15);
  color: var(--secondary);
}

.badge-draft {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
}

.badge-archived {
  background: rgba(100, 116, 139, 0.2);
  color: var(--text-dim);
}

.course-title-card {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.course-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 14px;
}

.progress-bar-wrap {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  height: 6px;
  overflow: hidden;
  margin-bottom: 5px;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 20px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.8s ease;
}

/* ===== BUTTONS ===== */
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
  color: white;
}

.btn-secondary {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
  text-decoration: none;
}

.btn-secondary:hover {
  background: var(--card-2);
  color: var(--text);
  border-color: var(--primary);
}

.btn-success {
  background: linear-gradient(135deg, var(--secondary), #16a34a);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
  text-decoration: none;
}

.btn-success:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(34, 197, 94, 0.3);
  color: white;
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger), #dc2626);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-xs);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
  text-decoration: none;
}

.btn-danger:hover {
  transform: translateY(-1px);
  color: white;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 12px;
}

.btn-icon {
  padding: 8px 10px;
}

/* ===== TABLES ===== */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-sm);
}

.lms-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.lms-table thead th {
  background: rgba(99, 102, 241, 0.08);
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.lms-table tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid rgba(99, 102, 241, 0.06);
  vertical-align: middle;
  color: var(--text-muted);
  font-size: 13.5px;
}

.lms-table tbody tr:hover td {
  background: rgba(99, 102, 241, 0.05);
  color: var(--text);
}

.lms-table tbody tr:last-child td {
  border-bottom: none;
}

/* ===== FORMS ===== */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 7px;
  letter-spacing: 0.3px;
}

.form-control {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text);
  font-size: 14px;
  transition: var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.07);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.form-control::placeholder {
  color: var(--text-dim);
}

textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

select.form-control option {
  background: var(--card);
  color: var(--text);
}

/* ===== BADGES ===== */
.lms-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.lms-badge-primary {
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary-light);
}

.lms-badge-success {
  background: rgba(34, 197, 94, 0.15);
  color: var(--secondary);
}

.lms-badge-warning {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
}

.lms-badge-danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

.lms-badge-muted {
  background: rgba(100, 116, 139, 0.2);
  color: var(--text-dim);
}

.lms-badge-cyan {
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent);
}

/* ===== ALERTS ===== */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13.5px;
}

.alert-success {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.25);
  color: #4ade80;
}

.alert-error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #f87171;
}

.alert-warning {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: #fbbf24;
}

.alert-info {
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.25);
  color: #22d3ee;
}

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px);
  transition: transform 0.25s;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-overlay.active .modal-box {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-xs);
  transition: var(--transition);
}

.modal-close:hover {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ===== VIDEO PLAYER ===== */
.video-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* ===== PROGRESS ===== */
.progress-ring {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* ===== EMPTY STATE ===== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.empty-state .empty-icon {
  font-size: 64px;
  margin-bottom: 16px;
  opacity: 0.3;
}

.empty-state h3 {
  font-size: 18px;
  margin-bottom: 8px;
  color: var(--text-muted);
}

.empty-state p {
  font-size: 13px;
  color: var(--text-dim);
  max-width: 300px;
}

/* ===== AUTH PAGES ===== */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at top left, rgba(99, 102, 241, 0.12) 0%, var(--bg) 60%),
    radial-gradient(ellipse at bottom right, rgba(6, 182, 212, 0.08) 0%, transparent 60%);
  padding: 20px;
}

.auth-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}

.auth-logo .logo-circle {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin: 0 auto 12px;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.35);
}

.auth-title {
  font-size: 22px;
  font-weight: 800;
}

.auth-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* ===== LIVE CLASS ===== */
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--danger);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.5;
    transform: scale(0.8);
  }
}

/* ===== SECTION BUILDER ===== */
.section-item {
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  overflow: hidden;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  cursor: pointer;
  transition: var(--transition);
}

.section-header:hover {
  background: rgba(99, 102, 241, 0.08);
}

.section-toggle {
  font-size: 13px;
  color: var(--text-dim);
  transition: transform 0.2s;
}

.section-toggle.open {
  transform: rotate(90deg);
}

.lesson-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px 11px 44px;
  border-top: 1px solid rgba(99, 102, 241, 0.06);
  transition: var(--transition);
}

.lesson-item:hover {
  background: rgba(99, 102, 241, 0.05);
}

.lesson-type-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}

.lesson-type-icon.youtube {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

.lesson-type-icon.upload {
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary-light);
}

/* ===== CERTIFICATE ===== */
.certificate-card {
  background: linear-gradient(135deg, #1a2a4a 0%, #13203a 100%);
  border: 2px solid rgba(245, 158, 11, 0.4);
  border-radius: 20px;
  padding: 40px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.certificate-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.04) 0%, transparent 60%);
  pointer-events: none;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 991px) {
  .sidebar {
    transform: translateX(-100%);
    z-index: 200;
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.6);
  }

  .main-content {
    margin-left: 0 !important;
    width: 100% !important;
  }

  .hamburger-btn {
    display: flex;
  }

  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 150;
  }

  .sidebar-overlay.active {
    display: block;
  }

  .page-content {
    padding: 16px;
  }

  /* Grid Adjustments */
  .dashboard-grid,
  .settings-grid,
  .main-grid {
    grid-template-columns: 1fr !important;
  }

  .stat-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)) !important;
  }
}

@media (max-width: 768px) {
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .page-header .btn-primary,
  .page-header .btn-secondary {
    width: 100%;
    justify-content: center;
  }

  .topbar-subtitle {
    display: none;
  }

  .stat-grid {
    grid-template-columns: 1fr !important;
  }

  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .card-header .btn-secondary {
    width: 100%;
    justify-content: center;
  }

  .lms-table thead {
    display: none;
  }

  /* Consider stacking table cells for very small screens or keep scroll */
  .table-wrap {
    margin: 0 -16px;
    width: calc(100% + 32px);
    border-radius: 0;
  }
}

@media (max-width: 576px) {
  .stat-value {
    font-size: 20px;
  }

  .auth-card {
    padding: 24px 20px;
  }

  .topbar {
    padding: 0 12px;
  }

  .card {
    padding: 16px;
  }

  .page-title {
    font-size: 18px;
  }
}

/* ===== UTILITIES ===== */
.d-flex {
  display: flex;
}

.align-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-2 {
  gap: 8px;
}

.gap-3 {
  gap: 12px;
}

.text-primary {
  color: var(--primary-light);
}

.text-success {
  color: var(--secondary);
}

.text-warning {
  color: var(--warning);
}

.text-danger {
  color: var(--danger);
}

.text-muted {
  color: var(--text-muted);
}

.text-dim {
  color: var(--text-dim);
}

.fw-bold {
  font-weight: 700;
}

.mb-0 {
  margin-bottom: 0;
}

.mb-1 {
  margin-bottom: 4px;
}

.mb-2 {
  margin-bottom: 8px;
}

.mb-3 {
  margin-bottom: 16px;
}

.mb-4 {
  margin-bottom: 24px;
}

.mb-5 {
  margin-bottom: 32px;
}

.mt-auto {
  margin-top: auto;
}

.w-100 {
  width: 100%;
}

.rounded {
  border-radius: var(--radius-sm);
}

.overflow-hidden {
  overflow: hidden;
}

/* Dashboard Responsive Grids */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

@media (max-width: 1200px) {
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 650px) {
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 0 4px;
  }

  .stat-card {
    min-height: 130px !important;
    padding: 18px 10px !important;
    gap: 10px !important;
  }

  .stat-icon {
    width: 40px !important;
    height: 40px !important;
    font-size: 16px !important;
    border-radius: 10px !important;
  }

  .stat-value {
    font-size: 20px !important;
  }

  .stat-label {
    font-size: 9px !important;
    letter-spacing: 0.3px !important;
  }
}

/* Page Layout Grids */
.admin-grid-2-1 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: 2fr 1fr auto;
  gap: 10px;
  align-items: end;
}

@media (max-width: 992px) {
  .admin-grid-2-1 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 650px) {

  .form-grid-2,
  .form-grid-3 {
    grid-template-columns: 1fr;
  }
}