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

/* ─── Reset ──────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: 'Inter', -apple-system, sans-serif; background: #07051a; color: #e8e4f8; min-height: 100vh; }
a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font-family: inherit; }
input, select, textarea { outline: none; }

/* ─── CSS Variables ──────────────────────────────────────────────────────────── */
:root {
  --bg:         #07051a;
  --bg2:        #0a0820;
  --card:       #0f0c2e;
  --card2:      #1a1545;
  --gold:       #c9a84c;
  --golden:     #A4984B;
  --purple:     #7c3aed;
  --border:     rgba(201,168,76,0.14);
  --border2:    rgba(255,255,255,0.06);
  --text:       #e8e4f8;
  --muted:      #9b94c9;
  --radius:     12px;
  --radius-sm:  8px;
  --radius-lg:  18px;
  --shadow:     0 4px 24px rgba(0,0,0,0.5);
}

/* ─── Typography ─────────────────────────────────────────────────────────────── */
.font-display { font-family: 'Cinzel', Georgia, serif; }
h1,h2,h3,h4 { font-family: 'Cinzel', Georgia, serif; }
.label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }

/* ─── Stars Background ───────────────────────────────────────────────────────── */
.star-field { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.star {
  position: absolute; border-radius: 50%; background: #fff;
  animation: twinkle var(--dur, 3s) ease-in-out infinite alternate;
}
@keyframes twinkle { from { opacity: .05; } to { opacity: var(--op, .6); } }
.glow-purple {
  position: fixed; width: 500px; height: 500px; border-radius: 50%;
  background: radial-gradient(circle, rgba(124,58,237,.09) 0%, transparent 70%);
  filter: blur(60px); pointer-events: none; z-index: 0;
  top: -100px; left: 25%;
}
.glow-gold {
  position: fixed; width: 400px; height: 400px; border-radius: 50%;
  background: radial-gradient(circle, rgba(201,168,76,.06) 0%, transparent 70%);
  filter: blur(60px); pointer-events: none; z-index: 0;
  bottom: -80px; right: 20%;
}

/* ─── Layout ─────────────────────────────────────────────────────────────────── */
.app-wrap { display: flex; height: 100vh; position: relative; z-index: 1; overflow: hidden; }

/* ─── Sidebar ────────────────────────────────────────────────────────────────── */
.sidebar {
  width: 220px; flex-shrink: 0; display: flex; flex-direction: column;
  height: 100vh; border-right: 1px solid var(--border);
  background: var(--bg2); position: relative; z-index: 10;
}
.sidebar-logo { padding: 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.logo-icon {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: radial-gradient(circle, var(--gold), var(--purple));
  display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.logo-text p:first-child { font-family: 'Cinzel', serif; font-size: 12px; font-weight: 700; color: var(--gold); }
.logo-text p:last-child  { font-size: 10px; color: var(--muted); margin-top: 1px; }

.sidebar-nav { flex: 1; padding: 12px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.sidebar-nav a, .sidebar-nav button.nav-btn {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px;
  border-radius: var(--radius-sm); font-size: 12px; color: var(--muted);
  background: transparent; border: none; cursor: pointer; text-align: left;
  position: relative; transition: all .15s;
}
.sidebar-nav a:hover, .sidebar-nav button.nav-btn:hover { background: rgba(255,255,255,.05); color: var(--text); }
.sidebar-nav a.active, .sidebar-nav button.nav-btn.active {
  background: rgba(201,168,76,.12); color: var(--gold);
  border: 1px solid rgba(201,168,76,.2); font-family: 'Cinzel', serif;
}
.sidebar-nav a.active::before, .sidebar-nav button.nav-btn.active::before {
  content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; background: var(--gold); border-radius: 0 3px 3px 0;
}
.nav-icon { width: 18px; height: 18px; flex-shrink: 0; }
.nav-badge {
  margin-left: auto; background: #e11d48; color: #fff;
  font-size: 9px; font-weight: 700; padding: 1px 5px; border-radius: 999px;
  animation: pulse-badge 2s infinite;
}
@keyframes pulse-badge { 0%,100%{opacity:1;} 50%{opacity:.6;} }

.sidebar-user {
  margin: 12px; padding: 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--card);
  flex-shrink: 0;
}
.sidebar-user-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff;
}
.avatar-lg { width: 48px; height: 48px; font-size: 16px; }
.avatar-xl { width: 64px; height: 64px; font-size: 22px; font-family: 'Cinzel', serif; }
.sidebar-user-name { font-size: 12px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: 10px; color: var(--gold); }
.logout-btn {
  display: flex; align-items: center; gap: 6px; font-size: 10px;
  color: var(--muted); background: none; border: none; cursor: pointer;
  transition: color .15s; padding: 0; width: 100%;
}
.logout-btn:hover { color: #e11d48; }

/* ─── Main Area ──────────────────────────────────────────────────────────────── */
.main-area { flex: 1; display: flex; flex-direction: column; min-width: 0; overflow: hidden; }

/* ─── Header — Changed from blue/dark to light golden #A4984B ────────────────── */
.app-header {
  height: 56px; flex-shrink: 0; display: flex; align-items: center;
  justify-content: space-between; padding: 0 24px;
  border-bottom: 1px solid rgba(164,152,75,0.35);
  background: #A4984B;
  position: relative; z-index: 5;
  box-shadow: 0 2px 16px rgba(164,152,75,0.25);
}
.app-header h1 {
  font-family: 'Cinzel', serif; font-size: 14px; letter-spacing: .1em;
  color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,0.25);
}
.header-right { display: flex; align-items: center; gap: 10px; }
.header-search { position: relative; }
.header-search input {
  padding: 6px 12px 6px 32px; background: rgba(255,255,255,0.2); border: 1px solid rgba(255,255,255,0.3);
  border-radius: var(--radius-sm); font-size: 12px; color: #fff; width: 180px;
  transition: border-color .2s;
}
.header-search input::placeholder { color: rgba(255,255,255,0.6); }
.header-search input:focus { border-color: rgba(255,255,255,0.6); background: rgba(255,255,255,0.25); }
.header-search .search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); opacity: .6; }
.notif-btn {
  position: relative; width: 34px; height: 34px; border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.35); background: rgba(255,255,255,0.15); cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: background .15s;
}
.notif-btn:hover { background: rgba(255,255,255,0.25); }
.notif-dot {
  position: absolute; top: -3px; right: -3px; width: 16px; height: 16px;
  border-radius: 50%; background: #e11d48; color: #fff;
  font-size: 9px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}

