/* ==========================================================================
   EduGoo · sistema de design
   Tokens → base → layout (shell) → componentes → padrões de página.
   Sem framework: CSS moderno (custom properties, grid, :focus-visible).
   ========================================================================== */

/* ---------- 1. Tokens ---------- */
:root {
  color-scheme: light;

  /* Marca */
  --brand-50: #eff6ff;
  --brand-100: #dbeafe;
  --brand-200: #bfdbfe;
  --brand-500: #3b82f6;
  --brand-600: #2563eb;
  --brand-700: #1d4ed8;
  --brand-800: #1e40af;
  --brand-900: #1e3a8a;

  /* Acento quente (apadrinhamento, destaques) */
  --amber-50: #fffbeb;
  --amber-100: #fef3c7;
  --amber-400: #fbbf24;
  --amber-500: #f59e0b;
  --amber-700: #b45309;
  --amber-900: #78350f;

  /* Estados */
  --green-50: #ecfdf5;
  --green-100: #d1fae5;
  --green-600: #059669;
  --green-700: #047857;
  --red-50: #fef2f2;
  --red-100: #fee2e2;
  --red-600: #dc2626;
  --red-700: #b91c1c;
  --violet-50: #f5f3ff;
  --violet-100: #ede9fe;
  --violet-600: #7c3aed;
  --violet-700: #6d28d9;
  --teal-50: #f0fdfa;
  --teal-600: #0d9488;
  --teal-700: #0f766e;
  --rose-50: #fff1f2;
  --rose-600: #e11d48;

  /* Neutros (slate) */
  --ink: #0f172a;
  --ink-2: #1e293b;
  --muted: #475569;
  --subtle: #5b6b80;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #f1f5f9;
  --bg: #f6f8fb;

  /* Tipografia */
  --font-sans: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Outfit", "Plus Jakarta Sans", system-ui, sans-serif;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: clamp(1.625rem, 1.3rem + 1.2vw, 2.125rem);
  --text-4xl: clamp(1.875rem, 1.4rem + 2vw, 2.75rem);

  /* Espaçamento (base 4px) */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.25rem;
  --s-6: 1.5rem;
  --s-8: 2rem;
  --s-10: 2.5rem;
  --s-12: 3rem;

  /* Raios */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-2xl: 28px;
  --r-full: 999px;

  /* Sombras */
  --sh-xs: 0 1px 2px rgb(15 23 42 / 0.06);
  --sh-sm: 0 1px 3px rgb(15 23 42 / 0.08), 0 1px 2px rgb(15 23 42 / 0.04);
  --sh-md: 0 6px 16px -4px rgb(15 23 42 / 0.1), 0 2px 6px -2px rgb(15 23 42 / 0.06);
  --sh-lg: 0 18px 40px -12px rgb(15 23 42 / 0.22);
  --ring: 0 0 0 3px rgb(37 99 235 / 0.35);

  /* Movimento */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --t-fast: 120ms;
  --t: 200ms;

  /* Layout */
  --sidebar-w: 268px;
  --topbar-h: 64px;
  --bottomnav-h: 64px;
  --content-max: 1180px;
  --gutter: 16px;
}

@media (min-width: 640px) {
  :root { --gutter: 24px; }
}
@media (min-width: 1280px) {
  :root { --gutter: 40px; }
}

/* ---------- 2. Base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-display);
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--ink);
}
h1 { font-size: var(--text-3xl); font-weight: 700; }
h2 { font-size: var(--text-xl); font-weight: 650; }
h3 { font-size: var(--text-base); font-weight: 600; }
h4 { font-size: var(--text-sm); font-weight: 600; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
img { display: block; max-width: 100%; }
a { color: var(--brand-700); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
i[class^="ri-"], i[class*=" ri-"] { line-height: 1; }

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--brand-600);
  outline-offset: 2px;
  border-radius: 6px;
}

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

.skip-link {
  position: fixed;
  top: 8px; left: 8px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--ink);
  color: #fff;
  border-radius: var(--r-sm);
  font-weight: 600;
  transform: translateY(-150%);
  transition: transform var(--t) var(--ease);
}
.skip-link:focus-visible { transform: none; color: #fff; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- 3. Shell (sidebar · topbar · bottom nav) ---------- */
.app { min-height: 100vh; }

.sidebar {
  display: none;
}

.app-main {
  min-width: 0;
  padding-bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom) + var(--s-6));
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: 0 var(--gutter);
  background: rgb(255 255 255 / 0.88);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar__brand { display: flex; }
.topbar__search { display: none; flex: 1; max-width: 460px; }
.topbar__actions { margin-left: auto; display: flex; align-items: center; gap: var(--s-1); }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand__mark { width: 34px; height: 34px; flex: none; }
.brand__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: -0.02em;
}
.brand__name span { color: var(--brand-600); }
.brand__tag { display: block; font-size: 11px; color: var(--subtle); font-weight: 500; margin-top: 1px; }

.avatar-btn {
  display: inline-flex;
  border-radius: var(--r-full);
  padding: 2px;
  border: 2px solid transparent;
  transition: border-color var(--t-fast);
}
.avatar-btn:hover { border-color: var(--brand-200); }

