/* ── RESET & TOKENS ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:       #0a0a0a;
  --bg2:      #111111;
  --bg3:      #181818;
  --bg4:      #222222;
  --border:   #2a2a2a;
  --border2:  #333333;
  --text:     #e8e8e8;
  --text2:    #a0a0a0;
  --text3:    #666666;
  --gold:     #C9A961;
  --gold2:    #e0bf7a;
  --gold-dim: rgba(201,169,97,0.12);
  --green:    #22c55e;
  --red:      #ef4444;
  --blue:     #3b82f6;
  --orange:   #f97316;
  --purple:   #a855f7;
  --shadow:   0 4px 24px rgba(0,0,0,0.5);
  --radius:   10px;
  --sidebar-w: 240px;
  --topbar-h:  60px;
}

html { font-size: 15px; }
body { font-family: 'Inter', sans-serif; background: var(--bg); color: var(--text);
       min-height: 100vh; overflow-x: hidden; }
h1,h2,h3,h4 { font-family: 'Oswald', sans-serif; font-weight: 500; letter-spacing: 0.03em; }
a { color: var(--gold); text-decoration: none; }
input, select, textarea, button { font-family: inherit; font-size: inherit; }
button { cursor: pointer; }

/* ── PAGES ───────────────────────────────────────────────────────────────── */
.page { display: none; }
.page.active { display: block; }

/* ── LOGIN ───────────────────────────────────────────────────────────────── */
#page-login {
  position: fixed; inset: 0; display: none;
  align-items: center; justify-content: center;
  background: var(--bg);
}
#page-login.active { display: flex; }

.login-bg {
  position: absolute; inset: 0; overflow: hidden;
}
.login-overlay {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 30% 50%, rgba(201,169,97,0.06) 0%, transparent 60%);
}
.gi-pattern {
  position: absolute; inset: 0; opacity: 0.03;
  background-image: repeating-linear-gradient(
    45deg, var(--gold) 0, var(--gold) 1px, transparent 0, transparent 50%);
  background-size: 24px 24px;
}

.login-card {
  position: relative; z-index: 1;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 16px; padding: 2.5rem 2rem; width: 100%; max-width: 400px;
  box-shadow: var(--shadow);
}
.login-logo { display: flex; align-items: center; gap: 1rem; margin-bottom: 0.5rem; }
.login-logo h1 { font-family: 'Oswald', sans-serif; font-size: 2rem; font-weight: 700;
                  color: var(--gold); letter-spacing: 0.1em; }
.login-subtitle { color: var(--text2); font-size: 0.85rem; margin-bottom: 2rem; }