/* Notification dropdown */
.notif-dropdown {
  position: absolute; right: 0; top: 44px; width: 280px; z-index: 100;
  background: #130f35; border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; display: none;
}
.notif-dropdown.open { display: block; animation: fadeDown .2s ease; }
@keyframes fadeDown { from{opacity:0;transform:translateY(-6px)} to{opacity:1;transform:translateY(0)} }
.notif-header { padding: 12px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.notif-header span { font-family: 'Cinzel', serif; font-size: 12px; }
.notif-item { padding: 12px 16px; border-bottom: 1px solid var(--border2); display: flex; gap: 10px; align-items: flex-start; }
.notif-item:last-child { border-bottom: none; }
.notif-item.unread { background: rgba(124,58,237,.05); }
.notif-dot-small { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); flex-shrink: 0; margin-top: 4px; }
.notif-dot-empty { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.notif-text { font-size: 11px; color: var(--text); line-height: 1.5; }
.notif-time { font-size: 10px; color: var(--muted); margin-top: 2px; }

/* ─── Page Content ───────────────────────────────────────────────────────────── */
.page-content { flex: 1; overflow-y: auto; padding: 24px; }
.page-content::-webkit-scrollbar { width: 4px; }
.page-content::-webkit-scrollbar-thumb { background: rgba(201,168,76,.2); border-radius: 2px; }

/* ─── Cards ──────────────────────────────────────────────────────────────────── */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
}
.card-sm { padding: 14px; }
.card-hover { transition: border-color .2s, transform .15s; }
.card-hover:hover { border-color: rgba(201,168,76,.3); transform: translateY(-1px); }

/* ─── Grid Helpers ───────────────────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; }
@media(max-width:900px) { .grid-4{grid-template-columns:1fr 1fr;} .grid-3{grid-template-columns:1fr 1fr;} .grid-2{grid-template-columns:1fr;} }

/* ─── Stat Cards ─────────────────────────────────────────────────────────────── */
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.stat-icon { width: 34px; height: 34px; border-radius: 8px; display: flex; align-items: center; justify-content: center; margin-bottom: 12px; font-size: 16px; }
.stat-val { font-family: 'Cinzel', serif; font-size: 26px; font-weight: 700; }
.stat-label { font-size: 11px; color: var(--muted); margin-top: 2px; }
.stat-sub { font-size: 10px; margin-top: 4px; }

