/* ============================================
   MINBAR LIVE — Professional Design System
   ============================================ */

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

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

/* ---- Light Theme ---- */
:root {
  --bg: #F4F7F5;
  --bg-alt: #EDF2EE;
  --card: #FFFFFF;
  --ink: #0F1A14;
  --ink-soft: #5A7265;
  --ink-muted: #8FA398;
  --teal: #0D9488;
  --teal-dark: #0A6B62;
  --teal-deeper: #074E48;
  --teal-soft: #E0F5F0;
  --accent: #10B981;
  --accent-soft: #D1FAE5;
  --rose: #DC2626;
  --rose-soft: #FEE2E2;
  --blue: #2563EB;
  --blue-soft: #DBEAFE;
  --green: #16A34A;
  --green-soft: #DCFCE7;
  --orange: #D97706;
  --orange-soft: #FEF3C7;
  --amber: #F59E0B;
  --amber-soft: #FEF3C7;
  --border: #D4E2DA;
  --border-subtle: #E8F0EB;
  --shadow-xs: 0 1px 2px rgba(10,20,14,.04);
  --shadow-sm: 0 1px 3px rgba(10,20,14,.06), 0 1px 2px rgba(10,20,14,.04);
  --shadow: 0 4px 12px rgba(10,20,14,.07), 0 1px 4px rgba(10,20,14,.04);
  --shadow-md: 0 8px 24px rgba(10,20,14,.08), 0 2px 8px rgba(10,20,14,.04);
  --shadow-lg: 0 16px 48px rgba(10,20,14,.10), 0 4px 12px rgba(10,20,14,.05);
  --shadow-xl: 0 24px 64px rgba(10,20,14,.14), 0 8px 20px rgba(10,20,14,.06);
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;
  --transition-fast: 120ms cubic-bezier(.4,0,.2,1);
  --transition: 200ms cubic-bezier(.4,0,.2,1);
  --transition-smooth: 300ms cubic-bezier(.4,0,.2,1);
  --transition-spring: 400ms cubic-bezier(.175,.885,.32,1.1);
}

/* ---- Dark Theme ---- */
body.dark {
  --bg: #0C1410;
  --bg-alt: #121E18;
  --card: #162019;
  --ink: #E8F5EC;
  --ink-soft: #8EA89A;
  --ink-muted: #5C7568;
  --teal: #34D399;
  --teal-dark: #6EE7B7;
  --teal-deeper: #A7F3D0;
  --teal-soft: #0D3D2E;
  --accent: #34D399;
  --accent-soft: #0D3D2E;
  --rose: #F87171;
  --rose-soft: #3B1212;
  --blue: #60A5FA;
  --blue-soft: #172554;
  --green: #4ADE80;
  --green-soft: #143322;
  --orange: #FB923C;
  --orange-soft: #3B2009;
  --amber: #FBBF24;
  --amber-soft: #3B2E09;
  --border: #243830;
  --border-subtle: #1C2E26;
  --shadow-xs: 0 1px 2px rgba(0,0,0,.2);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.25), 0 1px 2px rgba(0,0,0,.15);
  --shadow: 0 4px 12px rgba(0,0,0,.25), 0 1px 4px rgba(0,0,0,.15);
  --shadow-md: 0 8px 24px rgba(0,0,0,.3), 0 2px 8px rgba(0,0,0,.15);
  --shadow-lg: 0 16px 48px rgba(0,0,0,.4), 0 4px 12px rgba(0,0,0,.2);
  --shadow-xl: 0 24px 64px rgba(0,0,0,.5), 0 8px 20px rgba(0,0,0,.25);
}

/* ---- Base ---- */
html { font-size: 16px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  direction: ltr;
  line-height: 1.6;
  transition: background var(--transition-smooth), color var(--transition-smooth);
}

a { color: var(--teal); text-decoration: none; transition: color var(--transition-fast); }
a:hover { text-decoration: underline; }
::selection { background: var(--teal-soft); color: var(--teal-dark); }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; border-radius: 4px; }

img { max-width: 100%; height: auto; }

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-muted); }

/* ============================================
   NAVIGATION
   ============================================ */
.top-nav {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; gap: 14px;
  padding: 10px 24px;
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(16px) saturate(1.6);
  -webkit-backdrop-filter: blur(16px) saturate(1.6);
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--transition-smooth), border-color var(--transition-smooth);
}
body.dark .top-nav { background: rgba(22,32,25,.88); }

