:root {
  /* Paleta "the blues" passada pra referência — azul-acinzentado da logo Unh'Art */
  --navy: #2a384c;
  --navy-light: #5c6b73;
  --navy-glow: #a0b2c2;
  --bg: #f4f6f7;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e1e6e9;
  /* 3,31:1 contra o branco e 3,05:1 contra o fundo cinza — o mínimo da
     WCAG 1.4.11 pra borda que identifica um controle (P2-17). Separada da
     `--border` decorativa de propósito: divisória de card e linha de
     tabela não identificam controle nenhum, e escurecer as duas deixaria
     a tela pesada sem ganho de acessibilidade. */
  --border-campo: #828f9a;
  --accent: #2a384c;
  /* Os três tons de estado passaram a atender o mínimo da WCAG AA (4,5:1
     pra texto normal) sobre o próprio fundo — P2-17 da auditoria de
     20/09/2026, que mediu 3,00:1 no verde e 2,90:1 no laranja. São as
     cores que dizem "confirmado", "atenção" e "cancelado": o estado do
     atendimento é a informação mais consultada do painel, e quem lê o
     celular no sol também depende disso. O matiz é o mesmo, só mais
     escuro. */
  --green: #15803d;
  --green-bg: #e8f8ee;
  --orange: #b45309;
  --orange-bg: #fef3e2;
  --red: #b91c1c;
  --red-bg: #fdecec;
  --pink-bg: #fde8ee;
  --pink-ic: #e0577a;
  --peach-bg: #fdecd8;
  --peach-ic: #e08a3c;
  --blue-bg: #e4ecfb;
  --blue-ic: #4a6fd6;
  --purple-bg: #eee6fb;
  --purple-ic: #8a5fd6;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Poppins", sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
  width: 232px;
  flex-shrink: 0;
  background:
    radial-gradient(130% 55% at 88% 68%, rgba(160, 178, 194, 0.45), transparent 60%),
    linear-gradient(165deg, #253237 0%, #2a384c 55%, #45566a 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 28px 20px;
  position: relative;
}
.brand { margin-bottom: 40px; }
.brand-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: #9db0bd;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.brand-footer img {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

nav.main-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 10px;
  color: #b7c2cb;
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 500;
  position: relative;
}
.nav-item:hover { background: var(--navy-light); color: #fff; }
.nav-item.active { background: var(--navy-light); color: #fff; }
.nav-icon { width: 18px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.nav-badge {
  margin-left: auto;
  background: #e0577a;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  padding: 1px 7px;
}

.profile-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--navy-light);
  border-radius: 12px;
  padding: 12px;
  margin-top: 16px;
}
.profile-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #d1d9df;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--navy);
  flex-shrink: 0;
  overflow: hidden;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-name { font-size: 13.5px; font-weight: 600; }
.profile-role { font-size: 11.5px; color: #9db0bd; }
.sair-link {
  display: block;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: #9db0bd;
  text-decoration: none;
  /* Alvo de toque de 44px (P3-01 da auditoria): o sistema é usado no
     celular, por profissionais que muitas vezes estão com as próprias
     unhas longas — alvo pequeno erra. */
  padding: 14px 0;
  min-height: 44px;
  box-sizing: border-box;
}
.sair-link:hover { color: #ffffff; }

/* MAIN */
main { flex: 1; padding: 32px 40px; max-width: 1280px; }
.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
  flex-wrap: wrap;
}
/* Botão "Voltar" injetado no topo de toda tela do painel (ver voltar.js).
   O padding generoso é o alvo de toque de 44px da auditoria (P3-01); a
   margem negativa desconta esse respiro extra pra não afastar o título. */
.voltar-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  padding: 11px 12px 11px 2px;
  min-height: 44px;
  box-sizing: border-box;
  margin: -11px 0 4px -2px;
}
.voltar-link:hover { color: var(--navy); }

.topbar h1 { font-size: 25px; margin: 0 0 4px; }
.topbar p { margin: 0; color: var(--muted); font-size: 14px; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.date-pill {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 14px;
  font-size: 13.5px;
  color: var(--text);
}
/* Stepper de mês (Visão Geral, Estoque, Financeiro) — troca o <input
   type="month"> nativo (calendário do sistema operacional, destoa do
   resto do site) por um "‹ Mês de Ano ›" simples, sem popup nenhum. */
.mes-stepper {
  display: flex; align-items: center; gap: 6px; background: var(--card);
  border: 1px solid var(--border); border-radius: 10px; padding: 5px 6px;
}
.mes-stepper-btn {
  background: none; border: none; cursor: pointer; color: var(--navy);
  /* 44x44: é o controle principal pra trocar de mês em Visão geral,
     Financeiro, Estoque e Relatórios (P3-01 da auditoria). */
  width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  border-radius: 6px; font-family: inherit; flex-shrink: 0; font-size: 17px;
}
.mes-stepper-btn:hover { background: var(--bg); }
.mes-stepper-label {
  font-size: 13.5px; font-weight: 600; color: var(--text); white-space: nowrap; padding: 0 4px;
}

/* Calendário customizado (Agenda, Relatórios) — mesmo motivo: substitui o
   popup nativo do <input type="date"> por um calendário com a cara do
   site. Ver calendario.js. */
.cal-trigger {
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; min-height: 44px; font-size: 13.5px; color: var(--text); cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px; font-family: inherit;
}
.cal-trigger:hover { background: var(--bg); }
.cal-trigger svg { color: var(--muted); flex-shrink: 0; }
.cal-popup-wrap { position: relative; display: inline-block; }
.cal-popup {
  display: none; position: absolute; top: calc(100% + 6px); left: 0; z-index: 60;
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  padding: 14px; box-shadow: 0 12px 32px rgba(0,0,0,.16); width: 264px;
}
.cal-popup.aberto { display: block; }
.cal-popup-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-popup-header button {
  background: none; border: none; cursor: pointer; color: var(--navy);
  width: 26px; height: 26px; border-radius: 6px; font-family: inherit; font-size: 15px;
}
.cal-popup-header button:hover { background: var(--bg); }
.cal-popup-titulo { font-weight: 700; font-size: 13px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-dow { font-size: 10px; color: var(--muted); text-align: center; padding: 4px 0; font-weight: 600; }
.cal-day {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  border-radius: 8px; font-size: 12px; cursor: pointer; border: none; background: none;
  font-family: inherit; color: var(--text);
}
.cal-day:hover { background: var(--bg); }
.cal-day:disabled { visibility: hidden; cursor: default; }
.cal-day.cal-hoje { font-weight: 700; color: var(--navy); }
.cal-day.cal-selecionado { background: var(--accent); color: #fff; }
.cal-range-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cal-range-sep { color: var(--muted); font-size: 13px; }

.bell {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  position: relative;
  font-size: 16px;
}
.bell::after {
  content: "";
  position: absolute; top: 8px; right: 9px;
  width: 7px; height: 7px; border-radius: 50%;
  background: #e0577a;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 11px 18px;
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}
.btn-outline {
  width: 100%;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 10px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}
.btn-primary:disabled, .btn-outline:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
}
.card h2 { font-size: 15.5px; margin: 0 0 4px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stat-card { display: flex; flex-direction: column; gap: 12px; }
.stat-top { display: flex; align-items: center; gap: 12px; }
.stat-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; flex-shrink: 0;
}
.stat-label { font-size: 13px; color: var(--muted); }
.stat-value { font-size: 21px; font-weight: 700; }
.stat-delta { font-size: 12px; color: var(--green); font-weight: 600; }
.stat-progress-track { height: 6px; border-radius: 999px; background: var(--border); overflow: hidden; }
.stat-progress-fill { height: 100%; background: var(--navy); border-radius: 999px; }
.stat-sub { font-size: 12px; color: var(--muted); }

.mid-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; margin-bottom: 16px; }
.chart-value { font-size: 26px; font-weight: 700; margin: 6px 0 2px; }
.chart-sub { font-size: 12.5px; color: var(--muted); margin-bottom: 14px; }
.chart-row { display: flex; gap: 20px; align-items: flex-start; }
.legend { display: flex; flex-direction: column; gap: 12px; min-width: 128px; padding-top: 8px; }
.legend-item { font-size: 12px; }
.legend-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.legend-amount { font-weight: 700; font-size: 13px; margin-top: 1px; }
.tip-banner {
  margin-top: 14px;
  background: #eef1f3;
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 12.5px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  color: var(--text);
}
.tip-banner a { color: var(--navy); font-weight: 600; text-decoration: none; white-space: nowrap; }

.donut-wrap { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 6px 0 14px; }
.donut {
  width: 128px; height: 128px; border-radius: 50%;
  background: conic-gradient(var(--navy) 0% 81%, var(--border) 81% 100%);
  display: flex; align-items: center; justify-content: center;
}
.donut-inner {
  width: 96px; height: 96px; border-radius: 50%; background: var(--card);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.donut-pct { font-size: 22px; font-weight: 700; }
.donut-label { font-size: 11px; color: var(--muted); }
.occ-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.occ-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.occ-ic { width: 30px; height: 30px; border-radius: 8px; background: var(--blue-bg); color: var(--blue-ic); display: flex; align-items: center; justify-content: center; font-size: 13px; flex-shrink: 0; }
.occ-val { font-weight: 600; margin-left: auto; }

.bottom-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; }
.appt-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
}
.appt-row:last-of-type { border-bottom: none; }
.appt-time { font-weight: 700; width: 46px; flex-shrink: 0; }
.appt-name { font-weight: 600; }
.appt-service { color: var(--muted); font-size: 12px; }
.badge {
  font-size: 11.5px; font-weight: 600; padding: 4px 9px; border-radius: 999px;
  margin-left: auto;
}
.badge-green { background: var(--green-bg); color: var(--green); }
.badge-orange { background: var(--orange-bg); color: var(--orange); }
.badge-red { background: var(--red-bg); color: var(--red); }
.badge-muted { background: var(--border); color: var(--muted); }
.badge-blue { background: var(--blue-bg); color: var(--blue-ic); }
.appt-value { font-weight: 700; width: 76px; text-align: right; flex-shrink: 0; }
/* Celular (auditoria 19/09/2026): a lista "Atendimentos do dia" da Visão
   Geral passava 8px da tela a 360px (o conteúdo mínimo da linha empurrava o
   cartão), e nome comprido sem espaço estourava a lista de Clientes. */
.bottom-grid > * { min-width: 0; }
.appt-row > div:nth-child(2) { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.row-title, .row-sub { overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .appt-row { gap: 10px; flex-wrap: wrap; }
  .appt-value { width: auto; }
}
.see-all { display: block; text-align: center; margin-top: 12px; font-size: 13px; color: var(--navy); text-decoration: none; font-weight: 600; padding: 13px 0; min-height: 44px; box-sizing: border-box; }

.alert-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 0; border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.alert-row:last-of-type { border-bottom: none; }
.alert-ic { width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
.alert-title { font-weight: 600; }
.alert-sub { color: var(--muted); font-size: 11.5px; }
.chev { margin-left: auto; color: var(--muted); }

.benefits-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.benefit-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.benefit-card-header h2 { margin: 0; }
.club-badge {
  background: var(--navy); color: #fff; font-size: 12px; font-weight: 700;
  padding: 5px 12px; border-radius: 999px; white-space: nowrap;
}
.benefit-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.benefit-stat-label { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.benefit-stat-value { font-size: 19px; font-weight: 700; }

.profit-item { padding: 4px 0; }
.profit-label { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.profit-value { font-size: 27px; font-weight: 700; }
.profit-note { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.profit-divider { border-top: 1px solid var(--border); margin: 14px 0; }
.estimate-tag {
  background: var(--orange-bg); color: var(--orange); font-size: 11px; font-weight: 600;
  padding: 4px 10px; border-radius: 999px; white-space: nowrap;
}
.profit-hint { font-size: 11.5px; color: var(--muted); }
.profit-hint a { color: var(--navy); font-weight: 600; text-decoration: none; }

/* Alvo de toque de 44 px (P2-16 da auditoria de 20/09/2026).
   ------------------------------------------------------------------
   A auditoria mediu ícones de ação com 32 a 40 px, setas de mês com 26 e
   o ✕ de excluir foto com 24. O dedo cobre uns 45 px — abaixo disso
   erra-se o alvo, e aqui os alvos vizinhos incluem "excluir permanente".

   Vale só em `pointer: coarse` (dedo), de propósito: no PC, com mouse, o
   layout compacto que o Diogo desenhou continua exatamente como está. E
   `min-width`/`min-height` em vez de `width`/`height` pra caixa crescer
   sem esticar ícone nem quebrar o alinhamento de quem já era maior. */
@media (pointer: coarse) {
  .icon-btn,
  .bell,
  .cal-popup-header button {
    min-width: 44px;
    min-height: 44px;
  }
  .cal-day { min-height: 40px; }
  .chip { padding: 12px 16px; }
}

/* Genéricos reutilizados nas telas seguintes (Agenda, Clientes, Serviços, Financeiro) */
.page-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.chip {
  background: var(--card); border: 1px solid var(--border); color: var(--text);
  border-radius: 999px; padding: 8px 14px; font-size: 13px; font-weight: 500; cursor: pointer;
}
.chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.search-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  padding: 9px 14px; font-size: 13.5px; color: var(--muted); flex: 1; max-width: 320px;
}
.search-box input { border: none; outline: none; font-family: inherit; font-size: 13.5px; color: var(--text); background: transparent; width: 100%; }

table.data-table { width: 100%; border-collapse: collapse; }
table.data-table th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.4px;
  color: var(--muted); font-weight: 600; padding: 0 10px 10px; border-bottom: 1px solid var(--border);
}
table.data-table td { padding: 14px 10px; border-bottom: 1px solid var(--border); font-size: 13.5px; vertical-align: middle; }
table.data-table tr:last-child td { border-bottom: none; }
.row-avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--blue-bg); color: var(--blue-ic);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12.5px; margin-right: 10px; flex-shrink: 0;
}
.row-name-wrap { display: inline-flex; align-items: center; }
.row-title { font-weight: 600; }
.row-sub { color: var(--muted); font-size: 11.5px; }
.icon-btn {
  width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--border); background: var(--card);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--muted);
  font-family: inherit; font-size: 13px; padding: 0; line-height: 1;
}

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--text); }
.field input, .field select, .field textarea {
  border: 1px solid var(--border-campo); border-radius: 10px; padding: 10px 12px;
  font-family: inherit; font-size: 13.5px; color: var(--text); background: var(--card);
}
/* Foco visível (P2-17). O contorno padrão do navegador some quando o CSS
   mexe em borda, e aí quem navega por Tab perde de vista onde está — num
   formulário de 15 campos isso é o suficiente pra desistir. */
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible,
.btn-primary:focus-visible, .icon-btn:focus-visible, .chip:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 2px;
}
.field-hint { font-size: 11px; color: var(--muted); }

