/* =====================================================================
   style.css — Ficha Pré-Consulta · Victor Tavares
   Visual híbrido:
     • Formulário do paciente → Apple (espaçoso, premium, profundidade suave)
     • Painel admin (body.admin) → Vercel (minimal, flat, alto contraste)
     • Grupos Sim/Não e opções curtas → segmented control (Fluent)
   Dourado da marca como acento preciso.
   ===================================================================== */

:root {
  --bg: #f7f5f1;
  --bg-soft: #fbfaf7;
  --bg-card: #ffffff;
  --bg-input: #ffffff;
  --bg-track: rgba(40, 30, 10, 0.06);
  --text: #2b2a27;
  --muted: #6e6b64;
  --muted-2: #a6a299;
  --line: rgba(40, 30, 10, 0.09);
  --line-strong: rgba(40, 30, 10, 0.14);
  --accent: #c9a24d;
  --accent-2: #e0c16a;
  --accent-ink: #936f1e;
  --accent-soft: rgba(201, 162, 77, 0.10);
  --ok: #2f9e6e;
  --erro: #cf514f;
  --shadow-soft: 0 1px 2px rgba(50, 40, 15, 0.04), 0 6px 16px rgba(50, 40, 15, 0.05);
  --shadow: 0 1px 3px rgba(50, 40, 15, 0.05), 0 18px 42px rgba(50, 40, 15, 0.09);
  --radius: 22px;
  --radius-sm: 14px;
  --container: 720px;
  --font-accent: "Sora", "Inter", system-ui, sans-serif;
  --ease: cubic-bezier(.32, .72, 0, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(201, 162, 77, 0.06), transparent 34rem),
    radial-gradient(circle at 94% 8%, rgba(201, 162, 77, 0.045), transparent 26rem),
    var(--bg);
  line-height: 1.6;
  letter-spacing: -0.006em;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }

.container { width: min(var(--container), calc(100% - 40px)); margin: 0 auto; }
.container-wide { --container: 1100px; }