.top-nav .logo {
  font-weight: 800; font-size: 20px;
  color: var(--teal-dark);
  display: flex; align-items: center; gap: 8px;
  letter-spacing: -.03em;
  text-decoration: none;
}
.top-nav .logo:hover { text-decoration: none; }
body.dark .top-nav .logo { color: var(--teal); }
.top-nav .logo svg { width: 26px; height: 26px; fill: var(--teal); }

.top-nav .nav-links { display: flex; gap: 2px; margin-left: auto; }
.top-nav .nav-link {
  padding: 7px 14px; border-radius: var(--radius-full);
  font-size: 13px; font-weight: 500;
  color: var(--ink-soft);
  transition: all var(--transition);
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
}
.top-nav .nav-link:hover { background: var(--teal-soft); color: var(--teal); text-decoration: none; }
.top-nav .nav-link.active {
  background: var(--teal); color: #fff;
  box-shadow: 0 2px 8px rgba(13,148,136,.25);
}

.top-nav .user-area { display: flex; align-items: center; gap: 8px; margin-left: 8px; }
.top-nav .user-badge {
  padding: 5px 12px; border-radius: var(--radius-full);
  font-size: 11px; font-weight: 700; letter-spacing: .3px;
  background: var(--teal-soft); color: var(--teal);
}
.top-nav .avatar-sm {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--teal), var(--accent));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
  box-shadow: 0 2px 8px rgba(13,148,136,.2);
  overflow: hidden;
}
.top-nav .avatar-sm img { width: 100%; height: 100%; object-fit: cover; }

/* ============================================
   LAYOUT
   ============================================ */
.container { max-width: 1120px; margin: 0 auto; padding: 28px 20px; }

/* ============================================
   PANEL / CARD
   ============================================ */
.lp {
  background: var(--card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
}
.lp:hover { box-shadow: var(--shadow); }
.lp h2 {
  font-size: 18px; font-weight: 700;
  color: var(--ink);
  margin-bottom: 18px;
  display: flex; align-items: center; gap: 8px;
  letter-spacing: -.02em;
  line-height: 1.3;
}
.lp h2 small {
  font-size: 12px; color: var(--ink-muted); font-weight: 500;
  margin-left: 4px;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 20px; border-radius: var(--radius-sm);
  font-family: inherit; font-size: 13px; font-weight: 600;
  border: none; cursor: pointer;
  transition: all var(--transition);
  letter-spacing: -.01em;
  line-height: 1.4;
}
.btn:active { transform: scale(.97); }
.btn-primary {
  background: linear-gradient(135deg, var(--teal), var(--accent));
  color: #fff;
  box-shadow: 0 2px 8px rgba(13,148,136,.25), inset 0 1px 0 rgba(255,255,255,.12);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(13,148,136,.35), inset 0 1px 0 rgba(255,255,255,.12); }
.btn-primary:active { transform: translateY(0) scale(.98); }
.btn-ghost {
  background: var(--card); border: 1.5px solid var(--border);
  color: var(--ink-soft);
}
.btn-ghost:hover { border-color: var(--teal); color: var(--teal); background: var(--teal-soft); }
.btn-danger {
  background: var(--rose); color: #fff;
  box-shadow: 0 2px 8px rgba(220,38,38,.2);
}
.btn-danger:hover { opacity: .9; transform: translateY(-1px); }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: var(--radius-xs); }
.btn-lg { padding: 14px 28px; font-size: 15px; border-radius: var(--radius-md); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

/* ============================================
   TEACHER CARD
   ============================================ */
.teacher-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}
.teacher-card {
  background: var(--card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition-smooth);
  cursor: pointer;
}
.teacher-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--teal);
}
.teacher-card .tc-header {
  height: 130px;
  background: linear-gradient(135deg, var(--teal), var(--accent));
  position: relative;
  display: flex; align-items: flex-end; justify-content: center;
  overflow: hidden;
}
.teacher-card .tc-header::after {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0L60 30L30 60L0 30Z' fill='none' stroke='rgba(255,255,255,0.08)' stroke-width='1'/%3E%3C/svg%3E");
  background-size: 30px 30px;
}
.teacher-card .tc-avatar {
  width: 76px; height: 76px;
  border-radius: 50%;
  border: 3px solid var(--card);
  background: var(--card);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 700; color: var(--teal);
  position: absolute; bottom: -38px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transition: transform var(--transition);
  z-index: 1;
}
.teacher-card:hover .tc-avatar { transform: scale(1.05); }
.teacher-card .tc-avatar img { width: 100%; height: 100%; object-fit: cover; }

