/* ======================= ROOT VARIABLES ======================= */
:root {
  --beige: #F5F0E8;
  --beige-dark: #E8E0D0;
  --beige-light: #FAF7F2;
  --beige-hover: #EDE6D8;
  --brown: #8B7355;
  --brown-dark: #6B5740;
  --brown-light: #A89070;
  --accent: #C4956A;
  --accent-dark: #A87B52;
  --accent-light: #F0E0CC;
  --text: #3D3225;
  --text-muted: #8B7D6B;
  --text-light: #B0A090;
  --white: #FFFFFF;
  --red: #D64545;
  --green: #5B9A4B;
  --blue: #4A7FB5;
  --orange: #D4943A;
  --cyan: #4A9B8E;
  --pink: #C45B7C;
  --shadow: 0 2px 12px rgba(60,45,25,0.08);
  --shadow-lg: 0 8px 30px rgba(60,45,25,0.12);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --transition: 0.25s ease;

  --option-1: #D64545;
  --option-2: #4A7FB5;
  --option-3: #5B9A4B;
  --option-4: #D4943A;
}

/* ======================= RESET ======================= */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Tajawal', sans-serif;
  background: var(--beige);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: url('Background.png') center/cover no-repeat;
  opacity: 0.08;
  z-index: 0;
  pointer-events: none;
}
button { cursor: pointer; font-family: inherit; border: none; outline: none; }
input, textarea { font-family: inherit; outline: none; border: none; }
a { text-decoration: none; color: inherit; }

/* ======================= APP LAYOUT ======================= */
#app {
  display: flex;
  min-height: 100vh;
}

/* ======================= SIDEBAR ======================= */
#sidebar {
  width: 220px;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-left: 1px solid var(--beige-dark);
  display: flex;
  flex-direction: column;
  padding: 20px 12px;
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  z-index: 100;
  box-shadow: -2px 0 20px rgba(60,45,25,0.05);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 24px;
  border-bottom: 1px solid var(--beige-dark);
  margin-bottom: 16px;
}

.logo-upload-area {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.logo-upload-area:hover { opacity: 0.8; }
.logo-upload-area img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 12px;
}
.logo-placeholder {
  width: 44px;
  height: 44px;
  background: var(--accent);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.logo-placeholder .material-icons-round {
  font-size: 22px;
  color: var(--white);
}

.logo-icon {
  width: 44px;
  height: 44px;
  background: var(--accent);
  color: var(--white);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 900;
}
.logo-icon.small { width: 36px; height: 36px; font-size: 18px; }

.logo-text {
  font-size: 22px;
  font-weight: 900;
  color: var(--brown-dark);
}

.sidebar-menu { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.sidebar-footer { border-top: 1px solid var(--beige-dark); padding-top: 12px; }

.nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 500;
  transition: var(--transition);
}
.nav-btn:hover { background: var(--beige-light); color: var(--text); }
.nav-btn.active { background: var(--accent-light); color: var(--accent-dark); font-weight: 700; }
.nav-btn .material-icons-round { font-size: 22px; }

/* ======================= MAIN CONTENT ======================= */
#main-content {
  flex: 1;
  margin-right: 220px;
  padding: 30px 36px;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ======================= PAGES ======================= */
.page { display: none; animation: fadeIn 0.3s ease; }
.page.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ======================= PAGE HEADER ======================= */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
  flex-wrap: wrap;
}
.page-header h1 {
  font-size: 26px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
}
.page-header h1 .material-icons-round { font-size: 28px; color: var(--accent); }
.subtitle { color: var(--text-muted); font-size: 15px; margin-top: 4px; }
.text-accent { color: var(--accent); }

.section-title {
  font-size: 18px;
  font-weight: 700;
  margin: 24px 0 14px;
  color: var(--brown-dark);
}

/* ======================= BUTTONS ======================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  transition: var(--transition);
}
.btn .material-icons-round { font-size: 18px; }
.btn-primary { background: var(--accent); color: var(--white); }
.btn-primary:hover { background: var(--accent-dark); }
.btn-secondary { background: var(--beige-dark); color: var(--brown); }
.btn-secondary:hover { background: var(--beige-hover); }
.btn-danger { background: var(--red); color: var(--white); }
.btn-danger:hover { opacity: 0.9; }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--beige-light); color: var(--text); }
.btn-accent { background: var(--accent); color: var(--white); }
.btn-sm { padding: 7px 14px; font-size: 13px; border-radius: 8px; background: var(--beige-dark); color: var(--brown); }
.btn-sm:hover { background: var(--beige-hover); }
.btn-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--beige-dark); color: var(--brown); display: flex; align-items: center; justify-content: center; padding: 0; }
.btn-icon:hover { background: var(--beige-hover); }
.btn-large { padding: 14px 36px; font-size: 18px; font-weight: 700; border-radius: var(--radius); }

.header-actions { display: flex; gap: 10px; align-items: center; }

/* ======================= STATS GRID ======================= */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 10px;
}
.stat-card {
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 18px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow);
  transition: var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.stat-card.big { padding: 24px; }