.demo-box { margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.demo-title { font-size: 0.8rem; color: var(--text3); margin-bottom: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; }
.demo-creds { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.demo-creds { display: flex; flex-direction: column; gap: 0.45rem; }

.demo-credential {
  display: flex; align-items: center; gap: 0.75rem;
  background: var(--bg3); border: 1px solid var(--border2);
  border-radius: 8px; padding: 0.55rem 0.85rem; cursor: pointer;
  transition: all 0.2s;
}
.demo-credential:hover { border-color: var(--gold); background: var(--gold-dim); }

.demo-role  { font-size: 0.82rem; font-weight: 600; width: 90px; flex-shrink: 0; color: var(--text); }
.demo-info  { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.demo-email { font-size: 0.78rem; color: var(--gold); font-family: monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.demo-pass  { font-size: 0.73rem; color: var(--text3); }

/* ── LAYOUT ──────────────────────────────────────────────────────────────── */
#page-app { display: none; min-height: 100vh; }
#page-app.active { display: flex; }

/* ── SIDEBAR ─────────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w); min-height: 100vh; background: var(--bg2);
  border-right: 1px solid var(--border); display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; z-index: 100; transition: transform 0.3s;
}
.sidebar-logo {
  display: flex; align-items: center; gap: 0.75rem; padding: 1.25rem 1rem;
  border-bottom: 1px solid var(--border);
  font-family: 'Oswald', sans-serif; font-size: 1.15rem; font-weight: 700;
  color: var(--gold); letter-spacing: 0.08em;
}
.sidebar-user {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 1rem; border-bottom: 1px solid var(--border);
}
.user-avatar-box {
  width: 38px; height: 38px; border-radius: 50%; background: var(--gold-dim);
  border: 1.5px solid var(--gold); color: var(--gold); font-weight: 600;
  display: flex; align-items: center; justify-content: center; font-size: 1rem;
  flex-shrink: 0;
}
.user-name-sb { font-size: 0.85rem; font-weight: 500; }
.user-role-sb { font-size: 0.75rem; color: var(--text3); text-transform: capitalize; margin-top: 1px; }

.sidebar-nav { flex: 1; padding: 0.75rem 0; overflow-y: auto; }
.sidebar-nav .nav-item {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.7rem 1rem; color: var(--text2); cursor: pointer;
  border-radius: 0; transition: all 0.15s; font-size: 0.88rem;
  border-left: 3px solid transparent;
}
.sidebar-nav .nav-item:hover { background: var(--bg3); color: var(--text); }
.sidebar-nav .nav-item.active { background: var(--gold-dim); color: var(--gold); border-left-color: var(--gold); }
.sidebar-nav .nav-item svg { flex-shrink: 0; }

.sidebar-logout {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 1rem; border-top: 1px solid var(--border);
  background: none; border: none; border-top: 1px solid var(--border);
  color: var(--text3); font-size: 0.85rem; width: 100%; transition: color 0.2s;
}
.sidebar-logout:hover { color: var(--red); }

/* ── MAIN ────────────────────────────────────────────────────────────────── */
.main {
  flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column;
  min-height: 100vh;
}
.topbar {
  height: var(--topbar-h); background: var(--bg2); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 1rem; padding: 0 1.5rem;
  position: sticky; top: 0; z-index: 50;
}
.menu-toggle {
  display: none; flex-direction: column; gap: 4px; background: none;
  border: none; padding: 6px; cursor: pointer;
}
.menu-toggle span { width: 20px; height: 2px; background: var(--text2); border-radius: 2px; display: block; }
.topbar-title { flex: 1; font-family: 'Oswald', sans-serif; font-size: 1.1rem; color: var(--text); }
.topbar-actions { display: flex; align-items: center; gap: 0.5rem; }

.notif-btn {
  position: relative; background: none; border: none;
  color: var(--text2); padding: 6px; border-radius: 8px; transition: color 0.2s;
}
.notif-btn:hover { color: var(--text); }
.notif-badge {
  position: absolute; top: 2px; right: 2px; width: 16px; height: 16px;
  background: var(--gold); color: #000; font-size: 0.65rem; font-weight: 700;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
}
.notif-panel {
  position: fixed; top: var(--topbar-h); right: 1rem; width: 340px;
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); z-index: 200; max-height: 420px; overflow-y: auto;
}
.notif-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.75rem 1rem; border-bottom: 1px solid var(--border);
  font-size: 0.85rem; font-weight: 500;
}
.notif-header button { background: none; border: none; color: var(--gold); font-size: 0.78rem; cursor: pointer; }
.notif-item {
  padding: 0.75rem 1rem; border-bottom: 1px solid var(--border);
  font-size: 0.82rem; cursor: pointer; transition: background 0.15s;
}
.notif-item:hover { background: var(--bg3); }
.notif-item.unread { border-left: 3px solid var(--gold); }
.notif-item .notif-title { font-weight: 500; margin-bottom: 2px; }
.notif-item .notif-msg { color: var(--text2); }
.notif-item .notif-time { color: var(--text3); font-size: 0.75rem; margin-top: 3px; }

.sections { flex: 1; padding: 1.5rem; }
.section { display: none; }
.section.active { display: block; }

/* ── COMPONENTS ──────────────────────────────────────────────────────────── */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.5rem; flex-wrap: wrap; gap: 0.75rem;
}
.page-header h2 { font-size: 1.5rem; }

/* Stats Grid */
.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem; margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.25rem; display: flex; align-items: center; gap: 1rem;
  transition: border-color 0.2s;
}
.stat-card:hover { border-color: var(--border2); }
.stat-icon {
  width: 44px; height: 44px; border-radius: 10px; background: var(--gold-dim);
  display: flex; align-items: center; justify-content: center; font-size: 1.3rem;
  flex-shrink: 0;
}
.stat-icon svg { color: var(--gold); }
.stat-value { font-family: 'Oswald', sans-serif; font-size: 1.6rem; font-weight: 600; line-height: 1; }
.stat-label { font-size: 0.78rem; color: var(--text2); margin-top: 3px; }

/* Cards */
.card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.card-header {
  padding: 1rem 1.25rem; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-header h3 { font-size: 1rem; font-weight: 500; }
.card-body { padding: 1.25rem; }

/* Chart Card */
.chart-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; }
.chart-card h3 { font-size: 0.9rem; color: var(--text2); margin-bottom: 1rem; text-transform: uppercase; letter-spacing: 0.05em; }
.chart-wrap { position: relative; height: 220px; }

/* Grid layout for dashboard */
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.dash-grid .span-2 { grid-column: span 2; }
@media (max-width: 900px) { .dash-grid { grid-template-columns: 1fr; } .dash-grid .span-2 { grid-column: span 1; } }

/* Table */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
thead th {
  background: var(--bg3); padding: 0.65rem 0.9rem; text-align: left;
  font-size: 0.75rem; font-weight: 500; color: var(--text3);
  text-transform: uppercase; letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
}
tbody td { padding: 0.75rem 0.9rem; border-bottom: 1px solid var(--border); color: var(--text2); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--bg3); color: var(--text); }
tbody tr.clickable { cursor: pointer; }