.teacher-card .tc-status {
  position: absolute; top: 12px; left: 12px;
  padding: 4px 10px; border-radius: var(--radius-full);
  font-size: 10px; font-weight: 700; color: #fff;
  display: flex; align-items: center; gap: 5px;
  z-index: 1;
  backdrop-filter: blur(8px);
}
.tc-status .dot { width: 7px; height: 7px; border-radius: 50%; }
.tc-status.online .dot { background: #22c55e; box-shadow: 0 0 6px rgba(34,197,94,.5); }
.tc-status.online { background: rgba(34,197,94,.2); }
.tc-status.teaching .dot { background: #ef4444; box-shadow: 0 0 6px rgba(239,68,68,.5); }
.tc-status.teaching { background: rgba(239,68,68,.2); }
.tc-status.offline .dot { background: #9ca3af; }
.tc-status.offline { background: rgba(107,114,128,.2); }

.teacher-card .tc-body { padding: 46px 20px 18px; text-align: center; }
.teacher-card .tc-name {
  font-size: 17px; font-weight: 700;
  color: var(--ink); margin-bottom: 4px;
  letter-spacing: -.01em;
}
.teacher-card .tc-bio {
  font-size: 13px; color: var(--ink-soft);
  margin-bottom: 14px; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.teacher-card .tc-stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 8px; padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}
.tc-stats .tc-stat { text-align: center; }
.tc-stats .tc-stat-num { font-size: 15px; font-weight: 700; color: var(--teal); }
.tc-stats .tc-stat-label { font-size: 10px; color: var(--ink-muted); text-transform: uppercase; letter-spacing: .3px; }
.teacher-card .tc-price {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; background: var(--teal-soft);
  border-top: 1px solid var(--border-subtle);
}
.tc-price .price { font-size: 17px; font-weight: 700; color: var(--teal-dark); }
body.dark .tc-price .price { color: var(--teal); }
.tc-price .unit { font-size: 12px; color: var(--ink-soft); }
.tc-price .rating { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--amber); }

/* ============================================
   STAR RATING
   ============================================ */
.stars { display: inline-flex; gap: 2px; }
.stars .star { color: #D1D5DB; font-size: 16px; transition: color var(--transition-fast); }
.stars .star.filled { color: #F59E0B; }

/* ============================================
   BADGES
   ============================================ */
.badge-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: var(--radius-full);
  font-size: 11px; font-weight: 600;
}
.badge-online { background: var(--green-soft); color: var(--green); }
.badge-offline { background: var(--bg-alt); color: var(--ink-muted); }
.badge-teaching { background: var(--rose-soft); color: var(--rose); }
.badge-level { background: var(--blue-soft); color: var(--blue); }

/* ============================================
   PROFILE PAGE
   ============================================ */
.profile-hero {
  background: linear-gradient(135deg, var(--teal-dark), var(--teal), var(--accent));
  border-radius: var(--radius-lg);
  padding: 48px 24px;
  text-align: center;
  color: #fff;
  position: relative;
  overflow: hidden;
  margin-bottom: 24px;
}
.profile-hero::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0L60 30L30 60L0 30Z' fill='none' stroke='rgba(255,255,255,0.06)' stroke-width='1'/%3E%3C/svg%3E");
  background-size: 30px 30px;
}
.profile-hero::after {
  content: '';
  position: absolute; top: -60px; right: -60px;
  width: 200px; height: 200px;
  background: rgba(255,255,255,.06);
  border-radius: 50%;
}
.profile-hero .profile-avatar {
  width: 120px; height: 120px;
  border-radius: 50%; border: 4px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.12);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px; font-size: 48px;
  position: relative; z-index: 1;
  overflow: hidden;
  transition: transform var(--transition);
  box-shadow: 0 8px 32px rgba(0,0,0,.2);
}
.profile-hero .profile-avatar:hover { transform: scale(1.04); }
.profile-hero .profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-hero h1 { font-size: 26px; font-weight: 700; position: relative; z-index: 1; letter-spacing: -.02em; }
.profile-hero .profile-sub { font-size: 14px; opacity: .85; margin-top: 4px; position: relative; z-index: 1; }

.profile-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}
.profile-sidebar .lp { position: sticky; top: 80px; }

