/* ═══════════════════════════════════════════════════════════════
   ÁREA DO ALUNO — ACORDES PARA VIDA
   Identidade visual: Preto predominante + Dourado elegante
   ═══════════════════════════════════════════════════════════════ */

:root {
  --g: #cfb508;
  --gd: #9e8b06;
  --gl: #f0da30;
  --gp: #fff8d0;
  --bg: #080604;
  --bgc: #12100c;
  --bgp: #181510;
  --t: #f5eed8;
  --td: #bfb590;
  --b: rgba(207, 181, 8, 0.25);
  --br: rgba(207, 181, 8, 0.12);
  --f: 'Nunito', sans-serif;
  --fd: 'Cinzel', serif;
  --success: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;
  --shadow-card: 0 6px 0 rgba(0, 0, 0, 0.35), 0 10px 24px rgba(0, 0, 0, 0.45);
  --shadow-gold: 0 6px 0 #6d5d03, 0 10px 20px rgba(207, 181, 8, 0.3);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --transition: 0.22s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }

body {
  background: var(--bg);
  color: var(--t);
  font-family: var(--f);
  font-size: 1rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  position: relative;
  line-height: 1.6;
}

#topbarScreen {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
}

a { color: var(--gl); text-decoration: none; }
img { max-width: 100%; height: auto; }
button { cursor: pointer; font-family: var(--f); }
input, textarea, select { font-family: var(--f); }

/* ═══════════════════════════════════════════════════════════════
   BACKGROUND ANIMATIONS
   ═══════════════════════════════════════════════════════════════ */

.sparkles { position: fixed; inset: 0; z-index: 0; pointer-events: none; }

@keyframes floatNote {
  0% { transform: translateY(100vh) rotate(0deg) scale(0); opacity: 0; }
  10% { opacity: 0.15; }
  50% { opacity: 0.1; }
  90% { opacity: 0.15; }
  100% { transform: translateY(-120px) rotate(360deg) scale(1); opacity: 0; }
}

.music-notes { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.music-note { position: absolute; color: var(--g); opacity: 0; font-size: 24px; animation: floatNote 9s linear infinite; }
.music-note:nth-child(1) { left: 5%; animation-delay: 0s; }
.music-note:nth-child(2) { left: 15%; animation-delay: 2.5s; font-size: 28px; }
.music-note:nth-child(3) { left: 25%; animation-delay: 4.5s; font-size: 18px; }
.music-note:nth-child(4) { left: 70%; animation-delay: 1.2s; font-size: 22px; }
.music-note:nth-child(5) { left: 82%; animation-delay: 3.5s; font-size: 20px; }
.music-note:nth-child(6) { left: 90%; animation-delay: 5.5s; font-size: 30px; }
.music-note:nth-child(7) { left: 35%; animation-delay: 6.5s; font-size: 20px; }
.music-note:nth-child(8) { left: 55%; animation-delay: 2.8s; font-size: 16px; }

/* ═══════════════════════════════════════════════════════════════
   LOGIN SCREEN
   ═══════════════════════════════════════════════════════════════ */

.login-screen {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: linear-gradient(175deg, var(--bgc), var(--bgp));
  border: 2px solid var(--b);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card), inset 0 1px 0 rgba(207, 181, 8, 0.06);
  padding: 40px 32px;
  animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.login-logo {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin: 0 auto 16px;
  display: block;
  border: 3px solid var(--g);
  box-shadow: 0 4px 0 var(--gd), 0 8px 20px rgba(207, 181, 8, 0.25);
  object-fit: cover;
}

.login-title {
  font-family: var(--fd);
  font-size: 1.5rem;
  color: var(--gl);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 6px;
  text-shadow: 0 0 20px rgba(207, 181, 8, 0.2);
}

.login-subtitle {
  text-align: center;
  color: var(--td);
  font-size: 0.9rem;
  margin-bottom: 28px;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  color: var(--g);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 6px;
  font-weight: 700;
}

.form-input {
  width: 100%;
  padding: 14px 16px;
  background: rgba(8, 6, 4, 0.6);
  border: 2px solid var(--b);
  border-radius: var(--radius-sm);
  color: var(--t);
  font-size: 1rem;
  transition: all var(--transition);
  outline: none;
}

.form-input:focus {
  border-color: var(--g);
  box-shadow: 0 0 0 3px rgba(207, 181, 8, 0.15);
}

.form-input::placeholder { color: rgba(191, 181, 144, 0.4); }

.tools-link-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.tools-link-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  background: rgba(18, 16, 12, 0.5);
  border: 1px solid var(--b);
  border-radius: var(--radius, 14px);
  text-decoration: none;
  transition: all var(--transition, 0.2s ease);
}
.tools-link-item:hover {
  border-color: var(--g);
  background: rgba(207, 181, 8, 0.06);
  transform: translateY(-1px);
}
.tools-link-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(207, 181, 8, 0.12);
  border: 1px solid rgba(207, 181, 8, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}
