/* DejaVu Sans (fonte oficial da marca) — subconjunto Latin hospedado aqui.
   Licença livre: fonts/LICENSE-DejaVu.txt. Fonte: dejavu-fonts.github.io v2.37 */
@font-face { font-family: "DejaVu Sans"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/DejaVuSans-Regular.woff2") format("woff2"); }
@font-face { font-family: "DejaVu Sans"; font-weight: 700; font-style: normal; font-display: swap; src: url("fonts/DejaVuSans-Bold.woff2") format("woff2"); }

:root {
  /* Tatame Pay — tokens oficiais da marca (Conceito 01 / O Tatame).
     Ver .claude/skills/tatame-pay-brand/assets/tokens.json — não
     alterar estes valores sem atualizar a skill da marca também. */
  --graphite: #141819;
  --lime: #9BE34B;
  --lime-hover: color-mix(in srgb, var(--lime) 82%, var(--offwhite)); /* hover derivado do lima e do off-white da paleta */
  --offwhite: #F4F3EF;
  --gray: #ABB4AE;
  --mineral: #365A35;
  --surface-panel: #222829;
  --surface-nav: #101415;
  --border: #48524B;

  --status-success: #B8E7BC;
  --status-warning: #FFD483;
  --status-error: #FFB4AB;
  --status-info: #B8D6F6;

  --radius-card: 12px;
  --radius-control: 8px;
  --shadow: 0 2px 8px rgba(20,24,25,0.35), 0 1px 2px rgba(20,24,25,0.3);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "DejaVu Sans", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  background: var(--graphite);
  color: var(--offwhite);
}

.app {
  display: flex;
  min-height: 100vh;
}

/* ---------- Logo / wordmark (Tatame Pay) ---------- */
.tatame-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.32em;
  font-size: 20px;
  line-height: 1;
}
.tatame-logo svg { width: 1.07em; height: 1em; display: block; flex-shrink: 0; }
.tatame-logo .w-tatame { font-weight: 700; color: var(--offwhite); }
.tatame-logo .w-pay { font-weight: 400; color: var(--lime); margin-left: 0.18em; }
.tatame-logo.on-light .w-tatame,
.tatame-logo.on-light .w-pay { color: var(--graphite); }

/* ---------- Sidebar ---------- */
.sidebar {
  width: 270px;
  flex-shrink: 0;
  background: var(--surface-nav);
  color: var(--offwhite);
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
}

.sidebar-sub {
  font-size: 12px;
  color: var(--gray);
  margin-bottom: 20px;
  margin-top: 6px;
}

.sidebar-search {
  position: relative;
  margin-top: 14px;
}
.sidebar-search input {
  width: 100%;
  padding: 8px 12px;
  border-radius: var(--radius-control);
  border: 1px solid var(--border);
  background: var(--surface-panel);
  color: var(--offwhite);
  font-size: 13px;
}
.sidebar-search input::placeholder { color: var(--gray); }
.busca-resultados {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--surface-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  box-shadow: var(--shadow);
  overflow: hidden;
  z-index: 50;
  max-height: 280px;
  overflow-y: auto;
}
.busca-resultado-item {
  padding: 9px 12px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--offwhite);
  border-bottom: 1px solid var(--border);
}
.busca-resultado-item:last-child { border-bottom: none; }
.busca-resultado-item:hover { background: color-mix(in srgb, var(--offwhite) 8%, var(--surface-panel)); }
.busca-resultado-item span {
  font-size: 11px;
  color: var(--gray);
  white-space: nowrap;
}

.turma-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
}

.turma-nav-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 10px 12px;
  border-radius: var(--radius-control);
  cursor: pointer;
  background: transparent;
  border: 1px solid transparent;
  transition: background 0.15s;
  text-align: left;
}

.turma-nav-item:hover {
  background: color-mix(in srgb, var(--offwhite) 6%, transparent);
}

.turma-nav-item.active {
  background: var(--surface-panel);
  border-color: var(--lime);
}

.turma-nav-item .tn-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--offwhite);
}