.bottom-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  padding: 6px 6px max(6px, env(safe-area-inset-bottom));
  background: rgb(255 255 255 / 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  box-shadow: 0 -4px 20px rgb(15 23 42 / 0.05);
}
.bottom-nav__item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 52px;
  padding: 4px 2px;
  border: 0;
  border-radius: var(--r-md);
  background: none;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
}
.bottom-nav__item i { font-size: 22px; }
.bottom-nav__item:hover { text-decoration: none; color: var(--ink); }
.bottom-nav__item[aria-current="page"],
.bottom-nav__item.is-active {
  color: var(--brand-700);
  background: var(--brand-50);
}
.bottom-nav__item[aria-current="page"]::before,
.bottom-nav__item.is-active::before {
  content: "";
  position: absolute;
  top: -7px;
  width: 28px; height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--brand-600);
}

/* Sidebar no desktop */
@media (min-width: 1024px) {
  .app {
    display: grid;
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  }
  .sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: var(--s-6);
    padding: var(--s-6) var(--s-4);
    background: var(--surface);
    border-right: 1px solid var(--line);
    overflow-y: auto;
  }
  .sidebar .brand { padding: 0 var(--s-2); }
  .app-main { padding-bottom: var(--s-12); }
  .bottom-nav { display: none; }
  .topbar__brand { display: none; }
  .topbar__search { display: block; }
}

.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav__label {
  padding: var(--s-2) var(--s-3) var(--s-1);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--subtle);
}
.side-nav__item {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: 10px var(--s-3);
  border-radius: var(--r-md);
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  transition: background var(--t-fast), color var(--t-fast);
}
.side-nav__item i { font-size: 20px; color: var(--subtle); transition: color var(--t-fast); }
.side-nav__item:hover { background: var(--surface-3); color: var(--ink); text-decoration: none; }
.side-nav__item:hover i { color: var(--ink); }
.side-nav__item[aria-current="page"] { background: var(--brand-50); color: var(--brand-800); }
.side-nav__item[aria-current="page"] i { color: var(--brand-600); }
.side-nav__count {
  margin-left: auto;
  min-width: 22px;
  padding: 1px 7px;
  border-radius: var(--r-full);
  background: var(--surface-3);
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.sidebar__footer { margin-top: auto; display: grid; gap: var(--s-3); }
.user-card {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  color: var(--ink);
  text-decoration: none;
}
.user-card:hover { background: var(--surface-2); text-decoration: none; }
.user-card strong { display: block; font-size: var(--text-sm); }
.user-card span { display: block; font-size: var(--text-xs); color: var(--subtle); }
.demo-note {
  display: flex;
  gap: var(--s-2);
  padding: var(--s-3);
  border-radius: var(--r-md);
  background: var(--amber-50);
  color: var(--amber-900);
  font-size: var(--text-xs);
  line-height: 1.45;
}

/* ---------- 4. Página ---------- */
.page {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--s-6) var(--gutter) 0;
}
.page:focus { outline: none; }

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s-4);
  margin-bottom: var(--s-6);
}
.page-head__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: var(--s-2);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand-700);
}
.page-head__lead { margin-top: var(--s-2); color: var(--muted); max-width: 60ch; }
.page-head__actions { display: flex; flex-wrap: wrap; gap: var(--s-2); }

.section { margin-bottom: var(--s-8); }
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  margin-bottom: var(--s-4);
}
.section-head p { color: var(--subtle); font-size: var(--text-sm); margin-top: 2px; }

/* Grelhas responsivas */
.grid { display: grid; gap: var(--s-4); }
.grid-2 { display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.grid-3 { display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.grid-4 { display: grid; gap: var(--s-3); grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 768px) { .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-4); } }

