/* ============================================================
   PREMIER CURSOS — Design System v3.0
   Aesthetic: Premium SaaS × Stripe × Linear — Single-tenant
   ============================================================ */

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

/* ── 1. CUSTOM PROPERTIES (DARK DEFAULT — deep teal-navy) ── */
:root {
  /* Backgrounds — deep blue-teal, not pure black */
  --bg-base:       #080f1a;
  --bg-layer1:     #0c1526;
  --bg-layer2:     #101e30;
  --bg-card:       #121f32;
  --bg-card-hover: #172440;
  --bg-input:      #0e1928;
  --bg-sidebar:    #090f1e;
  --bg-topbar:     rgba(8, 15, 26, 0.90);

  /* Borders */
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-medium: rgba(255, 255, 255, 0.11);
  --border-strong: rgba(255, 255, 255, 0.20);

  /* Text */
  --text-high:    #e8edf5;
  --text-medium:  #7a96b8;
  --text-low:     #3d5570;
  --text-inverse: #080f1a;

  /* Accent palette */
  --accent-color:  #1a6cff;
  --accent-cyan:   #1a6cff;
  --accent-pink:   #f03a84;
  --accent-gold:   #f5a623;
  --accent-purple: #6c63ff;
  --accent-green:  #10c97e;

  /* Gradients */
  --grad-accent:  linear-gradient(135deg, #1a6cff 0%, #6c63ff 100%);
  --grad-warm:    linear-gradient(135deg, #f5a623 0%, #f03a84 100%);

  /* Shadows */
  --shadow-sm:   0 1px 4px rgba(0, 0, 0, 0.35);
  --shadow-md:   0 4px 20px rgba(0, 0, 0, 0.40);
  --shadow-lg:   0 8px 40px rgba(0, 0, 0, 0.50);
  --shadow-glow: 0 0 32px color-mix(in srgb, var(--accent-color) 18%, transparent);
  --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.04);

  /* Layout */
  --sidebar-w:  260px;
  --topbar-h:   64px;

  /* Radii */
  --r-sm:   8px;
  --r-md:   12px;
  --r-lg:   16px;
  --r-xl:   24px;
  --r-full: 9999px;

  /* Transitions */
  --t-fast:   0.15s ease;
  --t-base:   0.3s ease;
  --t-slow:   0.5s ease;
  --t-bounce: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── LIGHT THEME — clean, airy, #f8f9fa base ── */
[data-theme="light"] {
  --bg-base:       #f8f9fa;
  --bg-layer1:     #ffffff;
  --bg-layer2:     #f1f3f5;
  --bg-card:       #ffffff;
  --bg-card-hover: #f7f9fc;
  --bg-input:      #f8f9fa;
  --bg-sidebar:    #ffffff;
  --bg-topbar:     rgba(255, 255, 255, 0.94);

  --border-subtle: rgba(0, 0, 0, 0.06);
  --border-medium: rgba(0, 0, 0, 0.10);
  --border-strong: rgba(0, 0, 0, 0.18);

  --text-high:    #111827;
  --text-medium:  #4b5563;
  --text-low:     #9ca3af;
  --text-inverse: #ffffff;

  --shadow-sm:   0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md:   0 4px 20px rgba(0, 0, 0, 0.08);
  --shadow-lg:   0 8px 40px rgba(0, 0, 0, 0.10);
  --shadow-glow: 0 0 24px rgba(26, 108, 255, 0.10);
  --shadow-card: 0 1px 4px rgba(0, 0, 0, 0.06), 0 4px 16px rgba(0, 0, 0, 0.04);
}

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

html { height: 100%; scroll-behavior: smooth; }

body {
  min-height: 100%;
  background: var(--bg-base);
  color: var(--text-high);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  letter-spacing: -0.01em;
  transition: background var(--t-base), color var(--t-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg-layer1); }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: var(--r-full); }
::-webkit-scrollbar-thumb:hover { background: var(--text-low); }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; }