/* ============================================
   BOOKING SLOTS
   ============================================ */
.slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px;
}
.slot {
  padding: 10px 8px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  font-size: 13px;
}
.slot:hover { border-color: var(--teal); background: var(--teal-soft); }
.slot.selected {
  border-color: var(--teal); background: var(--teal); color: #fff;
  box-shadow: 0 2px 8px rgba(13,148,136,.3);
}
.slot.unavailable { opacity: .35; cursor: not-allowed; text-decoration: line-through; }

/* ============================================
   DAY PICKER
   ============================================ */
.day-picker { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.day-btn {
  padding: 8px 14px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--card); color: var(--ink);
  font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all var(--transition);
  text-align: center; min-width: 60px;
}
.day-btn:hover { border-color: var(--teal); }
.day-btn.active {
  background: var(--teal); color: #fff; border-color: var(--teal);
  box-shadow: 0 2px 8px rgba(13,148,136,.25);
}
.day-btn.disabled { opacity: .3; cursor: not-allowed; }

/* ============================================
   LESSON CARDS
   ============================================ */
.lesson-list { display: grid; gap: 12px; }
.lesson-card {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 20px;
  background: var(--card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: all var(--transition);
}
.lesson-card:hover { box-shadow: var(--shadow); border-color: var(--border); }
.lesson-card .lc-time {
  min-width: 64px; text-align: center;
  padding: 10px 8px;
  background: var(--teal-soft);
  border-radius: var(--radius-sm);
}
.lesson-card .lc-time .lc-hour { font-size: 18px; font-weight: 700; color: var(--teal); }
.lesson-card .lc-time .lc-ampm { font-size: 10px; color: var(--ink-soft); }
.lesson-card .lc-info { flex: 1; }
.lesson-card .lc-title { font-weight: 600; font-size: 14px; margin-bottom: 2px; }
.lesson-card .lc-meta { font-size: 12px; color: var(--ink-soft); display: flex; gap: 12px; }
.lesson-card .lc-actions { display: flex; gap: 8px; }

.lesson-status {
  padding: 4px 10px; border-radius: var(--radius-full);
  font-size: 11px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 4px;
}
.ls-upcoming { background: var(--blue-soft); color: var(--blue); }
.ls-live { background: var(--green-soft); color: var(--green); animation: pulse 2s infinite; }
.ls-completed { background: var(--bg-alt); color: var(--ink-muted); }
.ls-cancelled { background: var(--rose-soft); color: var(--rose); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .7; }
}

/* ============================================
   BOOKING REQUEST CARD
   ============================================ */