.tools-link-text { flex: 1; min-width: 0; }
.tools-link-text h3 {
  color: var(--gl);
  font-size: 1rem;
  margin-bottom: 4px;
}
.tools-link-text p {
  color: var(--td);
  font-size: 0.82rem;
  line-height: 1.4;
  margin: 0;
}
.tools-link-arrow {
  flex-shrink: 0;
  color: var(--td);
  font-size: 1.4rem;
  transition: color var(--transition, 0.2s ease);
}
.tools-link-item:hover .tools-link-arrow { color: var(--g); }

.annual-cal-wrap {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 16px;
  margin: 12px 0;
}
.annual-cal-month h4 {
  color: var(--g);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
  text-align: center;
}
.annual-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.annual-cal-daylabel {
  font-size: 0.65rem;
  color: var(--td);
  text-align: center;
  opacity: 0.6;
}
.annual-cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  border-radius: 4px;
  color: var(--t);
}
.annual-cal-day-empty { visibility: hidden; }
.annual-cal-day-today { border: 1px solid var(--g); font-weight: 700; }
.annual-cal-day-feriado { background: rgba(224, 93, 93, 0.55); color: #fff; }
.annual-cal-day-recesso { background: rgba(230, 150, 60, 0.55); color: #fff; }
.annual-cal-day-ferias { background: rgba(80, 140, 220, 0.55); color: #fff; }

.password-field-wrap { position: relative; }
.password-field-wrap .form-input { padding-right: 46px; }
.password-toggle-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 4px 6px;
  line-height: 1;
  color: var(--td);
  opacity: 0.8;
}
.password-toggle-btn:hover { opacity: 1; }

.role-selector {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.role-btn {
  flex: 1;
  padding: 12px;
  background: rgba(8, 6, 4, 0.6);
  border: 2px solid var(--b);
  border-radius: var(--radius-sm);
  color: var(--td);
  font-size: 0.9rem;
  font-weight: 700;
  transition: all var(--transition);
  text-align: center;
}

.role-btn:hover { border-color: var(--g); color: var(--gl); }
.role-btn.active {
  border-color: var(--g);
  color: var(--gl);
  background: rgba(207, 181, 8, 0.1);
  box-shadow: 0 0 0 3px rgba(207, 181, 8, 0.1);
}

/* ═══════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════ */

.btn-gold {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  background: linear-gradient(180deg, var(--gl), var(--g) 40%, var(--gd));
  border: none;
  border-radius: var(--radius);
  color: #080604;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-gold), inset 0 2px 0 rgba(255, 255, 255, 0.35);
  position: relative;
  top: 0;
  transition: all 0.18s ease;
  letter-spacing: 1px;
  text-transform: uppercase;
  width: 100%;
}

.btn-gold:hover { top: -3px; box-shadow: 0 10px 0 #6d5d03, 0 14px 28px rgba(207, 181, 8, 0.4), inset 0 2px 0 rgba(255, 255, 255, 0.35); }
.btn-gold:active { top: 3px; box-shadow: 0 3px 0 #6d5d03, 0 5px 10px rgba(207, 181, 8, 0.2); }
.btn-gold:disabled { opacity: 0.5; pointer-events: none; }

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  background: transparent;
  border: 2px solid var(--g);
  border-radius: var(--radius);
  color: var(--gl);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-outline:hover { background: rgba(207, 181, 8, 0.1); }

.btn-sm { padding: 8px 16px; font-size: 0.8rem; border-radius: var(--radius-sm); }

.btn-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: rgba(207, 181, 8, 0.1);
  color: var(--gl);
  cursor: pointer;
  transition: all var(--transition);
  font-size: 1.1rem;
}

.btn-icon:hover { background: rgba(207, 181, 8, 0.2); }

.btn-danger { background: linear-gradient(180deg, #f87171, #dc2626); color: #fff; box-shadow: 0 5px 0 #991b1b, 0 8px 16px rgba(239, 68, 68, 0.25); }
.btn-success { background: linear-gradient(180deg, #4ade80, #16a34a); color: #fff; box-shadow: 0 5px 0 #166534, 0 8px 16px rgba(34, 197, 94, 0.25); }

/* ═══════════════════════════════════════════════════════════════
   APP LAYOUT
   ═══════════════════════════════════════════════════════════════ */

.app-screen { display: none; position: relative; z-index: 2; }
.app-screen.active { display: flex; flex-direction: column; min-height: 100vh; animation: fadeIn 0.3s ease; }

.app-container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
  flex: 1;
}

/* ═══════════════════════════════════════════════════════════════
   TOP BAR
   ═══════════════════════════════════════════════════════════════ */

.topbar { position: sticky; top: 0; z-index: 100; background: linear-gradient(180deg, rgba(20, 17, 12, 0.97), rgba(14, 12, 8, 0.97)); border-bottom: 1px solid var(--b); backdrop-filter: blur(12px); padding: 10px 0; overflow-x: hidden; width: 100%; }

.topbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  width: 100%;
}

.topbar-logo { height: 36px; filter: drop-shadow(0 2px 4px rgba(207, 181, 8, 0.35)); }

.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid var(--g);
  object-fit: cover;
}

.topbar-name { color: var(--t); font-weight: 700; font-size: 0.9rem; }
.topbar-role { color: var(--g); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 1px; }

.topbar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.notification-badge {
  position: relative;
}

.notification-badge::after {
  content: attr(data-count);
  position: absolute;
  top: -4px;
  right: -4px;
  width: 18px;
  height: 18px;
  background: var(--danger);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  display: none;
}

.notification-badge.has-notifications::after { display: flex; }

/* ═══════════════════════════════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════════════════════════════ */

.layout { display: flex; min-height: calc(100vh - 58px); max-width: 100%; overflow-x: hidden; }

.sidebar {
  width: 260px;
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--bgc), var(--bgp));
  border-right: 1px solid var(--b);
  padding: 20px 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; padding: 0 12px; }

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  color: var(--td);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all var(--transition);
  cursor: pointer;
}

.sidebar-link:hover { color: var(--gl); background: rgba(207, 181, 8, 0.06); }
.sidebar-link.active { color: var(--gl); background: rgba(207, 181, 8, 0.1); border-left: 3px solid var(--g); }

.sidebar-link .icon { font-size: 1.2rem; width: 24px; text-align: center; flex-shrink: 0; }

.sidebar-divider {
  height: 1px;
  background: var(--b);
  margin: 12px 28px;
}

.sidebar-section-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--g);
  padding: 8px 28px;
  font-weight: 700;
}