/* ── 3. APP SHELL ── */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ── SIDEBAR ── */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
  transition: background var(--t-base), border-color var(--t-base);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 20px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.sidebar-brand-icon {
  width: 38px; height: 38px;
  border-radius: var(--r-md);
  background: var(--grad-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 900;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 0 18px color-mix(in srgb, var(--accent-color) 28%, transparent);
  animation: glowPulse 3s ease-in-out infinite;
}

.sidebar-logo-img {
  width: 38px; height: 38px;
  border-radius: var(--r-md);
  object-fit: contain;
  flex-shrink: 0;
  border: 1px solid var(--border-subtle);
}

.sidebar-brand-text p:first-child {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.20em;
  color: var(--text-low);
}
.sidebar-brand-text p:last-child {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-high);
  letter-spacing: -0.3px;
}

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

.sidebar-section-label {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--text-low);
  padding: 14px 8px 5px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  color: var(--text-medium);
  font-size: 13.5px;
  font-weight: 500;
  transition: all var(--t-fast);
  position: relative;
  overflow: hidden;
}
.nav-link:hover {
  background: var(--bg-card);
  color: var(--text-high);
  transform: translateX(3px);
}
.nav-link.active {
  background: var(--bg-card);
  color: var(--accent-color);
  font-weight: 600;
}
.nav-link.active::before {
  content: '';
  position: absolute;
  left: 0; top: 20%;
  height: 60%; width: 3px;
  border-radius: 0 var(--r-full) var(--r-full) 0;
  background: var(--accent-color);
  box-shadow: 0 0 10px var(--accent-color);
}
.nav-icon {
  width: 17px; height: 17px;
  flex-shrink: 0;
  opacity: 0.65;
  transition: opacity var(--t-fast);
}
.nav-link:hover .nav-icon,
.nav-link.active .nav-icon { opacity: 1; }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-subtle);
  font-size: 11px;
  color: var(--text-low);
  flex-shrink: 0;
}

/* ── TOPBAR ── */
.topbar {
  position: fixed;
  top: 0; left: var(--sidebar-w); right: 0;
  height: var(--topbar-h);
  background: var(--bg-topbar);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  z-index: 90;
  transition: background var(--t-base), border-color var(--t-base);
}
.topbar-title h1 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-high);
  letter-spacing: -0.4px;
}
.topbar-title p {
  font-size: 12px;
  color: var(--text-medium);
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ── MAIN CONTENT ── */
.page-content {
  margin-left: var(--sidebar-w);
  margin-top: var(--topbar-h);
  min-height: calc(100vh - var(--topbar-h));
  padding: 32px 28px;
  background: var(--bg-base);
  transition: background var(--t-base);
}

/* ── 4. COMPONENTS ── */

/* THEME TOGGLE */
.btn-theme {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 15px;
  border-radius: var(--r-full);
  border: 1px solid var(--border-medium);
  background: var(--bg-card);
  color: var(--text-medium);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--t-fast);
  white-space: nowrap;
}
.btn-theme:hover {
  border-color: var(--border-strong);
  color: var(--text-high);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

/* AVATAR */
.avatar {
  width: 36px; height: 36px;
  border-radius: var(--r-full);
  background: var(--grad-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  cursor: pointer;
  transition: transform var(--t-fast), box-shadow var(--t-fast);
}
.avatar:hover {
  transform: scale(1.08);
  box-shadow: 0 0 16px color-mix(in srgb, var(--accent-color) 30%, transparent);
}

/* STAT CARDS */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  padding: 22px 20px;
  box-shadow: var(--shadow-card);
  transition: all var(--t-base);
  position: relative;
  overflow: hidden;
  cursor: default;
}
.stat-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--grad-accent);
  opacity: 0;
  transition: opacity var(--t-base);
}
.stat-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-medium);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}
.stat-card:hover::after { opacity: 1; }

.stat-card-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  color: var(--text-medium);
  margin-bottom: 10px;
}
.stat-card-value {
  font-size: 30px;
  font-weight: 800;
  color: var(--text-high);
  letter-spacing: -1px;
  line-height: 1.1;
  margin-bottom: 6px;
}
.stat-card-note {
  font-size: 12px;
  color: var(--text-low);
}

/* PANEL */
.panel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  transition: background var(--t-base), border-color var(--t-base);
  overflow: hidden;
}
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-subtle);
}
.panel-header h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-high);
  letter-spacing: -0.1px;
}
.panel-body { padding: 20px 24px; }