/* ─── Progress Bar ───────────────────────────────────────────────────────────── */
.progress-wrap { height: 6px; background: var(--card2); border-radius: 999px; overflow: hidden; margin-top: 6px; }
.progress-bar  { height: 100%; border-radius: 999px; transition: width .5s ease; }

/* ─── Buttons ────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px;
  border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; cursor: pointer;
  border: none; transition: opacity .15s, transform .1s;
}
.btn:hover { opacity: .88; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: linear-gradient(135deg, var(--gold), #a07830); color: #07051a; }
.btn-purple  { background: linear-gradient(135deg, var(--purple), #a855f7); color: #fff; }
.btn-green   { background: linear-gradient(135deg, #059669, #047857); color: #fff; }
.btn-red     { background: linear-gradient(135deg, #e11d48, #be123c); color: #fff; }
.btn-ghost   { background: transparent; border: 1px solid var(--border); color: var(--muted); }
.btn-ghost:hover { background: var(--card2); color: var(--text); }
.btn-sm { padding: 5px 10px; font-size: 11px; border-radius: 6px; }
.btn-icon { width: 30px; height: 30px; padding: 0; justify-content: center; }

/* ─── Inputs ─────────────────────────────────────────────────────────────────── */
.input {
  width: 100%; padding: 10px 14px; background: var(--card2);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 13px; color: var(--text); transition: border-color .2s;
}
.input::placeholder { color: var(--muted); }
.input:focus { border-color: rgba(201,168,76,.45); }
.input-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.input-group label { font-size: 11px; color: var(--muted); font-weight: 500; }
select.input option { background: var(--card); }

/* ─── Tables ─────────────────────────────────────────────────────────────────── */
.table-wrap { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
th { background: var(--card2); padding: 10px 16px; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); text-align: left; }
td { padding: 12px 16px; border-top: 1px solid var(--border2); font-size: 13px; vertical-align: middle; }
tr:hover td { background: rgba(255,255,255,.02); }