/* Badge / Status */
.badge {
  display: inline-flex; align-items: center; padding: 2px 8px;
  border-radius: 20px; font-size: 0.73rem; font-weight: 500;
}
.badge-green  { background: rgba(34,197,94,0.12);  color: var(--green); }
.badge-red    { background: rgba(239,68,68,0.12);   color: var(--red); }
.badge-gold   { background: var(--gold-dim);         color: var(--gold); }
.badge-blue   { background: rgba(59,130,246,0.12);  color: var(--blue); }
.badge-gray   { background: rgba(100,100,100,0.12); color: var(--text2); }
.badge-orange { background: rgba(249,115,22,0.12);  color: var(--orange); }
.badge-purple { background: rgba(168,85,247,0.12);  color: var(--purple); }

/* Belt colors */
.belt { display: inline-block; width: 32px; height: 7px; border-radius: 2px; vertical-align: middle; }
.belt-branca  { background: #ffffff; border: 1px solid #ddd; }
.belt-azul    { background: #2563eb; }
.belt-roxa    { background: #7c3aed; }
.belt-marrom  { background: #92400e; }
.belt-preta   { background: #111; border: 1px solid #444; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  padding: 0.55rem 1.1rem; border-radius: 8px; font-size: 0.85rem; font-weight: 500;
  border: none; transition: all 0.15s; cursor: pointer; white-space: nowrap;
}
.btn-primary { background: var(--gold); color: #000; }
.btn-primary:hover { background: var(--gold2); }
.btn-outline { background: transparent; border: 1px solid var(--border2); color: var(--text2); }
.btn-outline:hover { border-color: var(--gold); color: var(--gold); }
.btn-danger { background: rgba(239,68,68,0.12); color: var(--red); border: 1px solid rgba(239,68,68,0.2); }
.btn-danger:hover { background: rgba(239,68,68,0.2); }
.btn-success { background: rgba(34,197,94,0.12); color: var(--green); border: 1px solid rgba(34,197,94,0.2); }
.btn-success:hover { background: rgba(34,197,94,0.2); }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }
.btn-full { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Forms */
.field { margin-bottom: 1rem; }
.field label { display: block; font-size: 0.78rem; color: var(--text3); margin-bottom: 0.35rem; text-transform: uppercase; letter-spacing: 0.05em; }
.field input, .field select, .field textarea {
  width: 100%; background: var(--bg3); border: 1px solid var(--border2);
  border-radius: 8px; padding: 0.65rem 0.9rem; color: var(--text);
  transition: border-color 0.2s; resize: vertical;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--gold);
}
.field input::placeholder, .field textarea::placeholder { color: var(--text3); }
.field select option { background: var(--bg3); }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* Lesson Cards */
.lesson-list { display: flex; flex-direction: column; gap: 0.75rem; }
.lesson-card {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem;
  display: flex; align-items: flex-start; gap: 1rem;
  transition: border-color 0.2s;
}
.lesson-card:hover { border-color: var(--border2); }
.lesson-date-box {
  min-width: 52px; background: var(--bg4); border-radius: 8px;
  padding: 0.5rem; text-align: center; flex-shrink: 0;
}
.lesson-day   { font-family: 'Oswald', sans-serif; font-size: 1.5rem; line-height: 1; color: var(--gold); }
.lesson-month { font-size: 0.7rem; color: var(--text3); text-transform: uppercase; }
.lesson-info  { flex: 1; }
.lesson-title { font-weight: 500; margin-bottom: 4px; }
.lesson-meta  { font-size: 0.8rem; color: var(--text2); display: flex; gap: 0.75rem; flex-wrap: wrap; }
.lesson-meta span { display: flex; align-items: center; gap: 4px; }
.lesson-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; align-items: flex-start; }

/* Instructor Cards */
.instructor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px,1fr)); gap: 1rem; }
.instructor-card {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem;
  transition: border-color 0.2s;
}
.instructor-card:hover { border-color: var(--gold); }
.instructor-card-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; }
.instructor-avatar {
  width: 46px; height: 46px; border-radius: 50%; background: var(--gold-dim);
  border: 2px solid var(--gold); display: flex; align-items: center; justify-content: center;
  font-family: 'Oswald', sans-serif; font-size: 1.1rem; color: var(--gold); flex-shrink: 0;
}
.instructor-name  { font-weight: 500; font-size: 0.95rem; }
.instructor-spec  { font-size: 0.78rem; color: var(--text2); margin-top: 2px; }
.instructor-rating { display: flex; align-items: center; gap: 4px; font-size: 0.82rem; color: var(--gold); }
.instructor-stats { display: flex; gap: 1rem; font-size: 0.8rem; color: var(--text2); margin: 0.75rem 0; }
.instructor-card-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* Packages Grid */
.packages-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); gap: 0.75rem; margin: 1rem 0; }
.package-card {
  background: var(--bg3); border: 2px solid var(--border);
  border-radius: var(--radius); padding: 1rem; cursor: pointer; transition: all 0.2s;
}
.package-card:hover, .package-card.selected { border-color: var(--gold); background: var(--gold-dim); }
.pkg-name    { font-weight: 500; margin-bottom: 4px; }
.pkg-lessons { font-size: 0.8rem; color: var(--text2); margin-bottom: 8px; }
.pkg-price   { font-family: 'Oswald', sans-serif; font-size: 1.4rem; color: var(--gold); }
.pkg-validity { font-size: 0.75rem; color: var(--text3); margin-top: 4px; }