.main-content {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: calc(100vh - 58px);
  max-height: calc(100vh - 58px);
  min-width: 0;
  max-width: 100%;
}

/* ═══════════════════════════════════════════════════════════════
   MOBILE BOTTOM NAV
   ═══════════════════════════════════════════════════════════════ */

.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: linear-gradient(180deg, rgba(14, 12, 8, 0.98), rgba(20, 17, 12, 0.98));
  border-top: 1px solid var(--b);
  backdrop-filter: blur(12px);
  padding: 8px 0;
}

.mobile-nav-inner {
  display: flex;
  justify-content: space-around;
  align-items: center;
  max-width: 500px;
  margin: 0 auto;
}

.mobile-nav-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--td);
  text-decoration: none;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 4px 8px;
  transition: all var(--transition);
  cursor: pointer;
}

.mobile-nav-link .icon { font-size: 1.3rem; }
.mobile-nav-link.active { color: var(--gl); }

/* ═══════════════════════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════════════════════ */

.card {
  background: linear-gradient(175deg, var(--bgc), var(--bgp));
  border: 2px solid var(--b);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card), inset 0 1px 0 rgba(207, 181, 8, 0.06);
  padding: 24px;
  margin-bottom: 20px;
  transition: all var(--transition);
}

.card-hover:hover {
  border-color: var(--g);
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.35), 0 14px 28px rgba(207, 181, 8, 0.15), inset 0 1px 0 rgba(207, 181, 8, 0.06);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-title {
  font-family: var(--fd);
  font-size: 1.1rem;
  color: var(--gl);
  text-transform: uppercase;
  letter-spacing: 1px;
  text-shadow: 0 0 16px rgba(207, 181, 8, 0.15);
}