/* DATA TABLE */
.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table thead th {
  text-align: left;
  padding: 10px 16px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-medium);
  background: var(--bg-layer2);
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}
.data-table thead th:first-child { border-radius: var(--r-sm) 0 0 var(--r-sm); }
.data-table thead th:last-child  { border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.data-table tbody tr {
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--t-fast);
}
.data-table tbody tr:last-child { border-bottom: none; }
.data-table tbody tr:hover { background: var(--bg-card-hover); }
.data-table tbody td {
  padding: 13px 16px;
  font-size: 13.5px;
  color: var(--text-high);
  vertical-align: middle;
}

/* BADGES */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid;
  white-space: nowrap;
}
.badge-pending  { background: rgba(245,166,35,0.12);  color: #e6941a;              border-color: rgba(245,166,35,0.30); }
.badge-approved { background: rgba(16,201,126,0.10);  color: var(--accent-green);  border-color: rgba(16,201,126,0.28); }
.badge-rejected { background: rgba(240,58,132,0.10);  color: var(--accent-pink);   border-color: rgba(240,58,132,0.28); }
.badge-active   { background: rgba(26,108,255,0.10);  color: var(--accent-cyan);   border-color: rgba(26,108,255,0.25); }
.badge-master   { background: rgba(108,99,255,0.12);  color: var(--accent-purple); border-color: rgba(108,99,255,0.28); }

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 20px;
  border-radius: var(--r-md);
  font-size: 13.5px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--t-base);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
  letter-spacing: -0.01em;
}
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 20px;
  border-radius: var(--r-md);
  font-size: 13.5px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1;
  text-decoration: none;
  letter-spacing: -0.01em;
  transition: all var(--t-base);
  background: var(--accent-color);
  color: var(--text-on-accent, #fff);
  box-shadow: 0 2px 10px color-mix(in srgb, var(--accent-color) 28%, transparent);
}
.btn-primary:hover {
  filter: brightness(1.10);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px color-mix(in srgb, var(--accent-color) 40%, transparent);
}
.btn-primary:active {
  transform: translateY(0);
  filter: brightness(0.96);
  box-shadow: 0 1px 6px color-mix(in srgb, var(--accent-color) 20%, transparent);
}
.btn-ghost {
  background: transparent;
  color: var(--text-medium);
  border-color: var(--border-medium);
  transition: all var(--t-base);
}
.btn-ghost:hover {
  background: var(--bg-card-hover);
  color: var(--text-high);
  border-color: var(--border-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.btn-ghost:active { transform: translateY(0); }
.btn-danger {
  background: rgba(240, 58, 132, 0.10);
  color: var(--accent-pink);
  border-color: rgba(240, 58, 132, 0.28);
  transition: all var(--t-base);
}
.btn-danger:hover {
  background: rgba(240, 58, 132, 0.20);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(240, 58, 132, 0.20);
}

/* INPUTS */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.input-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-medium);
  text-transform: uppercase;
  letter-spacing: 0.10em;
}
.input-field {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-medium);
  border-radius: var(--r-sm);
  color: var(--text-high);
  font-size: 13.5px;
  font-family: inherit;
  transition: border-color var(--t-base), box-shadow var(--t-base);
  outline: none;
}
.input-field:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-color) 12%, transparent);
}
.input-field:hover:not(:focus) { border-color: var(--border-strong); }
.input-field::placeholder { color: var(--text-low); }

/* ALERTS */
.alert {
  padding: 11px 16px;
  border-radius: var(--r-sm);
  font-size: 13.5px;
  border: 1px solid;
  margin-bottom: 16px;
}
.alert-error   { background: rgba(240,58,132,0.09);  border-color: rgba(240,58,132,0.28); color: #ff6bae; }
.alert-success { background: rgba(0,255,163,0.07);   border-color: rgba(0,255,163,0.25);  color: var(--accent-green); }

/* ── 5. LOGIN PAGE ── */
.login-bg {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
  background: var(--bg-base);
}
.login-bg::before {
  content: '';
  position: absolute;
  width: 640px; height: 640px;
  background: radial-gradient(circle, rgba(10,240,224,0.07) 0%, transparent 70%);
  top: -120px; right: -160px;
  pointer-events: none;
}
.login-bg::after {
  content: '';
  position: absolute;
  width: 520px; height: 520px;
  background: radial-gradient(circle, rgba(240,58,132,0.06) 0%, transparent 70%);
  bottom: -120px; left: -120px;
  pointer-events: none;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--r-xl);
  padding: 42px 36px;
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 1;
  transition: background var(--t-base), border-color var(--t-base);
}
.login-card-header {
  text-align: center;
  margin-bottom: 32px;
}
.login-logo {
  width: 58px; height: 58px;
  border-radius: var(--r-lg);
  background: var(--grad-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 900;
  color: #fff;
  margin: 0 auto 18px;
  animation: glowPulse 3s ease-in-out infinite;
}
.login-card-header h1 {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-high);
  letter-spacing: -0.6px;
  margin-bottom: 5px;
}
.login-card-header p {
  font-size: 13px;
  color: var(--text-medium);
}
.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.login-submit {
  width: 100%;
  padding: 12px;
  margin-top: 4px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  justify-content: center;
}

