/* ═══════════════════════════════════════════════════════════════════
   VIC HTMX UNIFY — camada final de padronização (Fase shell)
   Carregar DEPOIS de ivc_theme.css + vic_provisorio.css
   Objetivo: aparência estável, quadrada, roxo + laranja, diagramação limpa
   ═══════════════════════════════════════════════════════════════════ */

/* ── Tokens canônicos (sobrescrevem inconsistências entre temas) ── */
:root,
:root[data-theme="light"] {
  --vic-radius-xs: 2px;
  --vic-radius: 4px;
  --vic-radius-md: 6px;
  --vic-radius-lg: 8px;
  --vic-radius-xl: 10px;

  /* Aliases estruturais usados no ivc_theme */
  --radius: 4px;
  --radius-sm: 2px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 10px;
  --radius-2xl: 12px;
  --radius-pill: 4px; /* “quadradinho” — pills viram retângulos leves */
  --cut: 6px;
  --chamfer-sm: 4px;
  --chamfer-md: 6px;
  --chamfer-lg: 8px;

  /* Marca */
  --vic-primary: #230059;
  --vic-primary-light: #3d1b6e;
  --vic-primary-lighter: #ede0ff;
  --vic-accent: #fda326;
  --vic-accent-hover: #f09000;
  --vic-bg: #f7f4fb;
  --vic-surface: #ffffff;
  --vic-surface-alt: #f3eef8;
  --vic-border: #e4dceb;
  --vic-border-strong: #cfc2e0;
  --vic-text: #1a0a35;
  --vic-text-soft: #4a4060;
  --vic-text-faint: #7a7090;

  /* Ponte para tokens ivc_theme */
  --paper: #f7f4fb;
  --paper-soft: #fbf9fd;
  --paper-strong: #efe8f6;
  --ink-main: #1a0a35;
  --ink-soft: #4a4060;
  --ink-faint: #7a7090;
  --ink: var(--ink-main);
  --line: #e4dceb;
  --line-strong: #cfc2e0;
  --violet-ink: #230059;
  --violet-muted: #5e2d8c;
  --accent-orange: #fda326;
  --accent-orange-soft: #f4b34b;
  --card-bg: #ffffff;
  --dock-bg: rgba(247, 244, 251, 0.97);
  --dock-border: rgba(35, 0, 89, 0.14);
  --dock-icon-color: #230059;
  --dock-active-text: #f09000;
  --dock-active-bg: rgba(253, 163, 38, 0.12);
  --dock-active-border: rgba(253, 163, 38, 0.4);
}

:root[data-theme="dark"] {
  --vic-bg: #0d0820;
  --vic-surface: #16102e;
  --vic-surface-alt: #1e1640;
  --vic-border: #2e2050;
  --vic-border-strong: #3d2a6a;
  --vic-text: #e8e0ff;
  --vic-text-soft: #b8a8e0;
  --vic-text-faint: #8878b8;
  --vic-primary: #c4b0ff;
  --vic-primary-light: #a896f0;
  --vic-primary-lighter: rgba(196, 176, 255, 0.14);
  --vic-accent: #ff8c42;
  --vic-accent-hover: #fda326;
  --paper: #0d0820;
  --paper-soft: #16102e;
  --paper-strong: #221640;
  --card-bg: #16102e;
  --ink-main: #e8e0ff;
  --ink-soft: #b8a8e0;
  --line: #2e2050;
  --dock-bg: rgba(13, 8, 32, 0.97);
}

/* ── Shell / body ── */
html {
  scroll-behavior: smooth;
}

body {
  background: var(--paper, var(--vic-bg)) !important;
  color: var(--ink-main, var(--vic-text)) !important;
  font-family: "Inter", "Helvetica Neue", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  min-height: 100dvh;
}