.card-subtitle { color: var(--td); font-size: 0.85rem; }

/* ═══════════════════════════════════════════════════════════════
   DASHBOARD GRID
   ═══════════════════════════════════════════════════════════════ */

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.stat-card {
  background: linear-gradient(175deg, var(--bgc), var(--bgp));
  border: 2px solid var(--b);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-card), inset 0 1px 0 rgba(207, 181, 8, 0.06);
  transition: all var(--transition);
}

.stat-card:hover { border-color: var(--g); }

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--gl), var(--g) 40%, var(--gd));
  box-shadow: 0 4px 0 #6d5d03, 0 6px 12px rgba(207, 181, 8, 0.25);
}

.stat-value { font-family: var(--fd); font-size: 1.6rem; color: var(--gl); line-height: 1; }
.stat-label { color: var(--td); font-size: 0.8rem; margin-top: 2px; }

/* ═══════════════════════════════════════════════════════════════
   WELCOME BANNER
   ═══════════════════════════════════════════════════════════════ */

.welcome-banner {
  background: linear-gradient(135deg, rgba(207, 181, 8, 0.08), rgba(207, 181, 8, 0.02));
  border: 2px solid var(--b);
  border-radius: var(--radius);
  padding: 28px 24px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.welcome-text h2 {
  font-family: var(--fd);
  font-size: 1.5rem;
  color: var(--gl);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.welcome-text p { color: var(--td); font-size: 0.95rem; }

/* ═══════════════════════════════════════════════════════════════
   NEXT CLASS
   ═══════════════════════════════════════════════════════════════ */

.next-class-card {
  background: linear-gradient(175deg, rgba(207, 181, 8, 0.06), rgba(207, 181, 8, 0.01));
  border: 2px solid var(--g);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}

.next-class-card .class-info { display: flex; flex-direction: column; gap: 8px; }
.next-class-card .class-row { display: flex; gap: 12px; align-items: center; color: var(--t); font-size: 0.95rem; }
.next-class-card .class-row .label { color: var(--g); font-weight: 700; min-width: 90px; }

/* ═══════════════════════════════════════════════════════════════
   PROGRESS BAR
   ═══════════════════════════════════════════════════════════════ */

.progress-section { margin-bottom: 24px; }

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.progress-label { color: var(--td); font-size: 0.9rem; font-weight: 600; }
.progress-value { color: var(--gl); font-weight: 700; font-size: 0.9rem; }

.progress-bar {
  width: 100%;
  height: 10px;
  background: rgba(207, 181, 8, 0.1);
  border-radius: 10px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gd), var(--g), var(--gl));
  border-radius: 10px;
  transition: width 0.6s ease;
}

.progress-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.progress-stat {
  text-align: center;
  padding: 12px 8px;
  background: rgba(207, 181, 8, 0.05);
  border-radius: var(--radius-sm);
  border: 1px solid var(--br);
}

.progress-stat .val { font-family: var(--fd); font-size: 1.2rem; color: var(--gl); }
.progress-stat .lbl { color: var(--td); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 1px; margin-top: 2px; }

/* ═══════════════════════════════════════════════════════════════
   CALENDAR
   ═══════════════════════════════════════════════════════════════ */

.calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.calendar-nav h3 { font-family: var(--fd); color: var(--gl); font-size: 1.2rem; }

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 16px;
}

.calendar-day-header {
  text-align: center;
  color: var(--g);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 8px 4px;
  letter-spacing: 1px;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  color: var(--td);
}

.calendar-day:hover { background: rgba(207, 181, 8, 0.1); color: var(--gl); }
.calendar-day.other-month { opacity: 0.3; }
.calendar-day.today { border: 2px solid var(--g); color: var(--gl); font-weight: 700; }
.calendar-day.has-class { background: rgba(207, 181, 8, 0.15); color: var(--gl); font-weight: 700; }
.calendar-day.has-class::after {
  content: '';
  position: absolute;
  bottom: 4px;
  width: 5px;
  height: 5px;
  background: var(--g);
  border-radius: 50%;
}

.calendar-day.holiday { color: var(--danger); }
.calendar-day.past-class { color: var(--success); opacity: 0.7; }