.turma-nav-item .tn-meta {
  font-size: 11px;
  color: var(--gray);
}

.turma-nav-item .tn-badge {
  font-size: 10px;
  margin-top: 3px;
  padding: 1px 6px;
  border-radius: 20px;
  background: color-mix(in srgb, var(--offwhite) 10%, transparent);
  color: var(--gray);
}

.nav-overview {
  margin-bottom: 6px;
}

.sidebar .divider {
  border-top: 1px solid var(--border);
  margin: 10px 0;
  opacity: 0.5;
}

.btn-add-turma {
  margin-top: 14px;
  background: var(--lime);
  color: var(--graphite);
  border: none;
  padding: 10px 12px;
  border-radius: var(--radius-control);
  font-weight: 600;
  cursor: pointer;
  font-size: 13px;
}
.btn-add-turma:hover { background: var(--lime-hover); }

.sidebar-footer {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.btn-link {
  background: none;
  border: none;
  color: var(--gray);
  font-size: 12px;
  text-align: left;
  cursor: pointer;
  padding: 4px 2px;
}
.btn-link:hover { color: var(--offwhite); }

/* ---------- Main ---------- */
.main {
  flex: 1;
  padding: 28px 36px;
  overflow-y: auto;
  max-width: 100%;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 22px;
}

.page-title h1 {
  font-size: 32px;
  margin: 0 0 4px 0;
  font-weight: 700;
}

.page-title .subtitle {
  color: var(--gray);
  font-size: 14px;
}

.header-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn {
  padding: 9px 16px;
  border-radius: var(--radius-control);
  border: 1px solid var(--border);
  background: var(--surface-panel);
  color: var(--offwhite);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}
.btn:hover { background: color-mix(in srgb, var(--offwhite) 8%, var(--surface-panel)); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; pointer-events: none; }

.btn-primary {
  background: var(--lime);
  color: var(--graphite);
  border-color: var(--lime);
}
.btn-primary:hover { background: var(--lime-hover); border-color: var(--lime-hover); }

/* .btn-gold preservado por compatibilidade com o app.js (ação de destaque
   dentro de uma linha, ex: "Marcar Pago") — a marca só define um estilo de
   botão "primário" (lima + grafite), então segue o mesmo tratamento. */
.btn-gold {
  background: var(--lime);
  color: var(--graphite);
  border-color: var(--lime);
}
.btn-gold:hover { background: var(--lime-hover); border-color: var(--lime-hover); }

.btn-danger {
  background: var(--surface-panel);
  color: var(--status-error);
  border-color: var(--status-error);
}
.btn-danger:hover { background: color-mix(in srgb, var(--status-error) 14%, var(--surface-panel)); }

.btn-sm { padding: 6px 10px; font-size: 12px; }

/* ---------- Stat cards ---------- */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin: 24px 0;
}

.stat-card {
  background: var(--surface-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 16px 18px;
  box-shadow: var(--shadow);
}

.stat-card .stat-label {
  font-size: 12px;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 6px;
}

.stat-card .stat-value {
  font-size: 22px;
  font-weight: 700;
}

.stat-card.total .stat-value { color: var(--lime); }
.stat-card.paid .stat-value { color: var(--status-success); }
.stat-card.open .stat-value { color: var(--status-error); }
.stat-card .stat-sub {
  font-size: 12px;
  color: var(--gray);
  margin-top: 4px;
}

.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 6px;
  overflow: hidden;
  margin-top: 10px;
}
.progress-bar > div {
  height: 100%;
  background: var(--lime);
}

/* ---------- Table ---------- */
.card {
  background: var(--surface-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.table-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.search-input {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--surface-nav);
  color: var(--offwhite);
  font-size: 13px;
  width: 220px;
  max-width: 100%;
}
.search-input::placeholder { color: var(--gray); }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

thead th {
  text-align: left;
  padding: 10px 16px;
  background: var(--surface-nav);
  color: var(--gray);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border-bottom: 1px solid var(--border);
}

tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: color-mix(in srgb, var(--offwhite) 5%, var(--surface-panel)); }