.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.stat-value { font-size: 26px; font-weight: 800; display: block; }
.stat-label { color: var(--text-muted); font-size: 13px; }

/* ======================= ACTION CARDS ======================= */
.actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.action-card {
  background: var(--white);
  padding: 24px;
  border-radius: var(--radius-lg);
  text-align: right;
  box-shadow: var(--shadow);
  transition: var(--transition);
  border: 2px solid transparent;
}
.action-card:hover { border-color: var(--accent); box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.action-icon {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  margin-bottom: 14px;
  font-size: 24px;
}
.action-card h3 { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.action-card p { color: var(--text-muted); font-size: 13px; line-height: 1.5; }

/* ======================= CARDS GRID ======================= */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

/* ======================= QUIZ CARD ======================= */
.quiz-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: var(--transition);
  border-right: 4px solid var(--accent);
}
.quiz-card:hover { box-shadow: var(--shadow-lg); }
.quiz-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.quiz-card-title { font-size: 17px; font-weight: 700; }
.quiz-card-meta { color: var(--text-muted); font-size: 13px; }
.quiz-card-actions { display: flex; gap: 8px; margin-top: 12px; }

/* ======================= EMPTY STATE ======================= */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
  grid-column: 1 / -1;
}
.empty-state .material-icons-round { font-size: 64px; margin-bottom: 14px; display: block; }
.empty-state p { font-size: 16px; margin-bottom: 16px; }

/* ======================= FORMS ======================= */
.form-section {
  max-width: 700px;
}
.form-section label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--brown);
  margin: 18px 0 8px;
}
input[type="text"], input[type="number"], textarea {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--white);
  border: 2px solid var(--beige-dark);
  font-size: 15px;
  color: var(--text);
  transition: var(--transition);
}
input:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
.input-large { font-size: 22px; font-weight: 700; padding: 16px 20px; }
.input-area { min-height: 100px; resize: vertical; }

.input-with-btn { display: flex; gap: 10px; }
.input-with-btn input { flex: 1; }

.options-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }

.toggle-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--white);
  border: 2px solid var(--beige-dark);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  font-size: 14px;
}
.toggle-option:has(input:checked) { border-color: var(--accent); background: var(--accent-light); }
.toggle-option input { accent-color: var(--accent); }

.chip {
  padding: 8px 18px;
  border-radius: 20px;
  background: var(--beige-dark);
  color: var(--brown);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: 2px solid transparent;
}
.chip:hover { background: var(--beige-hover); }
.chip.active { background: var(--accent); color: var(--white); }
.time-chips { display: flex; gap: 8px; margin-top: 10px; }

.chips-container { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.member-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--white);
  border: 1px solid var(--beige-dark);
  border-radius: 20px;
  font-size: 13px;
}
.member-chip .remove-chip {
  cursor: pointer;
  color: var(--red);
  font-size: 16px;
  line-height: 1;
}

.number-selector {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: center;
  margin-top: 16px;
}
.number-display {
  font-size: 36px;
  font-weight: 900;
  color: var(--accent-dark);
  width: 60px;
  text-align: center;
}

/* ======================= QUIZ BUILDER LAYOUT ======================= */
.quiz-builder-layout {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.questions-sidebar {
  width: 220px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  position: sticky;
  top: 20px;
  flex-shrink: 0;
}
.sidebar-section-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--brown-dark);
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--beige-dark);
}
.sidebar-section-title .material-icons-round { font-size: 18px; color: var(--accent); }
.questions-nav-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
  max-height: 400px;
  overflow-y: auto;
}
.q-nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  transition: var(--transition);
  background: transparent;
  border: none;
  width: 100%;
  text-align: right;
}
.q-nav-item:hover { background: var(--beige-light); color: var(--text); }
.q-nav-item.active { background: var(--accent-light); color: var(--accent-dark); }
.q-nav-num {
  min-width: 24px; height: 24px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800;
  color: var(--white);
  flex-shrink: 0;
}
.q-nav-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.add-question-bar-mini {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  padding-top: 10px;
  border-top: 1px solid var(--beige-dark);
}
.add-question-bar-mini .btn-sm {
  flex: 1;
  min-width: 40px;
  justify-content: center;
  padding: 6px;
}
.add-question-bar-mini .btn-sm .material-icons-round { font-size: 16px; }

/* Title with image upload */
.title-with-image {
  display: flex;
  gap: 10px;
  align-items: center;
}
.title-with-image input { flex: 1; }
.image-upload-btn {
  width: 48px; height: 48px;
  border-radius: var(--radius-sm);
  background: var(--beige-dark);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}
.image-upload-btn:hover { background: var(--accent-light); }
.image-upload-btn .material-icons-round { font-size: 24px; color: var(--brown); }
.cover-preview {
  margin-top: 10px;
  text-align: center;
}
.cover-preview img {
  max-width: 300px;
  max-height: 150px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  box-shadow: var(--shadow);
  display: inline-block;
}
.cover-preview .remove-cover {
  display: inline-flex; align-items: center; gap: 4px;
  margin-top: 6px; padding: 4px 10px; border-radius: 6px;
  background: var(--red); color: white; font-size: 12px;
  cursor: pointer; border: none; font-family: inherit;
}