.booking-card {
  padding: 18px;
  background: var(--card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  transition: all var(--transition);
}
.booking-card:hover { box-shadow: var(--shadow-sm); }
.booking-card .bk-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.booking-card .bk-student { font-weight: 600; font-size: 14px; }
.booking-card .bk-time { font-size: 12px; color: var(--ink-soft); }
.booking-card .bk-note {
  font-size: 13px; color: var(--ink-soft);
  padding: 10px 14px;
  background: var(--bg-alt);
  border-radius: var(--radius-sm);
  margin: 8px 0;
  line-height: 1.5;
}
.booking-card .bk-actions { display: flex; gap: 8px; margin-top: 12px; }

/* ============================================
   ROOM / LIVE
   ============================================ */
.room-wrap {
  position: fixed; inset: 0;
  background: #0F172A;
  display: grid;
  grid-template-columns: 1fr 340px;
  grid-template-rows: 1fr 60px;
  z-index: 1000;
}
.room-main { grid-column: 1; grid-row: 1; position: relative; overflow: hidden; background: #000; }
.room-main video { width: 100%; height: 100%; object-fit: cover; border-radius: 0; }
.room-main .peer-video { position: absolute; width: 200px; height: 150px; border-radius: var(--radius-sm); object-fit: cover; border: 2px solid rgba(255,255,255,.15); bottom: 16px; right: 16px; }
.room-main .local-video { position: absolute; width: 160px; height: 120px; border-radius: var(--radius-sm); object-fit: cover; border: 2px solid rgba(255,255,255,.15); bottom: 16px; left: 16px; z-index: 5; }

.room-sidebar {
  grid-column: 2; grid-row: 1;
  background: #1E293B;
  border-left: 1px solid #334155;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.room-sidebar .rs-tabs {
  display: flex; border-bottom: 1px solid #334155;
}
.room-sidebar .rs-tab {
  flex: 1; padding: 12px 8px;
  text-align: center; font-size: 12px; font-weight: 600;
  color: #94A3B8; cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
}
.room-sidebar .rs-tab:hover { color: #E2E8F0; }
.room-sidebar .rs-tab.active { color: #34D399; border-bottom-color: #34D399; }
.room-sidebar .rs-panel { flex: 1; overflow-y: auto; padding: 12px; }
.room-sidebar .rs-panel.hidden { display: none; }

/* Room Chat */
.chat-msg { display: flex; gap: 10px; margin-bottom: 14px; }
.chat-msg .cm-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: #334155; display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #94A3B8;
  flex-shrink: 0;
}
.chat-msg .cm-body { flex: 1; }
.chat-msg .cm-name { font-size: 11px; font-weight: 600; color: #94A3B8; margin-bottom: 2px; }
.chat-msg .cm-text { font-size: 13px; color: #E2E8F0; line-height: 1.5; }
.chat-msg .cm-time { font-size: 10px; color: #64748B; margin-top: 2px; }

.chat-input-wrap {
  display: flex; gap: 8px; padding: 12px;
  border-top: 1px solid #334155;
}
.chat-input-wrap input {
  flex: 1; padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid #334155;
  background: #0F172A; color: #E2E8F0;
  font-family: inherit; font-size: 13px;
  transition: border-color var(--transition-fast);
}
.chat-input-wrap input:focus { outline: none; border-color: #34D399; }
.chat-input-wrap input::placeholder { color: #64748B; }
.chat-input-wrap button {
  padding: 10px 16px; border-radius: var(--radius-sm);
  background: var(--teal); color: #fff;
  border: none; cursor: pointer; font-size: 13px; font-weight: 600;
  transition: all var(--transition-fast);
}
.chat-input-wrap button:hover { opacity: .9; }

/* Room Controls Bar */
.room-controls {
  grid-column: 1 / -1; grid-row: 2;
  background: #1E293B;
  border-top: 1px solid #334155;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 0 20px;
}
.rc-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all var(--transition);
  font-size: 18px;
  background: #334155; color: #E2E8F0;
}
.rc-btn:hover { background: #475569; transform: scale(1.08); }
.rc-btn.active { background: var(--teal); color: #fff; }
.rc-btn.danger { background: var(--rose); color: #fff; }
.rc-btn.danger:hover { background: #DC2626; }
.rc-btn.muted { background: var(--rose); color: #fff; }

/* ============================================
   WHITEBOARD
   ============================================ */
.whiteboard-wrap {
  position: fixed; inset: 0;
  background: #fff;
  z-index: 1100;
  display: flex; flex-direction: column;
}
.whiteboard-wrap.dark-mode { background: #1E293B; }
.wb-toolbar {
  display: flex; align-items: center; gap: 4px;
  padding: 8px 12px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.wb-tool {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  border: 1.5px solid transparent;
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 16px;
  color: var(--ink-soft);
  transition: all var(--transition-fast);
}
.wb-tool:hover { background: var(--teal-soft); color: var(--teal); }
.wb-tool.active { border-color: var(--teal); background: var(--teal); color: #fff; }
.wb-color {
  width: 28px; height: 28px;
  border-radius: 50%; border: 2px solid var(--border);
  cursor: pointer; transition: transform var(--transition-fast);
}
.wb-color:hover { transform: scale(1.15); }
.wb-color.active { border-color: var(--ink); box-shadow: 0 0 0 2px var(--bg); }
.wb-sep { width: 1px; height: 28px; background: var(--border); margin: 0 4px; }
.wb-canvas-wrap { flex: 1; overflow: hidden; position: relative; }
.wb-canvas-wrap canvas { display: block; width: 100%; height: 100%; }

/* ============================================
   COUNTDOWN
   ============================================ */
.countdown {
  display: flex; gap: 12px; justify-content: center;
  margin: 16px 0;
}
.countdown .cd-box {
  background: var(--teal-soft);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  text-align: center;
  min-width: 64px;
}
.countdown .cd-num {
  font-size: 28px; font-weight: 700;
  color: var(--teal-dark);
  font-variant-numeric: tabular-nums;
}
body.dark .countdown .cd-num { color: var(--teal); }
.countdown .cd-label { font-size: 10px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .3px; }

/* ============================================
   SKELETON LOADING
   ============================================ */
.skeleton {
  background: linear-gradient(90deg, var(--border-subtle) 25%, transparent 50%, var(--border-subtle) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton-text { height: 14px; margin-bottom: 8px; }
.skeleton-title { height: 22px; width: 60%; margin-bottom: 12px; }
.skeleton-avatar { width: 80px; height: 80px; border-radius: 50%; }
.skeleton-card { height: 200px; border-radius: var(--radius-lg); }

/* ============================================
   TOAST
   ============================================ */
.toast-wrap {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  z-index: 9999; display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.toast-item {
  padding: 12px 24px; border-radius: var(--radius-md);
  background: var(--ink); color: var(--bg);
  font-size: 13px; font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toastIn .3s var(--transition-spring);
  pointer-events: auto;
  white-space: nowrap;
}
.toast-item.success { background: var(--teal); color: #fff; }
.toast-item.error { background: var(--rose); color: #fff; }
@keyframes toastIn { from { opacity:0; transform: translateY(16px) scale(.95); } to { opacity:1; transform: translateY(0) scale(1); } }

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
  text-align: center; padding: 48px 20px; color: var(--ink-soft);
}
.empty-state .es-icon { font-size: 48px; margin-bottom: 12px; opacity: .4; }
.empty-state .es-title { font-size: 17px; font-weight: 600; margin-bottom: 6px; color: var(--ink); }
.empty-state .es-text { font-size: 13px; max-width: 360px; margin: 0 auto 16px; line-height: 1.6; }

/* ============================================
   FORM FIELDS
   ============================================ */
.field { margin-bottom: 16px; }
.field label {
  display: block; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .5px;
  color: var(--ink-soft); margin-bottom: 6px;
}
.field input, .field select, .field textarea {
  width: 100%; padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card); color: var(--ink);
  font-family: inherit; font-size: 14px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(13,148,136,.1);
}
.field textarea { resize: vertical; min-height: 80px; }
.field input::placeholder, .field textarea::placeholder { color: var(--ink-muted); }

/* ============================================
   FILTER TABS
   ============================================ */
.filter-bar { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.filter-pill {
  padding: 6px 14px; border-radius: var(--radius-full);
  font-size: 12px; font-weight: 500;
  border: 1.5px solid var(--border);
  background: var(--card); color: var(--ink-soft);
  cursor: pointer; transition: all var(--transition);
}
.filter-pill:hover { border-color: var(--teal); color: var(--teal); }
.filter-pill.active {
  background: var(--teal); color: #fff; border-color: var(--teal);
  box-shadow: 0 2px 6px rgba(13,148,136,.2);
}

/* ============================================
   SEARCH
   ============================================ */
.search-wrap { position: relative; margin-bottom: 16px; }
.search-wrap input {
  width: 100%; padding: 12px 16px 12px 42px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card); color: var(--ink);
  font-family: inherit; font-size: 14px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.search-wrap input:focus {
  outline: none; border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(13,148,136,.1);
}
.search-wrap .search-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--ink-muted); font-size: 16px;
}

/* ============================================
   DASHBOARD STATS
   ============================================ */
.dash-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.dash-stat {
  background: var(--card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px 14px;
  text-align: center;
  transition: all var(--transition);
}
.dash-stat:hover { box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.dash-stat .ds-icon {
  width: 42px; height: 42px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 10px;
  font-size: 18px;
}
.dash-stat .ds-num { font-size: 24px; font-weight: 700; color: var(--ink); line-height: 1.2; }
.dash-stat .ds-label { font-size: 11px; color: var(--ink-muted); text-transform: uppercase; letter-spacing: .3px; margin-top: 2px; }

/* ============================================
   MODAL
   ============================================ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fadeIn .2s;
}
.modal {
  background: var(--card);
  border-radius: var(--radius-xl);
  padding: 28px;
  width: 100%; max-width: 480px;
  max-height: 80vh; overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: modalIn .3s var(--transition-spring);
}
.modal h3 {
  font-size: 19px; font-weight: 700; margin-bottom: 18px;
  letter-spacing: -.02em;
}
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }
@keyframes modalIn { from { opacity:0; transform: scale(.95) translateY(8px); } to { opacity:1; transform: scale(1) translateY(0); } }

/* ============================================
   ADMIN TABLE
   ============================================ */
.admin-table {
  width: 100%; border-collapse: collapse;
  font-size: 13px;
}
.admin-table th {
  padding: 10px 12px;
  text-align: left;
  font-size: 11px; font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .3px;
  color: var(--ink-soft);
  border-bottom: 2px solid var(--border);
}
.admin-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
}
.admin-table tr:hover { background: var(--teal-soft); }

/* ============================================
   DIVIDER
   ============================================ */
.divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 16px 0;
}

/* ============================================
   AVATAR
   ============================================ */
.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, var(--teal), var(--accent));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px;
  overflow: hidden; flex-shrink: 0;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 32px; height: 32px; font-size: 12px; }
.avatar-lg { width: 56px; height: 56px; font-size: 22px; }
.avatar-xl { width: 80px; height: 80px; font-size: 30px; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .profile-grid { grid-template-columns: 1fr; }
  .teacher-grid { grid-template-columns: 1fr; }
  .room-wrap { grid-template-columns: 1fr; grid-template-rows: 1fr 60px; }
  .room-sidebar { display: none; }
  .room-sidebar.mobile-open { display: flex; position: absolute; left: 0; top: 0; bottom: 60px; width: 300px; z-index: 10; }
  .top-nav .nav-links { display: none; }
  .dash-stats { grid-template-columns: repeat(2, 1fr); }
  .container { padding: 20px 14px; }
  .lp { padding: 20px; }
}

@media (max-width: 480px) {
  .container { padding: 12px 8px; }
  .lp { padding: 16px; }
  .lesson-card { flex-direction: column; text-align: center; }
  .top-nav { padding: 8px 14px; gap: 8px; }
  .top-nav .logo { font-size: 18px; }
  .top-nav .logo svg { width: 22px; height: 22px; }
  .dash-stats { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .dash-stat { padding: 14px 10px; }
  .dash-stat .ds-num { font-size: 20px; }
}

/* ── Hamburger Menu ── */
.menu-btn{display:none;width:36px;height:36px;border:none;background:none;cursor:pointer;font-size:20px;color:var(--ink-soft);align-items:center;justify-content:center;border-radius:8px;flex-shrink:0;}
body.dark .menu-btn{color:#94a3b8;}
@media(max-width:768px){.menu-btn{display:flex;}}
.mobile-overlay{position:fixed;inset:0;z-index:999;background:rgba(0,0,0,.4);display:none;backdrop-filter:blur(2px);-webkit-backdrop-filter:blur(2px);}
.mobile-overlay.open{display:block;}
.mobile-menu{position:fixed;top:0;right:-280px;width:280px;height:100vh;height:100dvh;z-index:1000;background:var(--card,#fff);padding:80px 24px 24px;transition:right .25s ease;box-shadow:-4px 0 24px rgba(0,0,0,.08);overflow-y:auto;}
body.dark .mobile-menu{background:#1e293b;}
.mobile-menu.open{right:0;}
.mobile-menu a{display:flex;align-items:center;gap:10px;padding:14px 0;font-size:15px;font-weight:600;color:var(--ink);text-decoration:none!important;border-bottom:1px solid var(--border-subtle,#f3f4f6);transition:color .15s;}
body.dark .mobile-menu a{color:#e2e8f0;border-color:#1e293b;}
.mobile-menu a:last-child{border-bottom:none;}
.mobile-menu a:hover{color:var(--teal);}
.mobile-menu-close{position:absolute;top:12px;right:12px;width:36px;height:36px;border:none;background:var(--bg-alt);cursor:pointer;font-size:18px;color:var(--ink-soft);display:flex;align-items:center;justify-content:center;border-radius:8px;}
.mobile-menu-close:hover{background:var(--border-subtle);}

/* ── Safe area padding for notched devices ── */
@supports(padding:max(0px)){.container,.lp,.auth-wrap,.room-wrap,.dash-content{padding-left:max(16px,env(safe-area-inset-left));padding-right:max(16px,env(safe-area-inset-right));}}

/* ── iOS tap delay fix ── */
button,a,.nav-link,.dash-tab,.lesson-card,.stat-card,.teacher-card{touch-action:manipulation;}

/* ── iOS zoom prevention ── */
input,textarea,select{font-size:16px!important;}