/* ── Marca ───────────────────────────────────────────────────── */
.brand { display: inline-flex; align-items: center; gap: 13px; }
.brand-mark {
  width: 46px; height: 46px; flex-shrink: 0;
  display: grid; place-items: center; border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-weight: 900; font-size: 0.92rem; letter-spacing: -0.06em;
  box-shadow: 0 4px 14px rgba(201, 162, 77, 0.30);
}
.brand strong { display: block; font-size: 1.02rem; font-weight: 800; letter-spacing: -0.01em; }
.brand small { display: block; color: var(--muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.12em; margin-top: 1px; }

/* ── Logo (imagem real) ──────────────────────────────────────── */
/* Símbolo da marca no lugar do "VT" (topo das páginas) */
.brand-mark {
  background: url("../img/logo-victor-mark.png") center / contain no-repeat;
  box-shadow: none; color: transparent; font-size: 0;
}
/* Logo completa: sidebar do painel e card de login */
.sidebar-logo { display: block; width: 100%; max-width: 172px; height: auto; margin: 2px auto; }
.login-logo { display: block; width: 230px; max-width: 80%; height: auto; margin: 2px auto 20px; }

/* ── Header (frosted, Apple) ─────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(247, 245, 241, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }

/* ── Botões ──────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 0 26px; border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-weight: 700; font-size: 0.95rem; letter-spacing: 0.01em;
  border: none; box-shadow: 0 6px 18px rgba(201, 162, 77, 0.28);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), opacity 0.2s ease;
  cursor: pointer; white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 26px rgba(201, 162, 77, 0.36); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-small { min-height: 40px; padding: 0 18px; font-size: 0.88rem; }
.btn-block { width: 100%; }
.btn-ghost {
  background: var(--bg-card); color: var(--text); box-shadow: none;
  border: 1px solid var(--line-strong); font-weight: 600;
}
.btn-ghost:hover { box-shadow: var(--shadow-soft); background: var(--bg-card); }

/* ── Cards ───────────────────────────────────────────────────── */
.card {
  padding: 34px; border-radius: var(--radius);
  background: var(--bg-card); border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

/* ── Tipografia ──────────────────────────────────────────────── */
.h1 { font-family: var(--font-accent); font-size: clamp(1.8rem, 5.2vw, 2.6rem); font-weight: 800; line-height: 1.08; letter-spacing: 0.005em; text-transform: uppercase; margin: 0 0 14px; color: var(--text); }
.h2 { font-family: var(--font-accent); font-size: 1.22rem; font-weight: 800; letter-spacing: 0.012em; text-transform: uppercase; margin: 0 0 6px; color: var(--text); }
.lead { color: var(--muted); font-size: 1.06rem; line-height: 1.6; margin: 0 0 8px; letter-spacing: -0.003em; }
.tag {
  display: inline-flex; align-items: center; padding: 7px 15px;
  border: 1px solid rgba(201, 162, 77, 0.32); border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-ink);
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
}
.accent { color: var(--accent-ink); }
.center { text-align: center; }

/* ── Hero ────────────────────────────────────────────────────── */
.hero-wrap { min-height: calc(100vh - 70px); display: grid; place-items: center; padding: 56px 0; }
.hero-box { text-align: center; max-width: 620px; }
.hero-box .btn { margin-top: 22px; }
.hero-icon {
  width: 100px; height: 100px; margin: 0 auto 26px;
  display: grid; place-items: center; border-radius: 28px;
  background: rgba(47, 158, 110, 0.10); border: 1px solid rgba(47, 158, 110, 0.28);
  font-size: 3rem; color: var(--ok); box-shadow: 0 12px 30px rgba(47, 158, 110, 0.12);
}

/* ── Formulário multi-etapas ─────────────────────────────────── */
.form-shell { padding: 30px 0 90px; }

.progress {
  position: sticky; top: 70px; z-index: 50;
  padding: 18px 0 16px; margin-bottom: 28px;
  background: rgba(247, 245, 241, 0.82);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
}
.progress-label { font-weight: 600; font-size: 0.9rem; color: var(--muted); margin-bottom: 12px; }
.progress-label span { color: var(--text); font-weight: 700; }
.progress-label .nm { color: var(--accent-ink); }

/* Stepper de etapas (Apple) */
.stepper { display: flex; gap: 7px; }
.dot { flex: 1; height: 6px; border-radius: 999px; background: var(--bg-track); transition: background 0.4s var(--ease); position: relative; cursor: pointer; }
.dot::after { content: ""; position: absolute; inset: -9px 0; }
.dot:hover { background: var(--accent-2); }
.dot.done { background: var(--accent); }
.dot.ativo { background: linear-gradient(90deg, var(--accent), var(--accent-2)); }

.step { display: none; }
.step.ativo { display: block; animation: rise 0.4s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.step-title { font-family: var(--font-accent); font-size: 1.4rem; font-weight: 800; letter-spacing: 0.012em; text-transform: uppercase; margin: 0 0 6px; color: var(--text); }
.step-sub { color: var(--muted); margin: 0 0 26px; font-size: 0.98rem; }

/* ── Campos ──────────────────────────────────────────────────── */
.field { margin-bottom: 24px; }
.field > label.lbl { display: block; margin-bottom: 10px; font-weight: 600; font-size: 0.98rem; letter-spacing: -0.005em; }
.field .req { color: var(--accent-ink); }
.hint { display: block; color: var(--muted-2); font-size: 0.82rem; margin-top: 6px; }

input[type=text], input[type=email], input[type=tel], input[type=password], textarea, select {
  width: 100%; padding: 15px 17px;
  background: var(--bg-input); border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); color: var(--text); font-size: 1rem;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
input::placeholder, textarea::placeholder { color: var(--muted-2); }
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(201, 162, 77, 0.16);
}
textarea { min-height: 116px; resize: vertical; line-height: 1.55; }
input.erro, textarea.erro, select.erro { border-color: var(--erro); box-shadow: 0 0 0 4px rgba(207, 81, 79, 0.14); }
.msg-erro { color: var(--erro); font-size: 0.84rem; margin-top: 6px; display: none; }
.msg-erro.show { display: block; }

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' stroke='%23e6c578' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center; padding-right: 44px; cursor: pointer;
}
select option { background: #fff; color: var(--text); }

/* ── Opções em lista (Apple cards) ───────────────────────────── */
.opcoes { display: grid; gap: 10px; }
.opcao {
  display: flex; align-items: center; gap: 13px; padding: 15px 17px; cursor: pointer;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--bg-card);
  transition: border-color 0.18s var(--ease), background-color 0.18s var(--ease), box-shadow 0.18s var(--ease), transform 0.12s var(--ease);
}
.opcao:hover { border-color: rgba(201, 162, 77, 0.5); box-shadow: var(--shadow-soft); }
.opcao:active { transform: scale(0.99); }
.opcao input { accent-color: var(--accent); width: 19px; height: 19px; flex-shrink: 0; }
.opcao span { font-size: 0.98rem; }
.opcao:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px rgba(201, 162, 77, 0.16); }
.opcao:has(input:checked) span { font-weight: 700; }