.layout-split { display: grid; gap: var(--s-8); grid-template-columns: minmax(0, 1fr); }
.layout-split > *, .layout-filters > * { min-width: 0; }
@media (min-width: 1100px) {
  .layout-split { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
  .layout-split > aside { position: sticky; top: calc(var(--topbar-h) + var(--s-6)); }
}
.layout-filters { display: grid; gap: var(--s-6); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1100px) {
  .layout-filters { grid-template-columns: 290px minmax(0, 1fr); align-items: start; }
  .layout-filters > .filters-panel { position: sticky; top: calc(var(--topbar-h) + var(--s-6)); max-height: calc(100vh - var(--topbar-h) - var(--s-10)); overflow: auto; }
}

/* Utilitários pequenos */
.stack { display: grid; gap: var(--s-3); grid-template-columns: minmax(0, 1fr); }
.stack-lg { display: grid; gap: var(--s-4); grid-template-columns: minmax(0, 1fr); }
.row { display: flex; align-items: center; gap: var(--s-2); }
.row-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.subtle { color: var(--subtle); }
.small { font-size: var(--text-sm); }
.xsmall { font-size: var(--text-xs); }
.strong { font-weight: 700; }
.num { font-variant-numeric: tabular-nums; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-2 { margin-top: var(--s-2); }
.mt-3 { margin-top: var(--s-3); }
.mt-4 { margin-top: var(--s-4); }
.mt-6 { margin-top: var(--s-6); }
.text-success { color: var(--green-700); }
.text-warning { color: var(--amber-700); }
.text-danger { color: var(--red-700); }
.text-brand { color: var(--brand-700); }

/* ---------- 5. Componentes ---------- */

/* Botões */
.btn {
  --btn-bg: var(--surface);
  --btn-fg: var(--ink);
  --btn-bd: var(--line-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: 44px;
  padding: 0 var(--s-4);
  border: 1px solid var(--btn-bd);
  border-radius: var(--r-md);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
}
.btn i { font-size: 18px; }
.btn:hover { text-decoration: none; background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn--primary { --btn-bg: var(--brand-600); --btn-fg: #fff; --btn-bd: var(--brand-600); box-shadow: 0 1px 2px rgb(37 99 235 / 0.3); }
.btn--primary:hover { background: var(--brand-700); border-color: var(--brand-700); }
.btn--dark { --btn-bg: var(--ink); --btn-fg: #fff; --btn-bd: var(--ink); }
.btn--dark:hover { background: var(--ink-2); }
.btn--soft { --btn-bg: var(--brand-50); --btn-fg: var(--brand-800); --btn-bd: var(--brand-100); }
.btn--soft:hover { background: var(--brand-100); }
.btn--ghost { --btn-bg: transparent; --btn-bd: transparent; --btn-fg: var(--muted); }
.btn--ghost:hover { background: var(--surface-3); color: var(--ink); }
.btn--danger { --btn-bg: var(--red-600); --btn-fg: #fff; --btn-bd: var(--red-600); }
.btn--danger:hover { background: var(--red-700); }
.btn--danger-soft { --btn-bg: var(--red-50); --btn-fg: var(--red-700); --btn-bd: var(--red-100); }
.btn--danger-soft:hover { background: var(--red-100); }
.btn--white { --btn-bg: #fff; --btn-fg: var(--ink); --btn-bd: #fff; }
.btn--white:hover { background: rgb(255 255 255 / 0.9); }
.btn--sm { min-height: 36px; padding: 0 var(--s-3); font-size: var(--text-xs); border-radius: 10px; }
.btn--sm i { font-size: 16px; }
.btn--block { width: 100%; }
.btn--link { min-height: auto; padding: 4px 2px; border: 0; background: none; color: var(--brand-700); }
.btn--link:hover { background: none; text-decoration: underline; text-underline-offset: 3px; }

.icon-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 44px; height: 44px;
  flex: none;
  border: 0;
  border-radius: var(--r-md);
  background: transparent;
  color: var(--muted);
  transition: background var(--t-fast), color var(--t-fast);
}
.icon-btn i { font-size: 20px; }
.icon-btn:hover { background: var(--surface-3); color: var(--ink); }
.icon-btn--sm { width: 36px; height: 36px; }
.icon-btn--sm i { font-size: 18px; }
.icon-btn[aria-pressed="true"] { color: var(--brand-600); }
.icon-btn .dot {
  position: absolute;
  top: 8px; right: 8px;
  min-width: 18px; height: 18px;
  padding: 0 5px;
  border-radius: var(--r-full);
  background: var(--red-600);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  border: 2px solid #fff;
  transform: translate(40%, -40%);
}

/* Cartões */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-xs);
  padding: var(--s-5);
}
.card--flush { padding: 0; overflow: hidden; }
.card--muted { background: var(--surface-2); box-shadow: none; }
.card--interactive { transition: border-color var(--t), box-shadow var(--t), transform var(--t) var(--ease); }
.card--interactive:hover { border-color: var(--brand-200); box-shadow: var(--sh-md); transform: translateY(-2px); }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); margin-bottom: var(--s-4); }
.card__title { display: flex; align-items: center; gap: var(--s-2); }

/* Ícone em pastilha */
.tile {
  display: inline-grid;
  place-items: center;
  width: 40px; height: 40px;
  flex: none;
  border-radius: var(--r-md);
  background: var(--brand-50);
  color: var(--brand-700);
}
.tile i { font-size: 20px; }
.tile--sm { width: 32px; height: 32px; border-radius: 10px; }
.tile--sm i { font-size: 16px; }
.tile--lg { width: 52px; height: 52px; border-radius: var(--r-lg); }
.tile--lg i { font-size: 26px; }
.tone-brand { background: var(--brand-50); color: var(--brand-700); }
.tone-green { background: var(--green-50); color: var(--green-700); }
.tone-amber { background: var(--amber-50); color: var(--amber-700); }
.tone-red { background: var(--red-50); color: var(--red-700); }
.tone-violet { background: var(--violet-50); color: var(--violet-700); }
.tone-teal { background: var(--teal-50); color: var(--teal-700); }
.tone-rose { background: var(--rose-50); color: var(--rose-600); }
.tone-slate { background: var(--surface-3); color: var(--muted); }

/* Etiquetas */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: var(--r-full);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  background: var(--surface-3);
  color: var(--muted);
}
.badge i { font-size: 13px; }
.badge--dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--success { background: var(--green-50); color: var(--green-700); }
.badge--warning { background: var(--amber-50); color: var(--amber-700); }
.badge--danger { background: var(--red-50); color: var(--red-700); }
.badge--info { background: var(--brand-50); color: var(--brand-700); }
.badge--violet { background: var(--violet-50); color: var(--violet-700); }

/* Chips (filtros) */
.chips { display: flex; gap: var(--s-2); overflow-x: auto; padding: 2px; margin: -2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-full);
  background: var(--surface);
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: 600;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.chip:hover { border-color: var(--brand-500); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip .count { font-size: 11px; opacity: 0.75; }

/* Formulários */
.field { display: grid; gap: 6px; }
.field + .field { margin-top: var(--s-4); }
.label { font-size: var(--text-sm); font-weight: 600; color: var(--ink-2); }
.hint { font-size: var(--text-xs); color: var(--subtle); }
.input, .select, .textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--ink);
  font-size: var(--text-base);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.input::placeholder, .textarea::placeholder { color: #8391a7; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand-600); box-shadow: var(--ring); outline: none; }
.input[aria-invalid="true"] { border-color: var(--red-600); }
.textarea { min-height: 110px; resize: vertical; }
.select {
  appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23475569'%3E%3Cpath d='M12 15.6 6.4 10l1.4-1.4 4.2 4.2 4.2-4.2 1.4 1.4z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 20px;
}
.field-error { font-size: var(--text-xs); color: var(--red-700); font-weight: 600; }
.form-row { display: grid; gap: var(--s-4); }
@media (min-width: 560px) { .form-row { grid-template-columns: 1fr 1fr; } .form-row .field + .field { margin-top: 0; } }

.search {
  position: relative;
}
.search > i {
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  color: var(--subtle);
  pointer-events: none;
}
.search .input { padding-left: 44px; }
.search--lg .input { min-height: 54px; border-radius: var(--r-lg); box-shadow: var(--sh-sm); font-size: var(--text-base); }
.search .search__clear { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); }

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  font-size: var(--text-sm);
  color: var(--ink-2);
  cursor: pointer;
}
.check input { width: 18px; height: 18px; accent-color: var(--brand-600); flex: none; cursor: pointer; }

.range { width: 100%; accent-color: var(--brand-600); }

/* Interruptor (button role="switch") */
.switch {
  position: relative;
  flex: none;
  width: 48px; height: 28px;
  border: 0;
  border-radius: var(--r-full);
  background: var(--line-strong);
  transition: background var(--t) var(--ease);
}
.switch::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--sh-sm);
  transition: transform var(--t) var(--ease);
}
.switch[aria-checked="true"] { background: var(--green-600); }
.switch[aria-checked="true"]::after { transform: translateX(20px); }

