/* =============================================
   CivilCare LMS – Premium Light Theme
   ============================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
  --primary:      #084b83;
  --primary-dk:   #053661;
  --primary-lt:   #eef5fb;
  --accent:       #f06d24;
  --accent-lt:    #fceee6;
  --teal:         #0e9f6e;
  --teal-lt:      #def7ec;
  --amber:        #d97706;
  --amber-lt:     #fef3c7;
  --dark:         #0f172a;
  --slate:        #334155;
  --muted:        #64748b;
  --border:       #e2e8f0;
  --border-dk:    #cbd5e1;
  --bg:           #f8fafc;
  --bg-soft:      #ffffff;
  --white:        #ffffff;
  --shadow-sm:    0 2px 4px rgba(8, 75, 131, 0.04), 0 1px 2px rgba(8, 75, 131, 0.02);
  --shadow:       0 10px 25px -5px rgba(8, 75, 131, 0.08), 0 8px 10px -6px rgba(8, 75, 131, 0.04);
  --shadow-lg:    0 20px 25px -5px rgba(8, 75, 131, 0.08), 0 8px 10px -6px rgba(8, 75, 131, 0.04);
  --shadow-xl:    0 25px 50px -12px rgba(8, 75, 131, 0.15);
  --radius-sm:    8px;
  --radius:       12px;
  --radius-lg:    20px;
  --radius-xl:    32px;
}

body { font-family: 'Outfit', 'Hind Siliguri', system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--dark); line-height: 1.6; font-size: 15px; }
a    { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img  { max-width: 100%; display: block; }

/* ── Utilities ── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 28px; }
.text-muted { color: var(--muted); }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 20px; border-radius: var(--radius-sm); border: none;
  font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: all .15s ease; text-decoration: none; line-height: 1.4;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary  { background: var(--primary); color: var(--white); box-shadow: 0 4px 12px rgba(8, 75, 131, 0.25); }
.btn-primary:hover { background: var(--primary-dk); box-shadow: 0 6px 16px rgba(8, 75, 131, 0.35); transform: translateY(-2px); }

.btn-accent   { background: var(--accent); color: var(--white); box-shadow: 0 4px 12px rgba(240, 109, 36, 0.25); }
.btn-accent:hover { background: #d95b18; box-shadow: 0 6px 16px rgba(240, 109, 36, 0.35); transform: translateY(-2px); }

.btn-success  { background: var(--teal); color: var(--white); }
.btn-success:hover { background: #057a55; }

.btn-outline  { background: var(--white); border: 1.5px solid var(--border-dk); color: var(--slate); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-lt); }

.btn-danger   { background: var(--accent-lt); color: var(--accent); border: 1px solid #fca5a5; }
.btn-danger:hover { background: var(--accent); color: var(--white); }

.btn-ghost    { background: transparent; color: var(--muted); border: none; }
.btn-ghost:hover { background: var(--bg); color: var(--dark); }

.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 13px 28px; font-size: 15px; border-radius: var(--radius); }

/* ── Alerts ── */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 14px; display: flex; align-items: flex-start; gap: 10px; }
.alert-success { background: var(--teal-lt); color: #065f46; border: 1px solid #6ee7b7; }
.alert-error   { background: var(--accent-lt); color: #9b1c1c; border: 1px solid #fca5a5; }
.alert-info    { background: var(--primary-lt); color: #1e429f; border: 1px solid #93c5fd; }

/* ── Forms ── */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; color: var(--slate); text-transform: uppercase; letter-spacing: .04em; }
.form-control {
  width: 100%; padding: 10px 14px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-size: 14px; background: var(--white);
  transition: border-color .15s, box-shadow .15s; color: var(--dark);
  font-family: inherit;
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,86,219,.12); }
textarea.form-control { min-height: 100px; resize: vertical; }
.form-hint { font-size: 12px; color: var(--muted); margin-top: 5px; }
select.form-control { cursor: pointer; }

/* ── Public Header ── */
.site-header {
  background: var(--white); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.site-header nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; height: 64px; max-width: 1200px; margin: 0 auto;
}
.site-header .logo {
  font-size: 20px; font-weight: 800; color: var(--dark); text-decoration: none;
  display: flex; align-items: center; gap: 8px;
}
.site-header .logo .logo-mark {
  width: 34px; height: 34px; background: var(--primary); border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 16px; font-weight: 900;
}
.site-header .logo span { color: var(--primary); }
.site-header .nav-links { display: flex; gap: 8px; align-items: center; }
.site-header .nav-links a {
  color: var(--muted); font-size: 14px; font-weight: 500;
  text-decoration: none; padding: 8px 14px; border-radius: var(--radius-sm); transition: all .15s;
}
.site-header .nav-links a:hover { color: var(--dark); background: var(--bg); }
.site-header .nav-links a.btn-primary { color: var(--white); }
.site-header .nav-links a.btn-primary:hover { color: var(--white); background: var(--primary-dk); }

/* ── Hero ── */
.hero {
  background: linear-gradient(135deg, #053661 0%, #084b83 60%, #0d63a6 100%);
  padding: 120px 28px 100px; color: var(--white); text-align: center; position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero .container { position: relative; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.12); color: #bfdbfe;
  padding: 6px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
  border: 1px solid rgba(255,255,255,.15); margin-bottom: 24px; backdrop-filter: blur(4px);
}
.hero h1 { font-size: clamp(36px, 5vw, 64px); font-weight: 800; margin-bottom: 24px; line-height: 1.1; letter-spacing: -1.5px; }
.hero h1 span { color: var(--accent); }
.hero p  { font-size: 19px; color: #e2e8f0; max-width: 580px; margin: 0 auto 40px; font-weight: 300; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-actions .btn-primary { background: white; color: var(--primary); }
.hero-actions .btn-primary:hover { background: #f0f4ff; }
.hero-actions .btn-border { background: transparent; border: 2px solid rgba(255,255,255,.4); color: white; padding: 11px 24px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; transition: all .15s; }
.hero-actions .btn-border:hover { background: rgba(255,255,255,.1); border-color: white; text-decoration: none; }

/* ── Stats Bar ── */
.stats-bar { background: var(--white); border-bottom: 1px solid var(--border); }
.stats-bar .container { display: flex; align-items: center; justify-content: space-between; padding-top: 14px; padding-bottom: 14px; }
.stats-bar p { font-size: 14px; color: var(--muted); }
.stats-bar p strong { color: var(--dark); }

/* ── Course Cards Grid ── */
.courses-section { padding: 64px 28px; }
.section-header { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 36px; }
.section-header h2 { font-size: 30px; font-weight: 800; letter-spacing: -.5px; }
.section-header p  { color: var(--muted); font-size: 15px; margin-top: 4px; }

.courses-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; }

.course-card {
  background: var(--white); border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s;
  display: flex; flex-direction: column; border: 1px solid var(--border);
}
.course-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }

.course-thumbnail { width: 100%; aspect-ratio: 16/9; overflow: hidden; background: #f1f5f9; position: relative; }
.course-thumbnail img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.course-card:hover .course-thumbnail img { transform: scale(1.05); }
.thumbnail-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 52px; background: linear-gradient(135deg, #e2e8f0, #cbd5e1); color: #94a3b8; }

.course-card-body { padding: 22px; flex: 1; display: flex; flex-direction: column; }
.course-card-body h3 { font-size: 17px; font-weight: 700; margin-bottom: 8px; color: var(--dark); line-height: 1.4; }
.course-card-body p  { color: var(--muted); font-size: 14px; flex: 1; margin-bottom: 16px; line-height: 1.65; }
.course-meta { display: flex; gap: 16px; font-size: 13px; color: var(--muted); margin-bottom: 18px; }
.course-meta span { display: flex; align-items: center; gap: 5px; font-weight: 500; }
.course-card-body .btn { align-self: flex-start; }

.empty-state { text-align: center; padding: 80px 24px; color: var(--muted); }
.empty-state .icon { font-size: 64px; margin-bottom: 16px; }
.empty-state h3 { font-size: 22px; margin-bottom: 8px; color: var(--slate); }

/* ── Site Footer ── */
.site-footer { background: var(--primary-dk); color: #cbd5e1; padding: 60px 28px 20px; font-size: 15px; margin-top: 80px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.5fr; gap: 40px; margin-bottom: 40px; text-align: left; }
.footer-col h4 { color: var(--accent); font-size: 16px; font-weight: 700; margin-bottom: 20px; }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col ul li { margin-bottom: 12px; }
.footer-col a { color: #cbd5e1; font-weight: 400; text-decoration: none; transition: color 0.2s; }
.footer-col a:hover { color: var(--accent); }
.footer-logo { height: 70px; background: white; padding: 8px 12px; border-radius: 8px; margin-bottom: 20px; display: inline-block; object-fit: contain; }
.brand-col .footer-desc { color: #e2e8f0; font-size: 15px; line-height: 1.6; margin-bottom: 24px; max-width: 300px; }
.social-links { display: flex; gap: 16px; }
.social-links a { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; background: rgba(255,255,255,0.1); border-radius: 50%; font-size: 18px; color: white; transition: all 0.2s; }
.social-links a:hover { background: var(--accent); transform: translateY(-3px); }
.contact-info li { display: flex; align-items: center; gap: 12px; color: #cbd5e1; }
.contact-info li i { color: var(--white); font-size: 16px; width: 16px; text-align: center; }
.footer-bottom { text-align: center; padding-top: 24px; border-top: 1px solid rgba(255,255,255,0.1); font-size: 14px; color: #94a3b8; }
.footer-bottom a { color: inherit; }

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

/* ── Auth Pages ── */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); padding: 24px; }
.auth-wrapper { display: flex; flex-direction: column; align-items: center; width: 100%; max-width: 420px; }
.auth-logo-top { text-align: center; margin-bottom: 28px; }
.auth-logo-top .mark { width: 52px; height: 52px; background: var(--primary); border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 900; color: white; margin: 0 auto 12px; box-shadow: 0 8px 24px rgba(26,86,219,.3); }
.auth-logo-top h1 { font-size: 22px; font-weight: 800; color: var(--dark); }
.auth-logo-top p  { color: var(--muted); font-size: 14px; margin-top: 4px; }
.auth-card {
  background: var(--white); border-radius: var(--radius-lg);
  padding: 36px; width: 100%; box-shadow: var(--shadow-xl);
  border: 1px solid var(--border);
}
.auth-card h2 { font-size: 20px; font-weight: 700; margin-bottom: 24px; color: var(--dark); }
.sub-list-container { position: sticky; top: 20px; }
@media (max-width: 992px) { .sub-list-container { position: static; } }
.auth-divider { text-align: center; margin-top: 20px; font-size: 13px; color: var(--muted); }
.auth-divider a { color: var(--primary); font-weight: 600; }

/* ── Admin Layout ── */
.admin-layout { display: flex; min-height: 100vh; background: var(--bg); }

.sidebar {
  width: 256px; background: var(--white);
  flex-shrink: 0; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  border-right: 1px solid var(--border);
}
.sidebar-brand { padding: 20px 20px 16px; border-bottom: 1px solid var(--border); }
.sidebar-brand .brand-inner { display: flex; align-items: center; gap: 10px; }
.sidebar-brand .brand-mark { width: 36px; height: 36px; background: var(--primary); border-radius: 9px; display: flex; align-items: center; justify-content: center; color: white; font-weight: 900; font-size: 15px; flex-shrink: 0; }
.sidebar-brand h1 { font-size: 15px; font-weight: 800; color: var(--dark); }
.sidebar-brand p  { font-size: 11px; color: var(--muted); margin-top: 1px; }

.sidebar-nav { padding: 12px 12px; flex: 1; }
.sidebar-nav .nav-section { padding: 8px 10px 4px; font-size: 10.5px; font-weight: 700; color: #9ca3af; text-transform: uppercase; letter-spacing: .08em; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; color: var(--muted); font-size: 14px; font-weight: 500;
  text-decoration: none; transition: all .12s; border-radius: var(--radius-sm);
  margin-bottom: 1px;
}
.sidebar-nav a:hover  { color: var(--dark); background: var(--bg); text-decoration: none; }
.sidebar-nav a.active { color: var(--primary); background: var(--primary-lt); font-weight: 600; }
.sidebar-nav a .icon  { font-size: 15px; width: 20px; text-align: center; }

.sidebar-footer { padding: 12px; border-top: 1px solid var(--border); }
.sidebar-footer a { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; text-decoration: none; padding: 8px 10px; border-radius: var(--radius-sm); transition: all .12s; }
.sidebar-footer a:hover { color: var(--accent); background: var(--accent-lt); }

.admin-main { flex: 1; overflow-x: hidden; min-width: 0; }

.admin-topbar {
  background: var(--white); padding: 0 28px; height: 60px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
}
.admin-topbar h2 { font-size: 18px; font-weight: 700; color: var(--dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-topbar .topbar-actions { display: flex; gap: 8px; align-items: center; }
@media (max-width: 640px) {
  .admin-topbar { padding: 0 16px; }
  .admin-topbar h2 { font-size: 16px; }
  .admin-topbar .topbar-actions .btn span,
  .admin-topbar .topbar-actions .admin-user span { display: none; }
  .admin-topbar .topbar-actions .btn i { margin: 0 !important; }
}
.admin-user { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.admin-user .avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), #4f86f0); color: var(--white); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }

.admin-content { padding: 28px; }

/* ── Stats Cards ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card {
  background: var(--white); border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow-sm); border: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px;
}
.stat-card .stat-icon-wrap { width: 48px; height: 48px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
.stat-card .stat-icon-wrap.blue   { background: var(--primary-lt); }
.stat-card .stat-icon-wrap.green  { background: var(--teal-lt); }
.stat-card .stat-icon-wrap.amber  { background: var(--amber-lt); }
.stat-card .stat-icon-wrap.red    { background: var(--accent-lt); }
.stat-info h3 { font-size: 26px; font-weight: 800; line-height: 1; }
.stat-info p  { font-size: 13px; color: var(--muted); margin-top: 3px; }

/* ── Dashboard Grid ── */
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 992px) { .dashboard-grid { grid-template-columns: 1fr; } }

/* ── Tables ── */
.table-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; border: 1px solid var(--border); }
.table-card-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; background: var(--bg-soft); }
.table-card-header h3 { font-size: 15px; font-weight: 700; }

.data-table { width: 100%; border-collapse: collapse; }
.data-table th { padding: 11px 16px; text-align: left; font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; background: var(--bg-soft); border-bottom: 1px solid var(--border); }
.data-table td { padding: 13px 16px; font-size: 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #f9fafb; }
.table-actions { display: flex; gap: 6px; align-items: center; }

/* ── Table Responsive ── */
.table-responsive { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ── Badges ── */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.badge-admin     { background: #ede9fe; color: #5b21b6; }
.badge-student   { background: var(--teal-lt); color: #065f46; }
.badge-protected { background: var(--accent-lt); color: #9b1c1c; }
.badge-free      { background: var(--teal-lt); color: #065f46; }
.badge-video     { background: #fce7f3; color: #9d174d; }
.badge-file      { background: var(--amber-lt); color: #92400e; }

/* ── Page Card ── */
.page-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 24px; border: 1px solid var(--border); }
.page-card h3 { font-size: 16px; font-weight: 700; margin-bottom: 20px; padding-bottom: 14px; border-bottom: 1px solid var(--border); color: var(--dark); }

/* ── Course Builder ── */
.builder-section { border: 1.5px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; background: var(--bg-soft); }
.entry-card { background: var(--white); border-radius: var(--radius-sm); padding: 16px; margin-bottom: 10px; border: 1px solid var(--border); }
.entry-card .entry-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.entry-card .entry-num { font-size: 11px; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: .05em; background: var(--primary-lt); padding: 3px 8px; border-radius: 4px; }
.entry-remove { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 18px; line-height: 1; padding: 4px 6px; border-radius: 4px; transition: all .12s; }
.entry-remove:hover { color: var(--accent); background: var(--accent-lt); }
.entry-grid { display: grid; gap: 12px; }
.entry-grid-2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 600px) { .entry-grid-2 { grid-template-columns: 1fr; } }

/* ── Student Portal Header ── */
.student-header {
  background: var(--white); color: var(--dark);
  padding: 0 28px; display: flex; align-items: center; justify-content: space-between;
  height: 60px; position: sticky; top: 0; z-index: 100;
  border-bottom: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.student-header .logo { font-size: 18px; font-weight: 800; color: var(--dark); text-decoration: none; display: flex; align-items: center; gap: 8px; }
.student-header .logo .lm { width: 30px; height: 30px; background: var(--primary); border-radius: 7px; display: flex; align-items: center; justify-content: center; color: white; font-weight: 900; font-size: 13px; }
.student-header .user-info { display: flex; align-items: center; gap: 16px; font-size: 13px; }
.student-header .user-name { color: var(--slate); font-weight: 500; }
.student-header .logout-btn { color: var(--accent); text-decoration: none; font-weight: 600; font-size: 13px; padding: 6px 12px; border-radius: var(--radius-sm); background: var(--accent-lt); transition: all .12s; white-space: nowrap; }
.student-header .logout-btn:hover { background: var(--accent); color: white; text-decoration: none; }

.student-content { max-width: 1140px; margin: 0 auto; padding: 32px 28px; }

@media (max-width: 768px) {
  .student-header { padding: 8px 16px; height: auto; flex-wrap: wrap; gap: 10px; justify-content: space-between; }
  .student-header .logo { font-size: 16px; }
  .student-header .user-name { display: none; }
  .student-header .user-info { gap: 8px; }
  .student-header .logout-btn { padding: 6px 10px; font-size: 12px; }
  .student-content { padding: 20px 16px; }
}

/* ── Student Course Cards ── */
.student-courses-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 20px; }
.student-course-card {
  background: var(--white); border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s;
  display: flex; flex-direction: column; border: 1px solid var(--border); cursor: pointer;
}
.student-course-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.student-course-card .thumb { aspect-ratio: 16/9; background: #0f172a; overflow: hidden; }
.student-course-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.student-course-card:hover .thumb img { transform: scale(1.04); }
.student-course-card .body { padding: 18px; flex: 1; display: flex; flex-direction: column; }
.student-course-card .body h3 { font-size: 16px; font-weight: 700; margin-bottom: 6px; color: var(--dark); }
.student-course-card .body p  { color: var(--muted); font-size: 13px; flex: 1; margin-bottom: 14px; line-height: 1.6; }
.student-course-card .meta { display: flex; gap: 12px; font-size: 12px; color: var(--muted); margin-bottom: 14px; font-weight: 500; }

/* ── Course Viewer Layout ── */
.course-viewer { display: grid; grid-template-columns: 1fr 340px; gap: 20px; }
@media (max-width: 960px) { .course-viewer { grid-template-columns: 1fr; } }

/* ── Tabs ── */
.tab-header { display: flex; border-bottom: 2px solid var(--border); padding: 0 16px; }
.tab-btn {
  padding: 12px 18px; border: none; background: none; cursor: pointer;
  font-size: 13px; font-weight: 600; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: color .12s; white-space: nowrap; font-family: inherit;
}
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── Video List ── */
.video-list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--radius-sm); cursor: pointer;
  transition: background .12s; margin-bottom: 3px;
}
.video-list-item:hover { background: var(--bg); }
.video-list-item.playing { background: var(--primary-lt); }
.video-list-item .vl-num {
  width: 28px; height: 28px; border-radius: 50%; background: var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0; color: var(--muted);
}
.video-list-item.playing .vl-num { background: var(--primary); color: var(--white); }
.video-list-item .vl-title { font-size: 13px; font-weight: 500; flex: 1; color: var(--dark); }
.video-list-item.playing .vl-title { color: var(--primary); font-weight: 600; }
.video-list-item .vl-arrow { font-size: 11px; color: var(--muted); }

/* ── Material List ── */
.material-item {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 10px 12px; border-radius: var(--radius-sm);
    border: 1px solid var(--border); margin-bottom: 8px; background: var(--white);
    transition: border-color .12s, box-shadow .12s; flex-wrap: wrap;
  }
  .material-item:hover { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-lt); }
  .material-item .mat-icon { font-size: 24px; flex-shrink: 0; padding-top: 2px; }
  .material-item .mat-info { flex: 1; min-width: 0; }
  .material-item .mat-title { font-size: 13px; font-weight: 600; color: var(--dark); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-bottom: 4px; }
  .material-item .mat-meta  { font-size: 11px; color: var(--muted); margin-bottom: 6px; }
  .material-item .mat-actions { display: flex; gap: 6px; flex-wrap: wrap; width: 100%; padding-left: 34px; }

/* ── Custom YouTube Player ── */
#custom-youtube-player * { box-sizing: border-box; margin: 0; padding: 0; }
#custom-youtube-player .player-container {
  position: relative; width: 100%; padding-top: 56.25%;
  background: #000; border-radius: var(--radius-lg) var(--radius-lg) 0 0; overflow: hidden;
}
#custom-youtube-player #yt-player { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
#custom-youtube-player .video-protection-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 2; background: transparent; pointer-events: auto; }
#custom-youtube-player .overlay {
  position: absolute; top: 0; left: 0; z-index: 3; width: 100%; height: 100%;
  background: rgba(0,0,0,.35); display: flex; justify-content: center; align-items: center;
  cursor: pointer; transition: opacity .2s; pointer-events: auto;
}
#custom-youtube-player .overlay-play-btn {
  width: 68px; height: 68px; border-radius: 50%; background: rgba(255,255,255,.95);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: var(--primary); transition: transform .15s;
  box-shadow: 0 4px 20px rgba(0,0,0,.3);
}
#custom-youtube-player .overlay:hover .overlay-play-btn { transform: scale(1.08); }
#custom-youtube-player .overlay.hidden { opacity: 0; pointer-events: none; }
#custom-youtube-player .overlay.loading { background: rgba(0,0,0,.7); }
#custom-youtube-player .overlay.loading .overlay-play-btn { font-size: 14px; color: var(--muted); }

/* Mobile Video Fix: Allow tap-to-play while protecting top/bottom logos */
@media (pointer: coarse), (max-width: 768px) {
  #custom-youtube-player #yt-player { pointer-events: auto; }
  #custom-youtube-player .video-protection-overlay { pointer-events: none; }
  #custom-youtube-player .video-protection-overlay::before,
  #custom-youtube-player .video-protection-overlay::after {
    content: ''; position: absolute; left: 0; width: 100%; pointer-events: auto;
  }
  #custom-youtube-player .video-protection-overlay::before { top: 0; height: 60px; }
  #custom-youtube-player .video-protection-overlay::after { bottom: 0; height: 60px; }
  #custom-youtube-player .overlay { pointer-events: none; }
}

#custom-youtube-player .custom-controls {
  position: absolute; bottom: 0; left: 0; width: 100%;
  background: linear-gradient(to top, rgba(0,0,0,.9) 0%, transparent 100%);
  z-index: 4; padding: 20px 16px 12px; opacity: 0; transition: opacity .2s; pointer-events: auto;
}
#custom-youtube-player .player-container:hover .custom-controls,
#custom-youtube-player .custom-controls:active,
#custom-youtube-player .custom-controls:focus-within { opacity: 1; }

@media (hover: none) and (pointer: coarse) {
  #custom-youtube-player .custom-controls { opacity: 1; }
}

#custom-youtube-player .timeline-container { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; color: white; font-size: 12px; font-weight: 500; }
#custom-youtube-player .timeline-container input[type="range"] {
  flex: 1; cursor: pointer; height: 4px; background: rgba(255,255,255,.25);
  border-radius: 2px; outline: none; -webkit-appearance: none; appearance: none;
}
#custom-youtube-player .timeline-container input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 14px; background: white; border-radius: 50%; cursor: pointer;
}
#custom-youtube-player .control-buttons { display: flex; justify-content: space-between; align-items: center; }
#custom-youtube-player .control-buttons .left-controls,
#custom-youtube-player .control-buttons .right-controls { display: flex; align-items: center; gap: 4px; }
#custom-youtube-player .control-buttons button {
  background: transparent; border: none; color: white; padding: 7px 9px;
  border-radius: 6px; cursor: pointer; font-size: 16px; line-height: 1; transition: background .15s;
}
#custom-youtube-player .control-buttons button:hover { background: rgba(255,255,255,.15); }
#custom-youtube-player .volume-control { display: flex; align-items: center; gap: 6px; }
#custom-youtube-player .volume-control input[type="range"] {
  width: 72px; cursor: pointer; height: 4px; background: rgba(255,255,255,.3);
  border-radius: 2px; outline: none; -webkit-appearance: none; appearance: none;
}
#custom-youtube-player .volume-control input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 12px; height: 12px; background: white; border-radius: 50%; cursor: pointer;
}
#custom-youtube-player .player-container:fullscreen .video-protection-overlay { z-index: 2147483645; }
#custom-youtube-player .player-container:fullscreen .custom-controls { z-index: 2147483647; }

