:root {
  --bg-main: #0c0e1f;
  --bg-sidebar: #0a0b19;
  --bg-card: #14162c;
  --bg-card-alt: #171a33;
  --border-subtle: #23253f;
  --text-primary: #f3f4f8;
  --text-secondary: #9295b2;
  --text-muted: #6b6e8a;
  --accent-purple: #6a5cf5;
  --accent-purple-dark: #4d3fd6;
  --accent-green: #33c481;
  --accent-orange: #d97b32;
  --accent-blue: #4a7fd9;
  --accent-pink: #e0508a;
  --accent-red: #e05555;
  --star: #f0a93a;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg-main);
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
}

a { color: inherit; text-decoration: none; }

.app-shell {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  flex-shrink: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 24px 8px;
}

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-purple-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
}

.brand-title { font-weight: 700; font-size: 16px; line-height: 1.2; }
.brand-subtitle { font-size: 11px; color: var(--text-muted); }

.nav-list { list-style: none; padding: 0; margin: 8px 0; flex: 1; }

.nav-item a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 4px;
  transition: background .15s, color .15s;
}

.nav-item a:hover { background: var(--bg-card); color: var(--text-primary); }

.nav-item.active a {
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-purple-dark));
  color: #fff;
}

.nav-icon { width: 18px; text-align: center; }

.sidebar-profile {
  border-top: 1px solid var(--border-subtle);
  padding-top: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 8px 0 8px;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  flex-shrink: 0;
}

.profile-name { font-weight: 600; font-size: 13px; }
.profile-role { font-size: 11px; color: var(--text-muted); }
.profile-info { flex: 1; }
.profile-caret { color: var(--text-muted); font-size: 12px; }

/* Main content */
.main-content { flex: 1; padding: 28px 32px; max-width: 1400px; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
}

.welcome-title { font-size: 24px; font-weight: 700; margin: 0 0 4px 0; }
.welcome-sub { color: var(--text-secondary); margin: 0; font-size: 13px; }

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

.topbar-date { display: flex; align-items: center; gap: 10px; color: var(--text-secondary); font-size: 13px; }
.topbar-date .date-icon { color: var(--accent-purple); font-size: 18px; }

.bell-wrap { position: relative; color: var(--text-secondary); font-size: 18px; }
.bell-badge {
  position: absolute; top: -6px; right: -8px;
  background: var(--accent-purple); color: #fff;
  font-size: 10px; font-weight: 700;
  width: 16px; height: 16px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}

/* Grid layout */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1.6fr 1.4fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.grid-row-2 { display: grid; grid-template-columns: 1.6fr 1.4fr 1fr; gap: 20px; margin-bottom: 20px; }

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.card-label {
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--accent-purple);
  margin-bottom: 14px;
}

.card-header-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.view-all-link { font-size: 12px; color: var(--accent-purple); font-weight: 600; }

/* Presenter spotlight card */
.presenter-card { background: linear-gradient(135deg, #4b3fce 0%, #6a5cf5 60%, #7d6ef9 100%); border: none; }
.presenter-card .card-label { color: rgba(255,255,255,.8); }
.presenter-top { display: flex; justify-content: space-between; align-items: flex-start; }
.presenter-name { font-size: 28px; font-weight: 800; margin: 4px 0 6px 0; }
.presenter-week { font-size: 13px; color: rgba(255,255,255,.85); margin-bottom: 20px; }
.crown-badge {
  width: 56px; height: 56px; border-radius: 50%;
  background: rgba(255,255,255,.18);
  display: flex; align-items: center; justify-content: center; font-size: 26px;
}
.pill-btn {
  display: inline-block;
  background: rgba(255,255,255,.16);
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}

/* Rotation list */
.rotation-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0;
}
.rotation-item:not(:last-child) { border-bottom: 1px solid var(--border-subtle); }
.rotation-number {
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.rotation-name { flex: 1; font-weight: 600; }
.this-week-tag {
  background: var(--accent-purple); color: #fff;
  font-size: 11px; font-weight: 600;
  padding: 4px 10px; border-radius: 999px;
}
.btn-outline {
  display: block; text-align: center; width: 100%;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card-alt);
  color: var(--accent-purple);
  padding: 10px; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 13px; margin-top: 12px;
}

/* Buttons */
.btn-primary {
  display: block; width: 100%; text-align: center;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-purple-dark));
  color: #fff; padding: 12px; border-radius: var(--radius-sm);
  font-weight: 700; font-size: 13px; border: none; cursor: pointer;
}

/* Team members */
.member-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; }
.member-link { color: inherit; display: flex; border-radius: var(--radius-md); transition: background .2s ease; }
.member-link:hover { background: rgba(106, 92, 245, 0.12); }
.member-name { font-weight: 600; font-size: 13px; }
.member-role { font-size: 11px; color: var(--text-muted); }