/* ─── Badges ─────────────────────────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 10px; font-weight: 600; }
.badge-live   { background: rgba(225,29,72,.15);  color: #f87171; border: 1px solid rgba(225,29,72,.3); }
.badge-green  { background: rgba(5,150,105,.15);  color: #34d399; border: 1px solid rgba(5,150,105,.3); }
.badge-gold   { background: rgba(201,168,76,.15); color: var(--gold); border: 1px solid rgba(201,168,76,.3); }
.badge-purple { background: rgba(124,58,237,.15); color: #a78bfa; border: 1px solid rgba(124,58,237,.3); }
.badge-gray   { background: rgba(255,255,255,.06); color: var(--muted); border: 1px solid var(--border2); }
.pulse-dot { width: 6px; height: 6px; border-radius: 50%; animation: pulse-badge 1.5s infinite; }

/* ─── Alert Banner ───────────────────────────────────────────────────────────── */
.live-banner {
  border-radius: var(--radius-lg); padding: 20px 24px;
  background: linear-gradient(135deg, #3b0764, #1e1a4a, #0a0820);
  border: 1px solid rgba(124,58,237,.4);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-bottom: 20px; cursor: pointer; transition: opacity .15s;
}
.live-banner:hover { opacity: .9; }
.live-banner-icon {
  width: 48px; height: 48px; border-radius: 50%; flex-shrink: 0;
  background: rgba(124,58,237,.25); border: 2px solid var(--purple);
  display: flex; align-items: center; justify-content: center; font-size: 22px;
  animation: glow-pulse 2s ease-in-out infinite;
}
@keyframes glow-pulse { 0%,100%{box-shadow:0 0 10px rgba(124,58,237,.3);} 50%{box-shadow:0 0 25px rgba(124,58,237,.6);} }
.live-banner-text h3 { font-family: 'Cinzel', serif; font-size: 16px; font-weight: 700; color: #fff; }
.live-banner-text p  { font-size: 12px; color: #c4b5fd; margin-top: 3px; }

/* ─── Course Card ────────────────────────────────────────────────────────────── */
.course-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; transition: border-color .2s, transform .15s; }
.course-card:hover { border-color: rgba(201,168,76,.3); transform: translateY(-2px); }
.course-img { height: 130px; overflow: hidden; position: relative; }
.course-img img { width: 100%; height: 100%; object-fit: cover; opacity: .5; }
.course-img-overlay { position: absolute; inset: 0; }
.course-img-badges { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; align-items: center; justify-content: space-between; }
.course-body { padding: 16px; }
.course-title { font-family: 'Cinzel', serif; font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.course-meta { font-size: 11px; color: var(--muted); margin-bottom: 10px; }

/* ─── Schedule Item ──────────────────────────────────────────────────────────── */
.schedule-item {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
  display: flex; align-items: center; gap: 14px;
  transition: border-color .2s;
}
.schedule-item:hover { border-color: rgba(201,168,76,.25); }
.schedule-time { text-align: center; width: 60px; flex-shrink: 0; }
.schedule-time .day  { font-size: 10px; color: var(--muted); }
.schedule-time .time { font-size: 13px; font-weight: 700; }
.schedule-time .dur  { font-size: 10px; color: var(--muted); }
.schedule-divider { width: 1px; height: 44px; background: var(--border); flex-shrink: 0; }
.schedule-info { flex: 1; min-width: 0; }
.schedule-info h4 { font-size: 13px; font-weight: 600; }
.schedule-info p  { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ─── Resource Item ──────────────────────────────────────────────────────────── */
.resource-item {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 16px; display: flex; align-items: center; gap: 12px;
  transition: border-color .2s;
}
.resource-item:hover { border-color: rgba(201,168,76,.25); }
.resource-icon { width: 38px; height: 38px; border-radius: 8px; background: var(--card2); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 18px; }
.resource-info { flex: 1; min-width: 0; }
.resource-info h4 { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.resource-info p  { font-size: 11px; color: var(--muted); margin-top: 2px; }
.resource-actions { display: flex; gap: 6px; }

/* ─── Section Header ─────────────────────────────────────────────────────────── */
.section-hdr { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.section-hdr h2 { font-family: 'Cinzel', serif; font-size: 14px; }
.section-hdr a, .section-hdr button { font-size: 12px; color: var(--gold); background: none; border: none; cursor: pointer; }
.section-hdr a:hover, .section-hdr button:hover { text-decoration: underline; }

/* ─── Tabs ───────────────────────────────────────────────────────────────────── */
.tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tab-btn {
  padding: 10px 16px; font-size: 12px; font-weight: 600; background: none;
  border: none; border-bottom: 2px solid transparent; color: var(--muted);
  cursor: pointer; transition: all .15s; margin-bottom: -1px; white-space: nowrap;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--gold); border-bottom-color: var(--gold); font-family: 'Cinzel', serif; }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ─── Login Page (kept for fallback) ────────────────────────────────────────── */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; position: relative; z-index: 1; }
.login-box {
  width: 100%; max-width: 420px;
  background: rgba(15,12,46,.95); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 36px; backdrop-filter: blur(20px);
  box-shadow: 0 0 60px rgba(124,58,237,.15);
}
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo-icon {
  width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 12px;
  background: radial-gradient(circle, var(--gold), var(--purple));
  display: flex; align-items: center; justify-content: center; font-size: 28px;
  box-shadow: 0 0 40px rgba(124,58,237,.4);
}
.login-logo h1 { font-family: 'Cinzel', serif; font-size: 22px; }
.login-logo p  { font-size: 12px; color: var(--muted); margin-top: 4px; }
.role-selector { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-bottom: 20px; }
.role-btn {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 8px; border-radius: var(--radius-sm); border: 1px solid var(--border2);
  background: var(--card2); cursor: pointer; transition: all .15s; font-size: 11px; font-weight: 600;
  color: var(--muted);
}
.role-btn:hover { border-color: var(--border); color: var(--text); }
.role-btn.active { border-color: var(--gold); background: rgba(201,168,76,.1); color: var(--gold); }
.role-btn .role-icon { font-size: 20px; }
.login-divider { text-align: center; font-size: 10px; color: var(--muted); margin: 16px 0; letter-spacing: .08em; text-transform: uppercase; }
.error-msg { background: rgba(225,29,72,.1); border: 1px solid rgba(225,29,72,.3); border-radius: var(--radius-sm); padding: 10px 14px; font-size: 12px; color: #f87171; margin-bottom: 14px; }

/* ─── Meeting / Video Room ───────────────────────────────────────────────────── */
.meeting-wrap { display: flex; flex-direction: column; height: 100vh; background: #020110; overflow: hidden; }
.meeting-topbar {
  height: 44px; flex-shrink: 0; display: flex; align-items: center;
  justify-content: space-between; padding: 0 16px;
  background: rgba(2,1,16,.95); border-bottom: 1px solid var(--border2);
}
.meeting-topbar-info { display: flex; align-items: center; gap: 12px; font-size: 12px; }
.rec-dot { width: 8px; height: 8px; border-radius: 50%; background: #e11d48; animation: pulse-badge 1s infinite; }
.timer { font-family: monospace; color: var(--muted); font-size: 13px; }
.meeting-main { flex: 1; display: flex; overflow: hidden; }
.video-area { flex: 1; display: flex; flex-direction: column; padding: 10px; gap: 8px; overflow: hidden; min-width: 0; }
.video-main {
  flex: 1; border-radius: 16px; overflow: hidden; position: relative;
  background: linear-gradient(135deg, #1a0a3d, #0d0826);
  border: 2px solid rgba(201,168,76,.3);
}
.video-main video { width: 100%; height: 100%; object-fit: cover; }
.video-label {
  position: absolute; bottom: 10px; left: 10px;
  background: rgba(0,0,0,.65); padding: 4px 10px; border-radius: 6px;
  font-size: 11px; font-weight: 600; display: flex; align-items: center; gap: 6px;
}
.video-label .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }
.video-thumb-row { display: flex; gap: 8px; height: 90px; }
.video-thumb {
  flex: 1; border-radius: 10px; position: relative; overflow: hidden;
  background: #0d0826; border: 1px solid rgba(255,255,255,.05);
  display: flex; align-items: center; justify-content: center;
}
.video-thumb.hand-raised { border-color: var(--gold) !important; }
.video-thumb video { width: 100%; height: 100%; object-fit: cover; }
.video-thumb-label {
  position: absolute; bottom: 4px; left: 4px; right: 4px;
  display: flex; align-items: center; justify-content: space-between; font-size: 8px; color: rgba(255,255,255,.7);
}
.video-thumb-icons { display: flex; gap: 2px; align-items: center; }
.video-avatar { font-size: 14px; font-weight: 700; color: #fff; width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }

/* Meeting Controls */
.meeting-controls {
  height: 64px; flex-shrink: 0; display: flex; align-items: center;
  justify-content: center; gap: 8px; padding: 0 16px;
  background: rgba(2,1,16,.97); border-top: 1px solid var(--border2);
}
.ctrl-btn {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 12px; border-radius: 10px; border: 1px solid rgba(255,255,255,.05);
  background: transparent; cursor: pointer; transition: all .15s; min-width: 52px;
}
.ctrl-btn:hover { background: rgba(255,255,255,.06); }
.ctrl-btn.active-danger { background: rgba(225,29,72,.12); border-color: rgba(225,29,72,.25); }
.ctrl-btn.active-accent { background: rgba(201,168,76,.12); border-color: rgba(201,168,76,.25); }
.ctrl-btn-icon { font-size: 18px; }
.ctrl-btn-icon.danger { color: #f87171; }
.ctrl-btn-icon.accent { color: var(--gold); }
.ctrl-btn-icon.normal { color: var(--muted); }
.ctrl-btn-label { font-size: 8px; color: var(--muted); white-space: nowrap; }
.ctrl-divider { width: 1px; height: 32px; background: var(--border2); margin: 0 4px; }
.end-btn {
  display: flex; align-items: center; gap: 6px; padding: 8px 16px;
  background: linear-gradient(135deg, #e11d48, #be123c); color: #fff;
  border: none; border-radius: 10px; font-size: 13px; font-weight: 700; cursor: pointer;
  transition: opacity .15s;
}
.end-btn:hover { opacity: .88; }

/* Meeting Side Panel */
.meeting-panel {
  width: 260px; flex-shrink: 0; display: flex; flex-direction: column;
  border-left: 1px solid var(--border2); background: #050415; overflow: hidden;
}
.panel-tabs { display: flex; border-bottom: 1px solid var(--border2); }
.panel-tab {
  flex: 1; padding: 10px; font-size: 11px; font-weight: 600;
  border: none; border-bottom: 2px solid transparent; background: transparent;
  color: var(--muted); cursor: pointer; transition: all .15s;
}
.panel-tab.active { color: var(--gold); border-bottom-color: var(--gold); }
.panel-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.panel-section { display: none; flex-direction: column; height: 100%; }
.panel-section.active { display: flex; }

/* Chat Panel */
.chat-msgs { flex: 1; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 10px; }
.chat-msgs::-webkit-scrollbar { width: 3px; }
.chat-msgs::-webkit-scrollbar-thumb { background: rgba(201,168,76,.2); border-radius: 2px; }
.chat-msg { display: flex; gap: 8px; }
.chat-msg.mine { flex-direction: row-reverse; }
.chat-msg-avatar { width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 700; color: #fff; }
.chat-msg-body { max-width: 78%; display: flex; flex-direction: column; }
.chat-msg.mine .chat-msg-body { align-items: flex-end; }
.chat-msg-name { font-size: 9px; color: var(--muted); margin-bottom: 2px; }
.chat-msg-bubble {
  padding: 6px 10px; border-radius: 10px; font-size: 11px; line-height: 1.5;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.05);
}
.chat-msg.mine .chat-msg-bubble {
  background: rgba(201,168,76,.1); border-color: rgba(201,168,76,.2);
}
.chat-msg-time { font-size: 9px; color: var(--muted); margin-top: 2px; }
.chat-input-wrap {
  padding: 10px; border-top: 1px solid var(--border2);
  display: flex; align-items: center; gap: 8px;
}
.chat-input-wrap input {
  flex: 1; padding: 7px 12px; background: var(--card2); border: 1px solid var(--border);
  border-radius: 8px; font-size: 12px; color: var(--text);
}
.chat-input-wrap input::placeholder { color: var(--muted); }
.chat-send-btn {
  width: 30px; height: 30px; border-radius: 8px; border: none;
  background: var(--gold); color: #07051a; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 14px;
  flex-shrink: 0; transition: opacity .15s;
}
.chat-send-btn:hover { opacity: .85; }

/* Participants Panel */
.participants-list { flex: 1; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 4px; }
.participant-item { display: flex; flex-direction: column; align-items: stretch; gap: 6px; padding: 8px; border-radius: 8px; }
.participant-item:hover { background: rgba(255,255,255,.03); }
.participant-main { display: flex; align-items: center; gap: 8px; }
.participant-name { flex: 1; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.participant-icons { display: flex; gap: 4px; align-items: center; font-size: 12px; }
.participant-hand, .participant-mute { flex-shrink: 0; }

/* Teacher control buttons (mute/unmute, kick/unkick, stage) */
.participant-actions { display: flex; flex-wrap: wrap; gap: 6px; padding-left: 34px; }
.participant-action-btn {
  appearance: none; -webkit-appearance: none; cursor: pointer;
  font-family: inherit; font-size: 10px; font-weight: 700; letter-spacing: .02em;
  padding: 4px 9px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--card2); color: var(--text);
  transition: opacity .15s, transform .1s;
  line-height: 1.4;
}
.participant-action-btn:hover { opacity: .82; }
.participant-action-btn:active { transform: scale(.96); }
.p-label { font-size: 9px; font-weight: 700; color: var(--gold); }
.section-label { font-size: 9px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 6px 8px 3px; }

/* ─── Certificate Card ───────────────────────────────────────────────────────── */
.cert-card {
  border-radius: 18px; border: 1px solid rgba(201,168,76,.3); overflow: hidden;
  background: linear-gradient(135deg, #1a0a3d, #0f0c2e); text-align: center;
  padding: 36px 24px; position: relative;
}
.cert-card::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at top left, rgba(201,168,76,.06) 0%, transparent 60%),
              radial-gradient(ellipse at bottom right, rgba(124,58,237,.06) 0%, transparent 60%);
}
.cert-icon { width: 60px; height: 60px; border-radius: 50%; margin: 0 auto 14px; background: rgba(201,168,76,.1); border: 2px solid rgba(201,168,76,.3); display: flex; align-items: center; justify-content: center; font-size: 26px; }
.cert-title { font-family: 'Cinzel', serif; font-size: 18px; font-weight: 700; margin: 6px 0; }
.cert-sub { font-size: 12px; color: var(--muted); margin-bottom: 16px; }

/* ─── Admin ──────────────────────────────────────────────────────────────────── */
.user-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-top: 1px solid var(--border2); transition: background .15s; }
.user-row:hover { background: rgba(255,255,255,.02); }
.user-info { flex: 1; min-width: 0; }
.user-info h4 { font-size: 13px; font-weight: 600; }
.user-info p  { font-size: 11px; color: var(--muted); margin-top: 1px; }
.user-actions { display: flex; align-items: center; gap: 6px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.status-dot.on  { background: #34d399; }
.status-dot.off { background: var(--muted); }

/* ─── Modal ──────────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.7); z-index: 200;
  display: none; align-items: center; justify-content: center; padding: 20px;
  backdrop-filter: blur(4px);
}
.modal-overlay.open { display: flex; animation: fadeIn .2s ease; }
@keyframes fadeIn { from{opacity:0;} to{opacity:1;} }
.modal {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 28px; width: 100%; max-width: 480px; box-shadow: var(--shadow);
  animation: slideUp .25s ease;
}
@keyframes slideUp { from{opacity:0;transform:translateY(16px);} to{opacity:1;transform:translateY(0);} }
.modal-hdr { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-hdr h3 { font-family: 'Cinzel', serif; font-size: 16px; }
.modal-close { background: none; border: none; cursor: pointer; color: var(--muted); font-size: 18px; transition: color .15s; }
.modal-close:hover { color: var(--text); }

/* ─── Flash / Toast ──────────────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 300;
  background: var(--card2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 18px; font-size: 13px; box-shadow: var(--shadow);
  animation: toastIn .25s ease; display: flex; align-items: center; gap: 8px;
}
.toast.success { border-color: rgba(5,150,105,.4); }
.toast.error   { border-color: rgba(225,29,72,.4); color: #f87171; }
@keyframes toastIn { from{opacity:0;transform:translateY(8px);} to{opacity:1;transform:translateY(0);} }

/* ─── Misc ───────────────────────────────────────────────────────────────────── */
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.text-gold   { color: var(--gold); }
.text-purple { color: #a78bfa; }
.text-muted  { color: var(--muted); }
.text-green  { color: #34d399; }
.text-red    { color: #f87171; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mb-8  { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.flex  { display: flex; }
.items-center { align-items: center; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.flex-1 { flex: 1; }
.hidden { display: none; }
.text-center { text-align: center; }
.font-mono { font-family: monospace; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ─── Scrollbars ─────────────────────────────────────────────────────────────── */
* { scrollbar-width: thin; scrollbar-color: rgba(201,168,76,.2) transparent; }
*::-webkit-scrollbar { width: 4px; height: 4px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: rgba(201,168,76,.2); border-radius: 2px; }

/* ─── Login page (new split design) ─────────────────────────────────────────── */
.split-login { display: flex; height: 100vh; margin: 0; font-family: sans-serif; }
.login-container { display: flex; width: 100%; max-width: 1000px; margin: auto; border-radius: 20px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.1); }
.login-sidebar { background: #e60000; color: white; padding: 40px; flex: 1; display: flex; align-items: center; }
.sidebar-content h1 { font-size: 2rem; }
.features { list-style: none; padding: 0; }
.features li { margin: 15px 0; }
.login-main { padding: 60px; flex: 1; background: white; }
.input-group input { width: 100%; padding: 12px; margin: 10px 0; border: 1px solid #ddd; border-radius: 8px; }
.btn-submit { width: 100%; padding: 15px; background: #e60000; color: white; border: none; border-radius: 8px; cursor: pointer; font-weight: bold; }
.role-selector { display: flex; gap: 10px; margin-bottom: 20px; }
.role-btn { flex: 1; padding: 10px; border: 1px solid #e60000; background: white; color: #e60000; border-radius: 8px; cursor: pointer; }

/* ═══════════════════════════════════════════════════════════════
   MOBILE RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */
.sidebar-toggle {
  display: none; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,.15); background: rgba(255,255,255,.08);
  cursor: pointer; font-size: 18px; color: var(--text); flex-shrink: 0;
}
.sidebar-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,.6);
  z-index: 9; backdrop-filter: blur(2px);
}
@media (max-width: 768px) {
  /* ── Dashboard / general pages ──────────────────────────── */
  .sidebar { position: fixed; left: -240px; top: 0; z-index: 10; width: 240px; height: 100vh; height: 100dvh; transition: left .25s ease; box-shadow: 4px 0 24px rgba(0,0,0,.5); overflow-y: auto; }
  .sidebar.open { left: 0; }
  .sidebar-overlay.open { display: block; }
  .sidebar-toggle { display: flex; }
  .app-header { padding: 0 14px; gap: 10px; }
  .app-header h1 { font-size: 12px; letter-spacing: .06em; }
  .header-search { display: none; }
  .page-content { padding: 16px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .live-banner { flex-direction: column; align-items: flex-start; gap: 12px; padding: 16px; }
  .tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; }
  .tab-btn { flex-shrink: 0; padding: 10px 12px; }

  /* ── Meeting / video call ────────────────────────────────── */

  /* Use small viewport height so controls stay above browser chrome */
  .meeting-wrap {
    height: 100vh;           /* fallback for older browsers */
    height: 100svh;          /* modern: shrinks when browser chrome shows */
    padding-bottom: 72px;    /* room for the fixed controls bar */
  }

  /* Top bar: compact, single line */
  .meeting-topbar { height: 44px; min-height: 44px; padding: 0 10px; flex-wrap: nowrap; overflow: hidden; gap: 8px; }
  .meeting-topbar-info { gap: 6px; font-size: 10px; flex-shrink: 1; min-width: 0; overflow: hidden; }
  .meeting-topbar > div:last-child { display: none; }

  /* Stack video on top, panel below */
  .meeting-main { flex-direction: column; overflow: hidden; }

  /* Video takes ~50% of the available height */
  .video-area { padding: 6px; gap: 6px; flex: 1 1 0; min-height: 160px; overflow: hidden; }
  .video-main { flex: 1; min-height: 0; border-radius: 10px; }
  .video-thumb-row { height: 56px; flex-shrink: 0; }

  /* Panel takes remaining space */
  .meeting-panel { width: 100%; border-left: none; border-top: 1px solid var(--border2); flex: 1 1 0; min-height: 140px; max-height: 45vh; }
  .panel-tab { font-size: 10px; padding: 8px 6px; }

  /* Controls: FIXED to bottom of visible viewport — always visible */
  .meeting-controls {
    position: fixed !important;
    bottom: 0; left: 0; right: 0;
    z-index: 50;
    height: auto;
    min-height: 64px;
    padding: 8px 6px;
    gap: 4px;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    justify-content: flex-start;
    background: rgba(2,1,16,.98);
    border-top: 1px solid rgba(255,255,255,.08);
  }
  .ctrl-btn { min-width: 48px; flex-shrink: 0; padding: 6px 8px; }
  .ctrl-btn-icon { font-size: 18px; }
  .ctrl-btn-label { font-size: 8px; }
  .ctrl-divider { height: 28px; margin: 0 2px; }
  .end-btn { padding: 8px 14px; font-size: 12px; flex-shrink: 0; }
}

@media (max-width: 480px) {
  /* ── General ─────────────────────────────────────────────── */
  .page-content { padding: 12px; }
  .stat-val { font-size: 20px; }
  .card { padding: 14px; }
  .login-box { padding: 24px 20px; }

  /* ── Meeting ─────────────────────────────────────────────── */
  /* Hide non-essential topbar info on tiny screens */
  .meeting-topbar-info > span:not(.timer):not(.rec-dot):not(.rec-label) { display: none; }
  /* Keep controls scrollable, icons only */
  .ctrl-btn-label { display: none; }
  .ctrl-btn { min-width: 42px; padding: 8px 6px; border-radius: 8px; }
  .ctrl-btn-icon { font-size: 20px; }
  #wb-toolbar { gap: 6px; padding: 8px; }
  #wb-size { width: 50px; }
}
body.sidebar-open { overflow: hidden; }

/* ── Courses + Upcoming grid (replaces hardcoded inline style) ── */
.courses-upcoming-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 20px;
}
@media (max-width: 768px) {
  .courses-upcoming-grid {
    grid-template-columns: 1fr;
  }
}

/* Students/guests: no empty banner strip under the teacher's video when there
   are no other tiles (their own face is never shown to them). */
.video-thumb-row.student-thumb-row:not(:has(.video-thumb)) { display: none; }
