/* ==========================================================================
   INFINITY HEALTH — DESIGN SYSTEM
   ========================================================================== */

:root {
  /* Colors — light theme (default). Brand: amber #F3AC0B, white, black. */
  --bg-primary: #F7F8FA;
  --bg-secondary: #F1F2F5;
  --bg-elevated: #FFFFFF;
  --bg-elevated-2: #F8FAFC;
  --bg-topbar: rgba(255, 255, 255, 0.82);
  --border-subtle: #E5E7EB;
  --border-strong: #D1D5DB;

  --brand-amber: #F3AC0B;
  --brand-amber-dim: rgba(243, 172, 11, 0.14);
  --brand-amber-ink: #1A1200;
  --health-green: #10B981;
  --health-green-dim: rgba(16, 185, 129, 0.12);
  --trust-blue: #2563EB;
  --trust-blue-dim: rgba(37, 99, 235, 0.12);
  --alert-yellow: #F59E0B;
  --alert-yellow-dim: rgba(245, 158, 11, 0.12);
  --critical-red: #EF4444;
  --critical-red-dim: rgba(239, 68, 68, 0.12);

  --text-primary: #111111;
  --text-secondary: #4B5563;
  --text-muted: #9CA3AF;

  /* Typography */
  --font-body: "Inter", "Open Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: "Space Grotesk", "Inter", sans-serif;

  /* Spacing scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  /* Radii & shadows */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 999px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.10);
  --shadow-glow-amber: 0 0 0 1px rgba(243, 172, 11, 0.3), 0 8px 24px rgba(243, 172, 11, 0.12);
  --shadow-glow-green: 0 0 0 1px rgba(16, 185, 129, 0.25), 0 8px 24px rgba(16, 185, 129, 0.08);
  --shadow-glow-blue: 0 0 0 1px rgba(37, 99, 235, 0.25), 0 8px 24px rgba(37, 99, 235, 0.08);

  --sidebar-width: 264px;
  --sidebar-width-collapsed: 76px;
  --header-height: 72px;

  --transition-fast: 150ms ease;
  --transition-base: 220ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark theme override — toggled via [data-theme="dark"] on <html> */
:root[data-theme="dark"] {
  --bg-primary: #0B1220;
  --bg-secondary: #111827;
  --bg-elevated: #161F31;
  --bg-elevated-2: #1C2740;
  --bg-topbar: rgba(11, 18, 32, 0.85);
  --border-subtle: #1F2A44;
  --border-strong: #2B3A5C;

  --brand-amber: #F3AC0B;
  --brand-amber-dim: rgba(243, 172, 11, 0.16);
  --brand-amber-ink: #1A1200;
  --health-green-dim: rgba(16, 185, 129, 0.14);
  --trust-blue-dim: rgba(37, 99, 235, 0.14);
  --alert-yellow-dim: rgba(245, 158, 11, 0.14);
  --critical-red-dim: rgba(239, 68, 68, 0.14);

  --text-primary: #FFFFFF;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
}

/* Reset
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
h1, h2, h3, h4, h5, h6 { font-family: var(--font-heading); margin: 0; font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }
ul, ol { margin: 0; padding: 0; list-style: none; }
input, select, textarea { font-family: inherit; }

::selection { background: var(--brand-amber); color: var(--brand-amber-ink); }

/* Focus visibility for accessibility */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--brand-amber);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -48px;
  left: var(--space-4);
  background: var(--brand-amber);
  color: var(--brand-amber-ink);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  z-index: 1000;
  transition: top var(--transition-fast);
  font-weight: 600;
}
.skip-link:focus { top: var(--space-4); }

/* ==========================================================================
   AUTH / LOGIN SCREENS
   ========================================================================== */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(243, 172, 11, 0.08), transparent 60%),
    radial-gradient(1000px 600px at 100% 100%, rgba(37, 99, 235, 0.06), transparent 55%),
    var(--bg-primary);
}
:root[data-theme="dark"] .auth-page {
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(239, 68, 68, 0.10), transparent 60%),
    radial-gradient(1000px 600px at 100% 100%, rgba(37, 99, 235, 0.12), transparent 55%),
    var(--bg-primary);
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  box-shadow: var(--shadow-md);
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}
.auth-brand__mark {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.auth-brand__mark img { width: 100%; height: 100%; object-fit: contain; }
.auth-brand__name { font-family: var(--font-heading); font-size: 1.1rem; font-weight: 700; }
.auth-brand__panel { font-size: 0.8rem; color: var(--text-secondary); }

.auth-title { font-size: 1.5rem; margin-bottom: var(--space-1); }
.auth-subtitle { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: var(--space-6); }

.panel-picker {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
  margin-top: var(--space-6);
}
.panel-picker__item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
  padding: var(--space-4);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}