/* Purchase Card */
.purchase-card {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem; margin-bottom: 0.75rem;
}
.purchase-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 0.75rem; }
.purchase-title { font-weight: 500; margin-bottom: 2px; }
.purchase-instructor { font-size: 0.82rem; color: var(--text2); }
.purchase-progress { margin-top: 0.5rem; }
.progress-bar-wrap { background: var(--bg4); border-radius: 99px; height: 6px; overflow: hidden; margin: 6px 0; }
.progress-bar { height: 100%; background: var(--gold); border-radius: 99px; transition: width 0.5s; }
.progress-labels { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--text3); }

/* Star Rating */
.star-rating { display: flex; gap: 4px; }
.star { font-size: 1.5rem; color: var(--border2); cursor: pointer; transition: color 0.1s; user-select: none; }
.star.active { color: var(--gold); }

/* Empty state */
.empty-state {
  text-align: center; padding: 3rem 1rem; color: var(--text3);
}
.empty-state .empty-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.empty-state p { font-size: 0.9rem; }
.empty-state .btn { margin-top: 1rem; }

/* Loading */
.loading {
  display: flex; align-items: center; justify-content: center;
  padding: 2rem; color: var(--text3); gap: 0.5rem;
}
.spinner {
  width: 18px; height: 18px; border: 2px solid var(--border2);
  border-top-color: var(--gold); border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Toast */
.toast {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 1000;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 10px; padding: 0.85rem 1.25rem; font-size: 0.88rem;
  box-shadow: var(--shadow); max-width: 320px;
  animation: slideUp 0.3s ease;
}
.toast.toast-success { border-left: 3px solid var(--green); }
.toast.toast-error   { border-left: 3px solid var(--red); }
.toast.toast-info    { border-left: 3px solid var(--blue); }
@keyframes slideUp { from { transform: translateY(10px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* Modals */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.65); z-index: 500;
  display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.modal {
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: 14px; width: 100%; max-width: 520px;
  max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow);
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem 1.25rem; border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 1.1rem; }
.modal-close {
  background: none; border: none; color: var(--text2); font-size: 1.4rem;
  line-height: 1; cursor: pointer; padding: 2px 6px;
}
.modal-close:hover { color: var(--text); }
.modal-body { padding: 1.25rem; }

/* Admin specific */
.admin-stat-card { border-left: 3px solid var(--gold); }
.filter-bar { display: flex; gap: 0.75rem; margin-bottom: 1rem; flex-wrap: wrap; align-items: center; }
.filter-bar input, .filter-bar select {
  background: var(--bg3); border: 1px solid var(--border2);
  border-radius: 8px; padding: 0.5rem 0.85rem; color: var(--text);
  font-size: 0.85rem;
}
.filter-bar input:focus, .filter-bar select:focus { outline: none; border-color: var(--gold); }

/* Helpers */
.hidden { display: none !important; }
.text-gold   { color: var(--gold); }
.text-green  { color: var(--green); }
.text-red    { color: var(--red); }
.text-muted  { color: var(--text2); }
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.fw-5 { font-weight: 500; }
.small { font-size: 0.8rem; }

/* Responsive */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .menu-toggle { display: flex; }
  .dash-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .row-2 { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .sections { padding: 1rem; }
}

/* ── VIDEOS ──────────────────────────────────────────────────────────────── */
.video-category-section { margin-bottom: 2rem; }
.video-cat-title {
  font-size: 1rem; font-weight: 500; color: var(--text2);
  text-transform: uppercase; letter-spacing: 0.06em;
  margin-bottom: 0.75rem; padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}
.video-cards-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}
.video-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  cursor: pointer; transition: all 0.2s;
}
.video-card:hover { border-color: var(--gold); transform: translateY(-2px); }
.video-thumb {
  position: relative; padding-bottom: 56.25%; overflow: hidden; background: var(--bg3);
}
.video-thumb img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.3s;
}
.video-card:hover .video-thumb img { transform: scale(1.05); }
.video-play-btn {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 2rem; color: #fff; background: rgba(0,0,0,0.3);
  opacity: 0; transition: opacity 0.2s;
}
.video-card:hover .video-play-btn { opacity: 1; }
.video-info { padding: 0.85rem; }
.video-title { font-weight: 500; font-size: 0.9rem; margin-bottom: 3px; }
.video-instructor { font-size: 0.78rem; color: var(--gold); margin-bottom: 3px; }
.video-desc { font-size: 0.78rem; color: var(--text2); }
.video-actions { display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; }
.videos-grid { margin-top: 0.5rem; }