.aluno-name-btn {
  background: none;
  border: none;
  padding: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--lime);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: transparent;
}
.aluno-name-btn:hover { text-decoration-color: var(--lime); }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.badge-pago { background: color-mix(in srgb, var(--status-success) 18%, var(--surface-panel)); color: var(--status-success); }
.badge-vencido { background: color-mix(in srgb, var(--status-error) 18%, var(--surface-panel)); color: var(--status-error); }
.badge-aberto { background: color-mix(in srgb, var(--status-warning) 18%, var(--surface-panel)); color: var(--status-warning); }

.due-hint {
  display: block;
  font-size: 11px;
  color: var(--status-warning);
  margin-top: 2px;
}

.row-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--gray);
}
.empty-state h3 { color: var(--offwhite); margin-bottom: 6px; }

/* ---------- Modal ---------- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(16,20,21,0.72);
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--surface-panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: 0 10px 40px rgba(20,24,25,0.5);
}

.modal h2 {
  margin: 0 0 4px 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--offwhite);
}
.modal .modal-sub {
  color: var(--gray);
  font-size: 13px;
  margin-bottom: 18px;
}

.form-group {
  margin-bottom: 14px;
}
.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.form-group input, .form-group select {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--surface-nav);
  color: var(--offwhite);
  font-size: 14px;
  font-family: inherit;
}
.form-group input::placeholder { color: var(--gray); }
.form-group input:disabled {
  background: color-mix(in srgb, var(--offwhite) 4%, var(--surface-nav));
  color: var(--gray);
  cursor: not-allowed;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.day-picker {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.day-chip {
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  font-size: 12px;
  cursor: pointer;
  user-select: none;
  background: var(--surface-nav);
  color: var(--offwhite);
}
.day-chip.selected {
  background: var(--lime);
  color: var(--graphite);
  border-color: var(--lime);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
  flex-wrap: wrap;
}
.modal-actions .spacer { flex: 1; }

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
}

.modal-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.info-note {
  font-size: 12px;
  color: var(--gray);
  background: color-mix(in srgb, var(--status-info) 10%, var(--surface-panel));
  border-radius: var(--radius-control);
  padding: 10px 12px;
  margin-bottom: 14px;
}

.overview-turma-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.overview-turma-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  cursor: pointer;
  background: var(--surface-panel);
}
.overview-turma-row:hover { border-color: var(--lime); }
.overview-turma-row .otr-name { font-weight: 700; font-size: 15px; color: var(--offwhite); }
.overview-turma-row .otr-meta { font-size: 12px; color: var(--gray); }
.overview-turma-row .otr-values { text-align: right; font-size: 13px; }
.overview-turma-row .otr-values .v-total { font-weight: 700; color: var(--offwhite); }
.overview-turma-row .otr-values .v-open { color: var(--status-error); font-size: 12px; }

/* ---------- Auth screen ---------- */
.auth-screen {
  min-height: 100vh;
  display: none;
  align-items: center;
  justify-content: center;
  background: var(--surface-nav);
  padding: 20px;
}
.login-card {
  background: var(--surface-panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 32px 28px;
  width: 100%;
  max-width: 360px;
  box-shadow: 0 10px 40px rgba(20,24,25,0.5);
}
.login-brand { margin-bottom: 2px; justify-content: center; font-size: 26px; }
.login-sub {
  text-align: center;
  color: var(--gray);
  font-size: 13px;
  margin-bottom: 22px;
}
.login-error {
  background: color-mix(in srgb, var(--status-error) 16%, var(--surface-panel));
  color: var(--status-error);
  font-size: 12px;
  padding: 8px 10px;
  border-radius: var(--radius-control);
  margin-bottom: 14px;
}
.login-loading {
  color: var(--gray);
  font-size: 14px;
  text-align: center;
}

/* ---------- Seleção de plano (tela de assinatura) ---------- */
.plan-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 24px 0 16px;
}
.plan-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  font: inherit;
  color: var(--offwhite);
  background: var(--surface-nav);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 20px 16px 16px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.plan-card > span { display: block; }