/* Question image */
.question-image-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.question-image-row .question-text-input { flex: 1; margin-bottom: 0; }
.q-image-preview {
  margin-bottom: 10px;
  text-align: center;
}
.q-image-preview img {
  max-width: 100%;
  max-height: 120px;
  border-radius: 8px;
  object-fit: cover;
  display: inline-block;
}
.q-image-preview .remove-q-image {
  display: inline-flex; align-items: center; gap: 4px;
  margin-top: 4px; padding: 3px 8px; border-radius: 6px;
  background: var(--red); color: white; font-size: 11px;
  cursor: pointer; border: none; font-family: inherit;
}

/* Apply time to all button */
.time-all-modal {
  text-align: center;
}
.time-all-modal h3 { margin-bottom: 16px; font-size: 18px; color: var(--brown-dark); }
.time-all-chips {
  display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-bottom: 20px;
}

/* ======================= QUIZ BUILDER ======================= */
.quiz-builder { flex: 1; min-width: 0; max-width: 800px; }
.quiz-title-section { margin-bottom: 24px; }

@media (max-width: 900px) {
  .quiz-builder-layout { flex-direction: column; }
  .questions-sidebar { width: 100%; position: static; flex-direction: row; }
}

.question-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  border-right: 4px solid var(--accent);
  animation: slideIn 0.3s ease;
}
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

.question-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.question-number {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  color: var(--white);
}

.question-text-input {
  width: 100%;
  padding: 14px;
  border: 2px solid var(--beige-dark);
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 14px;
  background: var(--beige-light);
}
.question-text-input:focus { border-color: var(--accent); }

.options-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.option-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.option-check {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 2px solid var(--beige-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
  color: transparent;
  font-size: 18px;
}
.option-check.correct { background: var(--green); border-color: var(--green); color: var(--white); }
.option-input {
  flex: 1;
  padding: 10px 14px;
  border: 2px solid var(--beige-dark);
  border-radius: 10px;
  font-size: 14px;
  background: var(--beige-light);
}
.option-input:focus { border-color: var(--accent); }

.tf-options { display: flex; gap: 12px; }
.tf-btn {
  flex: 1;
  padding: 16px;
  border-radius: var(--radius-sm);
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  border: 2px solid var(--beige-dark);
  background: var(--beige-light);
  cursor: pointer;
  transition: var(--transition);
}
.tf-btn.selected-true { background: #E8F5E9; border-color: var(--green); color: var(--green); }
.tf-btn.selected-false { background: #FFEBEE; border-color: var(--red); color: var(--red); }

.order-items { display: flex; flex-direction: column; gap: 8px; }
.order-item {
  display: flex;
  align-items: center;
  gap: 10px;
}
.order-num {
  width: 30px; height: 30px; border-radius: 8px; background: var(--accent-light);
  color: var(--accent-dark); display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; flex-shrink: 0;
}

.question-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.time-select {
  display: flex;
  gap: 4px;
}
.time-chip {
  padding: 5px 12px;
  border-radius: 8px;
  background: var(--beige-dark);
  color: var(--brown);
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition);
}
.time-chip.active { background: var(--accent); color: var(--white); }

.explanation-input {
  flex: 1;
  padding: 8px 14px;
  border: 1px solid var(--beige-dark);
  border-radius: 8px;
  font-size: 13px;
  background: var(--beige-light);
}

.add-question-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  flex-wrap: wrap;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
}

/* ======================= LIVE SESSION ======================= */
.live-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.live-badge {
  background: var(--red);
  color: var(--white);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 800;
  animation: pulse 1.5s infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.6; } }
.live-info { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.live-code { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-muted); }
.code-big { font-size: 24px; font-weight: 900; color: var(--accent-dark); letter-spacing: 4px; }
.live-count { display: flex; align-items: center; gap: 6px; color: var(--text-muted); }
.timer-display { display: flex; align-items: center; gap: 6px; font-weight: 700; color: var(--red); font-size: 18px; }

.live-body {
  text-align: center;
}

/* Waiting screen */
.waiting-screen { padding: 40px; }
.waiting-screen h2 { font-size: 24px; margin-bottom: 16px; }
.students-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 20px;
}
.student-badge {
  padding: 8px 18px;
  background: var(--white);
  border-radius: 20px;
  box-shadow: var(--shadow);
  font-size: 14px;
  font-weight: 600;
  animation: popIn 0.3s ease;
}
@keyframes popIn { from { transform: scale(0); } to { transform: scale(1); } }

/* Question display */
.live-question {
  max-width: 800px;
  margin: 0 auto;
}
.question-counter {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.timer-bar {
  height: 8px;
  background: var(--beige-dark);
  border-radius: 4px;
  margin-bottom: 20px;
  overflow: hidden;
}
.timer-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.1s linear;
}
.live-question-text {
  font-size: 24px;
  font-weight: 800;
  padding: 30px;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}