/* ── MESSAGES ────────────────────────────────────────────────────────────── */
.messages-layout {
  display: grid; grid-template-columns: 300px 1fr;
  gap: 0; background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; height: calc(100vh - 200px); min-height: 500px;
}
.conv-list {
  border-right: 1px solid var(--border); overflow-y: auto;
}
.conv-item {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.85rem 1rem; cursor: pointer; transition: background 0.15s;
  border-bottom: 1px solid var(--border);
}
.conv-item:hover, .conv-item.active { background: var(--bg3); }
.conv-item.conv-unread { border-left: 3px solid var(--gold); }
.conv-avatar {
  width: 40px; height: 40px; border-radius: 50%; background: var(--gold-dim);
  border: 1.5px solid var(--gold); color: var(--gold); font-weight: 600;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 1rem;
}
.conv-meta { flex: 1; min-width: 0; }
.conv-name { font-weight: 500; font-size: 0.88rem; }
.conv-last { font-size: 0.78rem; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.conv-badge {
  background: var(--gold); color: #000; font-size: 0.7rem; font-weight: 700;
  border-radius: 50%; width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

.chat-area { display: flex; flex-direction: column; }
.chat-header {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.85rem 1.25rem; border-bottom: 1px solid var(--border);
  background: var(--bg2);
}
.chat-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; flex: 1; color: var(--text3); gap: 0.5rem; }
.chat-messages { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: 0.5rem; }
.msg-bubble { max-width: 70%; padding: 0.6rem 0.9rem; border-radius: 12px; }
.msg-me    { align-self: flex-end; background: var(--gold-dim); border: 1px solid var(--gold); border-bottom-right-radius: 3px; }
.msg-other { align-self: flex-start; background: var(--bg3); border: 1px solid var(--border); border-bottom-left-radius: 3px; }
.msg-body  { font-size: 0.88rem; white-space: pre-wrap; word-break: break-word; }
.msg-time  { font-size: 0.7rem; color: var(--text3); margin-top: 3px; text-align: right; }
.chat-input-bar {
  display: flex; gap: 0.5rem; padding: 0.75rem 1rem;
  border-top: 1px solid var(--border); background: var(--bg2);
}
.chat-input-bar textarea {
  flex: 1; background: var(--bg3); border: 1px solid var(--border2);
  border-radius: 8px; padding: 0.6rem 0.9rem; color: var(--text);
  resize: none; min-height: 40px; max-height: 120px;
}
.chat-input-bar textarea:focus { outline: none; border-color: var(--gold); }

@media (max-width: 768px) {
  .messages-layout { grid-template-columns: 1fr; }
}

/* ── SETTINGS TOGGLE SWITCH ──────────────────────────────────────────────── */
.setting-row {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; padding: 0.85rem 0; border-bottom: 1px solid var(--border);
}
.setting-row:last-child { border-bottom: none; }
.setting-info { flex: 1; }
.setting-label { font-weight: 500; font-size: 0.88rem; }
.setting-desc  { font-size: 0.78rem; color: var(--text2); margin-top: 2px; }

.toggle-switch { position: relative; display: inline-block; width: 46px; height: 26px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0; background: var(--border2);
  border-radius: 99px; cursor: pointer; transition: 0.3s;
}
.toggle-slider::before {
  content: ''; position: absolute; width: 18px; height: 18px;
  left: 4px; bottom: 4px; background: #fff; border-radius: 50%; transition: 0.3s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--gold); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ── DASH GRID SPAN ──────────────────────────────────────────────────────── */
.span-2 { grid-column: span 2; }
@media (max-width: 900px) { .span-2 { grid-column: span 1; } }

/* ── ALERT BANNERS ───────────────────────────────────────────────────────── */
.alert-banner {
  display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
  padding: 0.75rem 1rem; border-radius: var(--radius); margin-bottom: 0.75rem;
  font-size: 0.85rem; border-left: 4px solid;
}
.alert-warning { background: rgba(249,115,22,0.1); border-color: var(--orange); color: var(--text); }
.alert-danger   { background: rgba(239,68,68,0.1);  border-color: var(--red);    color: var(--text); }
.alert-info     { background: rgba(59,130,246,0.1); border-color: var(--blue);   color: var(--text); }
.alert-success  { background: rgba(34,197,94,0.1);  border-color: var(--green);  color: var(--text); }
.alert-banner strong { font-weight: 600; }

/* ── BELT SELECT (inline belt editor) ───────────────────────────────────── */
.belt-select {
  background: var(--bg3); border: 1px solid var(--border2); border-radius: 6px;
  padding: 0.2rem 0.4rem; color: var(--text); font-size: 0.75rem; cursor: pointer;
}
.belt-select:focus { outline: none; border-color: var(--gold); }

/* ── STUDENT CONTROL TABLE fixes ────────────────────────────────────────── */
tbody td { vertical-align: middle; }

/* ── AGENDA ──────────────────────────────────────────────────────────────── */
.agenda-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.5rem;
}
@media (max-width: 900px) { .agenda-week { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 600px) { .agenda-week { grid-template-columns: repeat(2, 1fr); } }

.agenda-day {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.agenda-day.day-blocked { opacity: 0.6; border-color: var(--red); }

.agenda-day-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.4rem 0.6rem; background: var(--bg4);
  border-bottom: 1px solid var(--border);
}
.day-name { font-size: 0.75rem; font-weight: 600; color: var(--text2); }
.day-num  { font-size: 0.85rem; font-weight: 700; color: var(--text); }

.agenda-slot {
  padding: 0.25rem 0.5rem; font-size: 0.72rem;
  color: var(--green); border-bottom: 1px solid var(--border);
}
.agenda-lesson {
  padding: 0.25rem 0.5rem; font-size: 0.72rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lesson-confirmed { background: rgba(201,169,97,0.15); color: var(--gold); }
.lesson-scheduled { background: rgba(59,130,246,0.1);  color: var(--blue); }
.agenda-blocked   { padding: 0.3rem 0.5rem; font-size: 0.72rem; color: var(--red); }

/* Slots editor */
.weekday-block {
  padding: 0.65rem 0; border-bottom: 1px solid var(--border);
}
.weekday-block:last-child { border-bottom: none; }
.weekday-label {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 0.4rem; font-weight: 500; font-size: 0.85rem;
}
.slot-row {
  display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.35rem;
}
.slot-row input[type="time"] {
  background: var(--bg3); border: 1px solid var(--border2);
  border-radius: 6px; padding: 0.3rem 0.5rem; color: var(--text);
  font-size: 0.82rem; width: 110px;
}
.slot-row span { color: var(--text3); font-size: 0.8rem; }

.btn-xs { padding: 0.2rem 0.5rem; font-size: 0.75rem; }

/* ── PENDING PAYMENT CARDS ───────────────────────────────────────────────── */
.pending-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.1rem; margin-bottom: 0.75rem;
  transition: border-color 0.2s;
}
.pending-card:hover { border-color: var(--gold); }
.pending-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 0.6rem;
}
.pending-meta {
  display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap;
  margin-bottom: 0.6rem;
}
.pending-method {
  border: 1px solid; border-radius: 20px;
  padding: 2px 10px; font-size: 0.78rem; font-weight: 500;
}
.pending-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.75rem; }