.panel-picker__item:hover, .panel-picker__item:focus-visible {
  border-color: var(--brand-amber);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow-amber);
}
.panel-picker__icon { font-size: 1.4rem; }
.panel-picker__label { font-weight: 600; font-size: 0.95rem; }
.panel-picker__desc { font-size: 0.78rem; color: var(--text-secondary); }

/* ==========================================================================
   SPLIT LOGIN (unified index.html)
   ========================================================================== */
.split-auth { min-height: 100vh; display: flex; }
.split-auth__brand {
  flex: 1 1 60%;
  display: flex;
  align-items: center;
  padding: var(--space-12);
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px) 0 0 / 42px 42px,
    linear-gradient(0deg, rgba(255,255,255,0.05) 1px, transparent 1px) 0 0 / 42px 42px,
    linear-gradient(135deg, #F3AC0B 0%, #000000 45%, #000000 100%);
  color: #fff;
}
.split-auth__brand::before {
  content: "";
  position: absolute; inset: 0;
  background: url("../images/05.png") center 20% / cover no-repeat;
  opacity: 0.16;
  z-index: 0;
}
.split-auth__brand-inner { position: relative; z-index: 1; max-width: 460px; }
.split-auth__headline { font-size: 2.4rem; line-height: 1.15; margin-bottom: var(--space-5); }
.split-auth__headline-accent { color: var(--brand-amber); }
.split-auth__subtext { color: #B8C2D6; font-size: 0.98rem; line-height: 1.6; margin-bottom: var(--space-8); }
.split-auth__features { display: flex; flex-direction: column; gap: var(--space-4); }
.split-auth__features li { display: flex; align-items: center; gap: var(--space-3); font-size: 0.92rem; color: #E2E8F0; }
.split-auth__feature-check {
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(243, 172, 11, 0.18);
  color: var(--brand-amber);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.split-auth__form {
  flex: 1 1 40%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8);
  background: var(--bg-primary);
}
.split-auth__form-inner { width: 100%; max-width: 400px; }
.split-auth__form-inner .btn-primary { background: #000; color: #fff; }
@media (max-width: 900px) {
  .split-auth__brand { display: none; }
  .split-auth__form { flex: 1 1 100%; }
}

.demo-hint {
  margin-top: var(--space-5);
  padding: var(--space-3) var(--space-4);
  background: var(--trust-blue-dim);
  border: 1px solid rgba(37, 99, 235, 0.3);
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  color: var(--text-secondary);
}
.demo-hint strong { color: var(--text-primary); }

/* ==========================================================================
   FORM ELEMENTS
   ========================================================================== */
.field { margin-bottom: var(--space-5); }
.field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.92rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.field input::placeholder, .field textarea::placeholder { color: var(--text-muted); }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--brand-amber);
  box-shadow: 0 0 0 3px var(--brand-amber-dim);
  outline: none;
}
.field textarea { resize: vertical; min-height: 90px; }
.field-hint { font-size: 0.76rem; color: var(--text-muted); margin-top: var(--space-1); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
@media (max-width: 640px) { .field-row { grid-template-columns: 1fr; } }

.checkbox-row { display: flex; align-items: center; gap: var(--space-2); font-size: 0.85rem; color: var(--text-secondary); }
.checkbox-row input { width: 16px; height: 16px; accent-color: var(--brand-amber); }

/* Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  border: 1px solid transparent;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast);
  white-space: nowrap;
}
.btn:active { transform: scale(0.98); }
.btn-block { width: 100%; }
.btn-sm { padding: var(--space-2) var(--space-3); font-size: 0.8rem; }

.btn-primary { background: linear-gradient(135deg, #000 0%, var(--brand-amber) 140%); color: #fff; }
.btn-primary:hover { box-shadow: var(--shadow-glow-amber); filter: brightness(1.08); }

.btn-create { background: linear-gradient(135deg, #000 0%, var(--brand-amber) 140%); color: #fff; }
.btn-create:hover { box-shadow: var(--shadow-glow-amber); filter: brightness(1.08); }

.btn-secondary { background: var(--trust-blue); color: #fff; }
.btn-secondary:hover { box-shadow: var(--shadow-glow-blue); }

.btn-ghost { background: transparent; border-color: var(--border-strong); color: var(--text-primary); }
.btn-ghost:hover { border-color: var(--text-secondary); }

.btn-danger { background: var(--critical-red); color: #fff; }
.btn-danger:hover { box-shadow: 0 0 0 1px rgba(239,68,68,0.3), 0 8px 24px rgba(239,68,68,0.15); }

.btn-icon {
  width: 38px; height: 38px; padding: 0;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  display: inline-flex; align-items: center; justify-content: center;
}
.btn-icon:hover { color: var(--text-primary); border-color: var(--border-strong); }

.btn:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; transform: none; }

/* ==========================================================================
   APP SHELL — SIDEBAR + HEADER + MAIN
   ========================================================================== */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: 100vh;
}
.app-shell.is-collapsed { grid-template-columns: var(--sidebar-width-collapsed) 1fr; }

.sidebar {
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-subtle);
  padding: var(--space-5) var(--space-4);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 20;
}
.sidebar__brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 0 var(--space-2) var(--space-5);
  margin-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
}
.sidebar__mark {
  width: 38px; height: 38px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.sidebar__mark img { width: 100%; height: 100%; object-fit: contain; }
.sidebar__brand-text { overflow: hidden; }
.sidebar__brand-name { font-family: var(--font-heading); font-weight: 700; font-size: 0.95rem; white-space: nowrap; }
.sidebar__brand-panel { font-size: 0.72rem; color: var(--text-secondary); white-space: nowrap; }
.app-shell.is-collapsed .sidebar__brand-text,
.app-shell.is-collapsed .nav-link__label,
.app-shell.is-collapsed .sidebar__section-label { display: none; }

.sidebar__section-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: var(--space-4) var(--space-2) var(--space-2);
}