/* ═══════════════════════════════════════════════════════════════
   TABLES
   ═══════════════════════════════════════════════════════════════ */

.table-wrap { overflow-x: auto; }

table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

table th {
  text-align: left;
  padding: 12px 14px;
  color: var(--g);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 2px solid var(--b);
  font-weight: 700;
}

table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--br);
  color: var(--t);
}

table tr:hover td { background: rgba(207, 181, 8, 0.03); }

/* ═══════════════════════════════════════════════════════════════
   BADGES / STATUS
   ═══════════════════════════════════════════════════════════════ */

.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-success { background: rgba(34, 197, 94, 0.15); color: var(--success); border: 1px solid rgba(34, 197, 94, 0.3); }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: var(--warning); border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-danger { background: rgba(239, 68, 68, 0.15); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.3); }
.badge-info { background: rgba(59, 130, 246, 0.15); color: var(--info); border: 1px solid rgba(59, 130, 246, 0.3); }
.badge-gold { background: rgba(207, 181, 8, 0.15); color: var(--gl); border: 1px solid rgba(207, 181, 8, 0.3); }

/* ═══════════════════════════════════════════════════════════════
   LIBRARY
   ═══════════════════════════════════════════════════════════════ */

.library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.library-card {
  background: linear-gradient(175deg, var(--bgc), var(--bgp));
  border: 2px solid var(--b);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
}

.library-card:hover { border-color: var(--g); transform: translateY(-3px); box-shadow: var(--shadow-gold); }
.library-card .lib-icon { font-size: 3rem; display: block; margin-bottom: 12px; }
.library-card h3 { font-family: var(--fd); color: var(--gl); font-size: 1.1rem; text-transform: uppercase; }
.library-card p { color: var(--td); font-size: 0.8rem; margin-top: 4px; }

.file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: rgba(207, 181, 8, 0.04);
  border: 1px solid var(--br);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  transition: all var(--transition);
}

.file-item:hover { background: rgba(207, 181, 8, 0.08); border-color: var(--b); }
.file-item .file-icon { font-size: 1.5rem; }
.file-item .file-info { flex: 1; }
.file-item .file-name { color: var(--t); font-weight: 600; }
.file-item .file-meta { color: var(--td); font-size: 0.75rem; }

/* ═══════════════════════════════════════════════════════════════
   EXERCISES / TODO
   ═══════════════════════════════════════════════════════════════ */

.exercise-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
  background: rgba(207, 181, 8, 0.03);
  border: 1px solid var(--br);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
}

.exercise-item.completed { opacity: 0.6; }
.exercise-item.completed .exercise-desc { text-decoration: line-through; color: var(--td); }

.exercise-check {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--g);
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 2px;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: transparent;
}

.exercise-check.checked {
  background: var(--g);
  color: var(--bg);
}

.exercise-content { flex: 1; }
.exercise-desc { color: var(--t); font-weight: 600; margin-bottom: 2px; }
.exercise-deadline { color: var(--td); font-size: 0.78rem; }
.exercise-meta { display: flex; gap: 12px; margin-top: 6px; flex-wrap: wrap; }

/* ═══════════════════════════════════════════════════════════════
   CHAT
   ═══════════════════════════════════════════════════════════════ */

.chat-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 140px);
  background: linear-gradient(175deg, var(--bgc), var(--bgp));
  border: 2px solid var(--b);
  border-radius: var(--radius);
  overflow: hidden;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-msg {
  max-width: 75%;
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 0.9rem;
  line-height: 1.5;
  animation: fadeIn 0.2s ease;
}

.chat-msg.sent {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--g), var(--gd));
  color: var(--bg);
  border-bottom-right-radius: 6px;
}

.chat-msg.received {
  align-self: flex-start;
  background: rgba(207, 181, 8, 0.08);
  border: 1px solid var(--br);
  color: var(--t);
  border-bottom-left-radius: 6px;
}

.chat-msg .msg-time { font-size: 0.7rem; margin-top: 4px; opacity: 0.7; }

.chat-input-area {
  display: flex;
  gap: 10px;
  padding: 16px;
  border-top: 1px solid var(--b);
  background: rgba(8, 6, 4, 0.4);
}

.chat-input-area input {
  flex: 1;
  padding: 12px 16px;
  background: rgba(8, 6, 4, 0.6);
  border: 2px solid var(--b);
  border-radius: 24px;
  color: var(--t);
  font-size: 0.9rem;
  outline: none;
}