/* ── 6. PAGE HEADER ── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.page-header h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-high);
  letter-spacing: -0.6px;
}
.page-header p {
  font-size: 13px;
  color: var(--text-medium);
  margin-top: 3px;
  letter-spacing: 0em;
}

/* ── 7. ANIMATIONS ── */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-18px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.93); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes glowPulse {
  0%,100% { box-shadow: 0 0 16px color-mix(in srgb, var(--accent-color) 22%, transparent); }
  50%      { box-shadow: 0 0 36px color-mix(in srgb, var(--accent-color) 50%, transparent); }
}

.anim-fade-in    { animation: fadeIn 0.5s ease both; }
.anim-slide-up   { animation: slideUp 0.55s ease both; }
.anim-scale-in   { animation: scaleIn 0.45s cubic-bezier(0.34,1.56,0.64,1) both; }
.anim-slide-left { animation: slideInLeft 0.45s ease both; }

.delay-100 { animation-delay: 0.10s; }
.delay-200 { animation-delay: 0.20s; }
.delay-300 { animation-delay: 0.30s; }
.delay-400 { animation-delay: 0.40s; }
.delay-500 { animation-delay: 0.50s; }
.delay-600 { animation-delay: 0.60s; }

/* ── 8. MODAL ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-base);
}
.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}
.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--r-xl);
  width: 100%;
  max-width: 560px;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px) scale(0.97);
  transition: transform var(--t-bounce), opacity var(--t-base);
  opacity: 0;
}
.modal-overlay.active .modal-box {
  transform: translateY(0) scale(1);
  opacity: 1;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
}
.modal-header h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-high);
}
.modal-close {
  width: 30px; height: 30px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-medium);
  background: transparent;
  color: var(--text-low);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--t-fast);
  line-height: 1;
}
.modal-close:hover {
  background: var(--bg-card-hover);
  color: var(--text-high);
  border-color: var(--border-strong);
}
.modal-body  { padding: 24px; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border-subtle);
}

/* ── 9. FORM GRID ── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ── 10. COLOR PICKER ── */
.color-input-wrap {
  display: flex;
  gap: 8px;
  align-items: center;
}
.color-picker-input {
  width: 46px;
  height: 42px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-medium);
  background: var(--bg-input);
  cursor: pointer;
  padding: 3px;
  flex-shrink: 0;
}
.color-dot {
  display: inline-block;
  width: 14px; height: 14px;
  border-radius: 50%;
  vertical-align: middle;
  border: 2px solid rgba(255,255,255,0.18);
  margin-right: 4px;
}