.plan-card:hover { border-color: var(--gray); }
.plan-card:focus-visible { outline: 2px solid var(--offwhite); outline-offset: 2px; }
.plan-card.selected {
  background: var(--surface-panel);
  border-color: var(--lime);
  box-shadow: 0 0 0 1px var(--lime);
}
.plan-card .plan-state { font-size: 12px; font-weight: 600; color: var(--gray); }
.plan-card.selected .plan-state { color: var(--lime); }
.plan-card .plan-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.plan-card .plan-price strong { font-size: 32px; font-weight: 700; line-height: 1.1; }
.plan-card .plan-price small { font-size: 14px; color: var(--gray); margin-left: 4px; }
.plan-card .plan-old { font-size: 14px; color: var(--gray); }
.plan-card .plan-old s { text-decoration-thickness: 1.5px; }
.plan-card .plan-old small { font-size: 12px; }
.plan-card .plan-save { font-size: 14px; font-weight: 600; color: var(--lime); }
.plan-card .plan-desc { font-size: 14px; line-height: 1.5; color: var(--gray); }
.plan-card .plan-trial { font-size: 14px; font-weight: 600; color: var(--offwhite); margin-top: 4px; }
.plan-badge {
  position: absolute;
  top: -10px;
  right: 12px;
  background: var(--lime);
  color: var(--graphite);
  font-size: 12px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 20px;
}
@media (max-width: 600px) {
  .plan-grid { grid-template-columns: 1fr; }
}

/* ---------- Loading state ---------- */
.loading-block {
  text-align: center;
  padding: 60px 20px;
  color: var(--gray);
}

/* ---------- Trial banner ---------- */
.trial-banner {
  background: var(--lime);
  color: var(--graphite);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  padding: 10px 16px;
  border-radius: var(--radius-control);
  margin-bottom: 18px;
}

/* ---------- Save toast ---------- */
.save-toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--surface-panel);
  border: 1px solid var(--lime);
  color: var(--offwhite);
  padding: 10px 16px;
  border-radius: var(--radius-control);
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 200;
}
.save-toast.show { opacity: 1; transform: translateY(0); }
.save-toast.error { border-color: var(--status-error); color: var(--status-error); }

@media (max-width: 800px) {
  .app { flex-direction: column; }
  .sidebar { width: 100%; }
  .main { padding: 20px; }
  .form-row { grid-template-columns: 1fr; }
}

/* ---------- Página inicial pública (sem sessão): home + mockups demonstrativos ---------- */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.home { background: var(--graphite); color: var(--offwhite); min-height: 100vh; }
.home.is-entering { animation: homeFadeIn 240ms ease-out; }
@keyframes homeFadeIn { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
@media (prefers-reduced-motion: reduce) { .home.is-entering { animation: none; } }

.home :focus-visible,
.auth-screen :focus-visible { outline: 2px solid var(--offwhite); outline-offset: 2px; }
.home [tabindex="-1"]:focus { outline: none; }

.home-wrap { max-width: 1280px; margin: 0 auto; padding: 0 32px; }
.home section { scroll-margin-top: 80px; }

.home-skip {
  position: absolute; left: 16px; top: -64px; z-index: 30;
  background: var(--lime); color: var(--graphite); font-weight: 700; font-size: 14px;
  display: inline-flex; align-items: center; min-height: 44px;
  padding: 0 16px; border-radius: var(--radius-control); text-decoration: none;
}
.home-skip:focus { top: 8px; }

/* Botões da home: mesmos estilos .btn/.btn-primary do app, com alvo ≥ 44px */
.home-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 8px 16px; font-size: 14px; line-height: 20px;
  font-family: inherit; text-decoration: none; text-align: center;
  transition: background-color 150ms, border-color 150ms, color 150ms;
}
.home-btn-lg { min-height: 48px; padding: 12px 24px; font-size: 16px; line-height: 24px; }
.home-btn:active { box-shadow: inset 0 0 0 999px rgba(20, 24, 25, 0.12); }