.nav-list { display: flex; flex-direction: column; gap: var(--space-1); flex: 1; }
.nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-3);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.nav-link__icon { font-size: 1.05rem; width: 22px; text-align: center; flex-shrink: 0; }
.nav-link:hover { background: var(--bg-elevated); color: var(--text-primary); }
.nav-link.is-active { background: var(--brand-amber-dim); color: var(--brand-amber); }

.sidebar__footer {
  border-top: 1px solid var(--border-subtle);
  padding-top: var(--space-4);
  margin-top: var(--space-4);
}
.sidebar__collapse-btn {
  width: 100%;
  display: flex; align-items: center; gap: var(--space-2);
  background: transparent; border: none; color: var(--text-muted);
  font-size: 0.78rem; padding: var(--space-2);
}
.sidebar__collapse-btn:hover { color: var(--text-secondary); }

.main-col { display: flex; flex-direction: column; min-width: 0; }

.topbar {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 0 var(--space-6);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-topbar);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar__search {
  flex: 1;
  max-width: 420px;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: var(--space-2) var(--space-4);
  color: var(--text-muted);
}
.topbar__search input {
  background: none; border: none; color: var(--text-primary);
  font-size: 0.85rem; width: 100%;
}
.topbar__search input:focus { outline: none; }
.topbar__actions { display: flex; align-items: center; gap: var(--space-3); }

.icon-btn {
  position: relative;
  width: 40px; height: 40px;
  border-radius: var(--radius-full);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.05rem;
}
.icon-btn:hover { color: var(--text-primary); border-color: var(--border-strong); }
.icon-btn__badge {
  position: absolute; top: -2px; right: -2px;
  min-width: 16px; height: 16px; padding: 0 3px;
  border-radius: var(--radius-full);
  background: var(--critical-red);
  color: #fff; font-size: 0.62rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg-primary);
}

.user-chip {
  display: flex; align-items: center; gap: var(--space-2);
  padding: var(--space-1) var(--space-2) var(--space-1) var(--space-1);
  border-radius: var(--radius-full);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
}
.user-chip__avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--trust-blue), var(--critical-red));
  display: flex; align-items: center; justify-content: center;
  font-size: 0.78rem; font-weight: 700; color: #fff;
}
.user-chip__name { font-size: 0.82rem; font-weight: 600; }
.user-chip__role { font-size: 0.68rem; color: var(--text-secondary); }

.dropdown-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 320px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  z-index: 50;
  display: none;
  overflow: hidden;
}
.dropdown-panel.is-open { display: block; }
.dropdown-panel__header {
  padding: var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
  font-weight: 600; font-size: 0.85rem;
}
.dropdown-panel__list { max-height: 320px; overflow-y: auto; }
.dropdown-item {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.8rem;
}
.dropdown-item:last-child { border-bottom: none; }
.dropdown-item__title { font-weight: 600; margin-bottom: 2px; }
.dropdown-item__meta { color: var(--text-muted); font-size: 0.72rem; }
.dropdown-panel__footer { padding: var(--space-3); text-align: center; border-top: 1px solid var(--border-subtle); }

.relative { position: relative; }