/* ── 11. TOAST ── */
.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  padding: 13px 20px;
  border-radius: var(--r-md);
  font-size: 13.5px;
  font-weight: 500;
  z-index: 9999;
  opacity: 0;
  transform: translateY(14px) scale(0.97);
  transition: opacity 0.25s ease, transform 0.30s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
  background: #0e1a2e;
  border: 1px solid rgba(255,255,255,0.10);
  border-left: 4px solid var(--accent-color);
  box-shadow: 0 8px 32px rgba(0,0,0,0.55), 0 2px 8px rgba(0,0,0,0.3);
  color: #dbe8f8;
  max-width: 380px;
  min-width: 260px;
}
[data-theme="light"] .toast {
  background: #0c1828;
  border-color: rgba(255,255,255,0.08);
  color: #d4e4f7;
}
.toast-show {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.toast-success {
  background: #081f14;
  border-left-color: #10c97e;
  color: #a8f0cc;
}
[data-theme="light"] .toast-success {
  background: #071912;
  border-left-color: #0da866;
  color: #9ee8c0;
}
.toast-error {
  background: #1e0a14;
  border-left-color: #f03a84;
  color: #f8c0d4;
}
[data-theme="light"] .toast-error {
  background: #1a0810;
  border-left-color: #d4245e;
  color: #f0a8be;
}

/* ── 12. UTILITIES ── */
.flex            { display: flex; }
.flex-col        { flex-direction: column; }
.items-center    { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2   { gap: 8px; }
.gap-3   { gap: 12px; }
.gap-4   { gap: 16px; }
.mt-2    { margin-top: 8px; }
.mt-4    { margin-top: 16px; }
.mb-6    { margin-bottom: 24px; }
.w-full  { width: 100%; }
.font-semibold { font-weight: 600; }
.font-bold     { font-weight: 700; }
.text-sm       { font-size: 13px; }
.text-xs       { font-size: 11px; }
.text-accent   { color: var(--accent-cyan); }
.text-muted    { color: var(--text-medium); }
.overflow-x-auto { overflow-x: auto; }

/* ── 13. FORM GRID UTILITIES ── */
.form-grid .span-full { grid-column: 1 / -1; }

.panel-body { padding: 20px 24px; }

/* ── 14. BUTTON DANGER ── */
.btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: var(--r-md);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--t-fast);
    border: 1px solid rgba(240,58,132,0.40);
    background: rgba(240,58,132,0.10);
    color: var(--accent-pink);
}
.btn-danger:hover {
    background: rgba(240,58,132,0.22);
    border-color: var(--accent-pink);
    box-shadow: 0 0 12px rgba(240,58,132,0.25);
}
.btn-danger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ── 15. BADGE MASTER / ENROLLED ── */
.badge-master {
    background: color-mix(in srgb, var(--accent-color) 14%, transparent);
    color: var(--accent-color);
    border: 1px solid color-mix(in srgb, var(--accent-color) 35%, transparent);
    box-shadow: 0 0 8px color-mix(in srgb, var(--accent-color) 18%, transparent);
}

/* ── 16. TAB BUTTONS (settings page) ── */
.tab-btn {
    padding: 10px 20px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-medium);
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--t-base);
    white-space: nowrap;
    letter-spacing: -0.01em;
}
.tab-btn:hover {
    color: var(--text-high);
    background: var(--bg-card-hover);
}
.tab-btn.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
    font-weight: 600;
}

/* ── 17. INPUT GROUP (label + input pair) ── */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.input-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-medium);
    letter-spacing: 0.02em;
}

/* ── 18. CONDITIONAL CHECKBOX LABEL ── */
.cond-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-medium);
    cursor: pointer;
    padding: 8px 0;
}
.cond-checkbox-label:hover { color: var(--text-high); }

/* ── 19a. Extra utility classes for Teachers / Email modal ── */
.btn-secondary {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 18px; border-radius: var(--r-md); font-size: 13.5px; font-weight: 600;
    cursor: pointer; border: 1.5px solid var(--border-medium);
    background: var(--bg-card); color: var(--text-medium);
    transition: background .18s, color .18s;
}
.btn-secondary:hover { background: var(--bg-card-hover); color: var(--text-high); }

.btn-icon {
    background: transparent; border: none; cursor: pointer;
    font-size: 16px; padding: 4px 6px; border-radius: 6px;
    opacity: .75; transition: opacity .15s, background .15s;
}
.btn-icon:hover { opacity: 1; background: var(--bg-card-hover); }
.btn-icon-danger:hover { background: rgba(240,58,132,.12); }

.badge-inactive { background: rgba(100,100,120,.10); color: var(--text-low); border-color: rgba(100,100,120,.22); }

.form-input {
    width: 100%; padding: 10px 14px; border-radius: 8px; font-size: 13.5px;
    border: 1.5px solid var(--border-medium); background: var(--bg-input, var(--bg-card));
    color: var(--text-high); outline: none; transition: border-color .2s;
    font-family: inherit;
}
.form-input:focus { border-color: var(--accent-color); }