.dropzone {
  border: 1.5px dashed var(--border); border-radius: 12px; padding: 24px;
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
  color: var(--muted); font-size: 12.5px; cursor: pointer; background: var(--bg);
}
.dropzone strong { color: var(--text); font-size: 13.5px; }
.logo-row { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.logo-preview {
  width: 64px; height: 64px; border-radius: 16px; background: var(--navy); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 20px; flex-shrink: 0;
  overflow: hidden;
}
.logo-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }

.color-row { display: flex; gap: 10px; flex-wrap: wrap; }
.color-swatch {
  width: 40px; height: 40px; border-radius: 10px; cursor: pointer; position: relative;
  border: 2px solid transparent;
}
.color-swatch.active { border-color: var(--text); }
.color-swatch.active::after {
  content: "✓"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 15px; font-weight: 700;
}

.busca-cliente-wrap { position: relative; }
.busca-input-row { position: relative; }
.busca-chevron {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  color: var(--muted); cursor: pointer; font-size: 11px; user-select: none;
  padding: 6px; line-height: 1;
}
.busca-cliente-resultados {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 30;
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  max-height: 220px; overflow-y: auto; box-shadow: 0 8px 20px rgba(0,0,0,.12);
}
.busca-cliente-item { padding: 9px 12px; font-size: 13.5px; cursor: pointer; }
.busca-cliente-item:hover { background: var(--bg); }
.busca-cliente-item small { display: block; color: var(--muted); font-size: 11.5px; margin-top: 1px; }
.busca-cliente-vazio { padding: 9px 12px; font-size: 12.5px; color: var(--muted); }

