/* ============================================================
   Novos Alunos Uélicon — app.css
   ============================================================
   Light mode. Inter + tabular-nums.
   Importa tokens.css; só estilos próprios do produto aqui.
   v1.0 — 2026-05-11
   ============================================================ */

@import url('./tokens.css');

/* ============================================================
   F4 — x-cloak: esconder elementos Alpine antes de hidratar
   ============================================================ */
[x-cloak] { display: none !important; }

/* ============================================================
   RESET / BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

html { font-size: 16px; color-scheme: light; }
select option { background: #ffffff; color: var(--text-body); }
body {
  margin: 0;
  padding: 0;
  background: var(--surface-page);
  color: var(--text-body);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
html, body { overflow-x: hidden; }
body { min-height: 100vh; min-height: 100svh; }

h1, h2, h3, h4 { margin: 0; }

img, svg { display: block; max-width: 100%; }

button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
}

a {
  color: var(--accent-soft-text);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

/* ============================================================
   LAYOUT — container + header
   ============================================================ */
.app-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  height: var(--header-height);
  background: var(--surface-card);
  border-bottom: 1px solid var(--border-subtle);
}
.app-header__inner {
  max-width: var(--container-max);
  margin: 0 auto;
  height: 100%;
  padding: 0 var(--space-6);
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  font-size: var(--text-md);
  position: relative; /* âncora pro app-switcher */
}
.brand__mark {
  width: 24px; height: 24px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--neutral-200);
  color: var(--text-primary);
  font-weight: var(--weight-bold);
  font-size: var(--text-sm);
  border-radius: var(--radius-sm);
}
.brand__mark--button {
  border: 0;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  transition: background 120ms;
}
.brand__mark--button:hover { background: var(--neutral-300, #d4d4d8); }
.brand__mark--button:focus-visible { outline: 2px solid var(--green-600); outline-offset: 2px; }
.brand__name { letter-spacing: -0.005em; }

/* App switcher: dropdown pequeno ancorado no brand */
.app-switcher {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 100;
  min-width: 240px;
  margin: 0;
  padding: var(--space-2);
  list-style: none;
  background: var(--surface-card, #fff);
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
.app-switcher__head {
  padding: var(--space-2) var(--space-3) var(--space-1);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--text-secondary);
}
.app-switcher__item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}
.app-switcher__item:hover { background: var(--surface-subtle); }
.app-switcher__item:focus-visible { outline: 2px solid var(--green-600); outline-offset: -2px; }
.app-switcher__item--current { color: var(--green-700); cursor: default; }
.app-switcher__item--current:hover { background: var(--green-50); }
.app-switcher__icon { font-size: var(--text-md); line-height: 1; }
.app-switcher__nome { flex: 1; }
.app-switcher__check { color: var(--green-600); font-weight: var(--weight-bold); }

.app-nav {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}
.app-nav__link {
  position: relative;
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  color: var(--text-body);
  padding: var(--space-2) 0;
  border-bottom: 2px solid transparent;
  transition: color var(--motion-fast) var(--ease-out);
}
.app-nav__link:hover { color: var(--text-primary); text-decoration: none; }
.app-nav__link.is-active {
  color: var(--text-primary);
  border-bottom-color: var(--accent);
}
.app-nav__link:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 4px;
  border-radius: var(--radius-sm);
}

.app-header__spacer { flex: 1; }

.bell {
  position: relative;
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius);
  color: var(--text-body);
}
.bell:hover { background: var(--surface-subtle); color: var(--text-primary); }
.bell:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; }
.bell__count {
  position: absolute;
  top: 4px; right: 4px;
  min-width: 18px; height: 18px;
  padding: 0 5px;
  background: var(--red-500);
  color: #fff;
  font-size: 11px;
  font-weight: var(--weight-bold);
  border-radius: var(--radius-pill);
  display: inline-flex; align-items: center; justify-content: center;
  font-variant-numeric: tabular-nums;
}
.bell__count--zero { display: none; }

/* Botão Melhorias (estilo TMB: lâmpada + label + badge) */
.btn-melhorias {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  height: 36px;
  border-radius: var(--radius);
  border: 1px solid var(--border-default);
  background: var(--surface-card);
  color: var(--text-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  cursor: pointer;
}
.btn-melhorias:hover { background: var(--surface-subtle); color: var(--text-primary); }
.btn-melhorias:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; }
.btn-melhorias__icon { color: var(--text-secondary); }
.btn-melhorias:hover .btn-melhorias__icon { color: var(--text-primary); }
.btn-melhorias__badge {
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: var(--radius-pill);
  background: var(--green-700, oklch(45% 0.13 145));
  color: #fff;
  font-size: 11px;
  font-weight: var(--weight-bold);
  display: inline-flex; align-items: center; justify-content: center;
  font-variant-numeric: tabular-nums;
}
.btn-melhorias__badge--zero { display: none; }

/* Ícone de ação no header (admin, refresh) */
.app-header__icon-btn {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius);
  color: var(--text-body);
  background: transparent;
  border: 0;
  cursor: pointer;
}
.app-header__icon-btn:hover { background: var(--surface-subtle); color: var(--text-primary); }
.app-header__icon-btn:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; }

@media (max-width: 640px) {
  .btn-melhorias span:not(.btn-melhorias__badge) { display: none; }
  .btn-melhorias { padding: 0; width: 36px; justify-content: center; position: relative; }
  .btn-melhorias__badge {
    position: absolute;
    top: -4px; right: -4px;
    min-width: 18px; height: 18px;
    padding: 0 5px;
  }
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius);
  border: 1px solid var(--border-default);
  background: var(--surface-card);
  color: var(--text-body);
  font-size: var(--text-base);
}
.user-chip:hover { background: var(--surface-subtle); }
.user-chip__avatar {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--neutral-200);
  color: var(--text-body);
  font-weight: var(--weight-semibold);
  font-size: var(--text-xs);
  border-radius: var(--radius-pill);
}
.user-chip__caret { transition: transform var(--motion-fast) var(--ease-out); }
.user-chip__caret.is-open { transform: rotate(180deg); }
.user-chip-wrap { position: relative; }
.user-chip__menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 200px;
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  list-style: none;
  margin: 0;
  padding: var(--space-1);
  z-index: var(--z-dropdown);
}
.user-chip__menuitem {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  text-align: left;
  color: var(--text-body);
  font-size: var(--text-base);
}
.user-chip__menuitem:hover { background: var(--surface-subtle); color: var(--text-primary); }

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--space-6);
}

.page-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}
.page-title {
  font-size: var(--text-2xl);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  letter-spacing: var(--tracking-tight);
}
.page-subtitle {
  font-size: var(--text-base);
  color: var(--text-secondary);
  margin-top: var(--space-1);
}

/* ============================================================
   BOTÕES
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: 40px;
  padding: 0 var(--space-4);
  border-radius: var(--radius);
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  border: 1px solid transparent;
  transition: background var(--motion-fast) var(--ease-out),
              border-color var(--motion-fast) var(--ease-out),
              color var(--motion-fast) var(--ease-out);
  white-space: nowrap;
}
.btn:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
  box-shadow: var(--shadow-focus);
}
.btn--primary {
  background: var(--green-700);
  color: var(--text-on-accent);
  font-weight: var(--weight-semibold);
}
.btn--primary:hover { background: var(--green-800, oklch(38% 0.13 145)); }
.btn--primary:disabled,
.btn--primary[aria-disabled="true"] {
  background: var(--neutral-200);
  color: var(--text-disabled);
  cursor: not-allowed;
}
.btn--ghost {
  background: transparent;
  color: var(--text-body);
  border-color: var(--border-default);
}
.btn--ghost:hover { background: var(--surface-subtle); color: var(--text-primary); }
.btn--danger {
  background: var(--red-600);
  color: #fff;
}
.btn--danger:hover { background: var(--red-700); }
.btn--small { height: 32px; padding: 0 var(--space-3); font-size: var(--text-sm); }
.btn--full { width: 100%; }
.btn--icon {
  width: 36px; height: 36px;
  padding: 0;
  border-radius: var(--radius);
  color: var(--text-body);
}
.btn--icon:hover { background: var(--surface-subtle); color: var(--text-primary); }

/* ============================================================
   INPUTS
   ============================================================ */
.field { display: block; margin-bottom: var(--space-4); }
.field__label {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-body);
  margin-bottom: var(--space-1);
}
.field__hint {
  display: block;
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  margin-top: var(--space-1);
}
.field__error {
  display: block;
  font-size: var(--text-sm);
  color: var(--red-700);
  margin-top: var(--space-1);
}

.input, .select, .textarea {
  width: 100%;
  height: 40px;
  padding: 0 var(--space-3);
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  background: var(--surface-card);
  color: var(--text-body);
  font-size: var(--text-base);
  transition: border-color var(--motion-fast) var(--ease-out),
              box-shadow var(--motion-fast) var(--ease-out);
}
.textarea { height: auto; min-height: 80px; padding: var(--space-2) var(--space-3); resize: vertical; line-height: var(--leading-normal); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--border-strong); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--shadow-focus);
}
.input--error, .select--error, .textarea--error {
  border-color: var(--red-500);
}
.input::placeholder, .textarea::placeholder { color: var(--text-tertiary); }
.input:disabled, .select:disabled, .textarea:disabled {
  background: var(--surface-inset);
  cursor: not-allowed;
}