/* Pending purchase card */
.purchase-card.purchase-pending {
  border-color: var(--orange);
  border-left: 4px solid var(--orange);
}

/* ── SMART SCHEDULE CALENDAR ─────────────────────────────────────────────── */
.cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 3px; margin-top: .5rem;
}
.cal-header {
  text-align: center; font-size: .72rem; color: var(--text3);
  font-weight: 500; padding: .3rem 0; text-transform: uppercase;
}
.cal-cell {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  border-radius: 8px; font-size: .85rem; position: relative;
  cursor: default; transition: all .15s;
}
.cal-available {
  background: rgba(201,169,97,.12); color: var(--gold);
  border: 1px solid rgba(201,169,97,.3); cursor: pointer; font-weight: 500;
}
.cal-available:hover { background: rgba(201,169,97,.25); transform: scale(1.05); }
.cal-selected {
  background: var(--gold); color: #000;
  border: 1px solid var(--gold); font-weight: 700; cursor: pointer;
}
.cal-unavail { color: var(--text3); opacity: .4; }
.cal-past    { color: var(--text3); opacity: .25; }
.cal-empty   { }
.cal-today-dot {
  position: absolute; bottom: 3px; left: 50%; transform: translateX(-50%);
  width: 4px; height: 4px; border-radius: 50%; background: var(--gold);
}

/* Time slots grid */
.slots-grid {
  display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem;
}
.slot-btn {
  background: var(--bg3); border: 1px solid var(--border2);
  border-radius: 8px; padding: .45rem .85rem; font-size: .82rem;
  color: var(--text2); cursor: pointer; transition: all .15s;
  display: flex; flex-direction: column; align-items: center;
}
.slot-btn:hover { border-color: var(--gold); color: var(--gold); }
.slot-btn.slot-selected {
  background: var(--gold-dim); border-color: var(--gold);
  color: var(--gold); font-weight: 600;
}
.slot-end { font-size: .72rem; color: var(--text3); margin-top: 1px; }
.slot-btn.slot-selected .slot-end { color: var(--gold); }