.content {
  padding: var(--space-6);
  flex: 1;
}
.content-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
}
.content-header h1 { font-size: 1.5rem; margin-bottom: var(--space-1); }
.content-header p { color: var(--text-secondary); font-size: 0.88rem; }
.content-header__actions { display: flex; gap: var(--space-3); flex-wrap: wrap; }

.breadcrumb { font-size: 0.78rem; color: var(--text-muted); margin-bottom: var(--space-2); }
.breadcrumb span { color: var(--text-secondary); }

/* ==========================================================================
   CARDS / KPI / GRID
   ========================================================================== */
.grid { display: grid; gap: var(--space-5); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1100px) { .grid-cols-4 { grid-template-columns: repeat(2, 1fr); } .grid-cols-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid-cols-4, .grid-cols-3, .grid-cols-2 { grid-template-columns: 1fr; } }

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  transition: box-shadow var(--transition-fast), border-color var(--transition-fast);
}
.card:hover { border-color: var(--border-strong); }
.card-glow { box-shadow: 0 0 0 1px rgba(255,255,255,0.02) inset; }

.kpi-card__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-4); }
.kpi-card__icon {
  width: 42px; height: 42px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  background: var(--critical-red-dim); color: var(--text-primary);
}
.kpi-card__icon.is-blue { background: var(--trust-blue-dim); color: var(--text-primary); }
.kpi-card__icon.is-yellow { background: var(--alert-yellow-dim); color: var(--text-primary); }
.kpi-card__icon.is-red { background: var(--critical-red-dim); color: var(--text-primary); }
.kpi-card__trend { font-size: 0.74rem; font-weight: 700; padding: 2px 8px; border-radius: var(--radius-full); }
.kpi-card__trend.is-up { color: var(--health-green); background: var(--health-green-dim); }
.kpi-card__trend.is-down { color: var(--critical-red); background: var(--critical-red-dim); }
.kpi-card__value { font-family: var(--font-heading); font-size: 1.7rem; font-weight: 700; margin-bottom: 2px; }
.kpi-card__label { font-size: 0.8rem; color: var(--text-secondary); }

.card-title { font-size: 1rem; font-weight: 700; margin-bottom: var(--space-1); }
.card-subtitle { font-size: 0.8rem; color: var(--text-secondary); margin-bottom: var(--space-4); }

/* Simple bar/line chart placeholders built with divs */
.bars-chart { display: flex; align-items: flex-end; gap: var(--space-2); height: 160px; padding-top: var(--space-4); }
.bars-chart__bar {
  flex: 1;
  background: linear-gradient(180deg, var(--health-green), #000);
  border-radius: 6px 6px 0 0;
  position: relative;
  min-height: 4px;
}
.bars-chart__bar span {
  position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  font-size: 0.68rem; color: var(--text-muted); white-space: nowrap;
}
.bars-chart__labels { display: flex; gap: var(--space-2); margin-top: var(--space-2); }
.bars-chart__labels span { flex: 1; text-align: center; font-size: 0.7rem; color: var(--text-muted); }

/* ==========================================================================
   BENEFIT CARDS (Aluno)
   ========================================================================== */
.benefit-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}
.benefit-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.benefit-card__icon {
  width: 48px; height: 48px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  background: linear-gradient(135deg, #000 0%, var(--brand-amber) 140%);
  color: #fff;
}
.benefit-card__title { font-weight: 700; font-size: 1rem; }
.benefit-card__desc { font-size: 0.82rem; color: var(--text-secondary); flex: 1; }
.benefit-card.is-locked { opacity: 0.5; }
.benefit-card.is-locked .benefit-card__icon { background: var(--bg-secondary); color: var(--text-muted); }

/* ==========================================================================
   TABLES
   ========================================================================== */
.table-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-4); margin-bottom: var(--space-4); flex-wrap: wrap;
}
.table-toolbar__filters { display: flex; gap: var(--space-3); flex-wrap: wrap; flex: 1; }
.table-search {
  display: flex; align-items: center; gap: var(--space-2);
  background: var(--bg-secondary); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm); padding: var(--space-2) var(--space-3);
  min-width: 220px;
}
.table-search input { background: none; border: none; color: var(--text-primary); width: 100%; font-size: 0.85rem; }
.table-search input:focus { outline: none; }
.table-filter select {
  background: var(--bg-secondary); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm); color: var(--text-primary);
  padding: var(--space-2) var(--space-3); font-size: 0.82rem;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
}
table.data-table { width: 100%; border-collapse: collapse; min-width: 640px; }
.data-table th {
  text-align: left; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--text-muted); padding: var(--space-4); border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}