/* Progresso */
.progress {
  height: 8px;
  border-radius: var(--r-full);
  background: var(--surface-3);
  overflow: hidden;
}
.progress > span {
  display: block;
  height: 100%;
  width: var(--v, 0%);
  border-radius: inherit;
  background: var(--brand-600);
  transition: width 700ms var(--ease);
}
.progress--green > span { background: var(--green-600); }
.progress--amber > span { background: var(--amber-500); }
.progress--red > span { background: var(--red-600); }
.progress--violet > span { background: var(--violet-600); }
.progress--grad > span { background: linear-gradient(90deg, var(--brand-600), var(--green-600)); }
.progress--sm { height: 6px; }
.progress--on-dark { background: rgb(255 255 255 / 0.15); }
.progress--on-dark > span { background: linear-gradient(90deg, #93c5fd, #6ee7b7); }

/* Avatares */
.avatar {
  width: 40px; height: 40px;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-3);
}
.avatar--sm { width: 32px; height: 32px; }
.avatar--lg { width: 56px; height: 56px; }
.avatar--xl { width: 104px; height: 104px; border: 4px solid #fff; box-shadow: var(--sh-md); }
.avatar-wrap { position: relative; flex: none; }
.presence {
  position: absolute;
  right: 0; bottom: 0;
  width: 12px; height: 12px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: var(--line-strong);
}
.presence--on { background: var(--green-600); }
.avatar-stack { display: flex; }
.avatar-stack > * { margin-left: -10px; border: 2px solid #fff; }
.avatar-stack > *:first-child { margin-left: 0; }
.avatar-more {
  display: grid; place-items: center;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--muted);
  font-size: 11px; font-weight: 700;
}

/* Listas */
.list { list-style: none; display: grid; grid-template-columns: minmax(0, 1fr); }
.list > li + li { border-top: 1px solid var(--line); }
.list-item {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) 0;
  width: 100%;
  border: 0;
  background: none;
  text-align: left;
  color: inherit;
}
button.list-item, a.list-item { padding: var(--s-3); border-radius: var(--r-md); text-decoration: none; }
button.list-item:hover, a.list-item:hover { background: var(--surface-2); }
.list-item__title { font-weight: 600; font-size: var(--text-sm); }
.list-item__meta { font-size: var(--text-xs); color: var(--subtle); }

.checklist { list-style: none; display: grid; gap: var(--s-2); }
.checklist li { display: flex; align-items: flex-start; gap: var(--s-2); font-size: var(--text-sm); }
.checklist .state {
  display: grid; place-items: center;
  width: 20px; height: 20px;
  flex: none;
  margin-top: 1px;
  border-radius: 50%;
  font-size: 13px;
}
.state--ok { background: var(--green-600); color: #fff; }
.state--wait { background: var(--amber-100); color: var(--amber-700); }
.state--todo { background: var(--surface-3); color: var(--subtle); border: 1px dashed var(--line-strong); }

/* Meta (ícone + texto pequeno) */
.meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: var(--text-xs); color: var(--muted); }
.meta span { display: inline-flex; align-items: center; gap: 4px; }
.meta i { font-size: 14px; color: var(--subtle); }

/* Linha temporal */
.timeline { list-style: none; position: relative; display: grid; gap: var(--s-4); }
.timeline::before {
  content: "";
  position: absolute;
  left: 19px; top: 8px; bottom: 8px;
  width: 2px;
  background: linear-gradient(var(--line), var(--brand-200), var(--line));
}
.timeline > li { position: relative; display: flex; gap: var(--s-3); }
.timeline .tile { position: relative; z-index: 1; border: 3px solid var(--bg); box-sizing: content-box; width: 34px; height: 34px; }
.timeline--plain::before { left: 15px; }
.timeline--plain .tile { width: 28px; height: 28px; }

/* Estatística */
.stat { display: grid; gap: 2px; }
.stat__value { font-family: var(--font-display); font-size: var(--text-2xl); font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat__label { font-size: var(--text-xs); color: var(--muted); font-weight: 500; }

/* Estado vazio */
.empty {
  display: grid;
  justify-items: center;
  gap: var(--s-3);
  padding: var(--s-10) var(--s-6);
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-xl);
  background: var(--surface);
}
.empty .tile { width: 56px; height: 56px; border-radius: var(--r-lg); }
.empty .tile i { font-size: 28px; }
.empty p { color: var(--muted); max-width: 42ch; font-size: var(--text-sm); }

/* Separadores */
.tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: var(--r-lg);
  background: var(--surface-3);
  max-width: 100%;
  overflow-x: auto;
}
.tab {
  flex: none;
  white-space: nowrap;
  min-height: 40px;
  padding: 0 var(--s-4);
  border: 0;
  border-radius: var(--r-md);
  background: none;
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: 600;
}
.tab[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--sh-sm); }
.tab .count { margin-left: 6px; font-size: 11px; color: var(--subtle); }