.checkbox, .radio {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-base);
  color: var(--text-body);
  cursor: pointer;
  user-select: none;
}
.checkbox input, .radio input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.radio-list { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-3); border: 1px solid var(--border-default); border-radius: var(--radius); background: var(--surface-card); }
.radio-list .radio { padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); transition: background var(--motion-fast) var(--ease-out); }
.radio-list .radio:hover { background: var(--surface-subtle); }
.radio-list .radio:has(input:checked) { background: var(--accent-soft); color: var(--accent-soft-text); font-weight: var(--weight-medium); }
.parcela-row { display: flex; align-items: center; gap: var(--space-2); }
.parcela-row .parcela-num { width: 100px; flex-shrink: 0; }
.parcela-row .parcela-valor { flex: 1; }
.parcela-row .parcela-x { color: var(--text-secondary); font-weight: var(--weight-semibold); }
.muted { color: var(--text-secondary); font-size: var(--text-sm); margin-left: var(--space-2); }

.toggle {
  position: relative;
  display: inline-flex; align-items: center; gap: var(--space-2);
  cursor: pointer; user-select: none;
}
.toggle__input { position: absolute; opacity: 0; pointer-events: none; }
.toggle__track {
  width: 36px; height: 20px;
  background: var(--neutral-300);
  border-radius: var(--radius-pill);
  position: relative;
  transition: background var(--motion-fast) var(--ease-out);
}
.toggle__thumb {
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  background: #fff;
  border-radius: var(--radius-pill);
  transition: transform var(--motion-fast) var(--ease-out);
  box-shadow: var(--shadow-sm);
}
.toggle__input:checked + .toggle__track { background: var(--accent); }
.toggle__input:checked + .toggle__track .toggle__thumb { transform: translateX(16px); }
.toggle__input:focus-visible + .toggle__track {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

/* ============================================================
   CARDS / KPIs
   ============================================================ */
.card {
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.card__head {
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--border-subtle);
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
}
.card__title {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
}
.card__subtitle {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-top: var(--space-1);
}
.card__body { padding: var(--space-4) var(--space-6); }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}
@media (max-width: 1023px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 639px) { .kpi-grid { grid-template-columns: 1fr; } }

.kpi {
  background: var(--kpi-neutral-bg);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: border-color var(--motion-fast) var(--ease-out);
  text-align: left;
  width: 100%;
}
.kpi:hover { border-color: var(--border-strong); }
.kpi:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
  box-shadow: var(--shadow-focus);
}
.kpi__label {
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--text-secondary);
  margin-bottom: var(--space-3);
}
.kpi__number {
  font-size: var(--text-3xl);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  line-height: var(--leading-tight);
}
.kpi__unit {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-top: var(--space-1);
}
.kpi__warn {
  margin-top: var(--space-2);
  font-size: var(--text-sm);
  color: var(--amber-700);
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   BADGES (status + chips neutros)
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  border-radius: var(--radius-sm);
  background: var(--status-neutral-bg);
  color: var(--status-neutral-fg);
  line-height: 1.4;
  white-space: nowrap;
}
.badge--success { background: var(--status-success-bg); color: var(--status-success-fg); }
.badge--danger  { background: var(--status-danger-bg);  color: var(--status-danger-fg); }
.badge--warning { background: var(--status-warning-bg); color: var(--status-warning-fg); }
.badge--info    { background: var(--status-info-bg);    color: var(--status-info-fg); }
.badge svg { width: 12px; height: 12px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px var(--space-2);
  font-size: var(--text-xs);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
  color: var(--text-body);
  border: 1px solid var(--border-default);
  white-space: nowrap;
}
.chip--neutral { background: var(--surface-subtle); color: var(--text-secondary); border-color: var(--border-default); }
.chip--warning { background: var(--status-warning-bg); color: var(--status-warning-fg); border-color: var(--amber-200, var(--status-warning-bg)); }
.chip--danger  { background: var(--status-danger-bg); color: var(--status-danger-fg); border-color: var(--red-200, var(--status-danger-bg)); }

/* Chip 🚩 inline — sinalização de revisão na lista (compact, informativo) */
.chip-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-left: var(--space-2);
  background: var(--red-50);
  border: 1px solid var(--red-200);
  border-radius: var(--radius-sm);
  font-size: 11px;          /* emoji renderiza ~80% — 11px ≈ 14px visual */
  line-height: 1;
  vertical-align: middle;
  cursor: help;             /* não-clicável — só title tooltip */
}
.chip-flag:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 1px;
}

/* Chip ✓ validado — versão verde do chip-flag (2026-05-14 v1.3.2) */
.chip-validado {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px;
  margin-left: var(--space-1);
  border-radius: 50%;
  background: var(--green-50);
  border: 1px solid var(--green-200);
  color: var(--green-700);
  font-size: 11px; font-weight: 600;
  cursor: help;
  flex-shrink: 0;
}
.chip-validado:focus-visible { outline: 2px solid var(--green-500); outline-offset: 2px; }

/* Chip 💯 aprovado — versão dourada/amber do chip-validado (2026-05-14 v1.6) — só dono marca */
.chip-aprovado {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; margin-left: var(--space-1);
  border-radius: 50%;
  background: var(--amber-50); border: 1px solid var(--amber-300);
  color: var(--amber-700); font-size: 11px; font-weight: 700;
  cursor: help; flex-shrink: 0;
}
.chip-aprovado:focus-visible { outline: 2px solid var(--amber-500); outline-offset: 2px; }

/* ============================================================
   DOTS DE ETAPA (componente central)
   ============================================================ */
.etapa-dots {
  display: inline-flex;
  align-items: center;
  gap: 0;
}
.etapa-dot {
  width: 10px; height: 10px;
  border-radius: var(--radius-pill);
  background: var(--status-neutral-dot);
  flex-shrink: 0;
}
.etapa-dot--feito { background: var(--status-success-dot); }
.etapa-dot--parado { background: var(--status-warning-dot); }
.etapa-dot--bloqueado { background: var(--status-danger-dot); }
.etapa-connector {
  width: 12px; height: 1px;
  background: var(--border-subtle);
  flex-shrink: 0;
}
.etapa-connector--feito { background: var(--status-success-dot); }
.etapa-labels {
  margin-top: var(--space-1);
  display: flex;
  gap: 6px;
  font-size: 10px;
  color: var(--text-tertiary);
  text-transform: lowercase;
  letter-spacing: 0.02em;
}
.etapa-labels span { width: 22px; text-align: center; }
@media (max-width: 1023px) { .etapa-labels { display: none; } }

/* ============================================================
   TABELA
   ============================================================ */
.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface-card);
}
.table thead th {
  /* sticky removido — causava sobreposição da 1a row em algumas larguras (bug visto no audit r1).
     .table-wrap tem overflow:hidden, então sticky aqui também não estava cumprindo seu papel.
     Em listas muito longas, o usuário rola a página inteira (header já é sticky). */
  background: var(--surface-subtle);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--text-secondary);
  padding: var(--space-3) var(--space-4);
  text-align: left;
  border-bottom: 1px solid var(--border-default);
}
.th-sort {
  /* botão de ordenação dentro do th — herda o estilo do th, fica clicável */
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.th-sort:hover { color: var(--text-primary); }
.th-sort:focus-visible { outline: 2px solid var(--green-600); outline-offset: 2px; border-radius: 2px; }
.th-sort--active { color: var(--green-700); }
.th-sort__arrow { font-size: 10px; line-height: 1; }
.table tbody td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
  font-size: var(--text-base);
  color: var(--text-body);
  vertical-align: middle;
}
.table tbody tr {
  cursor: pointer;
  transition: background var(--motion-fast) var(--ease-out);
}
.table tbody tr:hover { background: var(--surface-subtle); }
.table tbody tr:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: -2px;
}
.table tbody tr .row-chevron { opacity: 0; }
.table tbody tr:hover .row-chevron { opacity: 1; color: var(--text-tertiary); }
.table .col-tab { font-variant-numeric: tabular-nums; }

.table-wrap {
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

/* nome do aluno + email empilhados */
.cell-aluno__nome { color: var(--text-primary); font-weight: var(--weight-medium); }
.cell-aluno__email { font-size: var(--text-xs); color: var(--text-secondary); margin-top: 2px; }

/* paginação */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--border-subtle);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}
.pagination__pages { display: flex; gap: var(--space-1); align-items: center; }
.pagination__btn {
  min-width: 32px; height: 32px;
  padding: 0 var(--space-2);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--surface-card);
  color: var(--text-body);
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
}
.pagination__btn:hover { background: var(--surface-subtle); }
.pagination__btn.is-active { background: var(--accent); color: var(--text-on-accent); border-color: var(--accent); font-weight: var(--weight-semibold); }
.pagination__btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ============================================================
   FILTROS CHIP-BAR
   ============================================================ */
.filterbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border-default);
  background: var(--surface-card);
  color: var(--text-body);
  border-radius: var(--radius);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  cursor: pointer;
  height: 36px;
}
.filter-chip:hover { border-color: var(--border-strong); }
.filter-chip.is-active {
  background: var(--accent-soft);
  color: var(--accent-soft-text);
  border-color: var(--accent);
}
.filter-chip svg { width: 12px; height: 12px; }

/* Variante flag — fica vermelho quando ativo (em vez do verde Uélicon padrão) */
.filter-chip--flag.is-active {
  background: var(--red-50);
  color: var(--red-700);
  border-color: var(--red-600);
}
.filter-chip--flag.is-active:hover {
  background: var(--red-100);
  border-color: var(--red-700);
}
.filter-chip--flag:focus-visible {
  outline: 2px solid var(--border-focus);   /* foco continua verde — consistência marca */
  outline-offset: 2px;
}

/* Variante validado — fica verde quando ativo (2026-05-14 v1.3.2) */
.filter-chip--valid.is-active {
  background: var(--green-50);
  border-color: var(--green-600);
  color: var(--green-700);
}
.filter-chip--valid.is-active:hover { background: var(--green-100); }
.filter-chip--valid.is-active:focus-visible { outline: 2px solid var(--green-500); outline-offset: 2px; }

