/* AS Diagnóstico Capilar — design system
   Paleta: azul profundo · branco · cinza claro · ciano tecnológico */
:root {
  --navy-950: #050f24;
  --navy-900: #071a3a;
  --navy-800: #0b2452;
  --navy-700: #12306a;
  --azul: #1463e6;
  --azul-claro: #e8f0fe;
  --ciano: #1bb6d6;
  --ciano-claro: #e3f7fb;
  --ok: #16a34a;
  --ok-2: #22c55e;
  --warn: #d99a06;
  --warn-2: #facc15;
  --bad: #dc2626;
  --bad-2: #ef4444;
  --bg: #f2f5fa;
  --card: #ffffff;
  --borda: #e3e9f2;
  --texto: #0e1b31;
  --texto-2: #3c4a62;
  --muted: #6b7a92;
  --raio: 14px;
  --sombra: 0 1px 2px rgba(10, 30, 70, .05), 0 6px 24px rgba(10, 30, 70, .06);
  --sidebar: 248px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 14px; color: var(--texto); background: var(--bg); line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--azul); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.01em; }
h1 { font-size: 24px; font-weight: 700; }
h2 { font-size: 18px; font-weight: 600; }
h3 { font-size: 15px; font-weight: 600; }
h4 { font-size: 13px; font-weight: 600; margin: 18px 0 10px; color: var(--texto-2); }
p { margin: 0 0 10px; }
code, kbd { font-family: ui-monospace, Consolas, monospace; font-size: 12px; background: #eef2f8; border: 1px solid var(--borda); border-radius: 5px; padding: 1px 5px; }
kbd { font-size: 11px; }
.ic { width: 20px; height: 20px; flex: none; }
.muted { color: var(--muted); }
.centro { text-align: center; }
.dir { margin-left: auto; text-align: right; }
.flex1 { flex: 1; }
.mt { margin-top: 14px; }
.mb { margin-bottom: 10px; }
.nowrap { white-space: nowrap; }
.inline { display: inline; }
.txt-ok { color: var(--ok); } .txt-warn { color: var(--warn); } .txt-bad { color: var(--bad); }
[hidden] { display: none !important; }

/* ---------- Estrutura ---------- */
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); background: radial-gradient(120% 60% at 0% 100%, rgba(27,182,214,.18), transparent 60%), linear-gradient(180deg, var(--navy-900), var(--navy-950)); color: #cfd9ea; padding: 22px 16px; display: flex; flex-direction: column; z-index: 30; }
.sidebar nav { display: flex; flex-direction: column; gap: 4px; margin-top: 28px; }
.sidebar nav a { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 10px; color: #d6e0f0; font-weight: 500; transition: background .15s; }
.sidebar nav a:hover { background: rgba(255,255,255,.06); text-decoration: none; }
.sidebar nav a.ativo { background: linear-gradient(90deg, var(--azul), #1d4fd8); color: #fff; box-shadow: 0 6px 20px rgba(20,99,230,.35); }
.sidebar-frase { margin-top: auto; font-size: 13px; color: #9fb0cc; line-height: 1.5; padding: 0 6px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; }
.brand img { width: 46px; height: 46px; }
.brand strong { display: block; font-size: 17px; letter-spacing: .02em; font-weight: 600; }
.brand strong span { font-weight: 300; }
.brand small { display: block; font-size: 8.5px; letter-spacing: .38em; opacity: .8; }
.brand-login { justify-content: center; }
.brand-login img { width: 54px; height: 54px; }
.brand-login.brand-custom img { width: auto; height: auto; max-height: 90px; max-width: 320px; }

.main { margin-left: var(--sidebar); min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; height: 72px; padding: 0 28px; background: linear-gradient(90deg, var(--navy-900), var(--navy-800)); color: #fff; }
.topbar-titulo { display: flex; align-items: center; gap: 12px; margin: 0 auto; }
.topbar-titulo .ic { width: 32px; height: 32px; color: var(--ciano); }
.topbar-titulo strong { display: block; font-size: 18px; font-weight: 600; }
.topbar-titulo small { color: #b8c6de; font-size: 12px; }
.topbar-user { display: flex; align-items: center; gap: 12px; }
.topbar-user strong { display: block; font-size: 13px; }
.topbar-user small { color: #b8c6de; font-size: 12px; }
.btn-icone { color: #cfd9ea; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; }
.btn-icone:hover { background: rgba(255,255,255,.08); }
.btn-menu { display: none; background: none; border: 0; color: #fff; font-size: 22px; cursor: pointer; }
.conteudo { padding: 24px 28px 60px; max-width: 1480px; margin: 0 auto; }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--ciano), var(--azul)); color: #fff; font-weight: 600; flex: none; }
img.avatar { object-fit: cover; background: #e8eef6; }
.avatar-xs { width: 24px; height: 24px; font-size: 10px; }
.avatar-sm { width: 32px; height: 32px; font-size: 13px; }
.avatar-lg { width: 60px; height: 60px; font-size: 24px; }
.avatar-xl { width: 120px; height: 120px; font-size: 42px; box-shadow: 0 0 0 4px #fff, 0 0 0 6px var(--ciano-claro); }
.topbar-user > a { display: block; border-radius: 50%; }
.topbar-user > a:hover { box-shadow: 0 0 0 2px var(--ciano); }
.pessoa-inline { display: inline-flex; gap: 8px; }

/* Perfil e identidade visual */
.perfil-edicao { display: flex; gap: 24px; align-items: flex-start; flex-wrap: wrap; }
.foto-edicao { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.foto-edicao-linha { flex-direction: row; align-items: center; gap: 16px; }
.foto-edicao .btn { flex-direction: row; cursor: pointer; }
.logo-previas { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.logo-previa { height: 120px; border-radius: 12px; display: grid; place-items: center; padding: 16px; border: 1px solid var(--borda); }
.logo-previa.escuro { background: linear-gradient(135deg, var(--navy-800), var(--navy-950)); }
.logo-previa.claro { background: #fff; }
.logo-previa img { max-width: 100%; max-height: 88px; object-fit: contain; }
.favicon-previa { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; padding: 14px; border-radius: 12px; background: #eef2f8; margin-bottom: 14px; }
.aba-falsa { display: flex; align-items: center; gap: 8px; width: 250px; padding: 8px 12px; border-radius: 10px 10px 0 0; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.12); font-size: 12px; }
.aba-falsa img { width: 16px; height: 16px; object-fit: contain; flex: none; }
.aba-falsa span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aba-falsa i { font-style: normal; color: var(--muted); }
.favicon-tamanhos { display: flex; align-items: flex-end; gap: 16px; }
.favicon-tamanhos figure { margin: 0; text-align: center; }
.favicon-tamanhos img { display: block; margin: 0 auto 4px; object-fit: contain; background: repeating-conic-gradient(#dfe5ee 0 25%, #fff 0 50%) 0 0 / 8px 8px; border-radius: 4px; }
.favicon-tamanhos figcaption { font-size: 11px; color: var(--muted); }
label.btn { flex-direction: row; cursor: pointer; color: var(--texto); }

/* Logo personalizada (imagem já contém o nome do salão) */
.brand-custom img { width: auto; height: auto; max-width: 100%; max-height: 64px; object-fit: contain; }
.sidebar .brand-custom { justify-content: center; }
.card-marca .brand-custom img { max-height: 48px; }

/* ---------- Componentes ---------- */
.card { background: var(--card); border: 1px solid var(--borda); border-radius: var(--raio); padding: 20px; box-shadow: var(--sombra); margin-bottom: 18px; }
.card-tit { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.card-tit .ic { color: var(--azul); }
.card-centro { max-width: 560px; margin: 40px auto; }
.card-centro h2 { margin-bottom: 14px; }
.pagina-topo { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.pagina-topo h1 + p { margin: 2px 0 0; }
.acoes, .linha { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.pilha { display: flex; flex-direction: column; gap: 10px; }
.pilha > .card { margin-bottom: 8px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border-radius: 10px; border: 1px solid var(--borda); background: #fff; color: var(--texto); font: inherit; font-weight: 500; cursor: pointer; transition: all .15s; white-space: nowrap; }
.btn:hover { border-color: #c8d3e3; background: #f7f9fc; text-decoration: none; }
.btn .ic { width: 18px; height: 18px; }
.btn-primario { background: linear-gradient(180deg, #1f6ff0, var(--azul)); border-color: var(--azul); color: #fff; box-shadow: 0 4px 14px rgba(20,99,230,.28); }
.btn-primario:hover { background: #1157cc; border-color: #1157cc; }
.btn-sucesso { background: linear-gradient(180deg, #19b06a, #0f9a5a); border-color: #0f9a5a; color: #fff; }
.btn-sucesso:hover { background: #0d8a50; }
.btn-escuro { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.18); color: #fff; }
.btn-escuro:hover { background: rgba(255,255,255,.12); }
.btn-perigo { color: var(--bad); border-color: #f5c6c6; }
.btn-perigo:hover { background: #fff1f1; }
.btn-fantasma { border-color: transparent; background: transparent; color: var(--muted); }
.btn-sm { padding: 5px 10px; font-size: 12.5px; border-radius: 8px; }
.btn-lg { padding: 13px 22px; font-size: 15px; }
.btn-bloco { width: 100%; }
.btn:disabled { opacity: .6; cursor: progress; }
.link-sm { font-size: 12.5px; }
.pill { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; background: #eef2f8; color: var(--texto-2); white-space: nowrap; }
.pill-ok { background: #e3f7ea; color: #127a3b; } .pill-warn { background: #fdf3d6; color: #8a6200; } .pill-bad { background: #fde6e6; color: #a61b1b; } .pill-info { background: var(--ciano-claro); color: #0b6f86; } .pill-muted { color: var(--muted); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.dot.ok { background: var(--ok-2); } .dot.warn { background: var(--warn-2); } .dot.bad { background: var(--bad-2); }
.alerta { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; border: 1px solid; display: flex; gap: 10px; align-items: flex-start; }
.alerta-ok { background: #effaf3; border-color: #bfe8cd; color: #11602f; }
.alerta-erro { background: #fff3f3; border-color: #f5c6c6; color: #8f1d1d; }
.alerta-info { background: var(--azul-claro); border-color: #c8dafc; color: #163f8c; }
.alerta-aviso { background: #fff9e8; border-color: #f3dc9b; color: #6e5100; }
.vazio { text-align: center; padding: 36px 16px; color: var(--muted); }
.vazio .ic { width: 40px; height: 40px; color: #b9c6da; margin-bottom: 6px; }
.vazio-sm { padding: 20px; }

/* Formulários */
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; color: var(--texto-2); }
input, select, textarea { font: inherit; color: var(--texto); padding: 10px 12px; border: 1px solid #d5deeb; border-radius: 10px; background: #fff; width: 100%; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--azul); box-shadow: 0 0 0 3px rgba(20,99,230,.12); }
textarea { resize: vertical; }
input[type=checkbox], input[type=radio] { width: auto; }
label.check { flex-direction: row; align-items: flex-start; gap: 10px; font-weight: 400; color: var(--texto); }
label.check input { margin-top: 3px; accent-color: var(--azul); }
.form-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.form-grid .col-2 { grid-column: span 2; } .form-grid .col-4 { grid-column: 1 / -1; }
.form-pilha { display: flex; flex-direction: column; gap: 14px; }
.form-acoes { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding-top: 6px; }
fieldset { border: 1px solid var(--borda); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
legend { font-weight: 600; padding: 0 6px; }
.lgpd small { color: var(--muted); display: block; }
.busca { position: relative; display: flex; align-items: center; }
.busca .ic { position: absolute; left: 11px; width: 17px; color: var(--muted); }
.busca input { padding-left: 36px; min-width: 260px; }
.sel-mini { width: auto; max-width: 240px; padding: 6px 10px; font-size: 12.5px; margin-left: auto; }

/* Chips (seleção na anamnese) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; flex-direction: row; cursor: pointer; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span, .chip-estatico { padding: 7px 13px; border-radius: 99px; border: 1px solid #d5deeb; background: #fff; font-size: 13px; font-weight: 500; color: var(--texto-2); transition: all .12s; user-select: none; }
.chip:hover span { border-color: var(--azul); }
.chip input:checked + span { background: var(--azul); border-color: var(--azul); color: #fff; }
.chip input:focus-visible + span { box-shadow: 0 0 0 3px rgba(20,99,230,.25); }
.chip-estatico { display: inline-block; background: var(--ciano-claro); border-color: transparent; color: #0b6f86; }

/* Tabelas */
.tabela-wrap { overflow-x: auto; margin: 0 -4px; }
.tabela { width: 100%; border-collapse: collapse; }
.tabela th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 10px 12px; border-bottom: 1px solid var(--borda); white-space: nowrap; }
.tabela td { padding: 12px; border-bottom: 1px solid #eef2f7; vertical-align: middle; }
.tabela tr:last-child td { border-bottom: 0; }
.tabela tr.clicavel { cursor: pointer; }
.tabela tr.clicavel:hover td { background: #f7faff; }
.tabela-compacta td, .tabela-compacta th { padding: 7px 10px; }
.tabela .apagado td { color: #a5b1c4; }
.pessoa { display: flex; align-items: center; gap: 12px; }
.pessoa b { display: block; }
.pessoa small { color: var(--muted); font-size: 12px; }
.pessoa-lg h1 { font-size: 22px; }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 18px; }
.kpi { background: var(--card); border: 1px solid var(--borda); border-radius: var(--raio); box-shadow: var(--sombra); padding: 18px 20px; display: flex; gap: 16px; align-items: center; }
.kpi-ic { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--azul-claro); color: var(--azul); flex: none; }
.kpi-ic .ic { width: 24px; height: 24px; }
.kpi small { display: block; color: var(--muted); font-size: 12.5px; }
.kpi b { display: flex; align-items: baseline; gap: 10px; font-size: 26px; font-weight: 700; margin: 2px 0; }
.var { font-size: 12px; font-weight: 600; }
.var.up { color: var(--ok); } .var.down { color: var(--bad); }

/* Anéis */
.anel { position: relative; flex: none; }
.anel svg { width: 100%; height: 100%; display: block; }
.anel .trilho { stroke: #e8eef6; }
.anel-ok .g1 { stop-color: var(--ciano); } .anel-ok .g2 { stop-color: var(--ok-2); }
.anel-warn .g1 { stop-color: #f59e0b; } .anel-warn .g2 { stop-color: var(--warn-2); }
.anel-bad .g1 { stop-color: #f97316; } .anel-bad .g2 { stop-color: var(--bad-2); }
.anel-muted .g1, .anel-muted .g2 { stop-color: #cbd5e1; }
.anel-txt { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.anel-txt b { font-size: 15px; font-weight: 700; color: var(--navy-800); }
.anel[style*="150px"] .anel-txt b, .anel[style*="170px"] .anel-txt b { font-size: 36px; }
.anel-txt small { font-size: 12px; color: var(--muted); }

/* ---------- Etapas ---------- */
.etapas { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.etapa { display: flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 500; }
.etapa b { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: #e2e8f2; font-size: 12px; color: var(--texto-2); }
.etapa.ativa { color: var(--texto); } .etapa.ativa b { background: var(--azul); color: #fff; box-shadow: 0 0 0 4px rgba(20,99,230,.15); }
.etapa.feita { color: var(--ok); } .etapa.feita b { background: #dff5e7; color: var(--ok); }
.etapas > i { flex: 0 1 50px; height: 2px; background: #dbe3ee; }

/* ---------- Anamnese ---------- */
.anamnese .card h3 { margin-bottom: 14px; color: var(--navy-800); }
.anamnese-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px 28px; }
.campo { display: flex; flex-direction: column; gap: 8px; }
.campo-textarea, .campo-multi { grid-column: 1 / -1; }
.campo-rot { font-size: 13px; font-weight: 600; color: var(--texto-2); }
.cliente-faixa { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.barra-fixa { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: 10px; padding: 14px 0; background: linear-gradient(transparent, var(--bg) 35%); }

/* ---------- Captura ---------- */
.captura-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.card-camera { background: linear-gradient(180deg, #0a1d40, #071530); border-color: #0f2a5a; color: #fff; }
.card-camera .card-tit .ic { color: var(--ciano); }
.card-camera .sel-mini { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.2); }
.card-camera .sel-mini option { color: #000; }
.visor { position: relative; aspect-ratio: 4 / 3; background: #000; border-radius: 12px; overflow: hidden; }
.visor video { width: 100%; height: 100%; object-fit: cover; transition: transform .2s; }
.visor-moldura { position: absolute; inset: 14px; pointer-events: none; }
.visor-moldura i { position: absolute; width: 34px; height: 34px; border: 2px solid rgba(255,255,255,.75); }
.visor-moldura i:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.visor-moldura i:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; }
.visor-moldura i:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; }
.visor-moldura i:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; }
.visor-mira { position: absolute; left: 50%; top: 50%; width: 40px; height: 40px; margin: -20px 0 0 -20px; border: 1px solid rgba(27,182,214,.7); border-radius: 50%; pointer-events: none; }
.visor-mira::before, .visor-mira::after { content: ""; position: absolute; background: rgba(27,182,214,.7); }
.visor-mira::before { left: 50%; top: -10px; bottom: -10px; width: 1px; }
.visor-mira::after { top: 50%; left: -10px; right: -10px; height: 1px; }
.visor-zoom { position: absolute; top: 18px; right: 22px; font-size: 16px; font-weight: 600; text-shadow: 0 1px 3px #000; }
.visor-status, .visor-regiao { position: absolute; bottom: 18px; padding: 4px 10px; border-radius: 99px; background: rgba(0,0,0,.55); font-size: 12px; backdrop-filter: blur(4px); }
.visor-status { left: 18px; }
.visor-status i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #f59e0b; margin-right: 4px; }
.visor-status.ok i { background: var(--ok-2); box-shadow: 0 0 8px var(--ok-2); }
.visor-regiao { right: 18px; color: var(--ciano); font-weight: 600; }
.visor-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.visor-flash.on { animation: flash .35s ease-out; }
@keyframes flash { 0% { opacity: .85; } 100% { opacity: 0; } }
.visor-erro { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 30px; background: rgba(5,15,36,.9); color: #e5ecf7; line-height: 1.6; }
.cam-ctrl { display: flex; justify-content: center; gap: 8px; margin: 14px 0 10px; }
.cam-ctrl button { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 64px; padding: 8px 10px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: #dce6f5; font: inherit; font-size: 12px; cursor: pointer; }
.cam-ctrl button:hover { background: rgba(255,255,255,.07); }
.cam-ctrl button.on { border-color: rgba(27,182,214,.6); color: var(--ciano); }
.cam-ctrl button#bt-zoom-menos, .cam-ctrl button#bt-zoom-mais { font-size: 20px; min-width: 40px; justify-content: center; }
.regioes { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.regioes button { padding: 6px 11px; border-radius: 99px; border: 1px solid rgba(255,255,255,.18); background: transparent; color: #cdd8ea; font: inherit; font-size: 12px; cursor: pointer; }
.regioes button.ativo { background: var(--ciano); border-color: var(--ciano); color: #04263a; font-weight: 600; }
/* Mapa da cabeça (seleção de região) */
.regiao-seletor { display: grid; grid-template-columns: 175px 1fr; gap: 18px; align-items: start; margin-bottom: 14px; padding: 14px; border-radius: 12px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); }
.regiao-tit { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: #9fb0cc; margin-bottom: 8px; }
.regiao-seletor .regioes { margin-bottom: 10px; }
.regiao-dica { margin: 0; font-size: 12.5px; line-height: 1.5; color: #dce6f5; padding: 8px 12px; border-left: 3px solid var(--bad-2); background: rgba(239,68,68,.08); border-radius: 0 8px 8px 0; }
.regiao-dica:empty { display: none; }
.mapa-cabeca { width: 100%; height: auto; display: block; }
.mapa-cabeca .orelha, .mapa-cabeca .nariz { fill: rgba(255,255,255,.1); stroke: rgba(255,255,255,.4); stroke-width: 1.2; }
.mapa-cabeca .contorno { fill: none; stroke: rgba(255,255,255,.75); stroke-width: 2; pointer-events: none; }
.mapa-cabeca .reg > * { fill: rgba(255,255,255,.05); stroke: rgba(255,255,255,.28); stroke-width: 1; transition: fill .15s; }
.mapa-cabeca .reg { cursor: pointer; }
.mapa-cabeca .reg:hover > * { fill: rgba(27,182,214,.28); }
.mapa-cabeca .reg.feito > * { fill: rgba(34,197,94,.18); }
.mapa-cabeca .reg.ativo > * { fill: rgba(239,68,68,.7); stroke: #ef4444; animation: pulsa-reg 1.4s ease-in-out infinite; }
@keyframes pulsa-reg { 50% { fill: rgba(239,68,68,.38); } }
.mapa-cabeca .rot { font-size: 8px; font-weight: 600; letter-spacing: .08em; fill: #9fb0cc; pointer-events: none; }
.mapa-cabeca .badge { pointer-events: none; }
.mapa-cabeca .badge circle { fill: var(--ok-2); stroke: #071530; stroke-width: 1.5; }
.mapa-cabeca .badge text { font-size: 9.5px; font-weight: 700; fill: #052e16; }
.mapa-box.sem-area { opacity: .55; }
/* Versão para fundo claro (relatórios) */
.mapa-claro .orelha, .mapa-claro .nariz { fill: #eef2f8; stroke: #9aa8bf; }
.mapa-claro .contorno { stroke: #3c4a62; }
.mapa-claro .reg > * { fill: #f6f8fb; stroke: #c9d3e2; }
.mapa-claro .reg.feito > * { fill: rgba(34,197,94,.35); }
.mapa-claro .rot { fill: #6b7a92; }
.mapa-claro .badge circle { stroke: #fff; }
@media (max-width: 560px) { .regiao-seletor { grid-template-columns: 1fr; } .mapa-box { max-width: 170px; margin: 0 auto; } }

.cam-acoes { display: flex; gap: 10px; }
.cam-acoes kbd { background: rgba(255,255,255,.2); border-color: transparent; color: #fff; }
.dica { margin: 12px 0 0; font-size: 12px; color: #9fb0cc; }
.dica a { color: var(--ciano); }
.dica kbd { background: rgba(255,255,255,.12); color: #fff; border-color: transparent; }

.cliente-mini { padding: 10px 14px; background: #f5f8fc; border-radius: 10px; margin-bottom: 14px; }
.cliente-mini b { display: block; } .cliente-mini small { color: var(--muted); }
.galeria { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; max-height: 560px; overflow-y: auto; padding: 2px; }
.vazio-galeria { padding: 30px 10px; }
.foto-card { border: 1px solid var(--borda); border-radius: 12px; overflow: hidden; cursor: pointer; background: #fff; transition: box-shadow .15s, transform .15s; }
.foto-card:hover { box-shadow: var(--sombra); transform: translateY(-1px); }
.foto-card.erro { border-color: #f5c6c6; }
.foto-img { position: relative; aspect-ratio: 4 / 3; background: #0b1730; overflow: hidden; }
.foto-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.scanline { position: absolute; left: 0; right: 0; height: 30%; background: linear-gradient(180deg, transparent, rgba(27,182,214,.45), transparent); animation: scan 1.6s linear infinite; }
@keyframes scan { 0% { top: -30%; } 100% { top: 100%; } }
.foto-info { padding: 8px 10px; }
.foto-info b { display: block; font-size: 12.5px; }
.foto-info small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--muted); font-size: 11.5px; line-height: 1.4; margin-top: 2px; }
.foto-rodape { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-top: 6px; font-size: 12px; }
.foto-status { color: var(--muted); font-size: 11.5px; }
.foto-status.scan { color: #0b8fb0; font-weight: 600; }
.marc { display: flex; align-items: center; gap: 2px; font-weight: 600; }
.marc .dot { width: 8px; height: 8px; margin: 0 2px 0 6px; } .marc .dot:first-child { margin-left: 0; }
.legenda-ia { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--muted); margin: 14px 0; }

.modal { border: 0; border-radius: 16px; padding: 0; max-width: 1000px; width: calc(100% - 32px); box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.modal::backdrop { background: rgba(5,15,36,.6); backdrop-filter: blur(3px); }
.modal-corpo { position: relative; padding: 22px; }
.modal-x { position: absolute; top: 10px; right: 14px; border: 0; background: none; font-size: 26px; cursor: pointer; color: var(--muted); }
.modal-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 22px; }
.modal-grid img { width: 100%; border-radius: 12px; display: block; background: #000; }
.modal-grid h3 { margin-bottom: 8px; }
.modal-grid label { margin-top: 10px; }
.barras { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.barra { display: grid; grid-template-columns: 150px 1fr 32px; align-items: center; gap: 10px; font-size: 12.5px; }
.barra > div { height: 8px; background: #edf1f7; border-radius: 99px; overflow: hidden; }
.barra i { display: block; height: 100%; border-radius: 99px; }
.barra i.ok { background: linear-gradient(90deg, var(--ciano), var(--ok-2)); } .barra i.warn { background: var(--warn-2); } .barra i.bad { background: var(--bad-2); } .barra i.info { background: linear-gradient(90deg, var(--azul), var(--ciano)); }
.barra b { text-align: right; }
.lista { margin: 8px 0; padding-left: 18px; } .lista li { margin-bottom: 4px; }
.lista-marc { margin: 8px 0; padding-left: 22px; font-size: 12.5px; color: var(--texto-2); } .lista-marc li { margin-bottom: 3px; }

.processando { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: rgba(5,15,36,.82); backdrop-filter: blur(6px); color: #fff; }
.processando-box { text-align: center; max-width: 420px; padding: 20px; }
.processando h2 { margin: 22px 0 16px; }
.processando ul { list-style: none; padding: 0; margin: 0 0 14px; text-align: left; display: inline-block; }
.processando li { padding: 5px 0 5px 28px; position: relative; color: #8193b2; }
.processando li::before { content: ""; position: absolute; left: 4px; top: 11px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid #3b4d6e; }
.processando li.ativo { color: #fff; } .processando li.ativo::before { border-color: var(--ciano); border-top-color: transparent; animation: gira .8s linear infinite; }
.processando li.feito { color: #9be8b6; } .processando li.feito::before { background: var(--ok-2); border-color: var(--ok-2); }
@keyframes gira { to { transform: rotate(360deg); } }
.scanner { width: 150px; height: 150px; margin: 0 auto; border-radius: 50%; border: 2px solid rgba(27,182,214,.5); position: relative; overflow: hidden; background: radial-gradient(circle, rgba(27,182,214,.15), transparent 70%); }
.scanner div { position: absolute; inset: 0; background: conic-gradient(from 0deg, transparent 0 300deg, rgba(27,182,214,.8) 360deg); animation: gira 1.6s linear infinite; }

/* ---------- Resultado ---------- */
.resultado-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.resultado-topo { display: flex; gap: 28px; align-items: center; flex-wrap: wrap; }
.tabela-class { border-collapse: collapse; flex: 1; min-width: 240px; background: #f8fafd; border-radius: 12px; overflow: hidden; }
.tabela-class td { padding: 8px 14px; font-size: 13px; color: var(--texto-2); }
.tabela-class td b { color: var(--texto); }
.indicadores { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; text-align: center; }
.indicadores > div { display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 12px; color: var(--texto-2); }
.mapeamento { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; }
.mapeamento > img { width: 100%; border-radius: 12px; display: block; background: #000; }
.legenda-vert { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.legenda-vert li { display: grid; grid-template-columns: 18px 1fr; }
.legenda-vert b { font-size: 13px; } .legenda-vert small { grid-column: 2; color: var(--muted); font-size: 12px; }
.legenda-vert .dot { margin-top: 5px; }
.miniaturas { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.miniaturas button { padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; cursor: pointer; background: #000; aspect-ratio: 4/3; }
.miniaturas button:hover { border-color: var(--ciano); }
.miniaturas img { width: 100%; height: 100%; object-fit: cover; display: block; }
.texto p { color: var(--texto-2); line-height: 1.65; }
.regioes-achados, .hipoteses { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.regioes-achados > div, .hipoteses > div { background: #f8fafd; border: 1px solid #edf1f7; border-radius: 10px; padding: 12px 14px; }
.regioes-achados p, .hipoteses p { margin: 4px 0 0; font-size: 13px; color: var(--texto-2); }
.hipoteses b { display: block; margin-top: 6px; }
.dados { display: grid; grid-template-columns: 120px 1fr; gap: 8px 12px; margin: 0; font-size: 13px; }
.dados dt { color: var(--muted); } .dados dd { margin: 0; font-weight: 500; }
.dados-2 { grid-template-columns: 180px 1fr; }
.resumo { color: var(--texto-2); line-height: 1.65; margin-top: 10px; }
.evolucao-box { border-left: 3px solid var(--ciano); background: var(--ciano-claro); padding: 10px 14px; border-radius: 0 10px 10px 0; margin-top: 12px; }
.evolucao-box p { margin: 4px 0 0; font-size: 13px; }
.evol-melhora { border-color: var(--ok); background: #eefaf2; } .evol-piora { border-color: var(--bad); background: #fff3f3; }
.lista-check { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 9px; }
.lista-check li { display: grid; grid-template-columns: 22px 1fr; gap: 6px; font-size: 13px; color: var(--texto-2); }
.lista-check .ic { width: 18px; height: 18px; color: var(--azul); }
.nota { font-size: 12px; color: var(--muted); }

/* ---------- Dashboard ---------- */
.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 18px; align-items: start; }
.card-cta { display: flex; gap: 14px; align-items: center; background: linear-gradient(135deg, var(--azul), #0b3fa8); color: #fff; border: 0; }
.card-cta:hover { text-decoration: none; filter: brightness(1.05); }
.card-cta .ic { width: 34px; height: 34px; }
.card-cta b { display: block; font-size: 15px; } .card-cta small { opacity: .85; }
.card-marca { background: radial-gradient(80% 120% at 0% 100%, rgba(27,182,214,.35), transparent 60%), linear-gradient(135deg, var(--navy-800), var(--navy-950)); color: #fff; border: 0; display: flex; flex-direction: column; justify-content: space-between; min-height: 180px; }
.card-marca h3 { color: var(--ciano); font-size: 18px; } .card-marca p { color: #c7d3e8; }
.brand-claro { align-self: flex-end; }
.lista-retorno { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.lista-retorno li { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.kpis-4 .kpi b { font-size: 22px; }

/* Gráfico */
.grafico { width: 100%; height: auto; display: block; }
.grafico .grade { stroke: #edf1f7; }
.grafico .eixo { font-size: 11px; fill: var(--muted); }
.grafico .linha { fill: none; stroke-width: 2.5; stroke-linejoin: round; }
.grafico .ponto { stroke: #fff; stroke-width: 2; }
.grafico .area { opacity: .12; }
.s1 { stroke: var(--azul); fill: var(--azul); } .s2 { stroke: var(--ciano); fill: var(--ciano); } .s3 { stroke: var(--ok-2); fill: var(--ok-2); } .s4 { stroke: #f59e0b; fill: #f59e0b; } .s5 { stroke: #8b5cf6; fill: #8b5cf6; }
.grafico .linha.s1, .grafico .linha.s2, .grafico .linha.s3, .grafico .linha.s4, .grafico .linha.s5 { fill: none; }
.grafico-legenda { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.grafico-legenda i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.grafico-legenda i.s1 { background: var(--azul); } .grafico-legenda i.s2 { background: var(--ciano); } .grafico-legenda i.s3 { background: var(--ok-2); } .grafico-legenda i.s4 { background: #f59e0b; } .grafico-legenda i.s5 { background: #8b5cf6; }

/* Abas / ficha */
.abas { display: flex; gap: 4px; border-bottom: 1px solid var(--borda); margin: -6px -4px 18px; overflow-x: auto; }
.abas button { padding: 10px 16px; border: 0; background: none; font: inherit; font-weight: 500; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.abas button.ativo { color: var(--azul); border-color: var(--azul); }
.evol-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 24px; }
.evol-grid h4 { margin-top: 0; }
.comparativo { margin-bottom: 22px; }
.comp-par { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.comp-par figure, .galeria-grade a { margin: 0; }
.comp-par img { width: 100%; border-radius: 10px; display: block; aspect-ratio: 4/3; object-fit: cover; background: #000; }
.comp-par figcaption { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.galeria-grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.galeria-grade a { display: block; border-radius: 10px; overflow: hidden; border: 1px solid var(--borda); color: var(--texto-2); }
.galeria-grade img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; background: #000; }
.galeria-grade span { display: block; padding: 6px 10px; font-size: 12px; }

/* Toasts */
.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast { padding: 12px 18px; border-radius: 10px; background: var(--navy-900); color: #fff; box-shadow: 0 10px 30px rgba(0,0,0,.25); max-width: 380px; transition: opacity .4s, transform .4s; }
.toast-erro { background: #9f1c1c; }
.toast.sai { opacity: 0; transform: translateY(10px); }

/* Login */
.tela-login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(70% 60% at 0% 100%, rgba(27,182,214,.25), transparent 60%), radial-gradient(60% 50% at 100% 0%, rgba(20,99,230,.35), transparent 60%), linear-gradient(135deg, var(--navy-900), var(--navy-950)); }
.login-wrap { width: 100%; max-width: 410px; display: flex; flex-direction: column; align-items: center; gap: 26px; }
.login-card { width: 100%; max-width: 410px; background: #fff; border-radius: 20px; padding: 34px 32px; box-shadow: 0 30px 80px rgba(0,0,0,.35); display: flex; flex-direction: column; gap: 14px; }
.login-card h1 { font-size: 20px; text-align: center; }
.login-card > .muted { text-align: center; margin-top: -8px; }
.login-rodape { text-align: center; font-size: 11.5px; color: var(--muted); margin: 4px 0 0; }

/* ---------- Responsivo ---------- */
@media (max-width: 1200px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .resultado-grid, .dash-grid { grid-template-columns: 1fr; }
}
@media (max-width: 980px) {
  .captura-grid, .modal-grid, .mapeamento, .evol-grid { grid-template-columns: 1fr; }
  .indicadores { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s; }
  body.menu-aberto .sidebar { transform: none; box-shadow: 20px 0 60px rgba(0,0,0,.4); }
  .main { margin-left: 0; }
  .btn-menu { display: block; }
  .topbar { padding: 0 16px; }
  .topbar-titulo small, .hide-sm { display: none; }
  .conteudo { padding: 16px; }
  .form-grid, .anamnese-grid { grid-template-columns: 1fr; }
  .form-grid .col-2 { grid-column: auto; }
  .busca input { min-width: 0; }
}
@media (max-width: 560px) {
  .kpis { grid-template-columns: 1fr; }
  .indicadores { grid-template-columns: repeat(2, 1fr); }
  .barra { grid-template-columns: 110px 1fr 28px; }
  .cam-acoes { flex-direction: column; }
}