.chat-input-area input:focus { border-color: var(--g); }

/* ═══════════════════════════════════════════════════════════════
   FINANCIAL
   ═══════════════════════════════════════════════════════════════ */

.financial-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.fin-card {
  text-align: center;
  padding: 24px;
  background: linear-gradient(175deg, var(--bgc), var(--bgp));
  border: 2px solid var(--b);
  border-radius: var(--radius);
}

.fin-card .fin-val { font-family: var(--fd); font-size: 2rem; color: var(--gl); }
.fin-card .fin-lbl { color: var(--td); font-size: 0.8rem; margin-top: 4px; text-transform: uppercase; letter-spacing: 1px; }
.fin-card.paid { border-color: rgba(34, 197, 94, 0.3); }
.fin-card.pending { border-color: rgba(245, 158, 11, 0.3); }
.fin-card.overdue { border-color: rgba(239, 68, 68, 0.3); }

/* ═══════════════════════════════════════════════════════════════
   CERTIFICATES
   ═══════════════════════════════════════════════════════════════ */

.cert-card {
  text-align: center;
  padding: 32px 24px;
  background: linear-gradient(175deg, var(--bgc), var(--bgp));
  border: 2px solid var(--g);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}

.cert-card::before {
  content: '';
  position: absolute;
  inset: 8px;
  border: 1px solid var(--b);
  border-radius: calc(var(--radius-lg) - 4px);
  pointer-events: none;
}

.cert-icon { font-size: 4rem; margin-bottom: 12px; display: block; }
.cert-name { font-family: var(--fd); font-size: 1.3rem; color: var(--gl); text-transform: uppercase; }
.cert-meta { color: var(--td); font-size: 0.85rem; margin: 8px 0; }

/* ═══════════════════════════════════════════════════════════════
   SETTINGS
   ═══════════════════════════════════════════════════════════════ */

.settings-section { margin-bottom: 32px; }

.settings-section h3 {
  font-family: var(--fd);
  color: var(--gl);
  font-size: 1.1rem;
  text-transform: uppercase;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--b);
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--br);
  gap: 16px;
}

.settings-label { color: var(--t); font-weight: 600; }
.settings-desc { color: var(--td); font-size: 0.8rem; }

/* ═══════════════════════════════════════════════════════════════
   TOGGLE SWITCH
   ═══════════════════════════════════════════════════════════════ */

.toggle {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
}

.toggle input { opacity: 0; width: 0; height: 0; }

.toggle .slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: rgba(207, 181, 8, 0.2);
  border-radius: 26px;
  transition: all var(--transition);
}

.toggle .slider::before {
  content: '';
  position: absolute;
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background: var(--t);
  border-radius: 50%;
  transition: all var(--transition);
}

.toggle input:checked + .slider { background: var(--g); }
.toggle input:checked + .slider::before { transform: translateX(22px); }

/* ═══════════════════════════════════════════════════════════════
   ADMIN PANEL
   ═══════════════════════════════════════════════════════════════ */

.admin-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.admin-tab {
  padding: 10px 20px;
  border: 2px solid var(--b);
  border-radius: var(--radius-sm);
  color: var(--td);
  background: transparent;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition);
}

.admin-tab:hover { border-color: var(--g); color: var(--gl); }
.admin-tab.active {
  border-color: var(--g);
  color: var(--gl);
  background: rgba(207, 181, 8, 0.1);
}

.search-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.search-bar input {
  flex: 1;
  min-width: 200px;
  padding: 12px 16px;
  background: rgba(8, 6, 4, 0.6);
  border: 2px solid var(--b);
  border-radius: var(--radius-sm);
  color: var(--t);
  font-size: 0.9rem;
  outline: none;
}

.search-bar input:focus { border-color: var(--g); }

/* ═══════════════════════════════════════════════════════════════
   MODAL
   ═══════════════════════════════════════════════════════════════ */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(8, 6, 4, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.2s ease;
}

.modal {
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  overflow-y: auto;
  background: linear-gradient(175deg, var(--bgc), var(--bgp));
  border: 2px solid var(--g);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
  padding: 32px;
  animation: fadeInUp 0.3s ease;
}