/* Disclosure */
.disclosure > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  list-style: none;
  cursor: pointer;
}
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary .chev { transition: transform var(--t) var(--ease); font-size: 22px; color: var(--subtle); }
.disclosure[open] > summary .chev { transform: rotate(180deg); }

/* Acções rápidas (botões com ícone) */
.quick-actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: var(--s-2); }
.quick-action {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  min-height: 56px;
  padding: var(--s-2) var(--s-3);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  color: var(--ink);
  font-size: var(--text-sm);
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
}
.quick-action:hover { border-color: var(--brand-200); box-shadow: var(--sh-sm); text-decoration: none; transform: translateY(-1px); }
.quick-action .tile { width: 36px; height: 36px; border-radius: 10px; }
.quick-action .tile i { font-size: 18px; }

/* Toast */
.toast-region {
  position: fixed;
  z-index: 80;
  left: 50%;
  bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom) + 16px);
  transform: translateX(-50%);
  display: grid;
  gap: var(--s-2);
  width: min(calc(100% - 32px), 420px);
  pointer-events: none;
}
@media (min-width: 1024px) {
  .toast-region { left: auto; right: 24px; bottom: 24px; transform: none; }
}
.toast {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: 12px 16px;
  border-radius: var(--r-md);
  background: var(--ink);
  color: #fff;
  font-size: var(--text-sm);
  font-weight: 500;
  box-shadow: var(--sh-lg);
  pointer-events: auto;
  animation: toast-in 260ms var(--ease) both;
}
.toast i { font-size: 18px; }
.toast--success i { color: #6ee7b7; }
.toast--error i { color: #fca5a5; }
.toast--info i { color: #93c5fd; }
.toast.is-leaving { animation: toast-out 200ms ease both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }

/* Diálogo (dialog nativo): folha inferior no telemóvel, centrado a partir de 640px */
.dialog {
  width: 100%;
  max-width: 100%;
  max-height: 92vh;
  margin: auto 0 0;
  padding: 0;
  border: 0;
  border-radius: var(--r-2xl) var(--r-2xl) 0 0;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--sh-lg);
  overflow: hidden;
}
.dialog[open] { display: flex; flex-direction: column; animation: sheet-in 320ms var(--ease) both; }
.dialog::backdrop { background: rgb(15 23 42 / 0.5); backdrop-filter: blur(2px); animation: fade-in 200ms ease both; }
.dialog__head {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  padding: var(--s-5) var(--s-5) var(--s-3);
}
.dialog__head::before {
  content: "";
  position: absolute;
  top: 8px; left: 50%;
  width: 40px; height: 4px;
  margin-left: -20px;
  border-radius: 4px;
  background: var(--line-strong);
}
.dialog__title { font-size: var(--text-lg); }
.dialog__desc { margin-top: 4px; font-size: var(--text-sm); color: var(--muted); }
.dialog__body { padding: var(--s-2) var(--s-5) var(--s-5); overflow-y: auto; overscroll-behavior: contain; }
.dialog__foot {
  display: flex;
  flex-wrap: wrap-reverse;
  justify-content: flex-end;
  gap: var(--s-2);
  padding: var(--s-4) var(--s-5) max(var(--s-4), env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}
.dialog__foot .btn { flex: 1 1 auto; }
@media (min-width: 640px) {
  .dialog {
    width: calc(100% - 48px);
    max-width: 520px;
    max-height: 86vh;
    margin: auto;
    border-radius: var(--r-xl);
  }
  .dialog--lg { max-width: 760px; }
  .dialog--sm { max-width: 420px; }
  .dialog[open] { animation: pop-in 240ms var(--ease) both; }
  .dialog__head::before { display: none; }
  .dialog__foot .btn { flex: 0 0 auto; }
}
.dialog--full {
  width: 100%; max-width: 100%;
  height: 100%; max-height: 100%;
  margin: 0;
  border-radius: 0;
}
@media (min-width: 640px) {
  .dialog--full { width: calc(100% - 48px); max-width: 720px; height: min(760px, 90vh); margin: auto; border-radius: var(--r-xl); }
  .dialog--full.dialog--video { max-width: 960px; }
}
.dialog--full .dialog__head::before { display: none; }
@keyframes sheet-in { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pop-in { from { transform: translateY(8px) scale(0.98); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* Popover de notificações */
.popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 40;
  width: min(360px, calc(100vw - 24px));
  padding: var(--s-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--sh-lg);
  animation: pop-in 200ms var(--ease) both;
}
.popover__head { display: flex; align-items: center; justify-content: space-between; padding: var(--s-2) var(--s-3); }
.notif { display: flex; gap: var(--s-3); padding: var(--s-3); border-radius: var(--r-md); color: inherit; text-decoration: none; }
.notif:hover { background: var(--surface-2); text-decoration: none; }
.notif.is-unread { background: var(--brand-50); }
.notif strong { display: block; font-size: var(--text-sm); }
.notif span { display: block; font-size: var(--text-xs); color: var(--muted); }

/* ---------- 6. Padrões de página ---------- */

/* Hero escuro (próximo passo) */
.hero {
  position: relative;
  overflow: hidden;
  padding: var(--s-6);
  border-radius: var(--r-2xl);
  background: radial-gradient(120% 140% at 100% 0%, #1e3a8a 0%, #0f172a 55%);
  color: #fff;
  box-shadow: var(--sh-lg);
}
.hero::after {
  content: "";
  position: absolute;
  right: -80px; top: -80px;
  width: 280px; height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgb(251 191 36 / 0.22), transparent 65%);
  pointer-events: none;
}
.hero > * { position: relative; z-index: 1; }
.hero h1, .hero h2 { color: #fff; }
.hero p { color: #cbd5e1; }
.hero__kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: var(--r-sm);
  background: rgb(59 130 246 / 0.22);
  border: 1px solid rgb(147 197 253 / 0.3);
  color: #bfdbfe;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.hero__panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: var(--s-3);
  padding: var(--s-4);
  border-radius: var(--r-lg);
  background: rgb(15 23 42 / 0.55);
  border: 1px solid rgb(148 163 184 / 0.18);
}
.hero__panel span { display: block; font-size: 11px; color: #94a3b8; }
.hero__panel strong { font-size: var(--text-sm); color: #fff; }
@media (min-width: 768px) { .hero { padding: var(--s-8) var(--s-10); } }

/* Banner de chamada (apadrinhamento/mentoria) */
.banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-4);
  padding: var(--s-5);
  border-radius: var(--r-xl);
  border: 1px solid var(--line);
}
.banner--warm { background: linear-gradient(135deg, #fffbeb, #ffedd5); border-color: #fde68a; }
.banner--cool { background: linear-gradient(135deg, var(--brand-50), #e0e7ff); border-color: var(--brand-100); }
.banner__text { flex: 1 1 220px; }
.banner__text p { color: var(--muted); font-size: var(--text-sm); margin-top: 2px; }

/* Cartão de bolsa */
.scholarship {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  height: 100%;
}
.scholarship__top { display: flex; gap: var(--s-3); align-items: flex-start; }
.scholarship__img { width: 56px; height: 56px; border-radius: var(--r-md); object-fit: cover; flex: none; background: var(--surface-3); }
.scholarship__title { font-size: var(--text-base); }
.scholarship__title a, .scholarship__title button {
  border: 0; padding: 0; background: none; text-align: left;
  color: inherit; font: inherit; font-weight: 600;
}
.scholarship__title a::after, .scholarship__title button::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.scholarship__course { font-size: var(--text-sm); color: var(--muted); margin-top: 2px; }
.scholarship__foot { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); margin-top: auto; padding-top: var(--s-3); border-top: 1px solid var(--line); }
.scholarship__value { font-size: var(--text-sm); font-weight: 700; color: var(--ink); }
.scholarship__value small { font-weight: 500; color: var(--subtle); }
.card.scholarship-card { position: relative; }
.card.scholarship-card .icon-btn, .card.scholarship-card .btn { position: relative; z-index: 2; }
.results--list .scholarship { flex-direction: row; flex-wrap: wrap; align-items: center; }
.results--list .scholarship__top { flex: 1 1 320px; }
.results--list .scholarship__foot { flex: 1 1 100%; margin-top: 0; }

/* Categorias */
.category {
  position: relative;
  display: grid;
  gap: var(--s-2);
  padding: var(--s-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  color: var(--ink);
  font-size: var(--text-sm);
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  transition: transform var(--t) var(--ease), box-shadow var(--t);
}
.category:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--sh-md); }
.category img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--r-md); }
.category small { display: block; font-size: 11px; font-weight: 500; color: var(--subtle); }

/* Calendário */
.calendar { display: grid; gap: var(--s-3); }
.calendar__head { display: flex; align-items: center; justify-content: space-between; }
.calendar__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.calendar__dow { font-size: 11px; font-weight: 700; color: var(--subtle); text-align: center; padding-bottom: 4px; text-transform: uppercase; }
.calendar__day {
  position: relative;
  display: grid; place-items: center;
  aspect-ratio: 1;
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: none;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.calendar__day:disabled { color: #a3afc0; cursor: default; font-weight: 500; }
button.calendar__day:not(:disabled):hover { border-color: var(--brand-500); }
.calendar__day.is-available { background: var(--green-50); color: var(--green-700); }
.calendar__day.is-deadline { background: var(--red-50); color: var(--red-700); }
.calendar__day.is-deadline::after, .calendar__day.is-event::after { content: ""; position: absolute; bottom: 5px; width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.calendar__day.is-today { border-color: var(--ink); }
.calendar__day[aria-pressed="true"] { background: var(--brand-600); color: #fff; }
.calendar__day.is-out { visibility: hidden; }

.slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-2); }
.slot {
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  font-size: var(--text-sm);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.slot:hover:not(:disabled) { border-color: var(--brand-600); }
.slot[aria-pressed="true"] { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.slot:disabled { color: #a3afc0; text-decoration: line-through; cursor: not-allowed; background: var(--surface-2); }

/* Chat */
.chat { display: flex; flex-direction: column; gap: var(--s-2); }
.bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: var(--text-sm);
  line-height: 1.45;
  animation: pop-in 200ms var(--ease) both;
}
.bubble time { display: block; margin-top: 4px; font-size: 11px; opacity: 0.75; }
.bubble--in { align-self: flex-start; background: var(--surface-3); border-bottom-left-radius: 6px; }
.bubble--out { align-self: flex-end; background: var(--brand-600); color: #fff; border-bottom-right-radius: 6px; }
.typing { align-self: flex-start; display: inline-flex; gap: 4px; padding: 12px 14px; border-radius: 18px; background: var(--surface-3); }
.typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--subtle); animation: blink 1.2s infinite both; }
.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }

/* Videochamada */
.video {
  position: relative;
  flex: 1;
  min-height: 420px;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 30% 20%, #1e3a8a, #0f172a 70%);
  color: #fff;
  text-align: center;
}
.video__self {
  position: absolute;
  right: 16px; bottom: 96px;
  width: 110px; height: 150px;
  border-radius: var(--r-md);
  background: linear-gradient(160deg, #334155, #1e293b);
  border: 2px solid rgb(255 255 255 / 0.25);
  display: grid; place-items: center;
  color: #cbd5e1;
  font-size: 12px;
}
.video__controls {
  position: absolute;
  left: 0; right: 0; bottom: 20px;
  display: flex;
  justify-content: center;
  gap: var(--s-3);
}
.video__btn {
  display: grid; place-items: center;
  width: 52px; height: 52px;
  border: 0;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.16);
  color: #fff;
}
.video__btn i { font-size: 22px; }
.video__btn:hover { background: rgb(255 255 255 / 0.26); }
.video__btn[aria-pressed="true"] { background: var(--red-600); }
.video__btn--end { width: 60px; height: 60px; background: var(--red-600); }
.video__btn--end:hover { background: var(--red-700); }

/* Carrossel horizontal com scroll-snap */
.rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(82%, 300px);
  gap: var(--s-4);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 2px 2px var(--s-2);
  margin: -2px;
}
.rail > * { scroll-snap-align: start; }
@media (min-width: 900px) {
  .rail { grid-auto-flow: row; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); overflow: visible; }
}

/* Perfil */
.profile-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-5);
  padding: var(--s-6);
  border-radius: var(--r-2xl);
  background: linear-gradient(135deg, var(--brand-50), #fff 60%), var(--surface);
  border: 1px solid var(--line);
}
.profile-head__photo { position: relative; }
.profile-head__photo .icon-btn {
  position: absolute; right: -2px; bottom: -2px;
  width: 36px; height: 36px;
  background: var(--brand-600); color: #fff;
  border: 3px solid #fff;
  border-radius: 50%;
}
.profile-head__photo .icon-btn:hover { background: var(--brand-700); }
.field-display { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3) 0; }
.field-display + .field-display { border-top: 1px solid var(--line); }
.field-display .fd-label { font-size: var(--text-xs); color: var(--subtle); font-weight: 600; }
.field-display .fd-value { margin: 0; font-weight: 600; font-size: var(--text-sm); overflow-wrap: anywhere; }
.setting { display: flex; align-items: center; gap: var(--s-4); padding: var(--s-3) 0; }
.setting + .setting { border-top: 1px solid var(--line); }
.setting p { font-size: var(--text-xs); color: var(--subtle); }

.edu-item { position: relative; padding-left: var(--s-4); }
.edu-item::before { content: ""; position: absolute; left: 0; top: 4px; bottom: 4px; width: 3px; border-radius: 3px; background: var(--line-strong); }
.edu-item.is-done::before { background: var(--green-600); }
.edu-item.is-current::before { background: var(--brand-600); }

.stars { display: inline-flex; gap: 1px; color: var(--amber-500); }
.stars i { font-size: 15px; }
.stars-input { display: flex; gap: var(--s-1); }
.stars-input button { border: 0; background: none; padding: 4px; color: var(--line-strong); }
.stars-input button i { font-size: 32px; }
.stars-input button[aria-checked="true"], .stars-input button.is-lit { color: var(--amber-500); }

.share-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-2); }
@media (min-width: 480px) { .share-grid { grid-template-columns: repeat(4, 1fr); } }
.share-grid .quick-action { flex-direction: column; justify-content: center; text-align: center; min-height: 92px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md); }
.table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { background: var(--surface-2); font-size: var(--text-xs); color: var(--muted); font-weight: 700; }
.table tr:last-child td { border-bottom: 0; }

.callout { display: flex; gap: var(--s-3); padding: var(--s-3) var(--s-4); border-radius: var(--r-md); font-size: var(--text-sm); }
.callout i { font-size: 18px; margin-top: 1px; }
.callout strong { display: block; }
.callout--info { background: var(--brand-50); color: var(--brand-900); }
.callout--warning { background: var(--amber-50); color: var(--amber-900); }
.callout--danger { background: var(--red-50); color: #7f1d1d; }
.callout--success { background: var(--green-50); color: #064e3b; }

.selection-bar {
  position: fixed;
  left: 50%;
  bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom) + 12px);
  z-index: 35;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: var(--s-2);
  width: min(calc(100% - 24px), 560px);
  padding: var(--s-2) var(--s-2) var(--s-2) var(--s-4);
  border-radius: var(--r-lg);
  background: var(--ink);
  color: #fff;
  box-shadow: var(--sh-lg);
  animation: sheet-in 260ms var(--ease) both;
}
@media (min-width: 1024px) { .selection-bar { bottom: 24px; left: calc(50% + var(--sidebar-w) / 2); } }
.selection-bar .btn--ghost { color: #e2e8f0; }
.selection-bar .btn--ghost:hover { background: rgb(255 255 255 / 0.1); color: #fff; }

.fab {
  position: fixed;
  right: 16px;
  bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom) + 16px);
  z-index: 25;
  display: grid; place-items: center;
  width: 56px; height: 56px;
  border: 0;
  border-radius: 18px;
  background: var(--brand-600);
  color: #fff;
  box-shadow: 0 10px 24px -6px rgb(37 99 235 / 0.55);
  transition: transform var(--t) var(--ease), background var(--t-fast);
}
.fab i { font-size: 26px; }
.fab:hover { background: var(--brand-700); transform: translateY(-2px); }
.fab .dot { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--red-600); color: #fff; font-size: 11px; font-weight: 700; line-height: 20px; border: 2px solid #fff; }
@media (min-width: 1024px) { .fab { display: none; } }
.desktop-only { display: none; }
@media (min-width: 1024px) { .desktop-only { display: block; } .mobile-only { display: none !important; } }

.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-2); }
.photo-grid > div {
  display: grid; place-items: center;
  aspect-ratio: 1;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, var(--amber-50), var(--brand-50));
  color: var(--subtle);
}
.photo-grid i { font-size: 26px; }