.data-table td {
  padding: var(--space-4); border-bottom: 1px solid var(--border-subtle);
  font-size: 0.85rem; vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--bg-elevated-2); }
.data-table__name { display: flex; align-items: center; gap: var(--space-3); }
.data-table__avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--trust-blue), var(--critical-red));
  display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem; font-weight: 700; color: #fff; flex-shrink: 0;
}
.row-actions { display: flex; gap: var(--space-2); }
.table-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-4); font-size: 0.78rem; color: var(--text-secondary);
}

/* Badges
   ========================================================================== */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: var(--radius-full);
  font-size: 0.72rem; font-weight: 700; white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-green { background: var(--critical-red-dim); color: var(--critical-red); }
.badge-blue { background: var(--trust-blue-dim); color: var(--trust-blue); }
.badge-yellow { background: var(--alert-yellow-dim); color: var(--alert-yellow); }
.badge-red { background: var(--critical-red-dim); color: var(--critical-red); }
.badge-gray { background: rgba(148, 163, 184, 0.14); color: var(--text-secondary); }

/* ==========================================================================
   TOASTS
   ========================================================================== */
.toast-stack {
  position: fixed; top: var(--space-6); right: var(--space-6);
  display: flex; flex-direction: column; gap: var(--space-3);
  z-index: 1000;
}
.toast {
  display: flex; align-items: flex-start; gap: var(--space-3);
  min-width: 280px; max-width: 360px;
  background: var(--bg-elevated); border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--critical-red);
  border-radius: var(--radius-md); padding: var(--space-4);
  box-shadow: var(--shadow-md);
  animation: toast-in var(--transition-base);
}
.toast.is-leaving { animation: toast-out var(--transition-base) forwards; }
.toast-success { border-left-color: var(--health-green); }
.toast-info { border-left-color: var(--trust-blue); }
.toast-warning { border-left-color: var(--alert-yellow); }
.toast-error { border-left-color: var(--critical-red); }
.toast__icon { font-size: 1.1rem; }
.toast__title { font-size: 0.85rem; font-weight: 700; margin-bottom: 2px; }
.toast__msg { font-size: 0.78rem; color: var(--text-secondary); }
@keyframes toast-in { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toast-out { from { opacity: 1; } to { opacity: 0; transform: translateX(24px); } }

/* ==========================================================================
   SKELETON LOADING
   ========================================================================== */
.skeleton {
  background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--bg-elevated-2) 37%, var(--bg-elevated) 63%);
  background-size: 400% 100%;
  animation: skeleton-shine 1.4s ease infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeleton-shine { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.skeleton-text { height: 12px; margin-bottom: 8px; width: 100%; }
.skeleton-title { height: 20px; width: 60%; margin-bottom: var(--space-3); }
.skeleton-card { height: 110px; }

/* Fade/slide in for content */
.fade-in { animation: fade-in var(--transition-base) both; }
@keyframes fade-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* ==========================================================================
   MODALS
   ========================================================================== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(5, 9, 18, 0.72);
  display: none; align-items: center; justify-content: center;
  padding: var(--space-4); z-index: 200;
}
.modal-overlay.is-open { display: flex; }
.modal {
  width: 100%; max-width: 480px;
  background: var(--bg-elevated); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-md);
  padding: var(--space-6);
  animation: fade-in var(--transition-base);
  max-height: 90vh; overflow-y: auto;
}
.modal--lg { max-width: 660px; }
.modal__header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-5); }
.modal__title { font-size: 1.1rem; }
.modal__footer { display: flex; justify-content: flex-end; gap: var(--space-3); margin-top: var(--space-6); }

/* ==========================================================================
   CALENDAR / AGENDA
   ========================================================================== */