/* Cabeçalho */
.home-header {
  position: sticky; top: 0; z-index: 20;
  background: var(--surface-nav); border-bottom: 1px solid var(--border);
}
.home-header-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 64px; }
.home-brand { display: inline-flex; align-items: center; min-height: 44px; border-radius: var(--radius-control); text-decoration: none; }
.home-nav { flex: 1; display: flex; justify-content: flex-end; gap: 4px; }
.home-nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px;
  color: var(--gray); font-size: 14px; text-decoration: none; border-radius: var(--radius-control);
  transition: color 150ms;
}
.home-nav a:hover { color: var(--offwhite); }
.home-header-actions { display: flex; gap: 12px; }

/* Hero */
.home-hero { padding: 64px 0; overflow: hidden; }
.home-hero-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px; align-items: center; }
.home-hero-copy { grid-column: 1 / span 6; }
.home-hero-visual { grid-column: 7 / span 6; position: relative; padding: 32px 32px 32px 0; }
.home-eyebrow { margin: 0 0 16px; font-size: 14px; line-height: 20px; font-weight: 700; color: var(--gray); }
.home-hero h1 { margin: 0 0 24px; font-size: 56px; line-height: 64px; font-weight: 700; }
.home-lead { margin: 0 0 32px; max-width: 34em; font-size: 20px; line-height: 28px; color: var(--gray); }
.home-cta-row { display: flex; flex-wrap: wrap; gap: 12px; }
.home-note { margin: 16px 0 0; font-size: 14px; line-height: 20px; color: var(--gray); }
.home-tatame { position: absolute; top: 0; right: 0; width: 72%; height: 64%; }