/* Variante aprovado (dono) — dourada/amber quando ativo (2026-05-14 v1.6) */
.filter-chip--approved.is-active {
  background: var(--amber-50);
  border-color: var(--amber-600);
  color: var(--amber-700);
}
.filter-chip--approved.is-active:hover { background: var(--amber-100); }
.filter-chip--approved:focus-visible { outline: 2px solid var(--amber-500); outline-offset: 2px; }

/* Variante "faltam aprovar" — neutro/cinza quando ativo (espelho negativo, 2026-05-16) */
.filter-chip--pending.is-active {
  background: var(--surface-subtle);
  border-color: var(--text-secondary);
  color: var(--text-primary);
}
.filter-chip--pending.is-active:hover { background: var(--border-subtle); }
.filter-chip--pending:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; }

/* Variante "Completos" — modo de visualização: 100% concluídos (2026-05-18 v1.8) */
.filter-chip--done.is-active {
  background: var(--green-50);
  border-color: var(--green-700);
  color: var(--green-700);
}
.filter-chip--done.is-active:hover { background: var(--green-100); }
.filter-chip--done:focus-visible { outline: 2px solid var(--green-500); outline-offset: 2px; }

/* Variante "Removidos" — modo de visualização: só removidos por inadimplência (2026-05-18 v1.8) */
.filter-chip--removed.is-active {
  background: var(--red-50);
  border-color: var(--red-600);
  color: var(--red-700);
}
.filter-chip--removed.is-active:hover { background: var(--red-100); }
.filter-chip--removed:focus-visible { outline: 2px solid var(--red-500); outline-offset: 2px; }

/* Variante "etapa pendente" — pílulas Falta grupo/plataforma/onboarding (2026-05-18 v1.9) */
.filter-chip--etapa.is-active {
  background: var(--amber-50);
  border-color: var(--amber-600);
  color: var(--amber-800, var(--amber-700));
}
.filter-chip--etapa.is-active:hover { background: var(--amber-100); }
.filter-chip--etapa:focus-visible { outline: 2px solid var(--amber-500); outline-offset: 2px; }

/* Popover de filtros agrupados (Validação) — 2026-05-18 v1.9 */
.filter-popover {
  position: relative;
  display: inline-block;
}
.filter-chip__caret {
  margin-left: 2px;
  font-size: 10px;
  opacity: 0.7;
}
.filter-popover__menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 30;
  min-width: 200px;
  background: var(--surface, #fff);
  border: 1px solid var(--border-default, #d4d4d8);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  padding: var(--space-1, 4px);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.filter-popover__item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: var(--text-sm);
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
}
.filter-popover__item:hover { background: var(--surface-subtle); }
.filter-popover__item:focus-visible { outline: 2px solid var(--border-focus); outline-offset: -2px; }
.filter-popover__item.is-active {
  background: var(--green-50);
  border-color: var(--green-600);
  color: var(--green-700);
  font-weight: 600;
}
.filter-popover__icon { font-size: 14px; line-height: 1; }
.filter-popover__clear {
  margin-top: 4px;
  padding: 6px 10px;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  font-size: var(--text-xs, 12px);
  color: var(--text-secondary);
  cursor: pointer;
}
.filter-popover__clear:hover {
  background: var(--surface-subtle);
  color: var(--text-primary);
}

/* Popover "Filtros avançados" (Vendedor/Plataforma/Origem/Período) — 2026-05-18 v1.10 */
.filter-popover--advanced .filter-popover__menu--advanced {
  min-width: 300px;
  right: 0;
  left: auto;
  padding: var(--space-3, 12px);
  gap: 10px;
}
.filter-popover__field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: var(--text-xs, 12px);
  color: var(--text-secondary);
}
.filter-popover__field select,
.filter-popover__field input[type="date"] {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border-default, #d4d4d8);
  border-radius: 6px;
  background: var(--surface, #fff);
  font-size: var(--text-sm);
  color: var(--text-primary);
}
.filter-popover__field--row {
  flex-direction: row;
  align-items: center;
  gap: 6px;
}
.filter-popover__field--row input[type="date"] { flex: 1; }
.filter-popover__sep {
  color: var(--text-tertiary, var(--text-secondary));
  font-size: var(--text-xs, 12px);
}
.filter-popover__label {
  font-weight: 600;
  color: var(--text-secondary);
}
/* Variante "avançados" — neutro (cinza) quando ativo */
.filter-chip--advanced.is-active {
  background: var(--surface-subtle);
  border-color: var(--text-secondary);
  color: var(--text-primary);
}
.filter-chip__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 2px;
  border-radius: 9px;
  background: var(--green-700, var(--accent));
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.search {
  position: relative;
  flex: 1;
  min-width: 240px;
  max-width: 360px;
}
.search input {
  width: 100%;
  height: 36px;
  padding: 0 var(--space-3) 0 36px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  background: var(--surface-card);
  font-size: var(--text-sm);
}
.search input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--shadow-focus);
}
.search svg {
  position: absolute;
  left: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  color: var(--text-tertiary);
}
.filterbar__right { margin-left: auto; display: flex; gap: var(--space-2); }

/* "Novo aluno" no header da página, alinhado à direita do título (2026-05-18 v1.11) */
.page-title-row__actions {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  flex-shrink: 0;
}

/* Limpar fica no fim da linha de filtros, empurrado pra direita (2026-05-18 v1.11) */
.filterbar__clear { margin-left: auto; }

/* Busca em row própria, full-width (2026-05-18 v1.11) */
.searchbar {
  display: flex;
  margin-bottom: var(--space-4);
}
.search--full {
  flex: 1;
  max-width: none;
  min-width: 0;
}

/* ============================================================
   DROPDOWN GENÉRICO
   ============================================================ */
.dropdown { position: relative; }
.dropdown__menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 200px;
  max-height: 280px;
  overflow-y: auto;
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: var(--space-1);
  z-index: var(--z-dropdown);
}
.dropdown__item {
  display: flex;
  align-items: center;
  width: 100%;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  color: var(--text-body);
  border-radius: var(--radius-sm);
  text-align: left;
}
.dropdown__item:hover { background: var(--surface-subtle); }
.dropdown__item.is-active { background: var(--accent-soft); color: var(--accent-soft-text); font-weight: var(--weight-medium); }

/* ============================================================
   DRAWER + OVERLAY + MODAL
   ============================================================ */
.overlay {
  position: fixed; inset: 0;
  background: oklch(0% 0 0 / 0.4);
  z-index: var(--z-overlay);
  animation: fade-in var(--motion-base) var(--ease-out);
}

.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: var(--drawer-width);
  max-width: 100vw;
  background: var(--surface-card);
  box-shadow: var(--shadow-drawer);
  z-index: var(--z-drawer);
  display: flex; flex-direction: column;
  animation: slide-in-right var(--motion-slow) var(--ease-out);
}
.drawer--wide { width: 560px; }
@media (max-width: 640px) {
  .drawer { width: 100vw; }
  .drawer--wide { width: 100vw; }
}
.drawer__head {
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--border-subtle);
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  flex-shrink: 0;
}
.drawer__title { font-size: var(--text-lg); font-weight: var(--weight-semibold); color: var(--text-primary); }
.drawer__title-link { color: inherit; text-decoration: none; display: inline-flex; align-items: center; }
.drawer__title-link:hover { color: var(--green-700); text-decoration: underline; }
.drawer__title-link:focus-visible { outline: 2px solid var(--green-600); outline-offset: 2px; border-radius: 2px; }
.drawer__sub { font-size: var(--text-sm); color: var(--text-secondary); margin-top: 2px; }
.drawer__body { flex: 1; overflow-y: auto; padding: var(--space-6); }
.drawer__foot {
  padding: var(--space-3) var(--space-6);
  border-top: 1px solid var(--border-subtle);
  background: var(--surface-card);
  display: flex; justify-content: flex-end; gap: var(--space-3);
  flex-shrink: 0;
}
.drawer__foot--between { justify-content: space-between; align-items: center; }
.drawer__close {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius);
  color: var(--text-body);
}
.drawer__close:hover { background: var(--surface-subtle); color: var(--text-primary); }