/* Documents */
.doc-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; }
.doc-icon {
  width: 36px; height: 36px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.doc-title { font-weight: 600; font-size: 13px; }
.doc-meta { font-size: 11px; color: var(--text-muted); }

/* Upcoming sessions empty state */
.empty-state { text-align: center; padding: 20px 8px; }
.empty-icon {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--bg-card-alt);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px auto; font-size: 20px; color: var(--text-muted);
}
.empty-title { font-weight: 700; margin-bottom: 6px; }
.empty-desc { font-size: 12px; color: var(--text-muted); line-height: 1.4; }

/* Stats row */
.stats-row { display: flex; justify-content: space-around; flex-wrap: wrap; gap: 12px; }
.stat-item { text-align: center; flex: 1; min-width: 90px; }
.stat-icon {
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 10px auto; font-size: 18px; color: #fff;
}
.stat-value { font-size: 22px; font-weight: 800; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 2px; line-height: 1.3; }

/* History table */
table.history-table { width: 100%; border-collapse: collapse; }
table.history-table th {
  text-align: left; font-size: 11px; text-transform: uppercase;
  color: var(--text-muted); font-weight: 700; padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
}
table.history-table td {
  padding: 12px 8px 12px 0; font-size: 13px;
  border-bottom: 1px solid var(--border-subtle);
}
table.history-table tr:last-child td { border-bottom: none; }
.role-tag { color: var(--accent-purple); font-weight: 600; }
.stars { color: var(--star); letter-spacing: 1px; }

/* Workflow */
.workflow-card { grid-column: 1 / -1; }
.workflow-steps { display: flex; align-items: flex-start; justify-content: space-between; margin-top: 10px; position: relative; }
.workflow-step { flex: 1; text-align: center; position: relative; padding: 0 8px; }
.workflow-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 18px; left: 55%;
  width: 90%;
  border-top: 2px dashed var(--border-subtle);
  z-index: 0;
}
.step-badge {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 14px;
  margin: 0 auto 12px auto; position: relative; z-index: 1;
}
.step-icon { font-size: 22px; margin-bottom: 10px; }
.step-title { font-weight: 700; font-size: 13px; margin-bottom: 6px; }
.step-desc { font-size: 11.5px; color: var(--text-muted); line-height: 1.4; max-width: 160px; margin: 0 auto; }

@media (max-width: 1100px) {
  .dashboard-grid, .grid-row-2 { grid-template-columns: 1fr; }
  .workflow-steps { flex-direction: column; gap: 20px; }
  .workflow-step::after { display: none; }
}

/* Wheel */
.wheel-shell { display: flex; justify-content: center; margin-bottom: 18px; position: relative; }
.wheel {
  width: 220px; height: 220px; border-radius: 50%; background: conic-gradient(var(--accent-purple), var(--accent-pink), var(--accent-blue), var(--accent-green), var(--accent-purple));
  position: relative; border: 10px solid rgba(255,255,255,.1); box-shadow: 0 18px 40px rgba(0,0,0,.3); transition: transform 4s cubic-bezier(.2,.8,.2,1); }
}
.wheel::before { content: ''; position: absolute; inset: 12px; border-radius: 50%; background: var(--bg-card); }
.wheel-center {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--text-primary); z-index: 1; }
.wheel-pointer {
  position: absolute; top: -6px; left: 50%; transform: translateX(-50%); width: 0; height: 0; border-left: 12px solid transparent; border-right: 12px solid transparent; border-top: 24px solid #fff; z-index: 2;
}
.selected-presenter { font-weight: 600; color: var(--accent-purple); margin-bottom: 12px; }

/* Forms (login/signup/upload) */
.auth-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--bg-main);
}
.auth-card {
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); padding: 36px; width: 380px;
}
.auth-card h2 { margin-top: 0; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 12px; color: var(--text-secondary); margin-bottom: 6px; font-weight: 600; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 10px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle); background: var(--bg-card-alt);
  color: var(--text-primary); font-size: 13px;
}
.form-error { color: var(--accent-red); font-size: 12px; margin-top: 4px; }
.auth-footer { text-align: center; font-size: 13px; color: var(--text-muted); margin-top: 16px; }
.messages { list-style: none; padding: 0; margin: 0 0 16px 0; }
.messages li {
  padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 8px;
}
.messages li.success { background: rgba(51,196,129,.15); color: var(--accent-green); }
.messages li.error { background: rgba(224,85,85,.15); color: var(--accent-red); }

.page-card { background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 24px; margin-bottom: 20px; }
.page-title { font-size: 20px; font-weight: 700; margin-bottom: 18px; }