/* ── Segmented control (Fluent) — grupos Sim/Não e opções curtas ── */
.opcoes.cols-2 {
  display: flex; gap: 5px; padding: 5px;
  background: var(--bg-track); border: 1px solid var(--line);
  border-radius: 16px; grid-template-columns: none;
}
.opcoes.cols-2 .opcao {
  flex: 1; justify-content: center; text-align: center;
  padding: 11px 10px; border: none; background: transparent; border-radius: 11px; box-shadow: none;
  font-weight: 600; color: var(--muted);
}
.opcoes.cols-2 .opcao:hover { background: rgba(255, 255, 255, 0.6); box-shadow: none; }
.opcoes.cols-2 .opcao input { position: absolute; opacity: 0; width: 0; height: 0; }
.opcoes.cols-2 .opcao:has(input:checked) {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-weight: 800; box-shadow: 0 2px 8px rgba(201, 162, 77, 0.26);
}

/* Horários de refeição */
.grid-horarios { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-horarios .field { margin-bottom: 0; }

/* Condicionais */
.condicional { display: none; margin-top: 16px; padding-left: 16px; border-left: 2px solid rgba(201, 162, 77, 0.4); }
.condicional.show { display: block; animation: rise 0.3s var(--ease); }

/* ── Navegação ───────────────────────────────────────────────── */
.form-nav { display: flex; gap: 12px; justify-content: space-between; margin-top: 32px; }
.form-nav .btn { flex: 1; max-width: 220px; }
.form-nav .btn-ghost { flex: 0 0 auto; }

/* ── Resumo ──────────────────────────────────────────────────── */
.resumo { display: grid; gap: 11px; margin-bottom: 24px; }
.resumo-item { display: flex; justify-content: space-between; gap: 16px; padding: 14px 17px; border-radius: var(--radius-sm); background: var(--bg-soft); border: 1px solid var(--line); }
.resumo-item b { color: var(--muted); font-weight: 600; }
.resumo-item span { font-weight: 700; text-align: right; }
.check-confirma { display: flex; align-items: flex-start; gap: 12px; margin: 16px 0; cursor: pointer; font-size: 0.96rem; }
.check-confirma input { accent-color: var(--accent); width: 21px; height: 21px; margin-top: 1px; flex-shrink: 0; }
.lgpd-nota { margin: 18px 0 4px; padding: 13px 15px; font-size: 0.85rem; color: var(--muted); background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius-sm); line-height: 1.5; }

/* ── Rascunho ────────────────────────────────────────────────── */
.rascunho-aviso { display: none; align-items: center; gap: 14px; flex-wrap: wrap; padding: 16px 18px; margin-bottom: 24px; border-radius: var(--radius-sm); background: var(--accent-soft); border: 1px solid rgba(201, 162, 77, 0.35); }
.rascunho-aviso.show { display: flex; }
.rascunho-aviso p { margin: 0; flex: 1; min-width: 200px; font-size: 0.92rem; }
.rascunho-aviso .btn-small { min-height: 36px; }