/* MOBILE / RESPONSIVE */
.hamburger-btn {
  display: none;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 110;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--navy);
  color: #fff;
  border: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
}
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(20, 26, 33, 0.5);
  z-index: 90;
}
.sidebar-overlay.show { display: block; }

@media (max-width: 900px) {
  body { display: block; }
  .hamburger-btn { display: flex; }
  /* O menu rola sozinho: o dedo arrasta a lista e o fundo fica travado
     (ver body.sidebar-lock abaixo). Isso substitui a tentativa anterior de
     encolher tudo pra caber sem rolar — os itens voltaram ao tamanho de
     sempre (pedido do usuario, 2026-09-18). Aquela compactacao nasceu
     como remendo pra um scroll que na verdade nunca chegou a ser testado
     no aparelho: o nav-mobile.js que o iPhone baixava era uma versao
     antiga, porque .js e .css vem de outro diretorio no servidor (ver
     DEPLOY-KINGHOST.md). */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    /* 100dvh, nao 100vh: no Safari do iOS o 100vh conta a altura COM a
       barra de ferramentas recolhida, entao o fim do menu — justamente o
       "Sair" — caia embaixo da barra, sem jeito de alcancar por mais que
       se rolasse. O 100vh fica de reserva pra navegador sem suporte. */
    height: 100vh;
    height: 100dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 100;
    /* Espaco pro botao ☰ (fixo em top:16px com 42px de altura e z-index
       acima do menu) nao cair em cima do logo. */
    padding-top: 64px;
    /* No iPhone sem botao fisico, o ultimo item ficava debaixo da barra
       de gestos. */
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
  }
  .sidebar.open { transform: translateX(0); }
  /* Altura natural, sem esticar: quem rola e a coluna inteira. Com flex:1
     o nav tentava ocupar a sobra e empurrava "Sair" pra fora do fluxo de
     rolagem. */
  nav.main-nav { flex: none; }
  /* Trava o scroll da pagina de fundo enquanto o menu mobile esta aberto -
     sem isso, no iOS Safari, arrastar o dedo sobre o menu rola a tela de
     tras (que fica visivel embaixo do overlay) em vez do menu, e o toque
     num link acaba sendo lido como gesto de scroll em vez de tap.
     `position: fixed` (nao so overflow: hidden) porque testado num iPhone
     de verdade e overflow: hidden sozinho nao trava o scroll no Safari
     real do iOS - o `top` negativo (definido via JS em nav-mobile.js)
     mantem a posicao visual, ja que position: fixed sozinho voltaria pro
     topo da pagina. */
  body.sidebar-lock { position: fixed; overflow: hidden; width: 100%; height: 100%; }
  main {
    max-width: 100%;
    padding: 84px 18px 32px;
  }
  .topbar { flex-direction: column; align-items: flex-start; }
  .topbar-actions { width: 100%; flex-wrap: wrap; }

  .stat-grid, .mid-grid, .bottom-grid, .benefits-grid, .benefit-stats, .form-grid,
  .cli-stats, .info-grid, .foto-grid, .est-summary, .compra-form, .consumo-card,
  .comissao-form, .fin-grid, .cost-form, .profit-summary, .client-grid, .fee-grid,
  .conta-grid, .caixa-summary, .seg-grid, .origem-grid, .resumo-grid, .precif-grid,
  .precif-fields, .pers-grid, .rank-grid, .custo-detalhe, .simulador-summary,
  .ins-row, .ins-row.despesas {
    grid-template-columns: 1fr !important;
  }
  .week-strip { display: flex !important; overflow-x: auto; gap: 8px; }
  /* Os 7 dias dividem a largura toda (pedido do Diogo, 22/09/2026). A
     regra acima troca a grade por uma fileira, e sem isto cada dia ficava
     do tamanho do próprio texto: a semana se espremia à esquerda e
     sobrava um vão à direita. `flex: 1 1 0` reparte por igual e deixa
     o `overflow-x` valendo se um dia a fileira tiver mais dias. */
  .week-strip > .day-card { flex: 1 1 0; min-width: 0; }
  .chart-row { flex-wrap: wrap; }
  [class*="tabs"] { overflow-x: auto; }
  /* A tabela vira lista de cartoes (ver tabela-cartao.js). Antes o cartao
     rolava de lado com a tabela travada em 480px, e as colunas da direita —
     Status e os botoes de acao — ficavam sempre escondidas. */
  .card { overflow-x: visible; }
  table.data-table { min-width: 0; display: block; }
  table.data-table thead { display: none; }
  table.data-table tbody,
  table.data-table tr,
  table.data-table td { display: block; width: 100%; }
  table.data-table tr {
    border: 1px solid var(--border); border-radius: 12px;
    margin-bottom: 10px; padding: 4px 14px; background: var(--card);
  }
  table.data-table tr:last-child { margin-bottom: 0; }
  table.data-table td {
    border: none; padding: 9px 0; font-size: 13.5px;
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
    border-bottom: 1px solid var(--border);
  }
  table.data-table td:last-child { border-bottom: none; }
  /* O nome da coluna vira o rotulo da linha. Sem ele, "12/09" e "R$ 150"
     soltos num cartao nao dizem nada. */
  table.data-table td[data-rotulo]::before {
    content: attr(data-rotulo);
    font-size: 12px; font-weight: 600; color: var(--muted);
    flex-shrink: 0; text-align: left;
  }
  /* Celula vazia (coluna sem titulo e sem conteudo) so somaria uma linha em
     branco dentro do cartao. */
  table.data-table td:empty { display: none; }
}