/* modal */
.modal {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  max-width: 440px;
  width: calc(100vw - 32px);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  display: block;
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-modal);
  padding: var(--space-6);
  animation: pop-in var(--motion-base) var(--ease-out);
  box-sizing: border-box;
}
.modal__title {
  display: block;
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  margin: 0 0 var(--space-2) 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.modal__body {
  display: block;
  font-size: var(--text-base);
  color: var(--text-body);
  margin: 0 0 var(--space-6) 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.modal__foot { display: flex; justify-content: flex-end; gap: var(--space-3); flex-wrap: wrap; }
.modal__foot .btn { min-height: 44px; }

@media (max-width: 480px) {
  .modal {
    width: calc(100vw - 16px);
    padding: var(--space-5);
  }
  .modal__foot { flex-direction: column-reverse; }
  .modal__foot .btn { width: 100%; }
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes slide-in-right { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes pop-in { from { opacity: 0; transform: translate(-50%, -50%) scale(0.96); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }

/* ============================================================
   TOASTS
   ============================================================ */
.toast-stack {
  position: fixed;
  bottom: var(--space-4);
  right: var(--space-4);
  z-index: var(--z-toast);
  display: flex; flex-direction: column-reverse; gap: var(--space-2);
  max-width: 380px;
}
.toast {
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-left-width: 4px;
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
  box-shadow: var(--shadow-md);
  font-size: var(--text-sm);
  color: var(--text-body);
  display: flex; gap: var(--space-2); align-items: flex-start;
  animation: slide-up var(--motion-base) var(--ease-out);
}
.toast--success { border-left-color: var(--accent); }
.toast--error { border-left-color: var(--red-500); }
.toast--info { border-left-color: var(--blue-500); }
.toast--warning { border-left-color: var(--amber-500); background: var(--amber-50); color: var(--amber-700); }
.toast__close { margin-left: auto; color: var(--text-tertiary); }
@keyframes slide-up {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   SKELETON SHIMMER
   ============================================================ */
.skeleton {
  display: block;
  background: linear-gradient(90deg, var(--neutral-100) 0%, var(--neutral-200) 50%, var(--neutral-100) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
  border-radius: var(--radius-sm);
  height: 14px;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) {
  .skeleton { animation: none; background: var(--neutral-100); }
}

/* ============================================================
   EMPTY STATE / ERROR STATE
   ============================================================ */
.state {
  text-align: center;
  padding: var(--space-12) var(--space-6);
  color: var(--text-secondary);
}
.state__icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px;
  margin: 0 auto var(--space-3);
  border-radius: var(--radius-pill);
  background: var(--surface-subtle);
  color: var(--text-secondary);
}
.state__title {
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}
.state__sub { font-size: var(--text-base); color: var(--text-secondary); margin-bottom: var(--space-4); max-width: 360px; margin-left: auto; margin-right: auto; }
.state--error .state__icon { background: var(--red-100); color: var(--red-700); }
.state--error .state__title { color: var(--red-700); }

/* ============================================================
   LOGIN
   ============================================================ */
.login-shell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: var(--space-4);
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-subtle);
  padding: var(--space-8);
}
.login-brand { text-align: center; margin-bottom: var(--space-6); }
.login-brand__mark {
  display: inline-flex;
  width: 40px; height: 40px;
  align-items: center; justify-content: center;
  background: var(--neutral-200);
  color: var(--text-primary);
  font-weight: var(--weight-bold);
  font-size: var(--text-lg);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-3);
}
.login-brand__title { font-size: var(--text-lg); font-weight: var(--weight-semibold); color: var(--text-primary); }
.login-brand__sub { font-size: var(--text-sm); color: var(--text-secondary); margin-top: var(--space-1); }
.login-foot { text-align: center; font-size: var(--text-xs); color: var(--text-secondary); margin-top: var(--space-6); }

/* ============================================================
   SINALIZAÇÃO — callout-flag + meta de seção (2026-05-14)
   ============================================================ */
.callout-flag {
  background: var(--red-50);
  border: 1px solid var(--red-300);
  border-left: 3px solid var(--red-600);
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  color: var(--red-700);
  line-height: var(--leading-normal);
}
.callout-flag__head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-1);
}
.callout-flag__icon {
  font-size: var(--text-md);
  line-height: 1;
}
.callout-flag__title {
  font-weight: var(--weight-semibold);
  color: var(--red-700);
}
.callout-flag__motivo {
  margin: var(--space-1) 0 var(--space-2);
  color: var(--red-700);
  font-style: italic;
  overflow-wrap: anywhere;
}
.callout-flag__meta {
  font-size: var(--text-xs);
  color: var(--red-600);
  margin: 0;
}

/* Callout verde validado — versão positiva do callout-flag (2026-05-14 v1.3.2) */
.callout-validado {
  margin-top: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--green-50);
  border: 1px solid var(--green-200);
  border-left: 3px solid var(--green-600);
  border-radius: var(--radius-md);
}
.callout-validado__head { display: flex; align-items: center; gap: var(--space-2); }
.callout-validado__icon { color: var(--green-700); }
.callout-validado__title { font-weight: 600; color: var(--green-700); }
.callout-validado__motivo { margin-top: var(--space-1); color: var(--text-primary); font-size: var(--text-sm); }
.callout-validado__meta { margin-top: var(--space-1); font-size: var(--text-xs); color: var(--text-secondary); }

/* Callout dourado aprovado 100% — versão "do dono" do callout-validado (2026-05-14 v1.6) */
.callout-aprovado {
  margin-top: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--amber-50);
  border: 1px solid var(--amber-200);
  border-left: 3px solid var(--amber-600);
  border-radius: var(--radius-md);
}
.callout-aprovado__head { display: flex; align-items: center; gap: var(--space-2); }
.callout-aprovado__icon { color: var(--amber-700); }
.callout-aprovado__title { font-weight: 600; color: var(--amber-700); }
.callout-aprovado__motivo { margin-top: var(--space-1); color: var(--text-primary); font-size: var(--text-sm); }
.callout-aprovado__meta { margin-top: var(--space-1); font-size: var(--text-xs); color: var(--text-secondary); }

/* Meta-info abaixo do botão Salvar (Comentário/Sinalização) */
.form-section__meta {
  margin-top: var(--space-2);
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

/* ============================================================
   SEÇÃO INLINE (form drawer)
   ============================================================ */
.form-section {
  margin-bottom: var(--space-4);
}
.form-section__title {
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}
.form-section__card {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: var(--space-3);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
@media (max-width: 640px) { .field-row { grid-template-columns: 1fr; } }

.radio-row { display: flex; flex-wrap: wrap; gap: var(--space-4); }

/* ============================================================
   CHECKLIST DAS 4 ETAPAS (drawer detalhe)
   ============================================================ */
.etapa-card {
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-subtle);
}
.etapa-card:last-child { border-bottom: 0; }
.etapa-card__head {
  display: flex; align-items: center; gap: var(--space-2);
  margin-bottom: var(--space-1);
}
.etapa-card__status {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}
.etapa-card__status--feito { color: var(--green-700); }
.etapa-card__status--parado { color: var(--amber-700); }
.etapa-card__status--pendente { color: var(--neutral-700); }
.etapa-card__nome { font-size: var(--text-base); font-weight: var(--weight-medium); color: var(--text-primary); }
.etapa-card__meta { font-size: var(--text-xs); color: var(--text-secondary); }
.etapa-card__obs { font-size: var(--text-xs); color: var(--text-secondary); font-style: italic; margin-top: 2px; }
.etapa-card__actions { margin-top: var(--space-2); display: flex; gap: var(--space-2); align-items: center; }
.etapa-card__form {
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px dashed var(--border-subtle);
}
.etapa-card__form .field { margin-bottom: var(--space-3); }
.etapa-card__form__foot {
  display: flex;
  gap: var(--space-2);
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: var(--space-2);
}
.etapa-card__confirm {
  margin-top: var(--space-3);
  padding: var(--space-3);
  border: 1px solid var(--red-200, oklch(88% 0.08 25));
  background: var(--red-50, oklch(96% 0.04 25));
  border-radius: var(--radius);
}
.etapa-card__confirm__text {
  margin: 0 0 var(--space-2) 0;
  font-size: var(--text-sm);
  color: var(--text-primary);
}
.drawer__inline {
  border-top: 1px solid var(--border-subtle);
  background: var(--surface-subtle);
  padding: var(--space-4) var(--space-6);
}
.drawer__inline__title {
  margin: 0 0 var(--space-2) 0;
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
}
.drawer__inline__text {
  margin: 0 0 var(--space-3) 0;
  font-size: var(--text-sm);
  color: var(--text-body);
}
.banner-removido {
  background: var(--red-50, oklch(96% 0.04 25));
  color: var(--red-700, oklch(45% 0.18 25));
  border: 1px solid var(--red-200, oklch(88% 0.08 25));
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  margin-bottom: var(--space-4);
}
.etapa-card__actions--end { justify-content: flex-end; }
.etapa-card__revert {
  background: none;
  border: 0;
  padding: 0;
  font-size: var(--text-xs);
  color: var(--text-secondary);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.etapa-card__revert:hover { color: var(--text-primary); }
.etapa-card__revert:focus-visible { outline: 2px solid var(--green-700, oklch(45% 0.13 145)); outline-offset: 2px; border-radius: 2px; }

/* ============================================================
   ADMIN TABS
   ============================================================ */
.tabs {
  display: flex;
  gap: var(--space-4);
  border-bottom: 1px solid var(--border-default);
  margin-bottom: var(--space-6);
}
.tab {
  position: relative;
  padding: var(--space-3) 0;
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  color: var(--text-body);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
}
.tab:hover { color: var(--text-primary); }
.tab.is-active {
  color: var(--text-primary);
  border-bottom-color: var(--accent);
}
.tab:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

/* ============================================================
   LISTAS COMPACTAS DO DASHBOARD
   ============================================================ */
.list-row {
  display: grid;
  grid-template-columns: 16px 1fr auto auto;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
  font-size: var(--text-sm);
}
.list-row:last-child { border-bottom: 0; }
.list-row__main { color: var(--text-primary); font-weight: var(--weight-medium); }
.list-row__sub { color: var(--text-secondary); font-size: var(--text-xs); }
.list-row__meta { color: var(--text-secondary); font-size: var(--text-sm); }

.ranking-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
  font-size: var(--text-base);
}
.ranking-row:last-child { border-bottom: 0; }
.ranking-row__pos { font-weight: var(--weight-semibold); color: var(--text-primary); width: 20px; font-variant-numeric: tabular-nums; }
.ranking-row__name { color: var(--text-body); flex: 1; }
.ranking-row__count { font-variant-numeric: tabular-nums; font-weight: var(--weight-semibold); color: var(--text-primary); }

/* ============================================================
   ALUNO SELETOR (drawer nova turma)
   ============================================================ */
.aluno-pick {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
}
.aluno-pick:hover { background: var(--surface-subtle); }
.aluno-pick__nome { color: var(--text-primary); font-weight: var(--weight-medium); flex: 1; }
.aluno-pick__meta { color: var(--text-secondary); font-size: var(--text-xs); }

/* ============================================================
   ERROR BANNER (login form)
   ============================================================ */
.error-banner {
  display: flex; align-items: flex-start; gap: var(--space-2);
  background: var(--red-50);
  color: var(--red-700);
  border: 1px solid var(--red-100);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius);
  font-size: var(--text-sm);
  margin: var(--space-2) 0;
}