/* ── Login ───────────────────────────────────────────────────── */
.login-wrap { min-height: calc(100vh - 70px); display: grid; place-items: center; padding: 44px 0; }
.login-card { width: min(420px, 100%); }
.alerta { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 18px; font-size: 0.9rem; border: 1px solid; }
.alerta-erro { background: rgba(207, 81, 79, 0.12); border-color: rgba(207, 81, 79, 0.4); color: #f0a3a1; }
.alerta-ok { background: rgba(47, 158, 110, 0.14); border-color: rgba(47, 158, 110, 0.4); color: #7fd6ab; }

/* ── Painel ──────────────────────────────────────────────────── */
.painel-head { padding: 32px 0 18px; }
.busca-wrap { margin: 18px 0 16px; }
.busca-wrap input { font-size: 1.04rem; }
.contador { color: var(--muted); font-size: 0.9rem; margin-bottom: 14px; }

.dash { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 6px 0 24px; }
.metric { padding: 18px 20px; border-radius: var(--radius-sm); background: var(--bg-card); border: 1px solid var(--line); box-shadow: var(--shadow-soft); }
.metric .num { font-family: var(--font-accent); font-size: 1.8rem; font-weight: 800; line-height: 1; font-feature-settings: 'tnum'; }
.metric .rot { color: var(--muted); font-size: 0.78rem; margin-top: 7px; text-transform: uppercase; letter-spacing: 0.06em; }
.metric.is-novo .num { color: var(--accent-ink); }
.metric.is-agendado .num { color: #d8a23a; }
.metric.is-atendido .num { color: #3fb985; }

.filtros { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { padding: 8px 16px; border-radius: 999px; cursor: pointer; border: 1px solid var(--line-strong); background: var(--bg-card); font-size: 0.86rem; font-weight: 600; color: var(--muted); transition: all 0.15s var(--ease); }
.chip:hover { border-color: var(--accent); color: var(--text); }
.chip.ativo { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.filtros select { width: auto; min-width: 170px; padding: 9px 38px 9px 14px; min-height: 40px; }
.filtros .btn-export { margin-left: auto; }

.badge { display: inline-flex; align-items: center; padding: 4px 11px; border-radius: 999px; font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap; }
.badge-novo { background: var(--accent-soft); color: var(--accent-ink); border: 1px solid rgba(201, 162, 77, 0.35); }
.badge-agendado { background: rgba(186, 125, 23, 0.16); color: #e0b357; border: 1px solid rgba(186, 125, 23, 0.4); }
.badge-atendido { background: rgba(47, 158, 110, 0.16); color: #5cc99a; border: 1px solid rgba(47, 158, 110, 0.4); }

.lista-pacientes { display: grid; gap: 11px; }
.paciente-card { display: flex; align-items: center; gap: 16px; padding: 18px 20px; border-radius: var(--radius-sm); background: var(--bg-card); border: 1px solid var(--line); box-shadow: var(--shadow-soft); transition: border-color 0.18s var(--ease), transform 0.18s var(--ease), box-shadow 0.18s var(--ease); }
.paciente-card:hover { border-color: rgba(201, 162, 77, 0.5); transform: translateY(-2px); box-shadow: var(--shadow); }
.paciente-avatar { width: 46px; height: 46px; flex-shrink: 0; border-radius: 13px; display: grid; place-items: center; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.paciente-info { flex: 1; min-width: 0; }
.paciente-info .nome { font-weight: 700; font-size: 1.05rem; }
.paciente-info .meta { color: var(--muted); font-size: 0.86rem; display: flex; gap: 10px; flex-wrap: wrap; margin-top: 2px; }
.paciente-info .meta .obj { color: var(--accent-ink); }
.paciente-zap { color: var(--muted); font-size: 0.86rem; white-space: nowrap; }
.vazio-lista { text-align: center; color: var(--muted); padding: 50px 0; }

/* Linha = card clicável + ações (arquivar / restaurar / excluir) */
.paciente-row { display: flex; align-items: center; gap: 8px; }
.paciente-row .paciente-card { flex: 1; min-width: 0; }
.paciente-card > svg:last-child { flex-shrink: 0; }
.row-acts { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.row-act { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 11px; border: 1px solid var(--line-strong); background: var(--bg-card); color: var(--muted); cursor: pointer; transition: color 0.15s var(--ease), border-color 0.15s var(--ease); }
.row-act:hover { color: var(--text); border-color: var(--accent); }
.row-act.danger:hover { color: #c0392b; border-color: #c0392b; }
.row-act svg { width: 18px; height: 18px; }
.btn-danger:hover { color: #c0392b; border-color: #c0392b; }
.badge-arquivado { background: rgba(255, 255, 255, 0.06); color: var(--muted); border: 1px solid var(--line-strong); }

/* ── Ficha individual ────────────────────────────────────────── */
.ficha-head { padding: 28px 0 12px; }

.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 0.9rem; font-weight: 600; margin-bottom: 16px; transition: color 0.15s var(--ease); }
.back-link:hover { color: var(--accent-ink); }

.ficha-profile { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 18px; padding: 24px 26px; }
.profile-main { display: flex; align-items: center; gap: 18px; min-width: 0; }
.profile-avatar { width: 64px; height: 64px; flex-shrink: 0; border-radius: 18px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; display: grid; place-items: center; font-size: 1.6rem; font-weight: 800; box-shadow: 0 6px 16px rgba(201, 162, 77, 0.28); }
.profile-name-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.profile-name { font-family: var(--font-accent); font-size: 1.5rem; font-weight: 800; letter-spacing: -0.01em; margin: 0; }
.profile-meta { color: var(--muted); font-size: 0.9rem; margin-top: 5px; display: flex; gap: 14px; flex-wrap: wrap; }
.profile-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Ícone das seções em quadradinho colorido */
.secao-btn .ico { width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft); display: inline-grid; place-items: center; font-size: 1.05rem; flex-shrink: 0; }

.secoes { display: grid; gap: 13px; }
.secao { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--bg-card); box-shadow: var(--shadow-soft); }
.secao-btn { width: 100%; display: flex; align-items: center; gap: 12px; padding: 18px 20px; cursor: pointer; background: transparent; border: none; color: var(--text); font-weight: 700; font-size: 1.04rem; text-align: left; }
.secao-btn .ico { font-size: 1.2rem; }
.secao-btn .seta { margin-left: auto; transition: transform 0.3s var(--ease); color: var(--accent-ink); }
.secao.aberta .secao-btn .seta { transform: rotate(180deg); }
.secao-body { display: none; padding: 4px 20px 22px; }
.secao.aberta .secao-body { display: block; }
.dado { padding: 12px 0; border-top: 1px solid var(--line); }
.dado:first-child { border-top: none; }
.dado .rotulo { color: var(--muted); font-size: 0.83rem; margin-bottom: 3px; }
.dado .valor { font-size: 1rem; }
.vazio { color: var(--muted-2); font-style: italic; }

.obs-box { margin-top: 8px; }
.obs-box textarea { min-height: 130px; }
.obs-feedback { font-size: 0.88rem; margin-left: 12px; color: var(--ok); opacity: 0; transition: opacity 0.2s ease; }
.obs-feedback.show { opacity: 1; }

/* ── Rodapé ──────────────────────────────────────────────────── */
.rodape { text-align: center; color: var(--muted-2); font-size: 0.82rem; padding: 32px 0; border-top: 1px solid var(--line); margin-top: 44px; }
.rodape a { color: var(--muted); }

/* Rodapé público (logo + CRN + aviso profissional + privacidade) */
.rodape-pub { border-top: 1px solid var(--line); margin-top: 56px; padding: 40px 0 48px; }
.rodape-pub-inner { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 11px; }
.rodape-logo { width: 168px; max-width: 60%; height: auto; margin-bottom: 2px; }
.rodape-cargo { color: var(--muted); font-size: 0.92rem; margin: 0; }
.rodape-nota { color: var(--muted-2); font-size: 0.84rem; line-height: 1.55; margin: 0 auto; max-width: 540px; }
.rodape-nota a { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 2px; }
.rodape-nota a:hover { color: var(--accent-2); }
.rodape-copy { color: var(--muted-2); font-size: 0.8rem; margin: 8px 0 0; }

/* =====================================================================
   FORMULÁRIO DO PACIENTE — reforço Apple (espaçoso, premium)
   (aplica-se a tudo que NÃO é painel admin)
   ===================================================================== */
body:not(.admin) { --radius: 28px; }
body:not(.admin) .card { padding: 42px; }
body:not(.admin) .hero-wrap { min-height: calc(100vh - 70px); padding: 72px 0; }
body:not(.admin) .hero-box { max-width: 640px; }
body:not(.admin) .hero-box .h1 { font-size: clamp(2.2rem, 6.4vw, 3.2rem); line-height: 1.04; }
body:not(.admin) .lead { font-size: 1.12rem; }
body:not(.admin) .step-title { font-size: 1.58rem; }
body:not(.admin) .step-sub { margin-bottom: 32px; }
body:not(.admin) .field { margin-bottom: 28px; }
body:not(.admin) input[type=text],
body:not(.admin) input[type=email],
body:not(.admin) input[type=tel],
body:not(.admin) textarea { padding: 16px 18px; }

/* =====================================================================
   PÁGINAS PÚBLICAS (ficha + login) — tema escuro suave (Apple/Linear/Stripe)
   Escopo: body:not(.admin). O painel (body.admin) tem seu próprio escuro.
   Charcoal leve (sem preto absoluto), dourado preservado, brilho contido.
   ===================================================================== */
body:not(.admin) {
  --bg: #161719;
  --bg-soft: #1d1e22;
  --bg-card: #1f2125;
  --bg-input: #25272c;
  --bg-track: rgba(255, 255, 255, 0.06);
  --text: #f1efea;
  --muted: #aaa8a2;
  --muted-2: #76746f;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --accent-ink: #e6c578;
  --accent-soft: rgba(201, 162, 77, 0.14);
  --shadow-soft: 0 1px 2px rgba(0, 0, 0, 0.30);
  --shadow: 0 10px 34px rgba(0, 0, 0, 0.40);

  background:
    radial-gradient(circle at top left, rgba(201, 162, 77, 0.07), transparent 36rem),
    radial-gradient(circle at 92% 6%, rgba(201, 162, 77, 0.05), transparent 28rem),
    var(--bg);
}

/* Header e barra de progresso: vidro escuro */
body:not(.admin) .topbar   { background: rgba(20, 21, 23, 0.72); }
body:not(.admin) .progress { background: rgba(20, 21, 23, 0.86); }

/* Botões e marca: brilho contido, sem sombras exageradas */
body:not(.admin) .btn         { box-shadow: 0 2px 10px rgba(0, 0, 0, 0.28); }
body:not(.admin) .btn:hover   { box-shadow: 0 6px 18px rgba(201, 162, 77, 0.22); }
body:not(.admin) .brand-mark  { box-shadow: 0 2px 10px rgba(0, 0, 0, 0.32); }

/* Select no escuro: seta e opções legíveis */
body:not(.admin) select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' stroke='%23e6c578' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
}
body:not(.admin) select option { background: #1f2125; color: var(--text); }

/* Segmented control (Sim/Não): hover no escuro */
body:not(.admin) .opcoes.cols-2 .opcao:hover { background: rgba(255, 255, 255, 0.06); }

/* Orientação discreta — mesmo padrão em TODOS os seletores (lista e Sim/Não) */
body:not(.admin) .field:has(> .opcoes)::after {
  content: "Basta clicar em uma das opções.";
  display: block;
  font-size: 0.78rem;
  color: #8f8d87;
  letter-spacing: 0.01em;
  margin-top: 8px;
}

/* =====================================================================
   PAINEL ADMIN — reforço Vercel (branco puro, mono, alto contraste)
   ===================================================================== */
body.admin {
  background: #161719;
  --bg-soft: #1d1e22;
  --bg-card: #1f2125;
  --bg-input: #25272c;
  --bg-track: rgba(255, 255, 255, 0.06);
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #f1efea;
  --muted: #aaa8a2;
  --muted-2: #76746f;
  --accent-ink: #e6c578;
  --accent-soft: rgba(201, 162, 77, 0.14);
}
body.admin .topbar { background: rgba(20, 21, 23, 0.78); border-bottom-color: var(--line); }
body.admin select option { background: #1f2125; color: var(--text); }
body.admin .card,
body.admin .metric,
body.admin .secao,
body.admin .paciente-card { box-shadow: none; border-radius: 10px; }
body.admin .metric { background: var(--bg-card); padding: 18px 20px; }
body.admin .metric .num {
  font-family: ui-monospace, "SF Mono", "Cascadia Code", "JetBrains Mono", "Roboto Mono", monospace;
  font-weight: 600; font-size: 1.85rem; letter-spacing: -0.03em;
}
body.admin .metric .rot { font-size: 0.74rem; letter-spacing: 0.08em; }
body.admin .paciente-card:hover { transform: none; box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4); border-color: rgba(255, 255, 255, 0.28); }
body.admin .paciente-zap { font-family: ui-monospace, "SF Mono", "JetBrains Mono", monospace; font-size: 0.82rem; }
body.admin .secao-btn { font-weight: 700; }
body.admin .h1 { letter-spacing: -0.005em; font-size: clamp(1.6rem, 4vw, 2.05rem); }
body.admin input, body.admin select, body.admin textarea { border-radius: 9px; }
body.admin .badge { border-radius: 6px; }
body.admin .chip { border-radius: 7px; }
body.admin .btn, body.admin .btn-ghost { border-radius: 9px; }

/* =====================================================================
   DASHBOARD SHELL — sidebar + topo (estilo referência: Vercel/Linear)
   Usado no painel (body.admin). Ícones SVG inline (sem dependências).
   ===================================================================== */
.app { display: flex; min-height: 100vh; align-items: stretch; }

/* Sidebar */
.sidebar {
  width: 256px; flex-shrink: 0; position: sticky; top: 0; height: 100vh;
  background: #1b1c20; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 24px 16px;
}
.sidebar-brand { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 6px 0 22px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.sidebar-brand .brand-mark { width: 64px; height: 64px; font-size: 1.3rem; border-radius: 18px; margin-bottom: 8px; }
.sidebar-brand strong { font-size: 1.05rem; font-weight: 800; letter-spacing: -0.01em; }
.sidebar-brand small { color: var(--muted); font-size: 0.82rem; }
.sidebar-nav { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.nav-item { display: flex; align-items: center; gap: 13px; padding: 11px 13px; border-radius: 10px; color: var(--muted); font-weight: 600; font-size: 0.94rem; transition: background-color 0.15s var(--ease), color 0.15s var(--ease); }
.nav-item svg { width: 20px; height: 20px; flex-shrink: 0; stroke-width: 1.8; }
.nav-item:hover { background: var(--bg-soft); color: var(--text); }
.nav-item.ativo { background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; }
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 0.72rem; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.help-card { margin-top: 16px; padding: 16px; border-radius: 14px; background: var(--bg-soft); border: 1px solid var(--line); text-align: left; }
.help-card .ht { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 0.9rem; }
.help-card p { margin: 4px 0 12px; color: var(--muted); font-size: 0.8rem; }
.help-card .btn { width: 100%; min-height: 38px; font-size: 0.82rem; }

/* Coluna principal */
.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.app-topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 34px; background: rgba(20, 21, 23, 0.82);
  backdrop-filter: saturate(180%) blur(16px); border-bottom: 1px solid var(--line);
}
.greet-title { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.06rem; letter-spacing: -0.01em; }
.greet-sub { color: var(--muted); font-size: 0.88rem; margin-top: 1px; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.icon-btn { position: relative; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--bg-card); color: var(--muted); cursor: pointer; transition: background-color 0.15s var(--ease), color 0.15s var(--ease); }
.icon-btn svg { width: 20px; height: 20px; stroke-width: 1.8; }
.icon-btn:hover { background: var(--bg-soft); color: var(--text); }
.dot-badge { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: #161719; font-size: 0.68rem; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; border: 2px solid var(--bg-card); }

.app-content { padding: 30px 34px 50px; flex: 1; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.page-head .h1 { display: flex; align-items: center; gap: 12px; margin: 0 0 4px; }
.page-head .h1 svg { width: 30px; height: 30px; stroke-width: 1.8; color: var(--accent-ink); }
.page-head .lead { font-size: 0.96rem; margin: 0; }

/* Botão escuro (ação primária — estilo Vercel) */
.btn-dark { background: #f1efea; color: #17181c; border: none; box-shadow: 0 2px 10px rgba(0,0,0,0.30); }
.btn-dark:hover { background: #ffffff; box-shadow: 0 6px 18px rgba(0,0,0,0.40); }

/* Cards de métrica com mini-gráfico */
body.admin .dash { gap: 16px; margin: 0 0 24px; }
body.admin .metric { position: relative; overflow: hidden; padding: 20px 20px 0; min-height: 138px; }
.metric-head { display: flex; align-items: center; gap: 14px; }
.metric-ico { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; }
.metric-ico svg { width: 24px; height: 24px; stroke-width: 1.9; }
.metric-head .num { font-size: 1.9rem; line-height: 1; }
.metric-head .rot { color: var(--text); font-size: 0.82rem; font-weight: 700; text-transform: none; letter-spacing: 0; margin-top: 4px; }
.metric-head .rot small { display: block; color: var(--muted-2); font-weight: 500; font-size: 0.76rem; }
.spark { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 48px; display: block; }
.ico-gold   { background: rgba(201,162,77,0.14); color: var(--accent-ink); }
.ico-purple { background: rgba(127,119,221,0.14); color: #6a5acd; }
.ico-blue   { background: rgba(55,138,221,0.14);  color: #2f7fd0; }
.ico-green  { background: rgba(47,158,110,0.14);  color: #2f9e6e; }
.sp-gold   { color: var(--accent); }
.sp-purple { color: #7f77dd; }
.sp-blue   { color: #378add; }
.sp-green  { color: #2f9e6e; }

/* Chips com ícone */
.chip { display: inline-flex; align-items: center; gap: 7px; }
.chip svg { width: 16px; height: 16px; stroke-width: 1.9; }

/* ── Menu agrupado (rótulos de seção + selo "em breve") ─────────── */
.nav-group { margin: 16px 0 4px; padding: 0 13px; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted-2); }
.nav-group:first-child { margin-top: 0; }
.nav-soon { margin-left: auto; font-size: 0.62rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted-2); background: var(--bg-track); border: 1px solid var(--line); padding: 2px 7px; border-radius: 999px; }

/* ── Cards de métrica: 2 colunas ────────────────────────────────── */
body.admin .dash-2 { grid-template-columns: repeat(2, 1fr); }

/* ── Faixa dinâmica abaixo do título ────────────────────────────── */
.faixa-dinamica { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; padding: 7px 14px; border-radius: 999px; background: var(--accent-soft); border: 1px solid rgba(201, 162, 77, 0.32); color: var(--accent-ink); font-size: 0.86rem; font-weight: 600; }
.faixa-dinamica strong { font-weight: 800; }
.faixa-dinamica svg { flex-shrink: 0; }

/* ── Seção "Hoje" ───────────────────────────────────────────────── */
.hoje-box { background: var(--bg-card); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; margin: 0 0 24px; }
.hoje-titulo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 0.92rem; color: var(--text); margin-bottom: 14px; }
.hoje-titulo svg { color: var(--accent-ink); }
.hoje-itens { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.hoje-item { display: flex; align-items: baseline; gap: 10px; padding: 12px 14px; border-radius: 10px; background: var(--bg-soft); border: 1px solid var(--line); }
.hoje-num { font-family: ui-monospace, "SF Mono", "JetBrains Mono", monospace; font-size: 1.5rem; font-weight: 700; line-height: 1; color: var(--accent-ink); }
.hoje-rot { color: var(--muted); font-size: 0.84rem; font-weight: 600; }
.hoje-rot small { color: var(--muted-2); font-weight: 500; }

/* ── Card do paciente enriquecido ───────────────────────────────── */
.paciente-info .meta .zap-inline { font-family: ui-monospace, "SF Mono", "JetBrains Mono", monospace; font-size: 0.82rem; color: var(--muted); }

/* ── Páginas-stub "Em breve" (Agenda / Consultas) ───────────────── */
.em-breve { max-width: 540px; margin: 40px auto; text-align: center; }
.em-breve-ico { width: 84px; height: 84px; margin: 0 auto 18px; border-radius: 24px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); }
.em-breve .h1 { justify-content: center; }
.em-breve-tag { font-size: 0.66rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent-ink); background: var(--accent-soft); border: 1px solid rgba(201, 162, 77, 0.32); padding: 4px 10px; border-radius: 999px; vertical-align: middle; }
.em-breve .lead { margin: 8px 0 22px; }

/* Responsivo do shell */
@media (max-width: 920px) {
  .app { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; flex-direction: row; align-items: center; gap: 10px; padding: 12px 16px; overflow-x: auto; border-right: none; border-bottom: 1px solid var(--line); }
  .sidebar-brand { flex-direction: row; gap: 10px; padding: 0 10px 0 0; margin: 0; border-bottom: none; border-right: 1px solid var(--line); }
  .sidebar-brand .brand-mark { width: 40px; height: 40px; font-size: 0.9rem; margin: 0; border-radius: 12px; }
  .sidebar-brand strong, .sidebar-brand small { display: none; }
  .sidebar-logo { max-width: none; width: auto; height: 42px; margin: 0; }
  .sidebar-nav { flex-direction: row; gap: 4px; flex: 0 0 auto; }
  .nav-item span.lbl { display: none; }
  .nav-item { padding: 10px; }
  .nav-group, .nav-soon { display: none; }
  .help-card { display: none; }
  .app-topbar { padding: 14px 18px; }
  .app-content { padding: 22px 18px 40px; }
  .page-head { flex-direction: column; }
}

/* Toast (aviso flutuante) */
.toast-wrap { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: #17181c; color: #fff; padding: 11px 18px; border-radius: 12px; font-size: 0.9rem; font-weight: 600; box-shadow: 0 12px 34px rgba(0, 0, 0, 0.28); opacity: 0; transform: translateY(12px); transition: opacity 0.25s var(--ease), transform 0.25s var(--ease); }
.toast.show { opacity: 1; transform: none; }

/* ── Impressão / PDF ─────────────────────────────────────────── */
.print-header { display: none; }
@media print {
  @page { margin: 1.4cm; }
  body { background: #fff !important; color: #000 !important; line-height: 1.45; }
  .topbar, .sidebar, .app-topbar, .rodape, .form-nav, .no-print, .obs-feedback, .secao-btn .seta { display: none !important; }
  .app-content { padding: 0 !important; }
  .print-header { display: block; text-align: center; border-bottom: 2px solid #000; padding-bottom: 10px; margin-bottom: 18px; font-size: 11pt; }
  .print-header strong { font-size: 13pt; }
  main.container { width: 100%; }
  .h1 { font-size: 18pt; color: #000 !important; margin: 4px 0 8px; }
  .lead { color: #333 !important; }
  .secao, .card { box-shadow: none !important; border: 1px solid #bbb !important; background: #fff !important; break-inside: avoid; margin-bottom: 10px; }
  .secao-body { display: block !important; padding-top: 0; }
  .secao-btn { color: #000 !important; padding: 10px 14px; font-size: 12pt; }
  .dado { padding: 6px 0; border-top: 1px solid #ddd; }
  .dado .rotulo { color: #555 !important; }
  .dado .valor, .vazio { color: #000 !important; }
  .obs-box textarea { border: 1px solid #bbb !important; background: #fff !important; color: #000 !important; min-height: 80px; }
}

/* ── Responsivo ──────────────────────────────────────────────── */
@media (max-width: 620px) {
  .dash { grid-template-columns: 1fr 1fr; }
  .hoje-itens { grid-template-columns: 1fr; }
  .metric-head { flex-wrap: wrap; }
}
@media (max-width: 560px) {
  .card { padding: 24px; }
  body:not(.admin) .card { padding: 22px; }   /* vence a regra de 42px no mobile */
  .grid-horarios { grid-template-columns: 1fr; }
  .form-nav { flex-wrap: wrap; }
  .form-nav .btn { max-width: none; }
  .brand small { font-size: 0.66rem; }
  .resumo-item { flex-direction: column; gap: 2px; }
  .resumo-item span { text-align: left; }
  .filtros .btn-export { margin-left: 0; width: 100%; }
}