/* ── 19. TEXT-ON-ACCENT contrast utility ── */
/*  JS sets --text-on-accent to #000 or #fff based on accent luminance  */
.text-on-accent { color: var(--text-on-accent, #000); }
.btn-primary,
.avatar {
    color: var(--text-on-accent, #000);
}

/* ── 20. USER MENU DROPDOWN ── */
.user-menu {
  position: relative;
}
.user-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 215px;
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--border-subtle);
  z-index: 9998;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-8px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.22s cubic-bezier(0.34,1.56,0.64,1);
}
.user-dropdown.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}
.user-dropdown-header {
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border-subtle);
}
.user-dropdown-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-high);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}
.user-dropdown-role {
  font-size: 11px;
  color: var(--text-medium);
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.user-dropdown-items { padding: 6px; }
.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  color: var(--text-medium);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
  text-decoration: none;
  border: none;
  background: none;
  width: 100%;
  box-sizing: border-box;
  text-align: left;
}
.user-dropdown-item:hover {
  background: var(--bg-card-hover);
  color: var(--text-high);
}
.user-dropdown-item.danger:hover {
  background: rgba(240,58,132,0.10);
  color: var(--accent-pink);
}
.user-dropdown-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 4px 6px;
}

/* ── 21. MONITORING CARDS ── */
.mon-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}
.mon-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-card);
  transition: all var(--t-base);
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  overflow: hidden;
}
.mon-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  border-radius: var(--r-sm) 0 0 var(--r-sm);
}
.mon-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-medium);
}
.mon-card[data-color="green"]::before  { background: #10c97e; }
.mon-card[data-color="yellow"]::before { background: #f5a623; }
.mon-card[data-color="red"]::before    { background: #ef4444; }
.mon-card[data-color="gray"]::before   { background: var(--border-strong); }

.mon-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.mon-card-id {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-low);
  letter-spacing: 0.05em;
}
.mon-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-high);
  letter-spacing: -0.2px;
  margin-top: 2px;
}
.mon-card-company {
  font-size: 12px;
  color: var(--text-medium);
  margin-top: 1px;
}
.mon-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}
.mon-card-meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  color: var(--text-medium);
}
.mon-card-meta-item svg {
  width: 12px; height: 12px;
  flex-shrink: 0;
  opacity: 0.6;
}
.mon-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
  margin-top: auto;
}

/* Semaphore pastel badges */
.sem-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 600;
  border: 1px solid;
  white-space: nowrap;
}
.sem-green  { background: rgba(16,201,126,0.12); color: #0fa96a; border-color: rgba(16,201,126,0.30); }
.sem-yellow { background: rgba(245,166,35,0.12);  color: #c97f10; border-color: rgba(245,166,35,0.30); }
.sem-red    { background: rgba(239,68,68,0.11);   color: #dc2626; border-color: rgba(239,68,68,0.28); }
.sem-gray   { background: rgba(107,114,128,0.10); color: #6b7280; border-color: rgba(107,114,128,0.24); }
[data-theme="light"] .sem-green  { background: rgba(16,201,126,0.10); color: #0a7d4f; }
[data-theme="light"] .sem-yellow { background: rgba(245,166,35,0.10); color: #9a600a; }
[data-theme="light"] .sem-red    { background: rgba(239,68,68,0.10);  color: #b91c1c; }
[data-theme="light"] .sem-gray   { background: rgba(107,114,128,0.08);color: #4b5563; }

/* KPI stat strip for monitoring */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all var(--t-base);
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.kpi-icon {
  width: 42px; height: 42px;
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.kpi-icon-green  { background: rgba(16,201,126,0.12); }
.kpi-icon-yellow { background: rgba(245,166,35,0.12); }
.kpi-icon-red    { background: rgba(239,68,68,0.10); }
.kpi-icon-gray   { background: rgba(107,114,128,0.10); }
.kpi-num {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-high);
  letter-spacing: -0.8px;
  line-height: 1;
}
.kpi-lbl {
  font-size: 12px;
  color: var(--text-medium);
  margin-top: 3px;
}
@media (max-width: 768px) {
  .kpi-strip { grid-template-columns: repeat(2, 1fr); }
  .mon-cards-grid { grid-template-columns: 1fr; }
}