/* ── LESSONS AVAILABLE CARD (student dashboard) ──────────────────────────── */
.lessons-available-card { border-left: 3px solid var(--gold); }

.total-lessons-display { text-align: center; padding: .5rem 0 .25rem; }

.total-lessons-number {
  font-size: 3.5rem; font-weight: 700; line-height: 1;
  font-family: 'Oswald', sans-serif; color: var(--gold);
}

.total-lessons-label {
  font-size: .85rem; color: var(--text3); margin-top: .25rem;
  text-transform: uppercase; letter-spacing: .05em;
}

.text-green  { color: var(--green) !important; }
.text-red    { color: var(--red)   !important; }
.text-gold   { color: var(--gold)  !important; }

/* ══════════════════════════════════════════════════════════════════════════
   THEMES — COLOR ACCENT SYSTEM
   Cada tema troca apenas --gold / --gold2 / --gold-dim (o accent color)
   mantendo o dark base intacto.
══════════════════════════════════════════════════════════════════════════ */

/* Default já definido em :root como gold — reafirmado abaixo para clareza */
[data-theme="gold"] {
  --gold:     #C9A961;
  --gold2:    #e0bf7a;
  --gold-dim: rgba(201,169,97,0.12);
}
[data-theme="blue"] {
  --gold:     #3b82f6;
  --gold2:    #60a5fa;
  --gold-dim: rgba(59,130,246,0.12);
}
[data-theme="green"] {
  --gold:     #22c55e;
  --gold2:    #4ade80;
  --gold-dim: rgba(34,197,94,0.12);
}
[data-theme="red"] {
  --gold:     #ef4444;
  --gold2:    #f87171;
  --gold-dim: rgba(239,68,68,0.12);
}
[data-theme="purple"] {
  --gold:     #a855f7;
  --gold2:    #c084fc;
  --gold-dim: rgba(168,85,247,0.12);
}
[data-theme="cyan"] {
  --gold:     #06b6d4;
  --gold2:    #22d3ee;
  --gold-dim: rgba(6,182,212,0.12);
}
[data-theme="orange"] {
  --gold:     #f97316;
  --gold2:    #fb923c;
  --gold-dim: rgba(249,115,22,0.12);
}
[data-theme="pink"] {
  --gold:     #ec4899;
  --gold2:    #f472b6;
  --gold-dim: rgba(236,72,153,0.12);
}

/* ── Theme Picker UI ─────────────────────────────────────────────────────── */
.theme-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.theme-swatch {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
  position: relative;
}
.theme-swatch:hover { transform: scale(1.15); }
.theme-swatch.active {
  border-color: var(--text);
  transform: scale(1.15);
}
.theme-swatch::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: inherit;
  opacity: 0.3;
}

/* ── Language Picker UI ─────────────────────────────────────────────────── */
.lang-picker {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.lang-btn {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  border-radius: 8px;
  border: 1.5px solid var(--border2);
  background: var(--bg3);
  color: var(--text2);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.lang-btn:hover { border-color: var(--gold); color: var(--text); }
.lang-btn.active {
  border-color: var(--gold);
  background: var(--gold-dim);
  color: var(--gold);
}

/* ── Appearance Card ─────────────────────────────────────────────────────── */
.appearance-card-body .field label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text3);
  margin-bottom: 0.4rem;
  display: block;
}

/* ══════════════════════════════════════════════════════════════════════════
   LIGHT MODE
══════════════════════════════════════════════════════════════════════════ */
[data-mode="light"] {
  --bg:       #f4f4f5;
  --bg2:      #ffffff;
  --bg3:      #f0f0f0;
  --bg4:      #e4e4e7;
  --border:   #d4d4d8;
  --border2:  #a1a1aa;
  --text:     #18181b;
  --text2:    #52525b;
  --text3:    #a1a1aa;
  --shadow:   0 4px 24px rgba(0,0,0,0.10);
}
[data-mode="light"] .sidebar            { background: var(--bg2); }
[data-mode="light"] .topbar             { background: var(--bg2); }
[data-mode="light"] .login-card         { background: var(--bg2); }
[data-mode="light"] .modal             { background: var(--bg2); }
[data-mode="light"] input,
[data-mode="light"] select,
[data-mode="light"] textarea {
  background: var(--bg3);
  color: var(--text);
  border-color: var(--border);
}
[data-mode="light"] .card { background: var(--bg2); }
[data-mode="light"] .notif-panel { background: var(--bg2); border-color: var(--border); }
[data-mode="light"] .toast { background: var(--bg4); color: var(--text); }
[data-mode="light"] .demo-credential { background: var(--bg3); }