.attendance { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.attendance span { aspect-ratio: 1; border-radius: 6px; background: var(--green-600); }
.attendance span.off { background: var(--surface-3); }
.attendance span.miss { background: var(--red-100); }

.select-check {
  position: absolute;
  top: 12px; left: 12px;
  z-index: 3;
  width: 22px; height: 22px;
  accent-color: var(--brand-600);
}
.is-selecting .application { padding-left: 48px; }

.recent-dropdown {
  position: absolute;
  left: 0; right: 0; top: calc(100% + 6px);
  z-index: 20;
  padding: var(--s-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--sh-lg);
}
.recent-dropdown [role="option"] {
  display: flex; align-items: center; gap: var(--s-2);
  width: 100%;
  padding: 10px var(--s-3);
  border: 0; border-radius: var(--r-sm);
  background: none;
  font-size: var(--text-sm);
  text-align: left;
}
.recent-dropdown [role="option"]:hover, .recent-dropdown [role="option"].is-active { background: var(--surface-3); }

.footer-note { margin-top: var(--s-10); padding-top: var(--s-6); border-top: 1px solid var(--line); font-size: var(--text-xs); color: var(--subtle); }

noscript .empty { margin: var(--s-6); }

/* Botão de filtros (pesquisa): só enquanto o painel não está fixo ao lado */
@media (min-width: 1100px) { .filters-toggle { display: none !important; } }
@media (min-width: 1024px) { .hide-desktop { display: none !important; } .hide-desktop + .chips { margin-top: 0; } }
.hero__panel { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.grid-4 > .field + .field, .grid > .field + .field, .grid-2 > .field + .field { margin-top: 0; }
.timeline .tile { box-shadow: 0 0 0 1px var(--line); }