.live-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.live-option {
  padding: 24px;
  border-radius: var(--radius);
  color: var(--white);
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.live-option:nth-child(1) { background: var(--option-1); }
.live-option:nth-child(2) { background: var(--option-2); }
.live-option:nth-child(3) { background: var(--option-3); }
.live-option:nth-child(4) { background: var(--option-4); }
.answer-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.3);
  border-radius: 8px;
  padding: 2px 10px;
  font-size: 14px;
}

/* Timer circle */
.timer-circle {
  width: 80px; height: 80px;
  border-radius: 50%;
  border: 5px solid var(--beige-dark);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 900;
  margin: 0 auto 14px;
  transition: border-color 0.3s;
}
.timer-circle.warning { border-color: var(--red); color: var(--red); }

/* Leaderboard */
.leaderboard { max-width: 600px; margin: 0 auto; }
.leaderboard h2 { text-align: center; font-size: 22px; margin-bottom: 20px; color: var(--accent-dark); }
.lb-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  background: var(--white);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  box-shadow: var(--shadow);
  animation: slideIn 0.3s ease;
}
.lb-row.first { border: 2px solid var(--accent); background: var(--accent-light); }
.lb-rank {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px;
}
.lb-name { flex: 1; font-weight: 600; }
.lb-score { font-weight: 800; font-size: 18px; color: var(--accent-dark); }