/* ============================================================
   HEADER MOBILE — hambúrguer + drawer-nav (≤640px)
   ============================================================
   C2 do audit visual round 1 (2026-05-11): em ≤640px o header
   estoura porque a nav inline com 4 links + sino + user-chip
   não cabe em 360px. Aqui:
   - escondemos a nav inline e mostramos um botão hamburger 44×44
   - o botão abre um drawer-from-left de 280px com a nav vertical
   - o drawer reusa o componente .overlay (já existente)
   ============================================================ */
.app-nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  color: var(--text-body);
  background: transparent;
  border: 0;
  flex-shrink: 0;
}
.app-nav-toggle:hover { background: var(--surface-subtle); color: var(--text-primary); }
.app-nav-toggle:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

/* drawer-from-left que segura a nav vertical no mobile */
.nav-drawer {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 280px;
  max-width: 85vw;
  background: var(--surface-card);
  box-shadow: var(--shadow-drawer);
  z-index: var(--z-drawer);
  display: flex;
  flex-direction: column;
  animation: slide-in-left var(--motion-base) var(--ease-out);
}
.nav-drawer__head {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-shrink: 0;
}
.nav-drawer__title {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
}
.nav-drawer__close {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  color: var(--text-body);
}
.nav-drawer__close:hover { background: var(--surface-subtle); color: var(--text-primary); }
.nav-drawer__list {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-3) 0;
  display: flex;
  flex-direction: column;
}
.nav-drawer__link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  color: var(--text-body);
  border-left: 3px solid transparent;
}
.nav-drawer__link:hover {
  background: var(--surface-subtle);
  color: var(--text-primary);
  text-decoration: none;
}
.nav-drawer__link.is-active {
  color: var(--text-primary);
  border-left-color: var(--accent);
  background: var(--accent-soft);
}

@keyframes slide-in-left {
  from { transform: translateX(-100%); }
  to   { transform: translateX(0); }
}

@media (max-width: 640px) {
  .app-nav-toggle { display: inline-flex; }
  .app-nav { display: none !important; }
  .app-header__inner {
    padding: 0 var(--space-3);
    gap: var(--space-2);
  }
  .brand__name {
    /* impede quebra em 2 linhas em 360px */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
  }
  /* user-chip mostra só inicial em mobile */
  .user-chip span:not(.user-chip__avatar):not(.user-chip__caret) {
    display: none;
  }
}

/* ============================================================
   HEADER TABLET (641-1023px) — Issue audit visual r2 2026-05-13
   ============================================================
   Em tablet a nav inline com 5 links + sino + Melhorias + admin
   + refresh + user-chip estoura, quebrando "Novos Alunos" e
   "Turmas de onboard" em 2-3 linhas. Aqui:
   - nowrap em todos os labels
   - "Turmas de onboard" vira "Turmas" via responsive label
   - font-size 13px nos nav-links pra ganhar espaço
   - user-chip oculta o nome (mantém só inicial no avatar)
   - brand__name compacta 14px
   - gap reduzido
   ============================================================ */
@media (min-width: 641px) and (max-width: 1023px) {
  .app-header__inner {
    gap: var(--space-3);
    padding: 0 var(--space-4);
  }
  .app-nav { gap: var(--space-4); }
  .app-nav__link {
    white-space: nowrap;
    font-size: var(--text-sm);
  }
  .brand__name {
    font-size: var(--text-base);
    white-space: nowrap;
  }
  /* user-chip mostra só inicial em tablet — economiza ~80px */
  .user-chip span:not(.user-chip__avatar):not(.user-chip__caret) {
    display: none;
  }
  /* "Turmas de onboard" → "Turmas" via responsive label
     (label completo permanece em desktop ≥1024px) */
  .app-nav__link[data-nav="turmas"] {
    font-size: 0; /* esconde texto original */
  }
  .app-nav__link[data-nav="turmas"]::after {
    content: "Turmas";
    font-size: var(--text-sm);
  }
}

/* ============================================================
   DRAWER WIDE em telas menores (I7 do audit)
   ============================================================
   Em ≤900px o drawer wide (560) fica apertado sobre tabela.
   Em 768 cobre 100vw pra não competir com a tabela atrás.
   ============================================================ */
@media (max-width: 900px) {
  .drawer--wide { width: 100vw; max-width: 100vw; }
}

/* ============================================================
   ADMIN — header de tab (botão "+ Novo X")
   ============================================================
   C3 do audit visual round 1: o botão "+ Novo X" estava com
   `display:flex; justify-content:flex-end` direto, ficando
   acima da tabela mas via margem negativa por cima da row 1
   em algumas larguras. Solução: wrapper .admin-tab__head que
   reserva espaço próprio com h2 à esquerda + botão à direita,
   tudo em fluxo normal (sem absolute).
   ============================================================ */
.admin-tab__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.admin-tab__head h2 {
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
}
.admin-tab__head p {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin: 2px 0 0;
}
.admin-tab__head__left { display: flex; flex-direction: column; gap: 0; }
@media (max-width: 640px) {
  .admin-tab__head {
    flex-direction: column;
    align-items: stretch;
  }
  .admin-tab__head .btn { width: 100%; }
}

/* ============================================================
   BOTÃO DANGER-SOFT (I4 do audit)
   ============================================================
   "Editar" deve ser ghost neutro (default), e botões de
   exclusão/desativação devem usar variante danger-soft:
   border + texto vermelho, fundo branco. Visual menos
   agressivo que .btn--danger (full vermelho).
   ============================================================ */
.btn--danger-soft {
  background: var(--surface-card);
  color: var(--red-700);
  border-color: var(--red-200);
}
.btn--danger-soft:hover {
  background: var(--red-50);
  border-color: var(--red-300);
  color: var(--red-700);
}
.btn--danger-soft:disabled,
.btn--danger-soft[aria-disabled="true"] {
  background: var(--neutral-100);
  color: var(--text-disabled);
  border-color: var(--border-default);
  cursor: not-allowed;
}

/* ============================================================
   BOTÃO :DISABLED genérico (I3 — role admin não editável)
   ============================================================ */
.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}
.btn--ghost:disabled,
.btn--ghost[aria-disabled="true"] {
  background: transparent;
  color: var(--text-disabled);
  border-color: var(--border-subtle);
}

/* ============================================================
   FOOTER — versão do sistema (injetado pelo deploy.sh)
   ============================================================ */
.app-footer {
  margin-top: var(--space-8);
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border-subtle);
  background: var(--surface-subtle);
  color: var(--text-tertiary);
  font-size: var(--text-xs);
}
.app-footer__inner {
  max-width: var(--container-max, 1200px);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  text-align: center;
}
.app-footer__sep { color: var(--border-default); }
.app-footer__version { font-variant-numeric: tabular-nums; }

/* ============================================================
   F1+F2+R0 — Fila TMB + Revisão E6 + data_venda em evidência
   ============================================================
   Spec: design/design-spec-tmb.md §7.1 — classes novas.
   Zero token novo. Tudo deriva de tokens.css.
   v1.1 — 2026-05-13
   ============================================================ */

/* -- 7.1.1 Faixa-resumo (KPI compacto inline pra /cadastros-tmb.html) -- */
.fila-resumo {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  flex-wrap: wrap;
  padding: var(--space-4) var(--space-6);
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-6);
}
.fila-resumo__chunk {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--motion-fast) var(--ease-out);
  background: transparent;
  border: 0;
  text-align: left;
}
.fila-resumo__chunk:hover { background: var(--surface-subtle); }
.fila-resumo__chunk:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}
.fila-resumo__dot {
  width: 8px; height: 8px;
  border-radius: var(--radius-pill);
  flex-shrink: 0;
  display: inline-block;
}
.fila-resumo__dot--vencido { background: var(--status-danger-dot); }
.fila-resumo__dot--hoje { background: var(--status-warning-dot); }
.fila-resumo__dot--proximos-7d { background: var(--status-info-dot); }
.fila-resumo__dot--futuro { background: var(--status-neutral-dot); }
.fila-resumo__num {
  font-size: 18px;
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.fila-resumo__label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}
.fila-resumo__link {
  margin-left: auto;
  font-size: var(--text-sm);
  color: var(--accent-soft-text);
  text-decoration: underline;
  text-underline-offset: 2px;
  background: transparent;
  border: 0;
  cursor: pointer;
}
.fila-resumo__link:hover { color: var(--green-700); }

@media (max-width: 640px) {
  .fila-resumo {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-2);
    padding: var(--space-4);
  }
  .fila-resumo__link { margin-left: 0; padding-top: var(--space-2); border-top: 1px solid var(--border-subtle); }
}

/* -- 7.1.2 Tab com contador -- */
.tab__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: var(--space-1);
  padding: 2px 6px;
  font-size: 11px;
  font-weight: var(--weight-semibold);
  background: var(--neutral-200);
  color: var(--text-secondary);
  border-radius: var(--radius-pill);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.tab.is-active .tab__count {
  background: var(--accent-soft);
  color: var(--accent-soft-text);
}

/* -- 7.1.3 Sub-filter chips com dot -- */
.subfilter-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}
.subfilter-chips .filter-chip { gap: var(--space-2); }
.filter-chip__dot {
  width: 6px; height: 6px;
  border-radius: var(--radius-pill);
  flex-shrink: 0;
  display: inline-block;
}
.filter-chip__dot--vencido { background: var(--status-danger-dot); }
.filter-chip__dot--hoje { background: var(--status-warning-dot); }
.filter-chip__dot--proximos-7d { background: var(--status-info-dot); }
.filter-chip__dot--futuro { background: var(--status-neutral-dot); }