.agenda-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-5); flex-wrap: wrap; gap: var(--space-3); }
.agenda-toolbar__nav { display: flex; align-items: center; gap: var(--space-3); }
.agenda-week {
  display: grid; grid-template-columns: 72px repeat(6, 1fr);
  border: 1px solid var(--border-subtle); border-radius: var(--radius-lg);
  overflow: hidden; background: var(--bg-elevated);
}
.agenda-week__head { padding: var(--space-3); text-align: center; font-size: 0.75rem; color: var(--text-secondary); border-bottom: 1px solid var(--border-subtle); border-left: 1px solid var(--border-subtle); }
.agenda-week__head:first-child { border-left: none; }
.agenda-week__time { padding: var(--space-2); font-size: 0.7rem; color: var(--text-muted); text-align: right; border-top: 1px solid var(--border-subtle); }
.agenda-slot {
  border-top: 1px solid var(--border-subtle); border-left: 1px solid var(--border-subtle);
  min-height: 48px; padding: 4px; position: relative;
}
.agenda-slot.is-free { background: var(--critical-red-dim); }
.agenda-slot.is-busy { background: var(--trust-blue-dim); }
.agenda-slot.is-blocked { background: repeating-linear-gradient(45deg, rgba(148,163,184,0.08), rgba(148,163,184,0.08) 6px, transparent 6px, transparent 12px); }
.agenda-slot__chip {
  font-size: 0.66rem; padding: 2px 6px; border-radius: 6px; font-weight: 700;
  display: block; text-align: center;
}
.agenda-slot.is-free .agenda-slot__chip { background: var(--critical-red); color: #fff; }
.agenda-slot.is-busy .agenda-slot__chip { background: var(--trust-blue); color: #fff; }
.agenda-slot.is-blocked .agenda-slot__chip { color: var(--text-muted); }
.agenda-slot button { width: 100%; height: 100%; background: none; border: none; padding: 0; }
.agenda-legend { display: flex; gap: var(--space-4); margin-top: var(--space-4); font-size: 0.78rem; color: var(--text-secondary); flex-wrap: wrap; }
.agenda-legend__dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: middle; }

.readonly-banner {
  display: flex; align-items: center; gap: var(--space-3);
  background: var(--alert-yellow-dim); border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--alert-yellow); border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4); font-size: 0.82rem; margin-bottom: var(--space-5);
}

/* ==========================================================================
   VIDEO CALL
   ========================================================================== */
.call-room {
  background: radial-gradient(600px 400px at 50% 20%, rgba(37,99,235,0.12), transparent), var(--bg-secondary);
  border: 1px solid var(--border-subtle); border-radius: var(--radius-lg);
  min-height: 460px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  position: relative; overflow: hidden; padding: var(--space-6);
  text-align: center;
}
.call-room__avatar {
  width: 96px; height: 96px; border-radius: 50%;
  background: linear-gradient(135deg, var(--trust-blue), var(--critical-red));
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; font-weight: 700; color: #fff; margin-bottom: var(--space-4);
}
.call-room__name { font-size: 1.1rem; font-weight: 700; margin-bottom: var(--space-1); }
.call-room__status { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: var(--space-6); }
.call-room__timer { font-family: var(--font-heading); font-size: 2.4rem; font-weight: 700; letter-spacing: 0.04em; margin-bottom: var(--space-6); }
.call-room__self-view {
  position: absolute; bottom: var(--space-4); right: var(--space-4);
  width: 120px; height: 90px; background: var(--bg-elevated);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem; color: var(--text-muted);
}
.call-controls { display: flex; gap: var(--space-3); margin-top: var(--space-6); }
.call-controls .btn-icon { width: 52px; height: 52px; border-radius: 50%; font-size: 1.2rem; }
.call-controls .btn-icon.is-danger { background: var(--critical-red); color: #fff; border-color: var(--critical-red); }

/* ==========================================================================
   STORE (Infinity Store)
   ========================================================================== */
.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-5); }
@media (max-width: 1100px) { .product-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .product-grid { grid-template-columns: 1fr; } }
.product-card {
  background: var(--bg-elevated); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
.product-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.product-card__image {
  height: 140px; background: linear-gradient(135deg, var(--bg-secondary), var(--bg-elevated-2));
  display: flex; align-items: center; justify-content: center; font-size: 2.2rem;
}
.product-card__body { padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-2); flex: 1; }
.product-card__cat { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.product-card__name { font-weight: 700; font-size: 0.92rem; }
.product-card__price-row { display: flex; align-items: baseline; gap: var(--space-2); margin-top: auto; }
.product-card__price { font-family: var(--font-heading); font-size: 1.1rem; font-weight: 700; color: var(--critical-red); }
.product-card__price-old { font-size: 0.76rem; color: var(--text-muted); text-decoration: line-through; }
.product-card__image img { width: 100%; height: 100%; object-fit: cover; }
.product-card__sale-badge {
  position: absolute; margin: var(--space-3); padding: 2px 10px; border-radius: var(--radius-sm);
  background: var(--critical-red); color: #fff; font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
}
.product-card__image { position: relative; }
.product-card__variation { display: flex; flex-direction: column; gap: 2px; font-size: 0.76rem; }
.product-card__variation select { padding: 4px 6px; font-size: 0.78rem; }

.store-tabs { display: flex; gap: var(--space-2); margin-bottom: var(--space-5); }
.store-tab {
  padding: var(--space-2) var(--space-4); border-radius: var(--radius-pill, 999px);
  background: var(--bg-secondary); border: 1px solid var(--border-subtle);
  font-size: 0.82rem; font-weight: 600; color: var(--text-secondary); cursor: pointer;
}
.store-tab.is-active { background: var(--brand-amber-dim); color: var(--brand-amber-ink); border-color: rgba(243,172,11,0.45); }

.cart-drawer {
  position: fixed; top: 0; right: 0; height: 100vh; width: 380px; max-width: 100vw;
  background: var(--bg-elevated); border-left: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-md); transform: translateX(100%);
  transition: transform var(--transition-base); z-index: 300;
  display: flex; flex-direction: column;
}
.cart-drawer.is-open { transform: translateX(0); }
.cart-drawer__header { padding: var(--space-5); border-bottom: 1px solid var(--border-subtle); display: flex; align-items: center; justify-content: space-between; }
.cart-drawer__items { flex: 1; overflow-y: auto; padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-4); }
.cart-item { display: flex; gap: var(--space-3); align-items: center; }
.cart-item__thumb { width: 48px; height: 48px; border-radius: var(--radius-sm); background: var(--bg-secondary); display: flex; align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0; }
.cart-item__info { flex: 1; min-width: 0; }
.cart-item__name { font-size: 0.85rem; font-weight: 600; }
.cart-item__meta { font-size: 0.74rem; color: var(--text-secondary); }
.cart-drawer__footer { padding: var(--space-5); border-top: 1px solid var(--border-subtle); }
.cart-total-row { display: flex; justify-content: space-between; font-size: 0.9rem; margin-bottom: var(--space-4); }
.cart-total-row strong { font-family: var(--font-heading); color: var(--critical-red); }