/* Conteúdo principal: largura legível + respiro da dock */
main#main-content.app,
main.app,
.app {
  width: 100%;
  max-width: 1120px;
  margin-left: auto;
  margin-right: auto;
  padding: 16px 16px calc(var(--dock-space, 64px) + 20px + env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
}

@media (min-width: 768px) {
  main#main-content.app,
  main.app,
  .app {
    padding: 24px 24px 48px;
  }
}

/* ── Tipografia semântica ── */
.title {
  font-weight: 700;
  color: var(--violet-ink, #230059);
  letter-spacing: -0.01em;
  line-height: 1.25;
  text-wrap: balance;
}

.eyebrow {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--ink-soft, #4a4060);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--vic-radius);
  font-size: 0.7rem;
  font-weight: 700;
  border: 1px solid var(--line);
  background: var(--paper-soft);
  color: var(--violet-ink);
}

.pill.violet,
.pill.green,
.pill.amber {
  border-radius: var(--vic-radius);
}

/* ── Cards unificados ── */
.card,
.card-vic,
.card-elevated,
[class*="card-body"] {
  border-radius: var(--vic-radius-lg) !important;
}

.card,
.card-vic {
  background: var(--card-bg, #fff) !important;
  border: 1px solid var(--line, var(--vic-border)) !important;
  box-shadow: 0 1px 2px rgba(35, 0, 89, 0.06) !important;
  padding: 16px;
  overflow: hidden;
}

.card + .card {
  margin-top: 12px;
}

.card:hover {
  border-color: rgba(253, 163, 38, 0.45);
  box-shadow: 0 2px 8px rgba(35, 0, 89, 0.08);
}

/* ── Botões ── */
.btn,
button.btn,
a.btn,
button[type="submit"].btn,
.btn-primary,
.btn.primary,
.btn-secondary,
.btn.accent,
.btn-ghost,
.btn-outline,
.btn.light {
  border-radius: var(--vic-radius) !important;
  font-weight: 600;
  letter-spacing: 0.01em;
  min-height: 36px;
}

.btn.primary,
.btn-primary {
  background: var(--violet-ink, #230059) !important;
  color: #fff !important;
  border: 1px solid var(--violet-ink, #230059) !important;
}

.btn.primary:hover,
.btn-primary:hover {
  background: var(--violet-muted, #5e2d8c) !important;
}

.btn.accent,
.btn-accent,
.btn-warning {
  background: var(--accent-orange, #fda326) !important;
  color: #1a0a35 !important;
  border: 1px solid var(--accent-orange, #fda326) !important;
}

.btn.accent:hover,
.btn-accent:hover {
  background: var(--accent-orange-soft, #f4b34b) !important;
}

/* ── Forms ── */
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
select,
textarea,
.input-vic,
.form-control {
  border-radius: var(--vic-radius) !important;
  border: 1px solid var(--line, var(--vic-border)) !important;
  background: var(--paper-soft, var(--vic-surface-alt)) !important;
  color: var(--ink-main, var(--vic-text)) !important;
  min-height: 38px;
  padding: 8px 12px;
  font-size: 0.875rem;
  box-shadow: none !important;
}

input:focus,
select:focus,
textarea:focus,
.form-control:focus {
  outline: none !important;
  border-color: var(--accent-orange, #fda326) !important;
  box-shadow: 0 0 0 3px rgba(253, 163, 38, 0.2) !important;
}

label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 4px;
}

/* ── Tabelas ── */
table,
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
  background: var(--paper-soft);
  font-weight: 700;
}

/* ── Alertas (sem faixa lateral gorda) ── */
.alert,
.alert-vic,
[role="alert"] {
  border-radius: var(--vic-radius) !important;
  border: 1px solid var(--line) !important;
  padding: 12px 14px !important;
}

/* ── Modais / overlays ── */
.modal,
.modal-content,
[class*="modal-"] {
  border-radius: var(--vic-radius-lg) !important;
}

/* ── Dock: mais quadrada e legível ── */
.unity-dock {
  border-radius: var(--vic-radius-lg) var(--vic-radius-lg) 0 0 !important;
  border-top: 2px solid var(--violet-ink, #230059) !important;
  box-shadow: 0 -4px 20px rgba(35, 0, 89, 0.1) !important;
}

.dock-icon {
  border-radius: var(--vic-radius) !important;
}

.dock-icon.active {
  background: var(--dock-active-bg) !important;
  color: var(--dock-active-text) !important;
  border: 1px solid var(--dock-active-border) !important;
}

/* ── Context selector HTMX ── */
#vic-htmx-context-selector details {
  border-radius: var(--vic-radius-lg) !important;
  border-color: rgba(35, 0, 89, 0.25) !important;
  box-shadow: 0 4px 16px rgba(35, 0, 89, 0.12) !important;
}

#vic-htmx-context-selector summary {
  border-radius: var(--vic-radius-lg);
}

/* ── Tailwind: cantos altos viram quadradinhos (mantém círculo em dots/avatares) ── */
.rounded-3xl,
.rounded-2xl,
.rounded-xl,
.rounded-lg,
.rounded-md,
.rounded {
  border-radius: var(--vic-radius-lg) !important;
}

/* Avatares de foto: cantos suaves (não pill gigante) */
img.rounded-full,
.avatar,
.avatar img {
  border-radius: 6px !important;
}

/* Semáforo / bolinhas / status: SEMPRE círculo — semântica de cor, não de forma */
.dot-btn,
.ro-dot,
.diario-dot,
.status-dot,
.vic-dot,
.vic-status-dot,
.msn-status-ring,
.saving-dots span,
.icon-circle,
.icon-circle-sm,
.icon-circle-lg {
  border-radius: 50% !important;
}

/* ── Grid de páginas comuns ── */
.page-header,
.atp-header,
.section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.page-header h1,
.page-header .title {
  margin: 0;
  font-size: 1.25rem;
  color: var(--violet-ink);
}

/* ── Empty / loading ── */
.empty-state {
  padding: 40px 20px;
  text-align: center;
  color: var(--ink-soft);
  border: 1px dashed var(--line);
  border-radius: var(--vic-radius-lg);
  background: var(--paper-soft);
}

/* ── HTMX loading indicator ── */
.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
  opacity: 1;
}

/* ── Bootstrap remnants used in avaliação ── */
.container {
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: 16px;
}

.bg-paper-soft {
  background: var(--paper-soft) !important;
}

.text-violet,
.text-violet-800,
.text-violet-600 {
  color: var(--violet-ink) !important;
}

.border-violet-200 {
  border-color: rgba(35, 0, 89, 0.2) !important;
}

.bg-violet-50 {
  background: var(--vic-primary-lighter) !important;
}

/* ── Images / media ──
   height:auto só no fluxo de conteúdo; avatares/logo/mascote mantêm caixa fixa */
img,
video {
  max-width: 100%;
  height: auto;
}

/* Avatares / mascote: preservam caixa fixa (não colapsam com height:auto) */
img.vic-mascot-img,
img.gnome-profile-avatar,
.avatar img,
.chat-bubble-avatar img,
.msg-avatar img,
.profile-pic img,
.folder-drawer-avatar img {
  max-width: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.login-brand img {
  width: clamp(10.5rem, 18vw, 13.5rem);
  height: auto;
  max-width: 100%;
  object-fit: contain;
}

/* Foto de perfil em div com background-image */
.profile-pic {
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}

/* ── Reduce noisy glass ── */
.glass,
.glass-panel {
  backdrop-filter: none !important;
  background: var(--card-bg) !important;
}

/* ── Páginas auth (login / registro / void) ── */
.login-page,
.register-page,
.auth-shell {
  background: var(--paper, #f7f4fb) !important;
  color: var(--ink-main);
  min-height: 100dvh;
}

.login-notice,
.login-error,
.login-message,
.auth-card {
  border-radius: var(--vic-radius-lg, 8px) !important;
}

/* ── Grids de listagem comuns ── */
.grid-cards,
.planos-grid,
.turmas-grid,
.lista-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

/* ── Listas / stacks ── */
.stack-md > * + * { margin-top: 12px; }
.stack-sm > * + * { margin-top: 8px; }
.stack-lg > * + * { margin-top: 16px; }

/* ── Badges / status (quadradinhos) ── */
.badge,
.badge-vic,
.chip,
.chip-vic,
.tag,
.status-badge {
  border-radius: var(--vic-radius, 4px) !important;
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.03em;
}

/* ── Tabs ── */
.app-tabs,
.tabs,
.nav-tabs {
  border-bottom: 1px solid var(--line);
  gap: 4px;
}

.app-tabs a,
.tabs a,
.nav-tabs a,
.tab-btn {
  border-radius: var(--vic-radius, 4px) var(--vic-radius, 4px) 0 0 !important;
  padding: 8px 12px;
  font-weight: 600;
  color: var(--ink-soft);
}

.app-tabs a.active,
.tabs a.active,
.nav-tabs .active,
.tab-btn.active {
  color: var(--violet-ink);
  border-bottom: 2px solid var(--accent-orange);
  background: var(--paper-soft);
}

/* ── Toolbars / filters ── */
.toolbar,
.filters,
.filter-bar,
.action-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 12px;
  background: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: var(--vic-radius-lg, 8px);
}

/* ── KPI / stat tiles ── */
.stat-tile,
.kpi-card,
.metric-card {
  background: var(--card-bg, #fff);
  border: 1px solid var(--line);
  border-radius: var(--vic-radius-lg, 8px);
  padding: 14px 16px;
}

.stat-tile .value,
.kpi-card .value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--violet-ink);
  letter-spacing: -0.02em;
}

.stat-tile .label,
.kpi-card .label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Progress bars ── */
.progress,
.progress-bar-track {
  height: 8px;
  background: var(--paper-strong);
  border-radius: var(--vic-radius, 4px);
  overflow: hidden;
}

.progress > *,
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-orange), var(--violet-ink));
  border-radius: var(--vic-radius, 4px);
}

/* ── Partial panels / drawers ── */
.panel,
.side-panel,
.drawer,
.curtain-panel {
  background: var(--card-bg, #fff);
  border: 1px solid var(--line);
  border-radius: var(--vic-radius-lg, 8px);
}

/* ── Diario / avaliação helpers ── */
.diario-shell,
.avaliacao-shell,
.gabarito-shell {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ═══ DIÁRIO DE BORDO — design system local ═══ */
.diario-root {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  background: var(--paper, #f7f4fb);
  color: var(--ink-main, #1a0a35);
}

.diario-tabs {
  display: flex;
  flex-shrink: 0;
  gap: 0;
  border-bottom: 1px solid var(--line, #e4dceb);
  background: var(--paper-soft, #fbf9fd);
}

.diario-tab {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 10px 8px;
  border: none;
  background: transparent;
  color: var(--ink-soft, #4a4060);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.diario-tab:hover {
  color: var(--violet-ink, #230059);
  background: rgba(35, 0, 89, 0.04);
}

.diario-tab.is-active {
  color: var(--violet-ink, #230059);
  border-bottom-color: var(--accent-orange, #fda326);
  background: var(--card-bg, #fff);
}

.diario-tab.is-active-green {
  color: var(--emerald, #2d8c5e);
  border-bottom-color: var(--emerald, #2d8c5e);
  background: var(--card-bg, #fff);
}

.diario-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 12px 96px;
}

@media (min-width: 640px) {
  .diario-scroll { padding: 20px 20px 104px; }
}

.diario-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  padding: 10px 12px;
  margin-bottom: 12px;
  background: var(--card-bg, #fff);
  border: 1px solid var(--line, #e4dceb);
  border-radius: var(--vic-radius-lg, 8px);
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--ink-soft, #4a4060);
}

.diario-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.diario-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50% !important;
  border: 2px solid transparent;
  flex-shrink: 0;
}

.diario-legend-dot.lvl-1 {
  background: var(--alert, #c84830);
  border-color: color-mix(in srgb, var(--alert, #c84830) 70%, #000);
}
.diario-legend-dot.lvl-2 {
  background: var(--accent-gold, #f0a800);
  border-color: var(--accent-orange, #fda326);
}
.diario-legend-dot.lvl-3 {
  background: var(--emerald, #2d8c5e);
  border-color: color-mix(in srgb, var(--emerald, #2d8c5e) 70%, #000);
}

.diario-alunos-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px;
}

.diario-aluno-card {
  background: var(--card-bg, #fff);
  border: 1px solid var(--line, #e4dceb);
  border-radius: var(--vic-radius-lg, 8px);
  padding: 12px 14px;
  box-shadow: 0 1px 2px rgba(35, 0, 89, 0.04);
}

.diario-aluno-card:focus-within {
  border-color: rgba(253, 163, 38, 0.55);
  box-shadow: 0 0 0 3px rgba(253, 163, 38, 0.12);
}

.diario-aluno-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line, #e4dceb);
}

.diario-aluno-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  border-radius: var(--vic-radius, 4px);
  background: var(--vic-primary-lighter, #ede0ff);
  color: var(--violet-ink, #230059);
  font-size: 0.75rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.diario-aluno-nome {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--ink-main, #1a0a35);
  line-height: 1.3;
  min-width: 0;
}

.diario-hab-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 36px;
  padding: 4px 0;
}

.diario-hab-label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--ink-soft, #4a4060);
  max-width: 58%;
  line-height: 1.35;
  word-break: break-word;
}

.diario-dots {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Bolinhas de avaliação — círculo real, alvo de toque confortável */
.dot-btn,
.ro-dot {
  display: inline-block;
  width: 26px;
  height: 26px;
  border-radius: 50% !important;
  background: var(--paper-soft, #fbf9fd);
  border: 2px solid var(--line-strong, #cfc2e0);
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  vertical-align: middle;
}

button.dot-btn {
  padding: 0;
  appearance: none;
}

.dot-btn:hover {
  transform: scale(1.08);
  border-color: var(--violet-ink, #230059);
}

.dot-btn:active {
  transform: scale(0.94);
}

.dot-btn:focus-visible,
.ro-dot:focus-visible {
  outline: 2px solid var(--accent-orange, #fda326);
  outline-offset: 2px;
}

.dot-btn.dot-active-1,
.ro-dot.dot-active-1 {
  background: var(--alert, #c84830);
  border-color: color-mix(in srgb, var(--alert, #c84830) 70%, #000);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--alert, #c84830) 22%, transparent);
  transform: scale(1.06);
}

.dot-btn.dot-active-2,
.ro-dot.dot-active-2 {
  background: var(--accent-gold, #f0a800);
  border-color: var(--accent-orange, #fda326);
  box-shadow: 0 0 0 3px rgba(253, 163, 38, 0.25);
  transform: scale(1.06);
}

.dot-btn.dot-active-3,
.ro-dot.dot-active-3 {
  background: var(--emerald, #2d8c5e);
  border-color: color-mix(in srgb, var(--emerald, #2d8c5e) 70%, #000);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--emerald, #2d8c5e) 22%, transparent);
  transform: scale(1.06);
}

.diario-adesao-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px dashed var(--line, #e4dceb);
}

.diario-adesao-label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--violet-ink, #230059);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.diario-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line, #e4dceb);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--violet-ink, #230059);
}

.diario-eval-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

@media (min-width: 900px) {
  .diario-eval-grid { grid-template-columns: repeat(4, 1fr); }
}

.diario-eval-card {
  background: var(--card-bg, #fff);
  border: 1px solid var(--line, #e4dceb);
  border-radius: var(--vic-radius-lg, 8px);
  padding: 12px;
}

.diario-eval-label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--ink-soft, #4a4060);
}

.eval-card-group {
  display: flex;
  gap: 6px;
}

.eval-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 52px;
  padding: 8px 4px;
  background: var(--paper-soft, #fbf9fd);
  border: 1.5px solid var(--line, #e4dceb);
  border-radius: var(--vic-radius, 4px);
  cursor: pointer;
  color: var(--ink-soft, #4a4060);
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.eval-card:hover {
  border-color: rgba(35, 0, 89, 0.35);
}

.eval-card.eval-active {
  border-color: var(--violet-ink, #230059);
  background: color-mix(in srgb, var(--violet-ink, #230059) 8%, var(--paper, #fff));
  color: var(--ink-main, #1a0a35);
  box-shadow: 0 1px 4px rgba(35, 0, 89, 0.1);
}

.eval-card .eval-dot {
  width: 12px;
  height: 12px;
  border-radius: 50% !important;
  border: 2px solid transparent;
}

.eval-card .eval-dot.n { background: var(--alert, #c84830); border-color: color-mix(in srgb, var(--alert) 70%, #000); }
.eval-card .eval-dot.p { background: var(--accent-gold, #f0a800); border-color: var(--accent-orange, #fda326); }
.eval-card .eval-dot.s { background: var(--emerald, #2d8c5e); border-color: color-mix(in srgb, var(--emerald) 70%, #000); }

.eval-card .eval-lbl {
  font-size: 0.5625rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.diario-textarea {
  width: 100%;
  font-size: 0.8125rem;
  line-height: 1.5;
  padding: 10px 12px;
  border: 1px solid var(--line, #e4dceb);
  border-radius: var(--vic-radius, 4px);
  background: var(--paper-soft, #fbf9fd);
  color: var(--ink-main, #1a0a35);
  resize: none;
  font-family: inherit;
  min-height: 72px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.diario-textarea:focus {
  outline: none;
  border-color: var(--accent-orange, #fda326);
  box-shadow: 0 0 0 3px rgba(253, 163, 38, 0.18);
  background: #fff;
}

.diario-textarea::placeholder {
  color: var(--ink-faint, #7a7090);
}

.diario-reflect-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

@media (min-width: 900px) {
  .diario-reflect-grid { grid-template-columns: 1fr 1fr; }
}

.diario-reflect-card {
  background: var(--card-bg, #fff);
  border: 1px solid var(--line, #e4dceb);
  border-radius: var(--vic-radius-lg, 8px);
  padding: 12px 14px;
}

.diario-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--line, #e4dceb);
  background: color-mix(in srgb, var(--paper, #f7f4fb) 92%, transparent);
  backdrop-filter: blur(8px);
}

.diario-footer.sticky-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 40;
}

.diario-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: var(--vic-radius, 4px);
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s ease, opacity 0.15s ease;
}

.diario-btn-ghost {
  background: var(--paper-soft, #fbf9fd);
  border-color: var(--line, #e4dceb);
  color: var(--ink-soft, #4a4060);
}

.diario-btn-primary {
  background: var(--violet-ink, #230059);
  color: #fff;
  border-color: var(--violet-ink, #230059);
}

.diario-btn-primary:hover {
  background: var(--violet-muted, #5e2d8c);
}

.diario-btn-success {
  background: var(--emerald, #2d8c5e);
  color: #fff;
  border-color: var(--emerald, #2d8c5e);
}

.diario-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--ink-soft, #4a4060);
  border: 1px dashed var(--line, #e4dceb);
  border-radius: var(--vic-radius-lg, 8px);
  background: var(--paper-soft, #fbf9fd);
  font-size: 0.8125rem;
}

.aluno-row,
.item-avaliacao-row {
  display: grid;
  grid-template-columns: minmax(120px, 1.2fr) repeat(auto-fit, minmax(56px, 1fr));
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--vic-radius, 4px);
  background: var(--paper-soft);
}

/* ── Planos / trilhas ── */
.plano-card,
.trilha-card,
.dia-trilha-card {
  border: 1px solid var(--line);
  border-radius: var(--vic-radius-lg, 8px);
  background: var(--card-bg, #fff);
  padding: 14px;
}

.plano-card:hover,
.trilha-card:hover {
  border-color: rgba(253, 163, 38, 0.5);
}

/* ── Utilitários de espaçamento estáveis ── */
.u-stack-sm > * + * { margin-top: 8px; }
.u-stack-md > * + * { margin-top: 12px; }
.u-stack-lg > * + * { margin-top: 20px; }

/* ── Fix overflow de tabelas em mobile ── */
.table-responsive,
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: var(--vic-radius-lg, 8px);
}

/* ── Print ── */
@media print {
  .unity-dock,
  #vic-htmx-context-selector,
  #vic-ticker,
  .dock-filters {
    display: none !important;
  }
  main.app {
    padding: 0 !important;
    max-width: none !important;
  }
}

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

/* ═══════════════════════════════════════════════════════════════════
   Onda 2 — cobertura global extra (page-by-page project pass)
   ═══════════════════════════════════════════════════════════════════ */

/* Sombras pesadas → elevação leve da marca */
.shadow-2xl,
.shadow-xl,
.shadow-lg {
  box-shadow: 0 2px 10px rgba(35, 0, 89, 0.08) !important;
}

/* Gradientes de hero genéricos (Tailwind purple/indigo) */
[class*="from-purple"],
[class*="from-indigo"],
[class*="to-purple"],
[class*="to-indigo"] {
  /* quando combinados com gradient, o background-image do TW manda;
     reforçamos via filter/text legibilidade */
  color: inherit;
}

/* Hero banners comuns */
.hero,
.page-hero,
.banner-vic,
[class*="hero-banner"] {
  border-radius: var(--vic-radius-lg) !important;
  background: linear-gradient(135deg, #230059 0%, #3d1b6e 55%, #5e2d8c 100%) !important;
  color: #fff !important;
  border: 1px solid rgba(35, 0, 89, 0.2);
}

/* Cards Tailwind genéricos sem .card */
.bg-white.border,
.bg-white.shadow-sm,
.bg-white.shadow,
article.bg-white,
section.bg-white {
  border-radius: var(--vic-radius-lg) !important;
  border-color: var(--line) !important;
}

/* Feed / mural — NÃO aplicar em .chat-bubble (quebra bolha do user = texto branco em fundo branco) */
.feed-card,
.mural-card,
.timeline-item {
  border-radius: var(--vic-radius-lg) !important;
  border: 1px solid var(--line);
  background: var(--card-bg, #fff);
}

/* ═══ VIC CHAT — bolhas legíveis (override de regras genéricas) ═══ */
.vic-chat .chat-bubble,
.chat-bubble {
  border-radius: 10px !important;
  max-width: 100%;
}

/* Bolha do usuário: roxo + texto branco (nunca fundo paper) */
.vic-chat .chat-bubble.bubble-user,
.chat-bubble.bubble-user,
.bubble-user {
  background: linear-gradient(135deg, #180048 0%, #230059 55%, #3d1b6e 100%) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 2px 10px rgba(35, 0, 89, 0.22) !important;
}

.bubble-user .bubble-content,
.bubble-user .bubble-content p,
.bubble-user .bubble-content span,
.bubble-user .bubble-footer,
.bubble-user .bubble-time {
  color: #ffffff !important;
}

.bubble-user .bubble-time {
  opacity: 0.75 !important;
}

.bubble-user .bubble-content a {
  color: #ffd28a !important;
}

/* Bolha da VIC: superfície clara + tinta escura */
.vic-chat .chat-bubble.bubble-vic,
.chat-bubble.bubble-vic,
.bubble-vic {
  background: #ffffff !important;
  color: var(--ink-main, #1a0a35) !important;
  border: 1px solid var(--line, #e4dceb) !important;
  box-shadow: 0 1px 4px rgba(35, 0, 89, 0.06) !important;
}

.bubble-vic .bubble-content,
.bubble-vic .bubble-content p {
  color: var(--ink-main, #1a0a35) !important;
}

.bubble-vic .bubble-time {
  color: var(--ink-faint, #7a7090) !important;
}

/* Conteúdo vazio: não deixa “fantasma” de bolha em branco */
.chat-bubble .bubble-content:empty {
  display: none;
}

.chat-bubble:not(:has(.bubble-content:not(:empty))):not(:has(.chat-cards-container)):not(:has(.chat-select-container)) {
  min-height: 0;
  padding-top: 8px;
  padding-bottom: 8px;
}

/* Cards Oracle dentro do chat */
.vic-chat .chat-card-oracle,
.chat-card-oracle {
  background: var(--paper-soft, #fbf9fd) !important;
  border: 1px solid var(--line, #e4dceb) !important;
  border-radius: 8px !important;
  color: var(--ink-main, #1a0a35) !important;
}

.vic-chat .chat-card-title,
.chat-card-title {
  color: var(--accent-orange, #fda326) !important;
  font-weight: 700 !important;
}

.vic-chat .chat-card-action,
.chat-card-action {
  color: var(--violet-ink, #230059) !important;
}

/* Textarea do chat: não herdar form “paper-soft” excessivo */
.vic-chat-textfield,
#vic-chat-textarea {
  background: #fff !important;
  color: var(--ink-main, #1a0a35) !important;
  border: 1.5px solid var(--accent-orange, #fda326) !important;
  border-radius: 8px !important;
  min-height: 42px !important;
}

.vic-chat-textfield:focus,
#vic-chat-textarea:focus {
  box-shadow: 0 0 0 3px rgba(253, 163, 38, 0.2) !important;
}

/* Avatares do chat: círculo */
.chat-bubble-avatar {
  border-radius: 50% !important;
  overflow: hidden;
}

/* Almox / prontidão / solicitações */
.almox-card,
.solicitacao-card,
.prontidao-card,
.reserva-card,
.material-card {
  border-radius: var(--vic-radius-lg) !important;
  border: 1px solid var(--line) !important;
  background: var(--card-bg, #fff) !important;
}

/* Agenda / calendário */
.fc,
.calendar-shell,
.agenda-day,
.evento-chip {
  border-radius: var(--vic-radius) !important;
}

/* Fórum */
.forum-topic,
.forum-reply,
.topico-card {
  border-radius: var(--vic-radius-lg) !important;
  border: 1px solid var(--line);
  background: var(--card-bg, #fff);
}

/* Relatórios / wizard */
.wizard-step,
.relatorio-card,
.encomenda-card {
  border-radius: var(--vic-radius-lg) !important;
  border: 1px solid var(--line);
  background: var(--card-bg, #fff);
  padding: 14px 16px;
}

/* Segurança / 2FA / auth cards */
.security-card,
.auth-panel,
.lgpd-panel {
  border-radius: var(--vic-radius-lg) !important;
  border: 1px solid var(--line);
  background: var(--card-bg, #fff);
  padding: 20px;
}

/* Avatares de foto / pills de UI: cantos suaves.
   NÃO forçar em bolinhas de status (.dot-btn, .status-dot, etc.) */
.rounded-full:not(.status-dot):not(.dot-btn):not(.ro-dot):not(.diario-dot):not(.vic-dot),
img.rounded-full {
  border-radius: 6px !important;
}

/* Inputs de busca e selects em toolbars */
.toolbar input,
.toolbar select,
.filters input,
.filters select,
.filter-bar input,
.filter-bar select {
  min-height: 36px;
  border-radius: var(--vic-radius) !important;
}

/* Links de ação laranja */
a.link-accent,
.action-link {
  color: var(--accent-orange-hover, #f09000);
  font-weight: 600;
  text-decoration: none;
}
a.link-accent:hover,
.action-link:hover {
  color: var(--violet-ink);
  text-decoration: underline;
}

/* Sticky headers de listagem */
.sticky-page-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--paper, #f7f4fb);
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}

/* Empty dashed boxes */
.border-dashed {
  border-color: var(--line-strong, #cfc2e0) !important;
}

/* Soften pure gray Tailwind surfaces into brand paper
   Usar background-color (não background) para não apagar background-image de fotos */
.bg-gray-50 {
  background-color: var(--paper-soft, #fbf9fd) !important;
}
.bg-gray-100 {
  background-color: var(--paper-strong, #efe8f6) !important;
}
.border-gray-100,
.border-gray-200 {
  border-color: var(--line) !important;
}
.text-gray-500,
.text-gray-600 {
  color: var(--ink-soft) !important;
}
.text-gray-800,
.text-gray-900 {
  color: var(--ink-main) !important;
}

/* Purple TW leftovers → brand */
.bg-purple-50,
.bg-purple-100 {
  background-color: var(--vic-primary-lighter, #ede0ff) !important;
}
.text-purple-600,
.text-purple-700,
.text-purple-800,
.text-indigo-700,
.text-indigo-800,
.text-indigo-900 {
  color: var(--violet-ink, #230059) !important;
}
.border-purple-100,
.border-purple-200,
.border-indigo-100 {
  border-color: rgba(35, 0, 89, 0.18) !important;
}

/* Focus rings brand */
.focus\:ring-purple-500:focus,
.focus\:border-purple-500:focus {
  --tw-ring-color: rgba(253, 163, 38, 0.35);
  border-color: var(--accent-orange) !important;
}

/* Mobile safe spacing for long lists */
.list-page,
.lista-page {
  padding-bottom: calc(var(--dock-space, 64px) + 24px);
}

/* HTMX swap fade (leve) */
.htmx-swapping {
  opacity: 0.55;
  transition: opacity 120ms ease;
}
.htmx-settling {
  opacity: 1;
}


/* ═══════════════════════════════════════════════════════════════════
   SURFACE PASS 2026 — revisão HTML global (product register)
   Círculos semânticos + diagramação de listagens + densidade estável
   ═══════════════════════════════════════════════════════════════════ */

/* Micro-indicadores de status — sempre círculo */
.status-dot,
.cor-dot,
.pd-dot,
.fio-cap-dot,
.lp-showcase-dot,
.hora-pill,
.vic-status-dot,
.online-indicator,
.offline-indicator,
.diario-legend-dot,
.eval-dot {
  border-radius: 50% !important;
}

/* Tailwind micro-dots coloridos (presença / semáforo em listagens) */
.w-2.h-2.rounded,
.w-2\.5.h-2\.5.rounded,
.w-3.h-3.rounded,
.w-2.h-2.bg-green-500,
.w-2.h-2.bg-emerald-500,
.w-2.h-2.bg-red-500,
.w-2.h-2.bg-amber-500,
.w-2.h-2.bg-gray-400,
.w-2\.5.h-2\.5.bg-green-500,
.w-2\.5.h-2\.5.bg-red-500,
.w-2\.5.h-2\.5.bg-amber-500,
.w-2\.5.h-2\.5.bg-gray-400 {
  border-radius: 50% !important;
}

/* ── Superfície de página padrão ── */
.page-surface,
.lista-page,
.dashboard-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.page-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--violet-ink, #230059);
  text-wrap: balance;
}

.page-subtitle {
  margin: 4px 0 0;
  font-size: 0.8125rem;
  color: var(--ink-soft, #4a4060);
  line-height: 1.45;
}

/* Section blocks */
.surface-section {
  background: var(--card-bg, #fff);
  border: 1px solid var(--line, #e4dceb);
  border-radius: var(--vic-radius-lg, 8px);
  padding: 16px;
}

.surface-section + .surface-section {
  margin-top: 12px;
}

.surface-section-title {
  margin: 0 0 12px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--violet-ink, #230059);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* List rows */
.surface-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.surface-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--card-bg, #fff);
  border: 1px solid var(--line, #e4dceb);
  border-radius: var(--vic-radius-lg, 8px);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.surface-row:hover {
  border-color: rgba(253, 163, 38, 0.45);
  box-shadow: 0 2px 8px rgba(35, 0, 89, 0.06);
}

.surface-row-title {
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--ink-main, #1a0a35);
  line-height: 1.3;
}

.surface-row-meta {
  font-size: 0.75rem;
  color: var(--ink-soft, #4a4060);
  margin-top: 2px;
}

/* Icon tile in lists */
.surface-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--vic-radius, 4px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--vic-primary-lighter, #ede0ff);
  color: var(--violet-ink, #230059);
  font-size: 1.1rem;
}

/* Chips / filters */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 28px;
  padding: 0 10px;
  border-radius: var(--vic-radius, 4px);
  border: 1px solid var(--line, #e4dceb);
  background: var(--paper-soft, #fbf9fd);
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--ink-soft, #4a4060);
  text-decoration: none;
  cursor: pointer;
}

.chip.is-active,
.chip[aria-current="page"] {
  background: var(--vic-primary-lighter, #ede0ff);
  border-color: rgba(35, 0, 89, 0.25);
  color: var(--violet-ink, #230059);
}

/* Modal / drawer content breathing */
#modalUniversalContent,
#panelContent,
.modal-body,
.drawer-body {
  color: var(--ink-main, #1a0a35);
}

#panelContent {
  background: var(--paper, #f7f4fb);
}

/* HTMX partials common */
.htmx-partial,
.partial-panel {
  padding: 12px;
}

/* Tables denser but readable */
.table-vic th {
  white-space: nowrap;
}

/* Callouts sem faixa lateral gorda */
.callout,
.notice,
.info-box {
  border-radius: var(--vic-radius, 4px) !important;
  border: 1px solid var(--line, #e4dceb) !important;
  border-left-width: 1px !important;
  padding: 12px 14px;
  background: var(--paper-soft, #fbf9fd);
}

.callout-warn,
.notice-warn {
  background: color-mix(in srgb, var(--accent-orange, #fda326) 10%, var(--paper));
  border-color: color-mix(in srgb, var(--accent-orange, #fda326) 40%, var(--line)) !important;
}

.callout-ok,
.notice-ok {
  background: color-mix(in srgb, var(--emerald, #2d8c5e) 10%, var(--paper));
  border-color: color-mix(in srgb, var(--emerald, #2d8c5e) 35%, var(--line)) !important;
}

/* Skeleton loaders — soft square OK */
.skeleton-pulse,
.skeleton {
  border-radius: var(--vic-radius, 4px);
  background: linear-gradient(90deg, var(--paper-strong) 25%, var(--paper-soft) 50%, var(--paper-strong) 75%);
  background-size: 200% 100%;
  animation: vicSkeleton 1.2s ease-in-out infinite;
}

@keyframes vicSkeleton {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .skeleton-pulse, .skeleton { animation: none; }
}

/* Progressive enhancement: hide empty decorative rings */
.vic-mascot-ring {
  border-radius: 50% !important;
}

/* Dock labels slightly clearer */
.dock-lbl {
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* Forum / feed list polish */
.forum-topic,
.topico-card,
.feed-card,
.mural-card {
  padding: 14px 16px;
}

/* Planos cards */
.plano-card h3,
.plano-card .title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--violet-ink, #230059);
  margin: 0 0 4px;
}

/* Auth: ensure logo visible */
.login-brand img,
.register-brand img {
  display: block;
}

/* Prevent unify height:auto from collapsing fixed media tiles */
.photo-thumb img,
.feed-mosaic__img,
.avatar-octo img {
  max-width: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