.modal h2 {
  font-family: var(--fd);
  color: var(--gl);
  text-transform: uppercase;
  margin-bottom: 20px;
  font-size: 1.2rem;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
  justify-content: flex-end;
}

/* ═══════════════════════════════════════════════════════════════
   TOOLS (Metronome, Tuner, etc.)
   ═══════════════════════════════════════════════════════════════ */

.tool-card {
  text-align: center;
  padding: 20px;
}

.metronome-display {
  font-family: var(--fd);
  font-size: 4rem;
  color: var(--gl);
  text-shadow: 0 0 30px rgba(207, 181, 8, 0.3);
}

.metronome-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 16px;
}

.metronome-controls button {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--g);
  background: transparent;
  color: var(--gl);
  font-size: 1.3rem;
  cursor: pointer;
  transition: all var(--transition);
}

.metronome-controls button:hover { background: rgba(207, 181, 8, 0.15); }
.metronome-controls button.playing { background: var(--g); color: var(--bg); }

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

/* ═══════════════════════════════════════════════════════════════
   LIGHT THEME
   ═══════════════════════════════════════════════════════════════ */

body.light-theme {
  --bg: #faf8f2;
  --bgc: #f5f1e6;
  --bgp: #ede6d6;
  --t: #1a1610;
  --td: #5c5238;
  --b: rgba(154, 122, 6, 0.45);
  --br: rgba(154, 122, 6, 0.25);
  --g: #9a7a06;
  --gl: #8a6a00;
  --gd: #6b5400;
  --gp: #fdf3d0;
}

body.light-theme .card,
body.light-theme .stat-card,
body.light-theme .modal,
body.light-theme .chat-container,
body.light-theme .fin-card,
body.light-theme .library-card,
body.light-theme .cert-card { background: #fff; }

body.light-theme .sidebar { background: #f5f1e6; }
body.light-theme .topbar { background: rgba(250, 248, 242, 0.97); }
body.light-theme .mobile-nav { background: rgba(250, 248, 242, 0.98); }
body.light-theme .form-input { background: rgba(255, 255, 255, 0.8); color: var(--t); }
body.light-theme .chat-input-area { background: rgba(250, 248, 242, 0.6); }
body.light-theme .chat-msg.received { background: rgba(207, 181, 8, 0.12); }

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 900px) {
  .sidebar { display: none; }
  .mobile-nav { display: block; }
  .main-content { padding: 16px; padding-bottom: 80px; }
  .layout { min-height: calc(100vh - 58px); }
  .main-content { max-height: none; }
}

@media (max-width: 600px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .progress-stats { grid-template-columns: repeat(2, 1fr); }
  .welcome-banner { text-align: center; justify-content: center; }
  .login-card { padding: 28px 20px; }
  .admin-tabs { gap: 2px; }
  .admin-tab { padding: 8px 14px; font-size: 0.75rem; }
  .financial-summary { grid-template-columns: 1fr; }
  .library-grid { grid-template-columns: 1fr; }
  .topbar-name { display: none; }
  .topbar-role { display: none; }
  .calendar-grid { gap: 2px; }
  .calendar-day { font-size: 0.75rem; }
  .calendar-day-header { font-size: 0.65rem; padding: 6px 2px; }
  .chat-msg { max-width: 90%; }
}

@media (max-width: 400px) {
  .topbar-inner { gap: 6px; }
  .topbar-logo { height: 28px; }
  .stat-card { flex-direction: column; text-align: center; }
  .stat-icon { margin: 0 auto; }
}

/* ═══════════════════════════════════════════════════════════════
   SCROLLBAR
   ═══════════════════════════════════════════════════════════════ */

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--b); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--g); }

/* ═══════════════════════════════════════════════════════════════
   UTILITIES
   ═══════════════════════════════════════════════════════════════ */

.text-center { text-align: center; }
.text-gold { color: var(--gl); }
.text-muted { color: var(--td); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.hidden { display: none !important; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--g);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  margin-bottom: 16px;
  transition: color var(--transition);
}

.back-link:hover { color: var(--gl); }

.page-title {
  font-family: var(--fd);
  font-size: 1.6rem;
  color: var(--gl);
  text-transform: uppercase;
  margin-bottom: 20px;
  text-shadow: 0 0 24px rgba(207, 181, 8, 0.2);
}

.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--td);
}

.empty-state .icon { font-size: 3rem; display: block; margin-bottom: 12px; }
.empty-state p { font-size: 0.9rem; }