.checkout-steps { display: flex; gap: var(--space-2); margin-bottom: var(--space-6); }
.checkout-step {
  flex: 1; text-align: center; padding: var(--space-3); border-radius: var(--radius-sm);
  background: var(--bg-secondary); border: 1px solid var(--border-subtle);
  font-size: 0.76rem; color: var(--text-secondary); font-weight: 600;
}
.checkout-step.is-active { background: var(--brand-amber-dim); color: var(--brand-amber-ink); border-color: rgba(243,172,11,0.45); font-weight: 700; }
.checkout-step.is-done { color: var(--critical-red); }

/* ==========================================================================
   HELP CENTER
   ========================================================================== */
.help-search { max-width: 560px; margin: 0 auto var(--space-8); text-align: center; }
.help-search .table-search { margin: var(--space-4) auto 0; max-width: 480px; }
.help-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-5); }
@media (max-width: 900px) { .help-grid { grid-template-columns: 1fr; } }
.help-article {
  background: var(--bg-elevated); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); padding: var(--space-5);
}
.help-article__icon { font-size: 1.4rem; margin-bottom: var(--space-3); }
.help-article__title { font-weight: 700; margin-bottom: var(--space-2); }
.help-article__desc { font-size: 0.82rem; color: var(--text-secondary); }
.help-article__tag { display: inline-block; margin-top: var(--space-3); font-size: 0.7rem; color: var(--text-muted); }

.faq-item { border-bottom: 1px solid var(--border-subtle); }
.faq-item__q {
  width: 100%; text-align: left; padding: var(--space-4) 0;
  background: none; border: none; color: var(--text-primary);
  display: flex; justify-content: space-between; align-items: center; font-weight: 600; font-size: 0.9rem;
}
.faq-item__a { padding: 0 0 var(--space-4); color: var(--text-secondary); font-size: 0.85rem; display: none; }
.faq-item.is-open .faq-item__a { display: block; }
.faq-item.is-open .faq-item__q { color: var(--brand-amber-ink); }

.chat-widget { display: flex; flex-direction: column; height: 480px; border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); background: var(--bg-elevated); overflow: hidden; }
.chat-widget__messages { flex: 1; overflow-y: auto; padding: var(--space-5); display: flex; flex-direction: column; gap: var(--space-3); }
.chat-bubble { max-width: 75%; padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); font-size: 0.85rem; }
.chat-bubble.is-user { align-self: flex-end; background: var(--brand-amber); color: var(--brand-amber-ink); border-bottom-right-radius: 2px; }
.chat-bubble.is-agent { align-self: flex-start; background: var(--bg-secondary); border-bottom-left-radius: 2px; }
.chat-widget__input { display: flex; gap: var(--space-3); padding: var(--space-4); border-top: 1px solid var(--border-subtle); }
.chat-widget__input input { flex: 1; }

/* ==========================================================================
   PLAN GATE / EMPTY STATES
   ========================================================================== */