/* Mockups (texto real, sempre com faixa "Dados demonstrativos") */
.mk {
  position: relative; z-index: 1; margin: 0;
  background: var(--surface-panel); border: 1px solid var(--border);
  border-radius: var(--radius-card); box-shadow: var(--shadow); overflow: hidden;
}
.mk-strip {
  display: flex; align-items: center; gap: 8px; padding: 8px 16px;
  background: var(--surface-nav); border-bottom: 1px solid var(--border);
  font-size: 14px; line-height: 20px; color: var(--gray);
}
.mk-strip svg,
.home-ico svg,
.home-terms svg,
.auth-back svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.mk-strip svg { width: 16px; height: 16px; }
.mk-body { padding: 24px; }
.mk-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-bottom: 12px; }
.mk-title { font-size: 16px; line-height: 24px; font-weight: 700; }
.mk-sub { font-size: 14px; line-height: 20px; color: var(--gray); }
.mk-num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.mk .is-in { color: var(--status-success); }
.mk .is-out { color: var(--status-error); }
.mk-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 24px; }
.mk-kpi { background: var(--surface-nav); border: 1px solid var(--border); border-radius: var(--radius-control); padding: 12px; }
.mk-kpi-label { display: block; font-size: 14px; line-height: 20px; color: var(--gray); }
.mk-kpi-value { display: block; font-size: 20px; line-height: 28px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mk-table { border: 1px solid var(--border); border-radius: var(--radius-control); overflow: hidden; }
.mk-table table { font-size: 14px; }
.mk-table thead th { font-size: 14px; text-transform: none; letter-spacing: 0; padding: 8px 12px; }
.mk-table tbody td { padding: 8px 12px; line-height: 28px; }
.mk-table tbody tr:hover { background: none; }
.mk .badge { font-size: 14px; line-height: 20px; padding: 2px 12px; }

.mk-flow { margin-top: 48px; }
.mk-flow-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 32px; padding: 24px; }
.mk-seg { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface-nav); border: 1px solid var(--border); border-radius: var(--radius-control); }
.mk-seg span { padding: 4px 12px; font-size: 14px; line-height: 20px; color: var(--gray); border-radius: 4px; }
.mk-seg .is-on { background: var(--lime); color: var(--graphite); font-weight: 700; }
.mk-legend { display: flex; gap: 16px; margin-bottom: 12px; font-size: 14px; line-height: 20px; color: var(--gray); }
.mk-legend span { display: inline-flex; align-items: center; gap: 8px; }
.mk-sw { display: inline-block; width: 12px; height: 12px; border-radius: 2px; }
.mk-sw.is-in { background: var(--status-success); }
.mk-sw.is-out { background: var(--status-error); }
.mk-bars { display: flex; gap: 8px; height: 220px; }
.mk-bar-group { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.mk-bar-pair { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 4px; border-bottom: 1px solid var(--border); }
.mk-b { width: 32%; max-width: 28px; height: var(--h); border-radius: 4px 4px 0 0; }
.mk-b.is-in { background: var(--status-success); }
.mk-b.is-out { background: var(--status-error); }
.mk-bar-label { padding-top: 8px; font-size: 14px; line-height: 20px; color: var(--gray); text-align: center; }
.mk-foot { margin: 16px 0 0; font-size: 14px; line-height: 20px; color: var(--gray); }
.mk-foot strong { font-variant-numeric: tabular-nums; white-space: nowrap; }
.mk-side { border-left: 1px solid var(--border); padding-left: 32px; }
.mk-rank { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.mk-rank-row { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; line-height: 20px; margin-bottom: 8px; }
.mk-track { display: block; height: 6px; background: var(--border); border-radius: 6px; overflow: hidden; }
.mk-track > span { display: block; height: 100%; background: var(--status-success); }
.mk-total {
  display: flex; justify-content: space-between; gap: 12px; margin: 24px 0 0; padding-top: 12px;
  border-top: 1px solid var(--border); font-size: 14px; line-height: 20px; font-weight: 700;
}

/* Seções */
.home-section { padding: 64px 0; border-top: 1px solid var(--border); }
.home-section-head { max-width: 720px; margin-bottom: 48px; }
.home-section-head h2 { margin: 0 0 12px; font-size: 32px; line-height: 40px; font-weight: 700; }
.home-section-head p { margin: 0; font-size: 20px; line-height: 28px; color: var(--gray); }

.home-features { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.home-feature { background: var(--surface-panel); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 24px; }
.home-ico {
  display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; margin-bottom: 16px;
  background: var(--graphite); border: 1px solid var(--border); border-radius: var(--radius-control); color: var(--offwhite);
}
.home-ico svg { width: 24px; height: 24px; }
.home-feature h3,
.home-step h3 { margin: 0 0 8px; font-size: 20px; line-height: 28px; font-weight: 700; }
.home-feature p,
.home-step p { margin: 0; font-size: 16px; line-height: 24px; color: var(--gray); }

.home-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.home-step { border-top: 2px solid var(--border); padding-top: 24px; }
.home-step-num { display: block; margin-bottom: 12px; font-size: 20px; line-height: 28px; font-weight: 700; color: var(--lime); font-variant-numeric: tabular-nums; }

.home-plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; max-width: 840px; }
.home-plan { position: relative; background: var(--surface-panel); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 32px 24px 24px; }
.home-plan.is-featured { border-color: var(--lime); }
.home-plan h3 { margin: 0 0 8px; font-size: 14px; line-height: 20px; font-weight: 700; color: var(--gray); text-transform: uppercase; letter-spacing: 0.3px; }
.home-price { margin: 0 0 8px; }
.home-price strong { font-size: 32px; line-height: 40px; font-weight: 700; font-variant-numeric: tabular-nums; }
.home-price span { margin-left: 4px; font-size: 16px; color: var(--gray); }
.home-plan-save { margin: 0 0 12px; font-size: 14px; line-height: 20px; font-weight: 700; color: var(--lime); }
.home-plan-desc { margin: 0; font-size: 16px; line-height: 24px; color: var(--gray); }
.home-plan-badge {
  position: absolute; top: -12px; right: 16px; padding: 2px 12px; border-radius: 20px;
  background: var(--lime); color: var(--graphite); font-size: 14px; line-height: 20px; font-weight: 700;
}
.home-terms { list-style: none; margin: 32px 0 0; padding: 0; display: grid; gap: 12px; max-width: 840px; }
.home-terms li { display: flex; gap: 12px; font-size: 16px; line-height: 24px; }
.home-terms svg { width: 24px; height: 24px; color: var(--lime); }

/* Fechamento */
.home-close { padding: 0 0 64px; }
.home-close-band {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 32px; align-items: center;
  padding: 48px; background: var(--mineral); border-radius: var(--radius-card); overflow: hidden;
}
.home-close h2 { margin: 0 0 12px; font-size: 32px; line-height: 40px; font-weight: 700; max-width: 18em; }
.home-close-sign { margin: 0 0 32px; font-size: 20px; line-height: 28px; }
.home-close-art { display: block; width: 100%; height: 240px; }

/* Rodapé */
.home-footer { padding: 32px 0; background: var(--surface-nav); border-top: 1px solid var(--border); }
.home-footer-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px; }
.home-footer p { margin: 0; font-size: 14px; line-height: 20px; color: var(--gray); }
.home-footer a { color: var(--offwhite); display: inline-block; padding: 12px 4px; border-radius: 4px; }
.home-footer-brand .tatame-logo { font-size: 20px; }

/* Link "Voltar" na tela de login/cadastro */
.auth-back {
  display: inline-flex; align-items: center; gap: 4px; min-height: 44px; margin: -16px 0 8px -8px; padding: 0 8px;
  color: var(--gray); font-size: 14px; text-decoration: none; border-radius: var(--radius-control);
}
.auth-back:hover { color: var(--offwhite); }
.auth-back svg { width: 20px; height: 20px; }

@media (max-width: 1024px) {
  .home-features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-hero h1 { font-size: 48px; line-height: 56px; }
}
@media (max-width: 900px) {
  .home-nav { display: none; }
  .home-hero-copy, .home-hero-visual { grid-column: 1 / -1; }
  .home-hero-visual { margin-top: 24px; }
  .mk-flow-grid { grid-template-columns: minmax(0, 1fr); }
  .mk-side { border-left: 0; padding-left: 0; border-top: 1px solid var(--border); padding-top: 24px; }
  .home-close-band { grid-template-columns: minmax(0, 1fr); }
  .home-close-art { display: none; }
}
@media (max-width: 640px) {
  .home-wrap { padding: 0 16px; }
  .home-hide-sm { display: none; }
  .home-brand .tatame-logo { font-size: 20px; }
  .home-hero { padding: 48px 0; }
  .home-hero h1 { font-size: 40px; line-height: 48px; }
  .home-lead, .home-section-head p { font-size: 16px; line-height: 24px; }
  .home-cta-row .home-btn { width: 100%; }
  .home-hero-visual { padding: 16px 16px 16px 0; }
  .home-tatame { width: 80%; height: 48%; }
  .mk-body, .mk-flow-grid { padding: 16px; }
  .mk-table thead th, .mk-table tbody td { padding-left: 8px; padding-right: 8px; white-space: nowrap; }
  .mk-bars { height: 180px; gap: 4px; }
  .home-section { padding: 48px 0; }
  .home-section-head { margin-bottom: 32px; }
  .home-section-head h2, .home-close h2 { font-size: 28px; line-height: 36px; }
  .home-features, .home-steps, .home-plans { grid-template-columns: minmax(0, 1fr); }
  .home-plans { gap: 32px; }
  .home-close { padding-bottom: 48px; }
  .home-close-band { padding: 32px 24px; }
  .home-close-band .home-btn { width: 100%; }
}

/* Home: botão secundário com borda de contraste ≥ 3:1 sobre o grafite (guia §4.2) */
.home .btn:not(.btn-primary) { border-color: color-mix(in srgb, var(--gray) 60%, var(--graphite)); }
.home-close h2 { margin-bottom: 32px; }

/* Home — ajustes só para celular (≤ 640px): página mais curta e menos repetitiva */
@media (max-width: 640px) {
  .home-hero { padding: 32px 0 40px; }
  .home-hero-visual { margin-top: 16px; }
  .home-hero .mk-kpis { grid-template-columns: minmax(0, 1fr); gap: 8px; margin-bottom: 16px; }
  .home-hero .mk-kpi { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0 12px; padding: 8px 12px; }
  .home-hero .mk-table tbody tr:nth-child(n+3) { display: none; }
  .home-section { padding: 40px 0; }
  .home-section-head { margin-bottom: 24px; }
  .home-features { gap: 12px; }
  .home-feature { display: grid; grid-template-columns: 48px minmax(0, 1fr); column-gap: 16px; align-items: start; padding: 16px; }
  .home-feature .home-ico { grid-row: 1 / span 2; margin: 0; }
  .home-feature h3 { margin: 0 0 4px; font-size: 18px; line-height: 24px; }
  .home-steps { gap: 16px; }
  .home-step { padding-top: 16px; }
  .home-step-num { margin-bottom: 4px; }
  .home-plans { gap: 24px; }
  .home-terms { margin-top: 24px; }
  .mk-flow { margin-top: 32px; }
  .mk-flow .mk-side { display: none; }
  .mk-flow .mk-bars { height: 150px; }
}

/* App no celular (≤ 800px): barra superior + menu em painel que abre ao tocar; tabelas viram cartões */
.topbar, .sidebar-overlay, .sidebar-close { display: none; }

@media (max-width: 800px) {
  .app { display: block; }

  .topbar {
    display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 90;
    min-height: 64px; padding: 8px 16px; background: var(--surface-nav); border-bottom: 1px solid var(--border);
  }
  .topbar-menu, .sidebar-close {
    display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
    width: 44px; height: 44px; padding: 0; color: var(--offwhite); cursor: pointer;
    background: var(--surface-panel); border: 1px solid var(--border); border-radius: var(--radius-control);
  }
  .topbar-menu svg, .sidebar-close svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
  .topbar-menu:focus-visible, .sidebar-close:focus-visible { outline: 2px solid var(--offwhite); outline-offset: 2px; }
  .topbar-brand { flex-shrink: 0; }
  .topbar-brand .tatame-logo { font-size: 20px; }
  .topbar-acad { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; color: var(--gray); }

  .sidebar-overlay {
    display: block; position: fixed; inset: 0; z-index: 140; background: rgba(16, 20, 21, 0.72);
    opacity: 0; visibility: hidden; transition: opacity 0.2s, visibility 0s 0.2s;
  }
  .sidebar-overlay.open { opacity: 1; visibility: visible; transition: opacity 0.2s; }
  body.menu-open { overflow: hidden; }

  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 150; width: min(88vw, 340px);
    overflow-y: auto; border-right: 1px solid var(--border); box-shadow: var(--shadow);
    transform: translateX(-100%); visibility: hidden; transition: transform 0.2s, visibility 0s 0.2s;
  }
  .sidebar.open { transform: none; visibility: visible; transition: transform 0.2s; }
  .sidebar-close { display: inline-flex; align-self: flex-end; margin-bottom: 8px; }

  .main { padding: 16px; }

  .tbl-stack thead { display: none; }
  .tbl-stack, .tbl-stack tbody, .tbl-stack tr, .tbl-stack td { display: block; width: 100%; }
  .tbl-stack tr { padding: 12px 16px; border-bottom: 1px solid var(--border); }
  .tbl-stack tbody tr:last-child { border-bottom: 0; }
  .tbl-stack td { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 4px 0; border: 0; text-align: right; }
  .tbl-stack td[data-label]::before { content: attr(data-label); flex-shrink: 0; font-size: 14px; color: var(--gray); text-align: left; }
  .tbl-stack td:first-child { display: block; font-size: 16px; font-weight: 700; text-align: left; padding-bottom: 8px; }
  .tbl-stack td:first-child::before { content: none; }
  .tbl-stack td[colspan] { display: block; text-align: center; }
  .tbl-stack .aluno-name-btn { font-size: 16px; text-align: left; min-height: 44px; }
  .tbl-stack .row-actions { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 8px; padding-top: 8px; }
  .tbl-stack .row-actions .btn { min-height: 44px; padding: 8px 16px; font-size: 14px; }
  .tbl-stack td:has(.row-actions) { display: block; text-align: left; }
  .turma-list { flex: none; overflow: visible; }
  .sidebar .divider { margin: 8px 0; }
}