/* ======================= DISCUSSION LIVE ======================= */
.disc-live-body { max-width: 700px; }
.disc-replies { max-height: 500px; overflow-y: auto; }
.disc-reply {
  background: var(--white);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
  animation: slideIn 0.3s ease;
}
.disc-reply.pinned { border-right: 3px solid var(--accent); background: #FFF8F0; }
.disc-reply.best { border-right: 3px solid var(--green); background: #F1F8F0; }
.disc-reply-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.disc-reply-author { font-weight: 600; font-size: 13px; color: var(--accent-dark); }
.disc-reply-text { font-size: 15px; line-height: 1.6; margin-bottom: 8px; }
.disc-reply-actions { display: flex; gap: 14px; }
.disc-reply-actions button {
  display: inline-flex; align-items: center; gap: 4px;
  background: transparent; color: var(--text-muted); font-size: 13px;
  padding: 4px 8px; border-radius: 6px; transition: var(--transition);
}
.disc-reply-actions button:hover { background: var(--beige-light); color: var(--accent); }
.disc-reply-actions button .material-icons-round { font-size: 16px; }
.disc-reply-actions .liked { color: var(--pink); }
.disc-stats-bar {
  display: flex; gap: 20px; padding: 14px; background: var(--white);
  border-radius: var(--radius-sm); box-shadow: var(--shadow); margin-top: 12px;
  color: var(--text-muted); font-size: 14px;
}
.disc-stats-bar span { display: flex; align-items: center; gap: 4px; }

/* ======================= TEAMS ======================= */
.teams-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.team-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.team-header {
  padding: 14px 18px;
  color: var(--white);
  font-weight: 700;
  font-size: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.team-members { padding: 8px 0; }
.team-member {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 18px;
  border-bottom: 1px solid var(--beige-light);
  font-size: 14px;
}
.team-member:last-child { border-bottom: none; }
.leader-badge {
  padding: 2px 8px; background: var(--accent-light); color: var(--accent-dark);
  border-radius: 8px; font-size: 11px; font-weight: 700;
}

/* ======================= SPIN WHEEL ======================= */
.wheel-section {
  display: flex;
  gap: 30px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.wheel-input-area { flex: 1; min-width: 250px; }
.wheel-canvas-area {
  display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.wheel-pointer { font-size: 32px; color: var(--accent-dark); line-height: 1; }
#wheel-canvas { border-radius: 50%; box-shadow: var(--shadow-lg); }
.wheel-result {
  padding: 16px 30px;
  background: var(--accent-light);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  font-size: 22px;
  font-weight: 800;
  color: var(--accent-dark);
  text-align: center;
}

/* ======================= ANALYTICS ======================= */
.analytics-tabs {
  display: flex;
  gap: 4px;
  background: var(--white);
  padding: 4px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  box-shadow: var(--shadow);
  width: fit-content;
}
.tab-btn {
  padding: 10px 24px;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  transition: var(--transition);
}
.tab-btn:hover { background: var(--beige-light); }
.tab-btn.active { background: var(--accent); color: var(--white); }
.charts-area { margin-top: 20px; }

/* ======================= RESULTS (NEW) ======================= */
.results-confetti {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 50;
}
.confetti-piece {
  position: absolute;
  top: -20px;
  animation: confettiFall linear forwards;
}
@keyframes confettiFall {
  0% { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  80% { opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

.results-title-section {
  text-align: center;
  margin-bottom: 10px;
  animation: fadeIn 0.5s ease;
}
.results-trophy {
  width: 80px; height: 80px;
  margin: 0 auto 12px;
  background: linear-gradient(135deg, #FFD700, #FFA000);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 30px rgba(255,215,0,0.4), 0 0 60px rgba(255,215,0,0.15);
  animation: trophyPulse 2s ease-in-out infinite;
}
.results-trophy .material-icons-round { font-size: 44px; color: #7A5C00; }
@keyframes trophyPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 30px rgba(255,215,0,0.4); }
  50% { transform: scale(1.08); box-shadow: 0 0 50px rgba(255,215,0,0.6), 0 0 80px rgba(255,215,0,0.2); }
}
.results-title-section h2 { font-size: 24px; color: var(--brown-dark); margin-bottom: 4px; }
.results-title-section p { color: var(--text-muted); font-size: 14px; }

/* New Podium */
.results-podium-new {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 14px;
  margin: 30px auto;
  max-width: 550px;
  min-height: 300px;
}
.podium-col-new {
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: podiumRise 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes podiumRise {
  from { opacity: 0; transform: translateY(80px) scale(0.8); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.podium-col-new.winner {
  animation: podiumRise 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) both, winnerGlow 2s ease-in-out 1s infinite;
}
@keyframes winnerGlow {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(255,215,0,0.3)); }
  50% { filter: drop-shadow(0 0 20px rgba(255,215,0,0.6)); }
}
.podium-avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 900;
  color: white;
  margin-bottom: 8px;
  border: 3px solid white;
  box-shadow: var(--shadow-lg);
}
.avatar-gold { background: linear-gradient(135deg, #FFD700, #FFA000); border-color: #FFD700; }
.avatar-silver { background: linear-gradient(135deg, #C0C0C0, #9E9E9E); border-color: #C0C0C0; }
.avatar-bronze { background: linear-gradient(135deg, #CD7F32, #A0522D); border-color: #CD7F32; }

.podium-col-new.winner .podium-avatar {
  width: 68px; height: 68px;
  font-size: 28px;
  animation: avatarBounce 1s ease 0.8s;
}
@keyframes avatarBounce {
  0%, 100% { transform: translateY(0); }
  30% { transform: translateY(-16px); }
  50% { transform: translateY(0); }
  70% { transform: translateY(-8px); }
}
.podium-name-new {
  font-size: 15px; font-weight: 700;
  color: var(--brown-dark);
  margin-bottom: 2px;
  max-width: 100px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}
.podium-score-new {
  font-size: 13px; font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.podium-bar-new {
  width: 100px;
  border-radius: 14px 14px 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}
.podium-col-new.winner .podium-bar-new {
  width: 115px;
  box-shadow: 0 4px 30px rgba(255,215,0,0.3);
}
.podium-medal { font-size: 32px; line-height: 1; }
.podium-place {
  font-size: 20px; font-weight: 900;
  color: rgba(255,255,255,0.9);
}

/* Results action buttons */
.results-actions-bar {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 30px;
  flex-wrap: wrap;
}

/* Report modal */
.report-modal {
  max-height: 70vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.report-modal h2 {
  display: flex; align-items: center; gap: 8px;
  font-size: 20px; margin-bottom: 4px;
}
.report-list {
  overflow-y: auto;
  max-height: 50vh;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.report-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--beige-light);
  border-radius: var(--radius-sm);
}
.report-rank {
  min-width: 30px; height: 30px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px;
  background: var(--beige-dark);
  color: var(--brown);
}
.report-rank.top { font-size: 13px; }
.report-name { flex: 1; font-weight: 600; font-size: 15px; }
.report-score { font-weight: 800; color: var(--accent-dark); font-size: 16px; }

/* Old podium (keep for backwards compat but hidden) */
.results-podium { display: none; }

/* ======================= SETTINGS ======================= */
.settings-info { margin-top: 30px; }
.app-badge {
  display: flex; align-items: center; gap: 12px;
  padding: 16px; background: var(--white); border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}
.app-badge p { color: var(--text-muted); font-size: 13px; }

/* ======================= MODAL ======================= */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(60,45,25,0.4);
  display: none; align-items: center; justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}
.modal-overlay.active { display: flex; }
.modal-content {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 30px;
  max-width: 550px;
  width: 92%;
  box-shadow: var(--shadow-lg);
  animation: popIn 0.3s ease;
  max-height: 85vh;
  overflow-y: auto;
}

/* ======================= ACTIVITY LIST ======================= */
.activity-list {}
.activity-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px; background: var(--white);
  border-radius: var(--radius-sm); margin-bottom: 8px;
  box-shadow: var(--shadow);
}
.activity-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.activity-text { flex: 1; }
.activity-text strong { display: block; font-size: 14px; }
.activity-text span { color: var(--text-muted); font-size: 12px; }

/* ======================= RESPONSIVE ======================= */
@media (max-width: 768px) {
  #sidebar {
    width: 64px;
    padding: 12px 6px;
  }
  #sidebar .logo-text,
  #sidebar .nav-btn span:not(.material-icons-round) { display: none; }
  #sidebar .sidebar-logo { justify-content: center; padding: 8px 0 16px; }
  #sidebar .nav-btn { justify-content: center; padding: 12px; }
  #main-content { margin-right: 64px; padding: 20px 16px; }
  .live-options { grid-template-columns: 1fr; }
  .options-grid { grid-template-columns: 1fr; }
  .wheel-section { flex-direction: column; }
}

.session-code-display {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 16px; background: var(--accent-light);
  border-radius: 20px; font-weight: 700; color: var(--accent-dark);
}

/* QR Code */
.qr-code-section {
  display: flex;
  align-items: center;
  gap: 24px;
  justify-content: center;
  margin: 16px 0;
  flex-wrap: wrap;
}
.qr-code-box {
  background: var(--white);
  padding: 16px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.qr-code-box img {
  width: 180px;
  height: 180px;
  image-rendering: pixelated;
}
.qr-code-box p {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
}
.code-and-qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

/* Mode cards */
.group-mode-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 10px 0 18px;
}
.mode-card {
  background: var(--white);
  border: 2px solid var(--beige-dark);
  border-radius: var(--radius);
  padding: 18px 14px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}
.mode-card:hover { border-color: var(--accent); }
.mode-card.active { border-color: var(--accent); background: var(--accent-light); }
.mode-card .material-icons-round { font-size: 32px; color: var(--accent); display: block; margin-bottom: 8px; }
.mode-card strong { font-size: 15px; display: block; margin-bottom: 4px; color: var(--brown-dark); }
.mode-card p { font-size: 12px; color: var(--text-muted); margin: 0; }

/* QR join section */
.qr-join-section {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-top: 16px;
  padding: 20px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.qr-join-info {
  flex: 1;
  min-width: 200px;
}
.qr-join-info > p:first-child { color: var(--text-muted); font-size: 13px; margin-bottom: 4px; }
.qr-join-count {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 12px 0;
  font-weight: 700;
  color: var(--accent-dark);
  font-size: 16px;
}
.qr-join-count .material-icons-round { font-size: 20px; }

/* Team names editing */
.team-names-area {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}
.team-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.team-name-color {
  width: 28px; height: 28px;
  border-radius: 8px;
  flex-shrink: 0;
}
.team-name-row input {
  flex: 1;
  padding: 8px 12px;
  font-size: 14px;
}

/* Discussion mini QR */
.disc-qr-mini {
  cursor: pointer;
}
.disc-qr-mini img {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  border: 2px solid var(--beige-dark);
  image-rendering: pixelated;
  transition: var(--transition);
}
.disc-qr-mini img:hover {
  border-color: var(--accent);
  transform: scale(1.1);
}

/* Multi-correct option */
.option-check.partial {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--white);
}

/* ======================= AUTH SCREEN ======================= */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  padding: 20px;
  position: relative;
  z-index: 1;
}
.auth-container {
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 48px 40px;
  width: 100%;
  max-width: 440px;
}
.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}
.auth-logo svg { width: 64px; height: 64px; margin-bottom: 12px; }
.auth-logo h1 { font-size: 28px; color: var(--brown-dark); margin-bottom: 4px; }
.auth-logo p { color: var(--text-muted); font-size: 14px; }
.auth-form h2 { font-size: 20px; margin-bottom: 20px; text-align: center; color: var(--brown); }
.auth-card {
  background: var(--beige-light);
  border: 2px solid var(--beige-dark);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 16px;
}
.auth-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.auth-label:not(:first-child) {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--beige-dark);
}
.auth-input {
  width: 100%;
  padding: 10px 0;
  background: transparent !important;
  font-size: 15px;
  color: var(--text);
  border: none !important;
  box-shadow: none !important;
  border-radius: 0;
  outline: none;
}
.auth-input::placeholder { color: var(--text-light); }
.auth-btn { width: 100%; justify-content: center; margin-top: 8px; }
.auth-divider {
  text-align: center;
  margin: 16px 0;
  color: var(--text-muted);
  font-size: 13px;
  position: relative;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 38%;
  height: 1px;
  background: var(--beige-dark);
}
.auth-divider::before { right: 0; }
.auth-divider::after { left: 0; }
.auth-switch {
  text-align: center;
  margin-top: 20px;
  font-size: 14px;
  color: var(--text-muted);
}
.auth-switch a { color: var(--accent-dark); font-weight: 700; }
.auth-switch a:hover { text-decoration: underline; }
.auth-error {
  background: #FFF0F0;
  color: var(--red);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 12px;
  display: none;
}

/* ======================= SETTINGS SECTIONS ======================= */
.settings-section {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.settings-section h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  color: var(--brown);
  margin-bottom: 16px;
}
.settings-section h3 .material-icons-round { font-size: 22px; color: var(--accent); }

.account-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--beige-light);
  border-radius: var(--radius-sm);
}
.account-avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.account-avatar .material-icons-round { font-size: 28px; color: var(--accent); }
.account-info { flex: 1; }
.account-info strong { display: block; font-size: 16px; }
.account-info .text-muted { display: block; font-size: 13px; color: var(--text-muted); margin: 2px 0 6px; }
.plan-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
}
.plan-free { background: var(--beige-dark); color: var(--brown); }
.plan-medium { background: #E3F2FD; color: #1565C0; }
.plan-full { background: #FFF3E0; color: #E65100; }

/* Language Cards */
.lang-cards {
  display: flex;
  gap: 8px;
}
.lang-card {
  background: var(--beige-light);
  border: 2px solid var(--beige-dark);
  border-radius: 8px;
  padding: 6px 18px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}
.lang-card:hover { border-color: var(--accent); }
.lang-card.active { border-color: var(--accent); background: var(--accent-light); }
.lang-flag { font-size: 16px; }
.lang-card strong { font-size: 13px; color: var(--brown-dark); }
.lang-card p { display: none; }

/* ======================= PLANS PAGE ======================= */
.plans-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 8px;
}
.plan-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
  transition: var(--transition);
}
.plan-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.plan-featured {
  border: 3px solid var(--accent);
  transform: scale(1.04);
}
.plan-featured:hover { transform: scale(1.04) translateY(-4px); }
.plan-popular {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--accent);
  color: var(--white);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  z-index: 1;
}
.plan-header {
  padding: 32px 24px;
  text-align: center;
  color: var(--white);
}
.plan-header .material-icons-round { font-size: 40px; margin-bottom: 8px; }
.plan-header h3 { font-size: 22px; margin-bottom: 8px; }
.plan-price { font-size: 36px; font-weight: 900; }
.plan-price small { font-size: 14px; font-weight: 500; }
.plan-free-bg { background: linear-gradient(135deg, #8B7355, #A89070); }
.plan-medium-bg { background: linear-gradient(135deg, #4A7FB5, #5B9ECE); }
.plan-full-bg { background: linear-gradient(135deg, var(--accent), #D4A574); }
.plan-features {
  list-style: none;
  padding: 24px;
}
.plan-features li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  font-size: 14px;
  border-bottom: 1px solid var(--beige);
}
.plan-features li:last-child { border: none; }
.plan-features .check { color: var(--green); font-size: 20px; }
.plan-features .cross { color: var(--text-light); font-size: 20px; }
.plan-btn {
  display: block;
  width: calc(100% - 48px);
  margin: 0 24px 24px;
  text-align: center;
  justify-content: center;
}

/* ======================= ENHANCED ANALYTICS ======================= */
.analytics-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 16px;
  box-shadow: var(--shadow);
}
.analytics-card h3 {
  font-size: 16px;
  color: var(--brown);
  margin-bottom: 16px;
}
.bar-chart-container {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 180px;
  padding-top: 10px;
}
.bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
  justify-content: flex-end;
}
.bar-fill {
  width: 100%;
  max-width: 48px;
  border-radius: 6px 6px 0 0;
  transition: height 0.6s ease;
  min-height: 4px;
}
.bar-label {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60px;
}
.bar-value {
  font-size: 12px;
  font-weight: 700;
  color: var(--brown);
}
.analytics-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.analytics-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--beige-light);
  border-radius: var(--radius-sm);
}
.analytics-rank {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
.analytics-row-name { flex: 1; font-weight: 600; font-size: 14px; }
.analytics-row-score { font-weight: 700; color: var(--accent-dark); }

.analytics-sessions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.session-row {
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 16px;
}
.session-row-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.session-row-icon .material-icons-round { color: var(--white); }
.session-row-info { flex: 1; }
.session-row-info strong { display: block; font-size: 15px; }
.session-row-info span { color: var(--text-muted); font-size: 13px; }
.session-row-stat { text-align: center; }
.session-row-stat strong { display: block; font-size: 18px; color: var(--accent-dark); }
.session-row-stat span { font-size: 11px; color: var(--text-muted); }

/* Plan locked overlay */
.feature-locked {
  position: relative;
  pointer-events: none;
  opacity: 0.5;
}
.lock-overlay {
  position: absolute;
  inset: 0;
  background: rgba(245,240,232,0.7);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: all;
  cursor: pointer;
  z-index: 5;
}
.lock-overlay .material-icons-round { font-size: 36px; color: var(--brown); margin-bottom: 4px; }
.lock-overlay span:last-child { font-size: 13px; color: var(--brown); font-weight: 600; }

/* Plans Promo on Home */
.plans-promo {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}
.promo-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.promo-header .material-icons-round { color: var(--accent); font-size: 24px; }
.promo-header h2 { font-size: 17px; color: var(--brown); margin: 0; }
.promo-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.promo-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--beige-light);
  border: 2px solid var(--beige-dark);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}
.promo-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.promo-icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.promo-icon .material-icons-round { color: #fff; font-size: 22px; }
.promo-info { flex: 1; }
.promo-info strong { display: block; font-size: 14px; color: var(--brown-dark); }
.promo-info > span { font-size: 16px; font-weight: 800; color: var(--accent-dark); }
.promo-info > span small { font-size: 11px; font-weight: 500; }
.promo-info p { font-size: 11px; color: var(--text-muted); margin: 2px 0 0; }

/* Subscription dates */
.sub-dates {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}
.sub-dates .material-icons-round { font-size: 14px; }

/* Themes grid */
.themes-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}
.theme-card {
  background: var(--beige-light);
  border: 2px solid var(--beige-dark);
  border-radius: 10px;
  padding: 8px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}
.theme-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.theme-card.active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.theme-card.locked { opacity: 0.45; cursor: not-allowed; }
.theme-preview {
  width: 100%;
  height: 40px;
  border-radius: 6px;
  margin-bottom: 6px;
  position: relative;
  overflow: hidden;
}
.theme-accent {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 50%;
  height: 14px;
  border-radius: 6px 0 0 0;
}
.theme-card span {
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
}
.theme-card .theme-lock {
  font-size: 12px;
  color: var(--text-muted);
  display: block;
  margin-top: 2px;
}
@media (max-width: 768px) {
  .themes-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Theme overrides */
[data-theme="ocean"] {
  --beige: #E8F4F8; --beige-dark: #C8E0E8; --beige-light: #F2F9FB; --beige-hover: #D8ECF2;
  --brown: #1A6B8A; --brown-dark: #0D4F6B; --brown-light: #3A8AAA;
  --accent: #2196F3; --accent-dark: #1565C0; --accent-light: #BBDEFB;
  --text: #1A3A4A; --text-muted: #5A8A9A; --text-light: #90B8C8;
}
[data-theme="forest"] {
  --beige: #E8F5E9; --beige-dark: #C8E6C9; --beige-light: #F1F8F2; --beige-hover: #D8ECD9;
  --brown: #2E7D32; --brown-dark: #1B5E20; --brown-light: #4CAF50;
  --accent: #4CAF50; --accent-dark: #2E7D32; --accent-light: #C8E6C9;
  --text: #1B3A1D; --text-muted: #5A8A5C; --text-light: #90B892;
}
[data-theme="lavender"] {
  --beige: #F3E8F9; --beige-dark: #D8C0E8; --beige-light: #F9F2FC; --beige-hover: #E8D4F2;
  --brown: #6A1B9A; --brown-dark: #4A148C; --brown-light: #8E24AA;
  --accent: #9C27B0; --accent-dark: #7B1FA2; --accent-light: #E1BEE7;
  --text: #2D1540; --text-muted: #7A5A8A; --text-light: #B090C0;
}
[data-theme="rose"] {
  --beige: #FDE8E8; --beige-dark: #F0C0C0; --beige-light: #FFF2F2; --beige-hover: #F5D0D0;
  --brown: #AD1457; --brown-dark: #880E4F; --brown-light: #C2185B;
  --accent: #E91E63; --accent-dark: #C2185B; --accent-light: #F8BBD0;
  --text: #3D1525; --text-muted: #9A5A6A; --text-light: #C090A0;
}
[data-theme="charcoal"] {
  --beige: #2D2D2D; --beige-dark: #3D3D3D; --beige-light: #383838; --beige-hover: #444;
  --brown: #E0E0E0; --brown-dark: #F5F5F5; --brown-light: #BDBDBD;
  --accent: #FF9800; --accent-dark: #F57C00; --accent-light: #4A4030;
  --text: #F0F0F0; --text-muted: #9E9E9E; --text-light: #757575;
  --white: #333; --shadow: 0 2px 12px rgba(0,0,0,0.3); --shadow-lg: 0 8px 30px rgba(0,0,0,0.4);
}
[data-theme="sunset"] {
  --beige: #FDE8D0; --beige-dark: #F0D0B8; --beige-light: #FFF2E8; --beige-hover: #F5DCC8;
  --brown: #BF360C; --brown-dark: #8B2500; --brown-light: #E64A19;
  --accent: #FF6B35; --accent-dark: #E65100; --accent-light: #FFCCBC;
  --text: #3D2010; --text-muted: #9A6A4A; --text-light: #C09878;
}
[data-theme="aurora"] {
  --beige: #E0F7FA; --beige-dark: #B2EBF2; --beige-light: #F0FCFD; --beige-hover: #C8F2F6;
  --brown: #00695C; --brown-dark: #004D40; --brown-light: #00897B;
  --accent: #00BCD4; --accent-dark: #00838F; --accent-light: #B2EBF2;
  --text: #0D3030; --text-muted: #4A8A8A; --text-light: #80B8B8;
}
[data-theme="royal"] {
  --beige: #EDE7F6; --beige-dark: #D1C4E9; --beige-light: #F5F0FA; --beige-hover: #DDD4ED;
  --brown: #4527A0; --brown-dark: #311B92; --brown-light: #5E35B1;
  --accent: #673AB7; --accent-dark: #512DA8; --accent-light: #D1C4E9;
  --text: #1A1040; --text-muted: #6A5A8A; --text-light: #9A8AB8;
}
[data-theme="golden"] {
  --beige: #FFF8E1; --beige-dark: #FFECB3; --beige-light: #FFFBEF; --beige-hover: #FFF0C0;
  --brown: #E65100; --brown-dark: #BF360C; --brown-light: #F57C00;
  --accent: #FFB300; --accent-dark: #FF8F00; --accent-light: #FFECB3;
  --text: #3D2D00; --text-muted: #9A7A30; --text-light: #C0A060;
}

/* Danger zone */
.danger-actions { display: flex; flex-direction: column; }
.settings-section h3 .material-icons-round[style] { color: var(--red) !important; }

@media (max-width: 768px) {
  .plans-grid { grid-template-columns: 1fr; }
  .plan-featured { transform: none; }
  .plan-featured:hover { transform: translateY(-4px); }
  .auth-container { padding: 32px 24px; }
  .promo-cards { grid-template-columns: 1fr; }
}