.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.25s ease; }

.pill {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.75rem;
  color: var(--g);
  background: rgba(207, 181, 8, 0.08);
  border: 1px solid var(--b);
}

.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }

.divider-gold {
  width: 80px;
  height: 3px;
  margin: 12px auto 20px;
  background: linear-gradient(90deg, transparent, var(--g), var(--gl), var(--g), transparent);
  border-radius: 2px;
}

/* Achievement badges */
.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.achievement {
  text-align: center;
  padding: 16px 12px;
  background: rgba(207, 181, 8, 0.04);
  border: 1px solid var(--br);
  border-radius: var(--radius-sm);
}

.achievement.locked { opacity: 0.35; filter: grayscale(1); }

.achievement .ach-icon { font-size: 2.2rem; display: block; margin-bottom: 6px; }
.achievement .ach-name { font-size: 0.78rem; font-weight: 600; color: var(--t); }
.achievement .ach-desc { font-size: 0.68rem; color: var(--td); margin-top: 2px; }

/* ═══════════ AGENDA SEMANAL (grade de horários) ═══════════ */
.week-nav { display:flex; align-items:center; justify-content:space-between; margin-bottom:14px; gap:12px; flex-wrap:wrap }
.week-nav h3 { margin:0; color:var(--t); font-size:1rem; text-align:center }
.week-grid-wrap { overflow-x:auto; border-radius:var(--radius); border:1px solid var(--b); background:var(--bgc) }
.week-grid { display:grid }
.week-grid-corner { background:var(--bgp); border-bottom:1px solid var(--b); border-right:1px solid var(--br); position:sticky; left:0; z-index:2 }
.week-grid-hour { background:var(--bgp); color:var(--gl); font-size:0.72rem; font-weight:700; text-align:center; padding:12px 4px; border-bottom:1px solid var(--b); border-right:1px solid var(--br); white-space:nowrap }
.week-grid-day { background:var(--bgp); padding:10px 14px; border-right:1px solid var(--b); border-bottom:1px solid var(--br); display:flex; flex-direction:column; justify-content:center; position:sticky; left:0; z-index:1 }
.week-grid-day-name { color:var(--t); font-weight:700; font-size:0.85rem }
.week-grid-day-date { color:var(--td); font-size:0.68rem; margin-top:2px }
.week-grid-day-today .week-grid-day-name { color:var(--gl) }
.week-slot { min-height:58px; border-right:1px solid var(--br); border-bottom:1px solid var(--br); padding:5px 7px; display:flex; flex-direction:column; justify-content:center; gap:2px; cursor:pointer; transition:background .15s }
.week-slot-empty:hover { background:rgba(207,181,8,.08) }
.week-slot-filled { background:rgba(207,181,8,.14); border-left:3px solid var(--g) }
.week-slot-filled strong { color:var(--gl); font-size:0.74rem; line-height:1.2 }
.week-slot-filled span { color:var(--td); font-size:0.66rem; line-height:1.2 }
.week-slot-completed { background:rgba(58,179,106,.14); border-left:3px solid #3ab36a }
.week-slot-completed strong { color:#3ab36a }
.week-slot-canceled { background:rgba(214,69,69,.14); border-left:3px solid #d64545 }
.week-slot-canceled strong { color:#d64545 }
.week-slot-makeup { background:rgba(59,130,246,.14); border-left:3px solid #3b82f6 }
.week-slot-makeup strong { color:#3b82f6 }
.week-slot-inprogress { background:rgba(59,130,246,.14); border-left:3px solid #3b82f6 }
.week-slot-inprogress strong { color:#3b82f6 }

/* ═══════════════════════════════════════════════════════════════
   ROBUSTEZ MOBILE — evita que textos longos empurrem o layout
   pra fora da tela (endereço, e-mail, etc. sem espaços)
   ═══════════════════════════════════════════════════════════════ */
.class-row { display: flex; gap: 8px; color: var(--t); font-size: 0.9rem; flex-wrap: wrap; word-break: break-word; overflow-wrap: break-word; min-width: 0; }
.class-row .label { color: var(--g); font-weight: 700; white-space: nowrap; }

@media (max-width: 600px) {
  .modal { padding: 20px; }
  div[style*="grid-template-columns:1fr 1fr"] { grid-template-columns: 1fr !important; }
}