/* ── PDF Modal ── */
.pdf-modal { display: none; position: fixed; inset: 0; background: rgba(15,23,42,.7); z-index: 9999; flex-direction: column; backdrop-filter: blur(4px); }
.pdf-modal.open { display: flex; }
.pdf-modal-header {
  background: var(--white); padding: 0 24px; height: 56px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.pdf-modal-header h3 { font-size: 15px; font-weight: 700; color: var(--dark); display: flex; align-items: center; gap: 8px; }
.pdf-modal-close {
  background: var(--bg); border: 1px solid var(--border); color: var(--muted);
  width: 32px; height: 32px; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 16px; transition: all .12s;
}
.pdf-modal-close:hover { background: var(--accent-lt); border-color: var(--accent); color: var(--accent); }
.pdf-modal-notice { background: #fffbeb; border-bottom: 1px solid #fde68a; padding: 8px 24px; font-size: 13px; color: #92400e; display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.pdf-modal-body { flex: 1; overflow-y: auto; background: #525659; display: flex; flex-direction: column; align-items: center; padding: 20px; gap: 12px; }
.pdf-modal-body canvas { box-shadow: 0 4px 20px rgba(0,0,0,.4); max-width: 100%; display: block; }
.pdf-loading { color: white; font-size: 14px; padding: 40px; text-align: center; }
.pdf-loading .spinner { width: 36px; height: 36px; border: 3px solid rgba(255,255,255,.2); border-top-color: white; border-radius: 50%; animation: spin .7s linear infinite; margin: 0 auto 12px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Responsive ── */
/* ── Admin Responsive ── */
@media (max-width: 992px) {
  .admin-layout { position: relative; overflow-x: hidden; }
  
  .sidebar {
    position: fixed; left: -256px; top: 0; bottom: 0; z-index: 1000;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 10px 0 30px rgba(0,0,0,0.1);
    display: flex; /* Override display:none */
  }
  .admin-layout.sidebar-open .sidebar { left: 0; }
  
  .sidebar-overlay {
    position: fixed; inset: 0; background: rgba(15,23,42,0.4);
    backdrop-filter: blur(2px); z-index: 999;
    opacity: 0; visibility: hidden; transition: all 0.3s;
  }
  .admin-layout.sidebar-open .sidebar-overlay { opacity: 1; visibility: visible; }
  
  .sidebar-close-btn {
    display: flex !important; align-items: center; justify-content: center;
    position: absolute; top: 12px; right: 12px;
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--bg); border: 1px solid var(--border);
    color: var(--muted); cursor: pointer; z-index: 10;
  }

  .admin-main { width: 100%; }
  .admin-content { padding: 16px; }
  
  .admin-topbar { padding: 0 16px; height: 56px; }
  .admin-topbar .menu-toggle { display: flex !important; }
  
  .courses-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
  .stat-card { padding: 16px; gap: 12px; }
  .stat-info h3 { font-size: 20px; }
  
  .table-card-header { padding: 12px 16px; flex-direction: column; align-items: flex-start; gap: 10px; }
  .table-card-header h3 { font-size: 14px; }
  
  .student-content { padding: 20px 16px; }
}

.menu-toggle {
  display: none; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 8px;
  background: var(--bg); border: 1px solid var(--border);
  color: var(--slate); cursor: pointer; transition: all 0.2s;
}
.menu-toggle:hover { background: var(--primary-lt); color: var(--primary); }

.sidebar-close-btn { display: none; }

/* ── Mobile Header & Hero Tweaks ── */
@media (max-width: 640px) {
  .site-header nav { padding: 0 16px; height: 56px; }
  .site-header .logo img { height: 40px !important; }
  .site-header .nav-links { gap: 4px; }
  .site-header .nav-links a { padding: 6px 10px; font-size: 13px; }
  .site-header .nav-links a.btn { padding: 6px 12px; }

  .hero { padding: 72px 20px 56px; }
  .hero h1 { font-size: 30px; letter-spacing: -.5px; }
  .hero p { font-size: 15px; margin-bottom: 28px; }
  .hero-badge { font-size: 12px; padding: 6px 14px; }
  .hero-actions { flex-direction: column; width: 100%; max-width: 280px; margin: 0 auto; }
  .hero-actions .btn, .hero-actions .btn-border { width: 100%; justify-content: center; text-align: center; }

  /* Courses */
  .courses-section { padding: 40px 16px; }
  .courses-grid { grid-template-columns: 1fr; }
  .section-header { flex-direction: column; align-items: flex-start; gap: 10px; }
  .section-header h2 { font-size: 22px; }

  /* Stats */
  .stats-section { padding: 40px 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 14px; }
  .stat-item { padding: 18px 10px; }
  .stat-item .stat-num { font-size: 28px; }
  .stat-item .stat-icon { font-size: 24px; margin-bottom: 8px; }
  .stat-item .stat-label { font-size: 12px; }
  .stat-item .stat-sub { font-size: 10px; }

  /* Features */
  .features-section { padding: 40px 16px; }
  .features-grid { grid-template-columns: 1fr; gap: 16px; margin-top: 24px; }

  /* Footer */
  .footer-logo { height: 52px; }

  .student-header { padding: 8px 16px; height: auto; flex-direction: column; align-items: flex-start; gap: 12px; }
  .student-header .user-info { width: 100%; justify-content: space-between; gap: 8px; }
  .student-header .user-name { display: inline-flex; }
}