@media (max-width: 640px) {
  .subfilter-chips { flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
  .subfilter-chips .filter-chip { scroll-snap-align: start; flex-shrink: 0; min-height: 44px; }
}

/* -- 7.1.4 Chip "Data alvo" por sub_estado (tabela TMB) -- */
.chip-data-alvo {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px var(--space-2);
  font-size: var(--text-xs);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.chip-data-alvo--vencido { background: var(--status-danger-bg); color: var(--status-danger-fg); border-color: var(--red-200, var(--status-danger-bg)); }
.chip-data-alvo--hoje { background: var(--status-warning-bg); color: var(--status-warning-fg); border-color: var(--amber-200, var(--status-warning-bg)); }
.chip-data-alvo--proximos-7d { background: var(--status-info-bg); color: var(--status-info-fg); border-color: var(--blue-200, var(--status-info-bg)); }
.chip-data-alvo--futuro { background: var(--status-neutral-bg); color: var(--status-neutral-fg); border-color: var(--border-subtle); }

/* -- 7.1.5 Linha tabela com hairline urgência -- */
.tr--vencido { box-shadow: inset 3px 0 0 var(--red-500); }

/* -- 7.1.6 Chip "Vendido em" (idade do registro) -- */
.chip-idade {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: var(--weight-medium);
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
  white-space: nowrap;
}
.chip-idade--fresco { background: var(--green-50); color: var(--green-700); }
.chip-idade--recente { background: var(--surface-subtle); color: var(--text-secondary); }
.chip-idade--medio { background: var(--status-warning-bg); color: var(--status-warning-fg); }
.chip-idade--velho { background: var(--status-danger-bg); color: var(--status-danger-fg); }

/* Célula "Vendido em" empilhada (R0) */
.vendido-em-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-start;
}
.vendido-em-cell__data {
  font-size: var(--text-sm);
  color: var(--text-body);
  font-variant-numeric: tabular-nums;
}

/* -- 7.1.7 Soma-card (TMB-D14 hint somatória) -- */
.soma-card {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
  transition: background-color var(--motion-slow) var(--ease-out),
              border-color var(--motion-slow) var(--ease-out),
              color var(--motion-slow) var(--ease-out);
  margin-top: var(--space-3);
}
.soma-card__icon { flex-shrink: 0; display: inline-flex; }
.soma-card--ok { background: var(--green-50); border-color: var(--green-200); color: var(--green-700); }
.soma-card--diverge { background: var(--amber-50); border-color: var(--amber-100); color: var(--amber-700); }
.soma-card--pending { background: var(--neutral-100); border-color: var(--border-subtle); color: var(--text-secondary); }

/* -- 7.1.8 Callout informativo (TMB-D15) -- */
.callout-tmb-d15 {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  padding: var(--space-3);
  background: var(--amber-50);
  border: 1px solid var(--amber-100);
  border-radius: var(--radius);
  margin-top: var(--space-3);
  font-size: var(--text-sm);
  color: var(--amber-700);
  line-height: 1.5;
}
.callout-tmb-d15__icon { flex-shrink: 0; color: var(--amber-700); margin-top: 2px; }
.callout-tmb-d15__link {
  display: inline-block;
  font-size: var(--text-xs);
  color: var(--amber-700);
  text-decoration: underline;
  text-underline-offset: 2px;
  margin-top: var(--space-1);
}
.callout-tmb-d15__link:hover { color: var(--red-700); }

/* -- 7.1.9 Hint denso (TMB-D16 radio "Ambos") -- */
.hint-denso {
  background: var(--surface-subtle);
  border-left: 3px solid var(--accent);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  color: var(--text-secondary);
  margin-top: var(--space-2);
  line-height: 1.5;
}

/* -- 7.1.10 Banner "Já em fila TMB" no drawer aluno (F2.4.2) -- */
.banner-fila-tmb {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  padding: var(--space-3);
  background: var(--status-info-bg);
  border: 1px solid var(--blue-100);
  border-radius: var(--radius);
  margin-top: var(--space-3);
  font-size: var(--text-sm);
  color: var(--status-info-fg);
}
.banner-fila-tmb--vencido {
  background: var(--status-danger-bg);
  border-color: var(--red-100);
  color: var(--status-danger-fg);
}
.banner-fila-tmb__icon { flex-shrink: 0; margin-top: 2px; }
.banner-fila-tmb__body { flex: 1; line-height: 1.5; }
.banner-fila-tmb__link {
  display: inline-block;
  margin-top: var(--space-1);
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: var(--weight-medium);
  font-size: var(--text-xs);
}

/* -- 7.1.11 Inline-form expansível (F2 drawer aluno) -- */
.inline-form-expand {
  background: var(--surface-subtle);
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  padding: var(--space-4);
  margin-top: var(--space-3);
  animation: expand-down var(--motion-slow) var(--ease-out);
  overflow: hidden;
}
.inline-form-expand__title {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--text-secondary);
  margin-bottom: var(--space-3);
}
.inline-form-expand__foot {
  display: flex;
  gap: var(--space-2);
  justify-content: flex-end;
  margin-top: var(--space-3);
  flex-wrap: wrap;
}
@keyframes expand-down {
  from { max-height: 0; opacity: 0; transform: translateY(-8px); }
  to { max-height: 800px; opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .inline-form-expand { animation: none; }
}

/* -- 7.1.12 Bottom-sheet (mobile) -- */
.bottom-sheet-overlay {
  position: fixed; inset: 0;
  background: oklch(0% 0 0 / 0.4);
  z-index: var(--z-overlay);
  animation: fade-in var(--motion-base) var(--ease-out);
}
.bottom-sheet {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  max-height: 80vh;
  background: var(--surface-card);
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  box-shadow: 0 -8px 32px oklch(0% 0 0 / 0.15);
  z-index: var(--z-drawer);
  animation: slide-up-sheet 280ms var(--ease-out);
  padding-bottom: env(safe-area-inset-bottom);
  display: flex;
  flex-direction: column;
}
.bottom-sheet__handle {
  width: 36px; height: 4px;
  background: var(--neutral-300);
  border-radius: var(--radius-pill);
  margin: var(--space-3) auto var(--space-2);
  flex-shrink: 0;
}
.bottom-sheet__head {
  padding: 0 var(--space-5) var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-shrink: 0;
}
.bottom-sheet__title {
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
}
.bottom-sheet__sub {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  margin-top: 2px;
}
.bottom-sheet__close {
  width: 32px; height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  color: var(--text-body);
}
.bottom-sheet__close:hover { background: var(--surface-subtle); color: var(--text-primary); }
.bottom-sheet__body {
  padding: var(--space-4) var(--space-5);
  overflow-y: auto;
  flex: 1;
}
.bottom-sheet__foot {
  padding: var(--space-3) var(--space-5);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  flex-shrink: 0;
}
@keyframes slide-up-sheet {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .bottom-sheet { animation: none; }
}

/* -- 7.1.13 Popover-edit-inline (F1.3.8 editar data alvo) -- */
.popover-inline {
  position: absolute;
  max-width: 280px;
  min-width: 240px;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: var(--space-4);
  z-index: var(--z-dropdown);
  animation: pop-in-sm var(--motion-base) var(--ease-out);
}
.popover-inline__foot {
  display: flex;
  gap: var(--space-2);
  justify-content: flex-end;
  margin-top: var(--space-3);
}
@keyframes pop-in-sm {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

/* -- 7.1.14 Linha confirm-mode (F4 desmarcar) -- */
.tr--confirm-mode {
  background: var(--red-50) !important;
  box-shadow: inset 3px 0 0 var(--red-500);
  transition: background var(--motion-base) var(--ease-out);
}
.row-confirm-remove {
  padding: var(--space-3) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  background: var(--red-50);
  border-radius: var(--radius);
}
.row-confirm-remove__title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-primary);
}
.row-confirm-remove__icon { color: var(--red-600); flex-shrink: 0; }
.row-confirm-remove__foot {
  display: flex;
  gap: var(--space-2);
  justify-content: flex-end;
}

/* -- 7.1.15 Card-aluno (mobile da fila TMB) -- */
.fila-card {
  padding: var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--surface-card);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.fila-card:last-child { border-bottom: 0; }
.fila-card--vencido { box-shadow: inset 3px 0 0 var(--red-500); }
.fila-card__nome { font-size: var(--text-base); font-weight: var(--weight-medium); color: var(--text-primary); }
.fila-card__meta { font-size: var(--text-xs); color: var(--text-secondary); }
.fila-card__chip-row { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.fila-card__actions { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-top: var(--space-2); }
.fila-card__actions .btn { min-height: 44px; }

/* -- 7.1.16 Page hero TMB -- */
.tmb-hero {
  margin-bottom: var(--space-6);
}

/* -- 7.1.17 Card "ações por linha" wrapper (a11y 44×44) -- */
.row-actions {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  justify-content: flex-end;
}
.row-actions__btn {
  width: 36px; height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  color: var(--text-body);
  background: transparent;
  border: 0;
  cursor: pointer;
  transition: background var(--motion-fast) var(--ease-out), color var(--motion-fast) var(--ease-out);
}
.row-actions__btn:hover { background: var(--surface-subtle); color: var(--text-primary); }
.row-actions__btn:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}
.row-actions__btn--ok { color: var(--green-700); }
.row-actions__btn--ok:hover { background: var(--green-50); }
.row-actions__btn--danger { color: var(--red-600); }
.row-actions__btn--danger:hover { background: var(--red-50); color: var(--red-700); }
.row-actions__btn--readonly { color: var(--text-tertiary); cursor: default; }
.row-actions__btn--readonly:hover { background: transparent; color: var(--text-tertiary); }
@media (max-width: 640px) {
  .row-actions__btn { width: 44px; height: 44px; }
}