/* Mode toggle button in topbar */
.mode-toggle-btn {
  background: none;
  border: 1.5px solid var(--border2);
  border-radius: 20px;
  padding: 4px 10px;
  color: var(--text2);
  font-size: 0.82rem;
  display: flex; align-items: center; gap: 5px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.mode-toggle-btn:hover { border-color: var(--gold); color: var(--gold); }

/* ══════════════════════════════════════════════════════════════════════════
   DASHBOARD DRAG-AND-DROP
══════════════════════════════════════════════════════════════════════════ */
.dash-grid.draggable-grid { user-select: none; }
.dash-card-wrapper {
  position: relative;
}
.drag-handle {
  position: absolute;
  top: 10px; right: 10px;
  opacity: 0;
  cursor: grab;
  color: var(--text3);
  transition: opacity 0.15s;
  z-index: 5;
  padding: 4px;
  border-radius: 4px;
}
.dash-card-wrapper:hover .drag-handle { opacity: 1; }
.dash-card-wrapper.dragging {
  opacity: 0.4;
  cursor: grabbing;
  transform: scale(0.97);
}
.dash-card-wrapper.drag-over {
  outline: 2px dashed var(--gold);
  outline-offset: 3px;
  border-radius: var(--radius);
}
.dashboard-edit-bar {
  display: flex; align-items: center; gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.6rem 0.85rem;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.83rem; color: var(--text2);
}
.dashboard-edit-bar svg { flex-shrink: 0; }
.card-toggle-list {
  display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem;
}
.card-toggle-chip {
  display: flex; align-items: center; gap: 0.35rem;
  padding: 0.3rem 0.7rem;
  border-radius: 20px;
  border: 1.5px solid var(--border2);
  background: var(--bg3);
  font-size: 0.78rem; color: var(--text2);
  cursor: pointer; transition: all 0.15s;
}
.card-toggle-chip.active {
  border-color: var(--gold);
  background: var(--gold-dim);
  color: var(--gold);
}
.card-toggle-chip .chip-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: currentColor;
}

/* ══════════════════════════════════════════════════════════════════════════
   MONTHLY CALENDAR VIEW
══════════════════════════════════════════════════════════════════════════ */
.month-calendar {
  width: 100%;
  border-collapse: separate;
  border-spacing: 3px;
}
.month-calendar th {
  text-align: center;
  font-size: 0.72rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text3);
  padding: 6px 4px;
}
.month-calendar td {
  vertical-align: top;
  width: calc(100%/7);
  min-height: 80px;
  background: var(--bg3);
  border-radius: 8px;
  padding: 4px;
  cursor: pointer;
  transition: background 0.12s;
  position: relative;
}
.month-calendar td:hover { background: var(--bg4); }
.month-calendar td.today {
  background: var(--gold-dim);
  outline: 1.5px solid var(--gold);
  outline-offset: -1px;
}
.month-calendar td.other-month { opacity: 0.35; }
.cal-day-num {
  font-size: 0.75rem; font-weight: 600;
  color: var(--text2);
  margin-bottom: 3px;
  display: block;
}
.cal-event {
  font-size: 0.7rem;
  padding: 2px 5px;
  border-radius: 4px;
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: var(--gold-dim);
  color: var(--gold);
  border-left: 2px solid var(--gold);
}
.cal-event.ev-confirmed { background: rgba(34,197,94,.12); color: var(--green); border-left-color: var(--green); }
.cal-event.ev-cancelled { background: rgba(239,68,68,.08); color: var(--red); border-left-color: var(--red); text-decoration: line-through; }
.cal-event.ev-completed { background: rgba(100,100,100,.10); color: var(--text3); border-left-color: var(--text3); }
.cal-more { font-size: 0.68rem; color: var(--text3); margin-top: 2px; }

.cal-nav {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 0.75rem;
}
.cal-nav h3 { font-size: 1rem; font-family: 'Oswald', sans-serif; }
.cal-nav-btns { display: flex; gap: 6px; }

.cal-view-toggle {
  display: flex; gap: 4px;
}
.cal-view-btn {
  padding: 4px 12px;
  border-radius: 6px;
  border: 1.5px solid var(--border2);
  background: var(--bg3);
  color: var(--text2);
  font-size: 0.78rem; cursor: pointer; transition: all 0.12s;
}
.cal-view-btn.active { border-color: var(--gold); background: var(--gold-dim); color: var(--gold); }

/* ══════════════════════════════════════════════════════════════════════════
   PUSH NOTIFICATION BANNER
══════════════════════════════════════════════════════════════════════════ */
.push-permission-bar {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.65rem 1rem;
  background: var(--gold-dim);
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  font-size: 0.83rem;
  margin-bottom: 1rem;
}
.push-permission-bar svg { flex-shrink: 0; color: var(--gold); }
.push-permission-bar .push-text { flex: 1; color: var(--text); }
.push-permission-bar .push-allow { margin-left: auto; }