.empty-state { text-align: center; padding: var(--space-10) var(--space-6); color: var(--text-secondary); }
.empty-state__icon { font-size: 2.4rem; margin-bottom: var(--space-4); }
.empty-state__title { font-size: 1.05rem; color: var(--text-primary); margin-bottom: var(--space-2); }

.plan-tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: var(--radius-full); font-size: 0.72rem; font-weight: 700; }
.plan-tag.is-starter { background: var(--trust-blue-dim); color: var(--trust-blue); }
.plan-tag.is-black { background: linear-gradient(135deg, rgba(243,172,11,0.18), rgba(17,17,17,0.10)); color: var(--brand-amber-ink); border: 1px solid rgba(243,172,11,0.4); }

/* Log severity */
.log-row.is-error td:first-child { border-left: 3px solid var(--critical-red); }
.log-row.is-warning td:first-child { border-left: 3px solid var(--alert-yellow); }
.log-row.is-info td:first-child { border-left: 3px solid var(--trust-blue); }

/* Utility */
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-green { color: var(--critical-red); }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mb-4 { margin-bottom: var(--space-4); }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.w-full { width: 100%; }

/* ==========================================================================
   RESPONSIVE — MOBILE FIRST FOR APP SHELL
   ========================================================================== */
@media (max-width: 960px) {
  .app-shell, .app-shell.is-collapsed { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: var(--sidebar-width);
    transform: translateX(-100%);
    transition: transform var(--transition-base);
  }
  .sidebar.is-mobile-open { transform: translateX(0); }
  .app-shell::before { content: none; }
  .mobile-menu-btn { display: inline-flex; }
  .mobile-overlay {
    display: none; position: fixed; inset: 0; background: rgba(5,9,18,0.6); z-index: 15;
  }
  .mobile-overlay.is-open { display: block; }
  .topbar__search { display: none; }
  .content { padding: var(--space-4); }
  .grid-cols-4, .grid-cols-3 { grid-template-columns: 1fr 1fr; }
}
.mobile-menu-btn { display: none; }

@media (max-width: 560px) {
  .grid-cols-4, .grid-cols-3, .grid-cols-2 { grid-template-columns: 1fr; }
  .content-header { flex-direction: column; }
  .auth-card { padding: var(--space-6) var(--space-5); }
  .panel-picker { grid-template-columns: 1fr; }
  .cart-drawer { width: 100%; }
}

/* Bottom tab bar for mobile — used primarily on Painel do Aluno */
.bottom-tabbar {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--bg-elevated); border-top: 1px solid var(--border-subtle);
  padding: var(--space-2) var(--space-2) calc(var(--space-2) + env(safe-area-inset-bottom));
  z-index: 40;
}
@media (max-width: 960px) {
  .bottom-tabbar.is-enabled { display: flex; justify-content: space-around; }
  body.has-bottom-tabbar .content { padding-bottom: 90px; }
}
.bottom-tabbar__item {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--text-muted); font-size: 0.64rem; padding: var(--space-2);
  flex: 1;
}
.bottom-tabbar__item.is-active { color: var(--brand-amber-ink); }
.bottom-tabbar__item span.icon { font-size: 1.15rem; }

/* ==========================================================================
   UNIFIED LOGIN (index.html) — reusable login widgets
   ========================================================================== */
.password-field { position: relative; }
.password-field input { padding-right: var(--space-10); }
.password-toggle {
  position: absolute; top: 50%; right: var(--space-2); transform: translateY(-50%);
  background: transparent; border: none; font-size: 1rem; line-height: 1;
  padding: var(--space-2); color: var(--text-muted);
}

.auth-forgot { text-align: right; margin: calc(var(--space-4) * -1) 0 var(--space-5); }
.auth-forgot a { color: var(--text-primary); font-size: 0.82rem; font-weight: 600; }
.auth-forgot a:hover { text-decoration: underline; }

.landing__footer {
  margin-top: var(--space-8);
  display: flex; align-items: center; justify-content: center; gap: var(--space-2);
  font-size: 0.78rem; color: var(--text-muted);
}
.landing__footer img { height: 20px; width: auto; }

/* ==========================================================================
   THEME TOGGLE
   ========================================================================== */
.theme-toggle-fab {
  position: fixed;
  bottom: var(--space-5);
  left: var(--space-5);
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem;
  z-index: 90;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}
.theme-toggle-fab:hover { transform: scale(1.06); border-color: var(--border-strong); }

/* ==========================================================================
   MONOCHROME ICONS
   ========================================================================== */
.icon-wrap { display: inline-flex; align-items: center; justify-content: center; line-height: 0; }
svg.icon { width: 1.15em; height: 1.15em; flex-shrink: 0; vertical-align: -0.2em; }