/* -- 7.1.18 Timeline (drawer detalhe da tarefa TMB) -- */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: var(--space-2);
}
.timeline__node {
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: var(--space-3);
  padding-bottom: var(--space-4);
  position: relative;
}
.timeline__node:not(:last-child)::before {
  content: '';
  position: absolute;
  top: 14px; bottom: 0;
  left: 7px;
  width: 2px;
  background: var(--border-subtle);
}
.timeline__dot {
  width: 12px; height: 12px;
  border-radius: var(--radius-pill);
  background: var(--neutral-300);
  margin-top: 4px;
  z-index: 1;
}
.timeline__dot--ok { background: var(--green-500); }
.timeline__dot--warn { background: var(--amber-500); }
.timeline__dot--danger { background: var(--red-500); }
.timeline__dot--current {
  background: #fff;
  border: 2px solid var(--neutral-400);
  width: 14px; height: 14px;
  margin-top: 3px;
}
.timeline__title {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
}
.timeline__meta {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  margin-top: 2px;
}
.timeline__obs {
  margin-top: var(--space-1);
  font-size: var(--text-xs);
  color: var(--text-secondary);
  font-style: italic;
  background: var(--surface-subtle);
  padding: var(--space-2);
  border-radius: var(--radius-sm);
}

/* -- 7.1.19 Tabela: opacidade pra linhas concluídas (cadastrado/removido) -- */
.tr--historico { opacity: 0.65; }
.tr--historico:hover { opacity: 1; }

/* -- 7.1.20 Header drawer aluno: linha "Vendido em" em destaque (R0) -- */
.drawer__sub-vendido {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-2);
  font-size: var(--text-base);
  color: var(--text-primary);
}
.drawer__sub-vendido__icon { color: var(--accent-soft-text); flex-shrink: 0; }
.drawer__sub-vendido__date { font-weight: var(--weight-semibold); }
.drawer__sub-vendido__age { font-size: var(--text-xs); color: var(--text-secondary); margin-left: var(--space-1); }

/* -- 7.1.21 Mobile cards: lista de fila TMB -- */
.fila-cards { display: none; }
@media (max-width: 640px) {
  .fila-table { display: none; }
  .fila-cards { display: block; background: var(--surface-card); border: 1px solid var(--border-default); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); overflow: hidden; }
}

/* Tablet: esconde colunas Telefone + Marcado por (acessíveis no drawer) */
@media (min-width: 641px) and (max-width: 1023px) {
  .fila-col--phone, .fila-col--marcadopor { display: none; }
}

/* -- 7.1.22 FAB mobile (+ Marcar aluno) -- */
.fab {
  position: fixed;
  bottom: calc(var(--space-4) + env(safe-area-inset-bottom));
  right: var(--space-4);
  width: 56px; height: 56px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  z-index: var(--z-dropdown);
  border: 0;
}
.fab:hover { background: var(--accent-hover); }
.fab:focus-visible {
  outline: 3px solid var(--border-focus);
  outline-offset: 3px;
}

@media (min-width: 641px) {
  .fab { display: none; }
}

/* -- 7.1.23 Tabs row TMB (com ícone + count) -- */
.tab-bar-tmb {
  display: flex;
  gap: var(--space-4);
  border-bottom: 1px solid var(--border-default);
  margin-bottom: var(--space-4);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.tab-bar-tmb .tab { flex-shrink: 0; scroll-snap-align: start; white-space: nowrap; }
@media (max-width: 640px) {
  .tab-bar-tmb .tab { min-height: 44px; padding-top: var(--space-3); padding-bottom: var(--space-3); }
}

/* -- 7.1.24 (R2 2026-05-13) Mobile cards: lista de alunos --
   Espelho de .fila-cards/.fila-card pra /alunos.html mobile. Em
   ≤640px a tabela some e vira lista de cards (consistência com
   /cadastros-tmb.html mobile). Issue 5 do audit r2. */
.alunos-cards { display: none; }
.alunos-card {
  padding: var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--surface-card);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  text-align: left;
}
.alunos-card:last-child { border-bottom: 0; }
.alunos-card__btn {
  display: flex; flex-direction: column; gap: var(--space-1);
  width: 100%; text-align: left;
  background: transparent; border: 0; padding: 0;
  cursor: pointer;
}
.alunos-card__nome { font-size: var(--text-base); font-weight: var(--weight-medium); color: var(--text-primary); }
.alunos-card__meta { font-size: var(--text-xs); color: var(--text-secondary); }
.alunos-card__chip-row { display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center; }
.alunos-card__chip-row .vendido-em-cell { gap: var(--space-2); }
@media (max-width: 640px) {
  /* Esconde só a tabela interna (não o wrapper, senão cascateia em .alunos-cards) */
  .alunos-table-wrap > .table-wrap { display: none; }
  .alunos-cards {
    display: block;
    background: var(--surface-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
  }
  /* drawer__sub-vendido em mobile: 13px conforme spec §10.3 */
  .drawer__sub-vendido { font-size: var(--text-sm); }
}


/* ============================================================
   Comentários (lista) — spec v1.4 2026-05-14
   ============================================================ */
.comentarios-list {
  margin-top: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.comentario-item {
  padding: var(--space-3);
  background: var(--surface-subtle);
  border-left: 3px solid var(--green-500);
  border-radius: var(--radius);
}
.comentario-item__head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.comentario-item__head strong {
  color: var(--text-primary);
  font-weight: var(--weight-medium);
}
.comentario-item__data::before {
  content: '·';
  margin-right: var(--space-1);
}
.comentario-item__del {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--red-600);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 0 6px;
  border-radius: var(--radius-sm, 4px);
}
.comentario-item__del:hover {
  color: var(--red-700);
  background: var(--red-50);
}
.comentario-item__del:focus-visible {
  outline: 2px solid var(--red-500);
  outline-offset: 2px;
}
.comentario-item__texto {
  color: var(--text-primary);
  font-size: var(--text-sm);
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
}

/* ============================================================
   Vendas timeline (/vendas.html) — acordeão dia a dia
   ============================================================ */
.vendas-timeline {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.venda-dia {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md, 8px);
  overflow: hidden;
  transition: border-color 0.15s;
}
.venda-dia--aberto { border-color: var(--accent); }
.venda-dia__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-4);
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
}
.venda-dia__head:hover { background: var(--surface-subtle, var(--bg-subtle, #f9fafb)); }
.venda-dia__head:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.venda-dia__data {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  min-width: 0;
}
.venda-dia__data-num {
  font-size: var(--text-2xl, 28px);
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.venda-dia__data-extra {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.venda-dia__separador { color: var(--text-tertiary, var(--text-secondary)); }
.venda-dia__meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}
.venda-dia__total {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  font-weight: 600;
  font-size: var(--text-lg, 18px);
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.venda-dia__total-label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
}
.venda-dia__valor {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}
.venda-dia__chevron {
  color: var(--text-secondary);
  transition: transform 0.15s;
  flex-shrink: 0;
}
.venda-dia--aberto .venda-dia__chevron { transform: rotate(180deg); }
.venda-dia__body {
  border-top: 1px solid var(--border-subtle);
  padding: var(--space-2);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.venda-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm, 6px);
  color: inherit;
  text-decoration: none;
  transition: background 0.1s;
}
.venda-item:hover { background: var(--surface-subtle, var(--bg-subtle, #f9fafb)); }
.venda-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.venda-item__nome {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 500;
  color: var(--text-primary);
  min-width: 0;
  flex: 1;
}
.venda-item__detalhes {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.venda-item__valor { font-weight: 500; color: var(--text-primary); }
.venda-item__sep { color: var(--text-tertiary, var(--text-secondary)); }
.venda-item__badge {
  display: inline-flex;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: var(--text-xs);
  font-weight: 500;
}
.venda-item__badge--removido {
  background: var(--red-50);
  color: var(--red-700);
}

@media (max-width: 640px) {
  .venda-dia__head { padding: var(--space-3); flex-wrap: wrap; }
  .venda-dia__data { width: 100%; }
  .venda-dia__data-num { font-size: var(--text-xl, 22px); }
  .venda-dia__meta { width: 100%; justify-content: space-between; }
  .venda-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .venda-item__detalhes { width: 100%; flex-wrap: wrap; }
}

/* ---- Filtro de período ---- */
.vendas-filtro {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.vendas-filtro__label {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}
.vendas-filtro__select {
  min-width: 180px;
  padding: 8px 12px;
  font-size: var(--text-sm);
}

/* Variante "período" — popover com atalhos + custom (2026-05-18 v1.12) */
.filter-chip--periodo {
  min-width: 160px;
  justify-content: space-between;
}
.filter-popover__menu--periodo {
  min-width: 240px;
  right: 0;
  left: auto;
}
.filter-popover__divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 4px 0;
}
.filter-popover__custom {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px 4px 4px;
}
.filter-popover__custom .filter-popover__field--row { gap: 6px; }
.filter-popover__custom input[type="date"] {
  flex: 1;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--border-default, #d4d4d8);
  border-radius: 6px;
  font-size: var(--text-sm);
}
.filter-popover__custom .btn { align-self: flex-end; }

/* ---- KPI delta (variação vs período anterior) ---- */
.kpi__delta {
  margin-top: 6px;
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.01em;
}
.kpi__delta--up { color: var(--green-700, oklch(50% 0.16 145)); }
.kpi__delta--down { color: var(--red-600, oklch(55% 0.18 25)); }
.kpi__delta--neutro { color: var(--text-tertiary, var(--text-secondary)); }

/* ---- Chart cards ---- */
.chart-card {
  margin-top: var(--space-4);
}
.chart-wrapper {
  position: relative;
  width: 100%;
  height: 280px;
}
.chart-wrapper--small {
  height: 240px;
}
.charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin-top: var(--space-4);
}
@media (max-width: 900px) {
  .charts-row { grid-template-columns: 1fr; }
  .chart-wrapper { height: 240px; }
  .chart-wrapper--small { height: 200px; }
}
@media (max-width: 640px) {
  .vendas-filtro { width: 100%; }
  .vendas-filtro__select { flex: 1; }
}

/* ============================================================
   TAREFAS EVER LINE — Componentes específicos (design-spec §6-§18)
   ============================================================
   Adições sobre o app.css clonado de Novos Alunos. Tudo no fim
   pra facilitar diff e merge futuro com a base.
   v1.0 — 2026-05-19
   ============================================================ */

/* ---- Bolinha de cor (status + frente) ----
   Sempre acompanhada de label (princípio 3 do design-principles).
*/
.status-dot,
.frente-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: var(--radius-pill);
  vertical-align: middle;
  flex-shrink: 0;
}
.status-dot { margin-right: 6px; }
.frente-dot { margin-right: 6px; }

/* ---- KPI variante negativa (atrasadas) ---- */
.kpi--negative {
  border-left: 3px solid var(--red-500);
}
.kpi--negative .kpi__number {
  color: var(--kpi-negative-fg);
}

/* ---- Avatar com iniciais (3 tamanhos) ---- */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  flex-shrink: 0;
  line-height: 1;
  letter-spacing: 0.02em;
  user-select: none;
}
.avatar--sm { width: 24px; height: 24px; font-size: 10px; }
.avatar--md { width: 32px; height: 32px; font-size: 12px; }
.avatar--lg { width: 48px; height: 48px; font-size: 16px; }
.avatar--inline {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

/* ---- Filtros por pessoa (linha superior — briefing 3.1) ---- */
.person-filter__row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  overflow-x: auto;
  scrollbar-width: thin;
  padding-bottom: 4px;
}
.person-filter {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px 14px 6px 6px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-pill);
  background: var(--surface-card);
  cursor: pointer;
  transition: border-color var(--motion-fast) var(--ease-out),
              background var(--motion-fast) var(--ease-out);
  min-height: 44px;
  white-space: nowrap;
  color: var(--text-body);
  font-family: inherit;
}
.person-filter:hover { border-color: var(--border-strong); }
.person-filter.is-active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-soft-text);
}
.person-filter:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}
.person-filter--all {
  padding-left: 14px;
}
.person-filter__name {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}
.person-filter__count {
  background: var(--surface-subtle);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  margin-left: 2px;
  font-variant-numeric: tabular-nums;
}
.person-filter.is-active .person-filter__count {
  background: var(--surface-card);
  color: var(--accent-soft-text);
}