/* Avisos (toast) e confirmação em modal — substituem alert()/confirm()/
   prompt() nativos do navegador (feios e inconsistentes entre PC e
   celular). Ver avisos.js. */
.toast-wrap {
  position: fixed; z-index: 9999; display: flex; flex-direction: column; gap: 10px;
  bottom: 20px; right: 20px; max-width: 360px; width: calc(100% - 40px);
}
.toast {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px 16px; box-shadow: 0 8px 24px rgba(0,0,0,.16);
  display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; color: var(--text);
  line-height: 1.4; animation: toast-in .2s ease;
}
.toast-erro { border-left: 4px solid var(--red); }
.toast-sucesso { border-left: 4px solid var(--green); }
.toast-info { border-left: 4px solid var(--blue-ic); }
.toast-icone { flex-shrink: 0; margin-top: 1px; }
.toast-erro .toast-icone { color: var(--red); }
.toast-sucesso .toast-icone { color: var(--green); }
.toast-info .toast-icone { color: var(--blue-ic); }
.toast-msg { flex: 1; }
.toast-fechar {
  margin-left: auto; cursor: pointer; color: var(--muted); background: none; border: none;
  font-size: 15px; line-height: 1; padding: 0; flex-shrink: 0;
}
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.modal-overlay {
  position: fixed; inset: 0; background: rgba(15,23,32,.5); z-index: 9998;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: modal-fade .15s ease;
}
@keyframes modal-fade { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
  background: var(--card); border-radius: 16px; padding: 24px; max-width: 380px; width: 100%;
  box-shadow: 0 20px 50px rgba(0,0,0,.3);
  max-height: calc(100vh - 40px); overflow-y: auto;
}
.modal-titulo { font-size: 16px; font-weight: 700; margin-bottom: 10px; color: var(--text); }
.modal-texto { font-size: 13.5px; color: var(--muted); line-height: 1.55; margin-bottom: 20px; }
.modal-acoes { display: flex; gap: 10px; justify-content: flex-end; }
.modal-acoes button { width: auto; }
.modal-opcoes { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.modal-opcao {
  border: 1px solid var(--border); border-radius: 10px; padding: 11px 14px; text-align: left;
  background: var(--bg); font-family: inherit; font-size: 13.5px; font-weight: 600; color: var(--text); cursor: pointer;
}
.modal-opcao:hover { border-color: var(--navy); }

@media (max-width: 640px) {
  .toast-wrap { left: 12px; right: 12px; bottom: 12px; max-width: none; width: auto; }
  .modal-card { max-width: none; }
  .modal-acoes { flex-direction: column-reverse; }
  .modal-acoes button { width: 100%; }
  .cal-range-row { width: 100%; flex-direction: column; align-items: stretch; gap: 6px; }
  .cal-range-row .cal-popup-wrap { width: 100%; }
  .cal-range-row .cal-trigger { width: 100%; justify-content: center; }
  .cal-range-sep { text-align: center; }
}

/* Zoom automático do iOS nos formulários (relatado em 2026-09-18, no balão da
   IA, mas vale pra todo campo do painel).
   O Safari do iPhone amplia a página inteira ao focar qualquer campo com
   fonte menor que 16px, e depois não volta sozinho — a profissional fica com
   a tela deslocada e precisa dar pinch pra voltar.
   Não dá pra resolver com `maximum-scale=1` no viewport: isso mataria o
   pinch-to-zoom da página toda, que é acessibilidade. 16px no campo é a única
   saída, e vale só no celular pra não mexer no visual do desktop. */
@media (max-width: 900px) {
  /* !important (auditoria 19/09/2026): regras das próprias telas, mais
     específicas (ex.: ".hor-row input" a 13px em Horários, selects a 13,5px em
     Financeiro e na ficha da cliente), venciam esta e o zoom continuava. */
  input:not([type="checkbox"]):not([type="radio"]),
  select,
  textarea {
    font-size: 16px !important;
  }
}

/* Cópia do botão Salvar no fim da página (ver salvar-rodape.js). Fica
   separado do conteúdo por uma linha, pra ela entender que é o fecho da
   tela e não mais um campo. No celular ocupa a largura toda: é o alvo mais
   importante da página. */
.salvar-rodape {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
}
@media (max-width: 900px) {
  .salvar-rodape { justify-content: stretch; }
  .salvar-rodape-btn { width: 100%; min-height: 48px; }
}

/* Aviso da Disponibilidade Inteligente (ver aviso-disponibilidade.js).
   Deliberadamente chamativo: é a única pista, dentro do painel, de que a
   página pública está escondendo horários livres da cliente. Sem isso ela
   configura uma vez e nunca mais vê — e conclui que o Club parou de trazer
   cliente. */
.aviso-disponibilidade {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--orange-bg);
  border: 1.5px solid var(--orange);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.aviso-disponibilidade > svg { color: var(--orange); flex-shrink: 0; margin-top: 1px; }
.aviso-disponibilidade-texto { flex: 1; min-width: 220px; font-size: 13.5px; line-height: 1.5; color: var(--text); }
.aviso-disponibilidade-texto strong { display: block; margin-bottom: 3px; font-size: 14.5px; }
.aviso-disponibilidade-acoes { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.aviso-disponibilidade-acoes .btn-primary {
  width: auto; text-decoration: none; display: inline-flex; align-items: center;
  min-height: 44px; padding: 0 16px;
}
.aviso-disponibilidade-acoes .btn-outline { width: auto; min-height: 44px; padding: 0 16px; }
@media (max-width: 640px) {
  .aviso-disponibilidade-acoes { width: 100%; }
  .aviso-disponibilidade-acoes .btn-primary,
  .aviso-disponibilidade-acoes .btn-outline { flex: 1; justify-content: center; }
}

/* Aviso de confirmação de e-mail (ver verificacao-email.js). Mesma forma do
   aviso acima de propósito — é a mesma classe de recado: uma coisa que ela
   precisa saber e que nenhuma outra tela conta. Laranja enquanto está no
   prazo, vermelho depois que o link público já saiu do ar. */
.aviso-verificacao {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--orange-bg);
  border: 1.5px solid var(--orange);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.aviso-verificacao > svg { color: var(--orange); flex-shrink: 0; margin-top: 1px; }
.aviso-verificacao-urgente { background: var(--red-bg); border-color: var(--red); }
.aviso-verificacao-urgente > svg { color: var(--red); }
.aviso-verificacao-texto { flex: 1; min-width: 240px; font-size: 13.5px; line-height: 1.5; color: var(--text); }
.aviso-verificacao-texto strong { display: block; margin-bottom: 3px; font-size: 14.5px; }
.aviso-verificacao-email { margin-top: 8px; color: var(--muted); font-size: 13px; }
.aviso-verificacao-email strong { display: inline; font-size: 13px; color: var(--text); }
.aviso-verificacao-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
/* [hidden] do navegador perde pro display:flex acima — sem esta linha o
   formulário do código já nasce aberto em toda tela. */
.aviso-verificacao-form[hidden] { display: none; }
.aviso-verificacao-form input {
  width: 140px; min-height: 44px; padding: 0 14px; border: 1.5px solid var(--border);
  border-radius: 10px; background: var(--card); color: var(--text);
  font-size: 20px; font-weight: 600; letter-spacing: 4px; text-align: center;
}
.aviso-verificacao-form input:focus { outline: none; border-color: var(--navy); }
.aviso-verificacao-form .btn-primary,
.aviso-verificacao-form .btn-outline { width: auto; min-height: 44px; padding: 0 16px; }
.aviso-verificacao-status { margin-top: 10px; font-size: 13px; color: var(--muted); }
.aviso-verificacao-status-ok { color: var(--green); font-weight: 600; }
.aviso-verificacao-status-erro { color: var(--red); font-weight: 600; }
.aviso-verificacao-acoes { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.aviso-verificacao-acoes .btn-primary { width: auto; min-height: 44px; padding: 0 16px; }
@media (max-width: 640px) {
  .aviso-verificacao-acoes { width: 100%; }
  .aviso-verificacao-acoes .btn-primary { flex: 1; justify-content: center; }
  .aviso-verificacao-form input { flex: 1; min-width: 120px; }
}

/* Card de lembretes da Visão geral e fila do WhatsApp assistido
   (ver lembretes.html e backend/lib/lembretes.js). */
.lembrete-linhas { display: flex; flex-direction: column; gap: 10px; }
.lembrete-linha { display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.lembrete-ic {
  width: 26px; height: 26px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700;
}
.lembrete-ic.ok { background: var(--green-bg); color: var(--green); }
.lembrete-ic.confirmado { background: var(--blue-bg); color: var(--blue-ic); }
.lembrete-ic.falta { background: var(--orange-bg); color: var(--orange); }