/* ---- Status pill clicável + popover ---- */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px var(--space-2);
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--text-body);
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: border-color var(--motion-fast) var(--ease-out),
              box-shadow var(--motion-fast) var(--ease-out);
}
.status-pill:hover { border-color: var(--border-strong); }
.status-pill:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}
.status-pill__dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-pill);
  flex-shrink: 0;
}
.status-pill--todo  .status-pill__dot { background: var(--task-todo-dot); }
.status-pill--doing .status-pill__dot { background: var(--task-doing-dot); }
.status-pill--done  .status-pill__dot { background: var(--task-done-dot); }

.status-popover-wrap { position: relative; display: inline-flex; }
.status-popover {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: var(--z-dropdown);
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: var(--space-1);
  min-width: 200px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.status-popover__item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: none;
  border: 0;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  color: var(--text-body);
  cursor: pointer;
  text-align: left;
  width: 100%;
  font-family: inherit;
}
.status-popover__item:hover { background: var(--surface-subtle); }
.status-popover__item.is-current {
  color: var(--accent-soft-text);
  font-weight: var(--weight-semibold);
  cursor: default;
}
.status-popover__item.is-current:hover { background: var(--accent-soft); }
.status-popover__item-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-pill);
  flex-shrink: 0;
}

/* ---- Chip de prioridade ---- */
.chip--prio-alta  { background: var(--prio-alta-bg);   color: var(--prio-alta-fg);   border-color: var(--red-200); }
.chip--prio-media { background: var(--prio-media-bg);  color: var(--prio-media-fg);  border-color: var(--amber-200); }
.chip--prio-baixa { background: var(--prio-baixa-bg);  color: var(--prio-baixa-fg);  border-color: var(--neutral-300); }

/* ---- Chip de frente ---- */
.chip--frente {
  background: var(--surface-card);
  color: var(--text-body);
  border-color: var(--border-default);
  font-weight: var(--weight-medium);
}

/* ---- Tag de prazo ---- */
.tag-prazo {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.tag-prazo--overdue  { color: var(--due-overdue-fg); font-weight: var(--weight-semibold); }
.tag-prazo--soon     { color: var(--due-soon-fg);    font-weight: var(--weight-medium); }
.tag-prazo--recurring { font-style: italic; color: var(--text-tertiary); }

/* ---- Filtros — label de grupo (ex.: "Frente:") ---- */
.filter-group {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-bottom: var(--space-3);
}
.filter-group__label {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--text-secondary);
  min-width: 76px;
}

/* ---- Search bar (busca + ordenar + limpar) ---- */
.search-bar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: var(--space-3) 0 var(--space-2);
  flex-wrap: wrap;
}
.search-bar__input {
  flex: 1;
  min-width: 240px;
  height: 36px;
}
.search-bar__select {
  height: 36px;
  min-width: 160px;
}
.filter-summary {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  margin-bottom: var(--space-4);
}

/* ---- Card list mobile (substitui tabela <768px) ---- */
.task-card-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.task-card {
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  cursor: pointer;
  transition: border-color var(--motion-fast) var(--ease-out),
              box-shadow var(--motion-fast) var(--ease-out);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.task-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}
.task-card:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}
.task-card__title-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.task-card__title {
  flex: 1;
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  color: var(--text-primary);
  line-height: var(--leading-snug);
  word-break: break-word;
}
.task-card__desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--leading-snug);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.task-card__meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  font-size: var(--text-xs);
  color: var(--text-secondary);
}
.task-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-top: 2px;
}

/* ---- Drawer wide variant (560px pra acomodar comentários) ---- */
.drawer--wide { max-width: 560px; width: 100%; }
@media (max-width: 640px) {
  .drawer--wide { max-width: 100%; }
}

/* ---- Kanban (3 colunas + accordion mobile) ---- */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  align-items: start;
}
@media (max-width: 1023px) {
  .kanban-board { grid-template-columns: repeat(3, 1fr); gap: var(--space-3); }
}
@media (max-width: 767px) {
  .kanban-board { grid-template-columns: 1fr; gap: var(--space-2); }
}

.kanban-col {
  background: var(--surface-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  min-height: 280px;
}
.kanban-col__head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  background: transparent;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}
.kanban-col__head--btn {
  width: 100%;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  background: transparent;
}
.kanban-col__head .status-dot {
  margin-right: 2px;
}
.kanban-col__count {
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  padding: 1px 8px;
  border-radius: var(--radius-pill);
  font-variant-numeric: tabular-nums;
  margin-left: auto;
}
.kanban-col__caret {
  display: none;
  transition: transform var(--motion-fast) var(--ease-out);
}
@media (max-width: 767px) {
  .kanban-col__caret { display: inline-flex; }
  .kanban-col__caret.is-open { transform: rotate(180deg); }
}
.kanban-col__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3);
  flex: 1;
  min-height: 0;
}
@media (min-width: 1024px) {
  .kanban-col__body {
    max-height: calc(100vh - var(--header-height) - 220px);
    overflow-y: auto;
  }
}

.kanban-card {
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  transition: border-color var(--motion-fast) var(--ease-out),
              box-shadow var(--motion-fast) var(--ease-out);
}
.kanban-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}
.kanban-card:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}
.kanban-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.kanban-card__title {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-primary);
  line-height: var(--leading-snug);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}
.kanban-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

/* ---- Comentário (sistema vs livre) ---- */
.comment-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.comment-item {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: var(--space-3);
  background: var(--surface-card);
}
.comment-item__head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
  font-size: var(--text-xs);
  color: var(--text-secondary);
}
.comment-item__name {
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
}
.comment-item__body {
  font-size: var(--text-sm);
  color: var(--text-body);
  line-height: var(--leading-normal);
  white-space: pre-wrap;
  word-wrap: break-word;
}
.comment-item--sistema {
  background: var(--surface-subtle);
  border-style: dashed;
}
.comment-item--sistema .comment-item__name {
  font-style: italic;
  color: var(--text-secondary);
}
.comment-item--sistema .comment-item__body {
  color: var(--text-secondary);
  font-size: var(--text-xs);
}
.comment-avatar-sistema {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--neutral-100);
  color: var(--text-secondary);
  flex-shrink: 0;
}

/* ---- Tarefa: bloco de detalhes (grid 2 colunas) ---- */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3) var(--space-4);
  margin: var(--space-2) 0;
}
@media (max-width: 640px) {
  .detail-grid { grid-template-columns: 1fr; }
}
.detail-cell__label {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  margin-bottom: 2px;
}
.detail-cell__value {
  font-size: var(--text-sm);
  color: var(--text-body);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* ---- form-section (reuso clone — pode não ter no app.css base) ---- */
.form-section { margin-bottom: var(--space-5); }
.form-section__card {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-4);
}
.form-section__title {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--text-secondary);
  margin: 0 0 var(--space-3) 0;
}

/* ---- Color swatch (admin frentes) ---- */
.color-swatch {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  vertical-align: middle;
  margin-right: 6px;
}

/* ---- Page action right (botões no canto direito do title-row) ---- */
.page-title-row__action {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

/* ---- Mobile: tabela esconde, card list aparece ---- */
@media (min-width: 768px) {
  .task-card-list { display: none; }
}
@media (max-width: 767px) {
  .table-wrap--tasks { display: none; }
}
