/* =====================================================================
   Dra. Estela Oxley — Estética Avançada · App de gestão
   ===================================================================== */
@font-face { font-family: 'Cormorant'; src: url(../fonts/cormorant-garamond-latin-400-normal.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Cormorant'; src: url(../fonts/cormorant-garamond-latin-500-normal.woff2) format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Cormorant'; src: url(../fonts/cormorant-garamond-latin-600-normal.woff2) format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Cormorant'; src: url(../fonts/cormorant-garamond-latin-400-italic.woff2) format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'Jost'; src: url(../fonts/jost-latin-300-normal.woff2) format('woff2'); font-weight: 300; font-display: swap; }
@font-face { font-family: 'Jost'; src: url(../fonts/jost-latin-400-normal.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Jost'; src: url(../fonts/jost-latin-500-normal.woff2) format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Jost'; src: url(../fonts/jost-latin-600-normal.woff2) format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Allura'; src: url(../fonts/allura-latin-400-normal.woff2) format('woff2'); font-display: swap; }

:root {
  --rosa: #B7766C; --rosa-2: #D9A99C; --rosa-3: #F3E6E0; --rosa-4: #FAF1EE;
  --vinho: #7A2E2E; --vinho-2: #5E2222;
  --bg: #FBF7F5; --card: #FFFFFF; --texto: #3E2A26; --muted: #8A6F68; --linha: #EEDFD8;
  --ok: #5F8F6E; --ok-bg: #E7F2EA; --alerta: #C0453B; --alerta-bg: #FBEAE8; --aviso: #C98A3A; --aviso-bg: #FBF1E2;
  --raio: 18px; --raio-s: 12px; --sombra: 0 2px 10px rgba(122, 46, 46, .06), 0 10px 30px rgba(122, 46, 46, .05);
  --serif: 'Cormorant', Georgia, serif; --sans: 'Jost', -apple-system, system-ui, sans-serif; --script: 'Allura', cursive;
  --side: 248px; --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
}
body.escuro {
  --bg: #1E1716; --card: #2A2120; --texto: #F2E6E1; --muted: #BFA8A0; --linha: #3D302D; --rosa-3: #3A2B28; --rosa-4: #302422;
  --ok-bg: #22332A; --alerta-bg: #3D2321; --aviso-bg: #3A2E1E; --sombra: 0 2px 10px rgba(0,0,0,.3);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--sans); font-size: 16px; color: var(--texto); background: var(--bg); -webkit-font-smoothing: antialiased; overscroll-behavior: none; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--vinho); }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; color: var(--vinho); margin: 0; letter-spacing: .01em; }
h1 { font-size: 34px; line-height: 1.1; } h2 { font-size: 26px; } h3 { font-size: 21px; }
.over { font-size: 11.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--rosa); font-weight: 500; }
.muted { color: var(--muted); } .small { font-size: 13.5px; } .tiny { font-size: 12px; }
.right { text-align: right; } .center { text-align: center; } .nowrap { white-space: nowrap; }
.hidden { display: none !important; }
svg.i { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ------------------------------------------------------------------ layout */
#app { display: flex; height: 100%; }
.side { width: var(--side); flex: none; background: var(--card); border-right: 1px solid var(--linha); display: flex; flex-direction: column; padding: calc(18px + var(--safe-t)) 14px 14px; overflow-y: auto; }
.side .brand { display: flex; flex-direction: column; align-items: center; padding: 4px 6px 18px; border-bottom: 1px solid var(--linha); margin-bottom: 10px; }
.side .brand img { width: 150px; }
body.escuro .side .brand img, body.escuro .logo-auto { filter: brightness(0) invert(.92) sepia(.2); }
.nav a { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px; color: var(--texto); text-decoration: none; font-size: 15.5px; margin: 1px 0; }
.nav a svg { color: var(--rosa); }
.nav a.on { background: var(--rosa-3); color: var(--vinho); font-weight: 500; }
.nav a.on svg { color: var(--vinho); }
.nav .grp { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 16px 14px 6px; }
.side .rodape { margin-top: auto; padding-top: 12px; font-size: 12.5px; color: var(--muted); }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 10px; padding: calc(12px + var(--safe-t)) 24px 12px; border-bottom: 1px solid var(--linha); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); position: sticky; top: 0; z-index: 20; min-height: 64px; }
.top .titulo { flex: 1; min-width: 0; }
.top .titulo h2 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .menu-btn { display: none; }
.view { flex: 1; overflow-y: auto; padding: 22px 24px calc(40px + var(--safe-b)); -webkit-overflow-scrolling: touch; }
.sync-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); display: inline-block; }
.sync-dot.pend { background: var(--aviso); } .sync-dot.off { background: #aaa; } .sync-dot.err { background: var(--alerta); }

@media (max-width: 1100px) { :root { --side: 84px; } .side .brand img { width: 52px; content: url(../img/monograma.png); } .nav a { justify-content: center; padding: 13px 0; } .nav a span, .nav .grp, .side .rodape span { display: none; } }
@media (max-width: 700px) {
  .side { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 60; transform: translateX(-100%); transition: transform .25s; box-shadow: var(--sombra); }
  .side.aberta { transform: none; } .side .brand img { width: 140px; content: url(../img/logo.png); }
  .nav a { justify-content: flex-start; padding: 12px 14px; } .nav a span, .nav .grp { display: inline; } .nav .grp { display: block; }
  .top .menu-btn { display: inline-flex; } .view { padding: 16px 14px calc(40px + var(--safe-b)); } .top { padding-left: 12px; padding-right: 12px; }
}

/* ------------------------------------------------------------------ componentes */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--linha); background: var(--card); padding: 11px 18px; border-radius: 999px; font-size: 15px; font-weight: 500; cursor: pointer; min-height: 46px; white-space: nowrap; color: var(--texto); text-decoration: none; transition: transform .08s, background .15s; }
.btn:active { transform: scale(.97); }
.btn.p { background: var(--vinho); border-color: var(--vinho); color: #fff; }
.btn.r { background: var(--rosa); border-color: var(--rosa); color: #fff; }
.btn.s { background: var(--rosa-3); border-color: var(--rosa-3); color: var(--vinho); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.danger { color: var(--alerta); border-color: color-mix(in srgb, var(--alerta) 30%, transparent); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.sm { min-height: 36px; padding: 6px 13px; font-size: 13.5px; }
.btn.ico { width: 46px; padding: 0; } .btn.sm.ico { width: 36px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn.wa { background: #25D366; border-color: #25D366; color: #fff; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; } .row.between { justify-content: space-between; } .row.nw { flex-wrap: nowrap; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 14px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } }
.card { background: var(--card); border-radius: var(--raio); box-shadow: var(--sombra); padding: 20px; border: 1px solid color-mix(in srgb, var(--linha) 60%, transparent); }
.card.flat { box-shadow: none; }
.card h3 + * { margin-top: 12px; }
.card.click { cursor: pointer; } .card.click:active { transform: scale(.995); }
.kpi .v { font-family: var(--serif); font-size: 34px; color: var(--vinho); line-height: 1.1; margin-top: 6px; }
.kpi .d { font-size: 13px; color: var(--muted); margin-top: 4px; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; background: var(--rosa-3); color: var(--vinho); font-weight: 500; white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); } .badge.al { background: var(--alerta-bg); color: var(--alerta); } .badge.av { background: var(--aviso-bg); color: var(--aviso); } .badge.cinza { background: var(--linha); color: var(--muted); }
.alerta { background: var(--alerta-bg); color: var(--alerta); border-radius: var(--raio-s); padding: 12px 16px; display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; }
.aviso { background: var(--aviso-bg); color: #8a5a1c; border-radius: var(--raio-s); padding: 12px 16px; font-size: 14.5px; }
.info { background: var(--rosa-4); border-radius: var(--raio-s); padding: 12px 16px; font-size: 14.5px; }
.list { display: flex; flex-direction: column; }
.li { display: flex; align-items: center; gap: 14px; padding: 13px 4px; border-bottom: 1px solid var(--linha); cursor: pointer; min-height: 60px; }
.li:last-child { border-bottom: 0; }
.li .t { font-weight: 500; } .li .s { font-size: 13.5px; color: var(--muted); margin-top: 2px; }
.avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--rosa-3); color: var(--vinho); display: grid; place-items: center; font-family: var(--serif); font-size: 19px; flex: none; overflow: hidden; background-size: cover; background-position: center; }
.avatar.g { width: 84px; height: 84px; font-size: 34px; }
.empty { text-align: center; color: var(--muted); padding: 36px 16px; }
.empty svg { width: 42px; height: 42px; color: var(--rosa-2); margin-bottom: 8px; }
.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; margin-bottom: 18px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { border: 0; background: transparent; padding: 9px 15px; border-radius: 999px; font-size: 14.5px; color: var(--muted); white-space: nowrap; cursor: pointer; }
.tabs button.on { background: var(--vinho); color: #fff; }
.seg { display: inline-flex; background: var(--rosa-3); border-radius: 999px; padding: 4px; }
.seg button { border: 0; background: transparent; padding: 7px 14px; border-radius: 999px; font-size: 14px; color: var(--vinho); cursor: pointer; }
.seg button.on { background: var(--card); box-shadow: 0 1px 4px rgba(0,0,0,.08); font-weight: 500; }
.bar { height: 10px; border-radius: 99px; background: var(--rosa-3); overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--rosa), var(--vinho)); border-radius: 99px; }
.dots { display: flex; gap: 6px; flex-wrap: wrap; }
.dots i { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--rosa-2); display: grid; place-items: center; font-style: normal; font-size: 11px; color: var(--rosa); }
.dots i.f { background: var(--rosa); border-color: var(--rosa); color: #fff; }
table.t { width: 100%; border-collapse: collapse; font-size: 14.5px; }
table.t th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase; padding: 8px 8px; border-bottom: 1px solid var(--linha); }
table.t td { padding: 11px 8px; border-bottom: 1px solid var(--linha); vertical-align: top; }
table.t tr.click { cursor: pointer; }
.money { font-variant-numeric: tabular-nums; white-space: nowrap; }
.pos { color: var(--ok); } .neg { color: var(--alerta); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--linha); background: var(--card); font-size: 14px; cursor: pointer; user-select: none; }
.chip.on { background: var(--vinho); border-color: var(--vinho); color: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

/* ------------------------------------------------------------------ formulários */
.f { display: block; }
.f > span { display: block; font-size: 13px; color: var(--muted); margin: 0 0 6px 2px; }
.in, .f input:not([type=checkbox]):not([type=radio]):not([type=range]), .f select, .f textarea {
  width: 100%; border: 1px solid var(--linha); background: var(--card); border-radius: var(--raio-s); padding: 12px 14px; font-size: 16px; min-height: 48px; outline: none; transition: border .15s, box-shadow .15s; }
.f textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.in:focus, .f input:focus, .f select:focus, .f textarea:focus { border-color: var(--rosa); box-shadow: 0 0 0 4px color-mix(in srgb, var(--rosa) 15%, transparent); }
.f select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23B7766C' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; }
.fgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.fgrid .full { grid-column: 1 / -1; }
@media (max-width: 600px) { .fgrid { grid-template-columns: 1fr; } }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 6px 0; }
.check input { width: 22px; height: 22px; accent-color: var(--vinho); }
.sn { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--linha); }
.sn .q { flex: 1; }
.sn .seg button.sim.on { background: var(--alerta); color: #fff; }
.search { position: relative; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 19px; }
.search input { padding-left: 42px !important; }
.secao { margin: 26px 0 10px; display: flex; align-items: center; gap: 10px; }
.secao::after { content: ''; flex: 1; height: 1px; background: var(--linha); }

/* ------------------------------------------------------------------ modais */
.ov { position: fixed; inset: 0; background: rgba(40, 20, 18, .38); z-index: 80; display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade .18s; backdrop-filter: blur(2px); }
.modal { background: var(--bg); border-radius: 24px; width: 100%; max-width: 640px; max-height: calc(100% - 20px); display: flex; flex-direction: column; box-shadow: 0 30px 80px rgba(0,0,0,.25); animation: up .22s; overflow: hidden; }
.modal.lg { max-width: 920px; } .modal.xl { max-width: 1180px; }
.modal .mh { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--linha); background: var(--card); }
.modal .mh h3 { flex: 1; }
.modal .mb { padding: 20px 22px; overflow-y: auto; flex: 1; -webkit-overflow-scrolling: touch; }
.modal .mf { padding: 14px 22px calc(14px + var(--safe-b)); border-top: 1px solid var(--linha); background: var(--card); display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.ov.full { padding: 0; } .ov.full .modal { max-width: none; max-height: none; height: 100%; border-radius: 0; }
@media (max-width: 700px) { .ov { padding: 0; align-items: flex-end; } .modal { max-height: 94%; border-radius: 22px 22px 0 0; } }
@keyframes fade { from { opacity: 0 } } @keyframes up { from { transform: translateY(24px); opacity: 0 } }
.toast { position: fixed; left: 50%; bottom: calc(26px + var(--safe-b)); transform: translateX(-50%); background: var(--texto); color: var(--bg); padding: 13px 22px; border-radius: 999px; z-index: 200; font-size: 15px; box-shadow: var(--sombra); animation: up .2s; max-width: 90vw; }
.fab { position: fixed; right: 26px; bottom: calc(26px + var(--safe-b)); z-index: 30; width: 62px; height: 62px; border-radius: 50%; background: var(--vinho); color: #fff; border: 0; box-shadow: 0 10px 28px rgba(122,46,46,.35); display: grid; place-items: center; cursor: pointer; }
.fab svg { width: 28px; height: 28px; }

/* ------------------------------------------------------------------ login / bloqueio */
.login { min-height: 100%; width: 100%; display: grid; place-items: center; padding: 24px; background: radial-gradient(1200px 600px at 20% 0%, #fff 0%, transparent 60%), linear-gradient(160deg, #FBF5F2, #F1DFD8); }
.login .box { width: 100%; max-width: 420px; text-align: center; }
.login .box img { width: 260px; margin-bottom: 26px; }
.login form { background: rgba(255,255,255,.7); border-radius: 26px; padding: 26px; box-shadow: var(--sombra); text-align: left; backdrop-filter: blur(10px); }
.pin { display: flex; gap: 14px; justify-content: center; margin: 22px 0; }
.pin i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--rosa); }
.pin i.f { background: var(--rosa); }
.teclado { display: grid; grid-template-columns: repeat(3, 84px); gap: 14px; justify-content: center; }
.teclado button { height: 84px; border-radius: 50%; border: 1px solid var(--linha); background: rgba(255,255,255,.75); font-size: 28px; font-family: var(--serif); color: var(--vinho); cursor: pointer; }
.teclado button:active { background: var(--rosa-3); }

/* ------------------------------------------------------------------ privacidade */
body.privado .sens { filter: blur(14px) !important; }
body.privado .sens-t { filter: blur(6px); }

/* ------------------------------------------------------------------ agenda */
.ag-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.ag-wrap { background: var(--card); border-radius: var(--raio); box-shadow: var(--sombra); overflow: hidden; }
.ag-cols { display: grid; border-bottom: 1px solid var(--linha); position: sticky; top: 0; background: var(--card); z-index: 3; }
.ag-cols div { padding: 10px 6px; text-align: center; font-size: 13px; color: var(--muted); border-left: 1px solid var(--linha); }
.ag-cols div b { display: block; font-family: var(--serif); font-size: 24px; color: var(--texto); font-weight: 500; }
.ag-cols div.hoje b { color: #fff; background: var(--vinho); border-radius: 50%; width: 38px; height: 38px; line-height: 38px; margin: 2px auto 0; }
.ag-body { display: grid; position: relative; max-height: calc(100vh - 230px); overflow-y: auto; }
.ag-horas div { height: var(--hh); font-size: 12px; color: var(--muted); text-align: right; padding: 0 8px; transform: translateY(-7px); }
.ag-dia { position: relative; border-left: 1px solid var(--linha); background-image: repeating-linear-gradient(to bottom, var(--linha) 0 1px, transparent 1px var(--hh)); }
.ag-dia.fechado { background-color: color-mix(in srgb, var(--linha) 35%, transparent); }
.ag-ev { position: absolute; left: 3px; right: 3px; border-radius: 10px; padding: 5px 8px; font-size: 12.5px; overflow: hidden; cursor: pointer; border-left: 4px solid var(--c, var(--rosa)); background: color-mix(in srgb, var(--c, var(--rosa)) 16%, var(--card)); line-height: 1.25; touch-action: none; user-select: none; }
.ag-ev b { display: block; font-weight: 500; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-ev.bloq { background: repeating-linear-gradient(45deg, var(--rosa-4), var(--rosa-4) 6px, var(--card) 6px, var(--card) 12px); border-left-color: var(--muted); color: var(--muted); }
.ag-ev.st-cancelado, .ag-ev.st-faltou { opacity: .45; text-decoration: line-through; }
.ag-ev.st-atendido { --c: var(--ok); }
.ag-ev.st-confirmado::after { content: '✓'; position: absolute; right: 6px; top: 4px; color: var(--ok); font-weight: 700; }
.ag-ev.drag { opacity: .85; box-shadow: 0 10px 24px rgba(0,0,0,.18); z-index: 5; }
.ag-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--alerta); z-index: 2; }
.ag-now::before { content: ''; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--alerta); }
.mes { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--linha); }
.mes > div { background: var(--card); min-height: 104px; padding: 6px; font-size: 12px; cursor: pointer; }
.mes > div.fora { opacity: .4; } .mes > div.hoje .n { background: var(--vinho); color: #fff; }
.mes .n { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-size: 13px; }
.mes .ev { border-radius: 6px; padding: 2px 6px; margin-top: 3px; background: color-mix(in srgb, var(--c, var(--rosa)) 18%, var(--card)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mes-h { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-size: 12px; color: var(--muted); padding: 8px 0; }

/* ------------------------------------------------------------------ paciente */
.pac-head { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.pac-head .nome { font-family: var(--serif); font-size: 32px; color: var(--vinho); line-height: 1.1; }
.timeline { position: relative; padding-left: 26px; }
.timeline::before { content: ''; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 2px; background: var(--linha); }
.timeline .ti { position: relative; padding: 0 0 18px; cursor: pointer; }
.timeline .ti::before { content: ''; position: absolute; left: -23px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--c, var(--rosa)); box-shadow: 0 0 0 4px var(--bg); }
.timeline .ti .d { font-size: 12.5px; color: var(--muted); }

/* ------------------------------------------------------------------ fotos */
.fotos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.foto { position: relative; border-radius: 14px; overflow: hidden; aspect-ratio: 3/4; background: var(--rosa-3); cursor: pointer; }
.foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.foto .lb { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 8px 7px; background: linear-gradient(transparent, rgba(0,0,0,.55)); color: #fff; font-size: 12px; }
.foto.sel { outline: 4px solid var(--vinho); outline-offset: -4px; }
.foto .num { position: absolute; top: 8px; right: 8px; background: var(--vinho); color: #fff; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; }
.cam { position: fixed; inset: 0; background: #000; z-index: 120; display: flex; flex-direction: column; color: #fff; }
.cam .stage { position: relative; flex: 1; overflow: hidden; display: grid; place-items: center; }
.cam video, .cam .ghost, .cam .prev { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cam .ghost { opacity: .35; pointer-events: none; }
.cam .guia, .cam .grade { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.cam .topo { position: absolute; top: 0; left: 0; right: 0; padding: calc(14px + var(--safe-t)) 18px 30px; background: linear-gradient(rgba(0,0,0,.6), transparent); display: flex; gap: 12px; align-items: flex-start; z-index: 3; }
.cam .baixo { padding: 16px 20px calc(18px + var(--safe-b)); background: #000; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.cam .disparo { width: 78px; height: 78px; border-radius: 50%; border: 5px solid #fff; background: rgba(255,255,255,.25); cursor: pointer; }
.cam .disparo:active { background: #fff; }
.cam .btn { background: rgba(255,255,255,.14); border-color: transparent; color: #fff; }
.cam .angs { display: flex; gap: 6px; flex-wrap: wrap; }
.cam .angs i { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,.3); }
.cam .angs i.f { background: var(--rosa-2); } .cam .angs i.a { background: #fff; transform: scale(1.3); }
.cmp-stage { position: relative; background: #111; border-radius: 16px; overflow: hidden; touch-action: none; }
.cmp-slider { position: relative; aspect-ratio: 3/4; max-height: 70vh; margin: auto; overflow: hidden; border-radius: 16px; touch-action: none; }
.cmp-slider img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cmp-slider .depois { clip-path: inset(0 0 0 50%); }
.cmp-slider .handle { position: absolute; top: 0; bottom: 0; left: 50%; width: 3px; background: #fff; transform: translateX(-50%); }
.cmp-slider .handle::after { content: '‹ ›'; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 44px; height: 44px; border-radius: 50%; background: #fff; color: var(--vinho); display: grid; place-items: center; font-weight: 700; }
.cmp-slider .tag { position: absolute; top: 12px; padding: 4px 12px; border-radius: 99px; background: rgba(0,0,0,.45); color: #fff; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; }

/* ------------------------------------------------------------------ mapa facial */
.mapa-wrap { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(280px, .9fr); gap: 20px; }
@media (max-width: 900px) { .mapa-wrap { grid-template-columns: 1fr; } }
.mapa-svg { width: 100%; max-height: 72vh; touch-action: none; display: block; margin: auto; background: var(--card); border-radius: 18px; }
.mapa-svg .pt circle { fill: var(--vinho); stroke: #fff; stroke-width: 2; }
.mapa-svg .pt text { fill: #fff; font-size: 11px; font-weight: 600; text-anchor: middle; dominant-baseline: central; font-family: var(--sans); pointer-events: none; }
.mapa-svg .zona { fill: var(--rosa); opacity: 0; transition: opacity .2s; }
.mapa-svg.zonas .zona { opacity: .10; }
.reg-l .li { min-height: 48px; padding: 9px 4px; }
.qtd-btns { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.qtd-btns button { min-height: 52px; border-radius: 12px; border: 1px solid var(--linha); background: var(--card); font-size: 18px; cursor: pointer; }
.qtd-btns button.on { background: var(--vinho); color: #fff; border-color: var(--vinho); }

/* ------------------------------------------------------------------ assinatura */
.sig { position: relative; border: 1.5px dashed var(--rosa-2); border-radius: 16px; background: #fff; touch-action: none; }
.sig canvas { width: 100%; height: 180px; display: block; border-radius: 16px; }
.sig .lim { position: absolute; top: 8px; right: 8px; }
.sig .lin { position: absolute; left: 24px; right: 24px; bottom: 40px; border-bottom: 1px solid #ddd; pointer-events: none; }
.sig .ph { position: absolute; left: 0; right: 0; bottom: 14px; text-align: center; font-size: 12px; color: #b9a39c; pointer-events: none; }

/* ------------------------------------------------------------------ documento (visual dos documentos dela) */
.docv { background: #fff; color: #3B2A27; max-width: 820px; margin: 0 auto; padding: 56px 64px 48px; position: relative; font-family: var(--sans); font-size: 14.5px; line-height: 1.55; box-shadow: var(--sombra); border-radius: 6px; overflow: hidden; }
.docv .moldura { position: absolute; inset: 14px; border: 1px solid #E3C3B8; border-radius: 4px; pointer-events: none; }
.docv .canto { position: absolute; left: 0; top: 0; width: 170px; height: 220px; pointer-events: none; }
.docv .canto.b { left: auto; top: auto; right: 0; bottom: 0; transform: rotate(180deg); }
.docv .ramo { position: absolute; right: 26px; top: 22px; width: 130px; pointer-events: none; }
.docv .cab { text-align: center; position: relative; }
.docv .cab img { width: 210px; }
.docv h1.dt { font-family: var(--serif); font-size: 27px; color: #3B2A27; text-align: center; margin: 14px 0 0; font-weight: 600; text-transform: uppercase; letter-spacing: .01em; }
.docv h2.ds { font-family: var(--serif); font-size: 29px; color: var(--vinho); text-align: center; margin: 0 0 4px; font-weight: 600; text-transform: uppercase; }
.docv .div { text-align: center; color: var(--rosa); margin: 4px 0 16px; font-size: 10px; letter-spacing: 2px; }
.docv .div::before, .docv .div::after { content: ''; display: inline-block; width: 150px; height: 1px; background: #D9A99C; vertical-align: middle; margin: 0 8px; }
.docv h3.sec { font-family: var(--sans); font-size: 15px; color: var(--vinho); text-align: center; margin: 18px 0 8px; font-weight: 500; letter-spacing: .04em; display: flex; align-items: center; gap: 12px; }
.docv h3.sec::before, .docv h3.sec::after { content: ''; flex: 1; height: 1px; background: #E3C3B8; }
.docv p { margin: 0 0 8px; }
.docv ul { margin: 4px 0 8px; padding-left: 18px; columns: 2; column-gap: 26px; }
.docv ul li { break-inside: avoid; margin-bottom: 2px; }
.docv ul li::marker { color: var(--vinho); }
.docv .campo { display: inline-block; min-width: 200px; border-bottom: 1px solid #C9A99F; padding: 0 6px; }
.docv .opts { display: flex; gap: 40px; justify-content: center; margin: 8px 0; }
.docv .assin { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 30px; text-align: center; }
.docv .assin img { height: 80px; max-width: 100%; object-fit: contain; display: block; margin: 0 auto -6px; }
.docv .assin .l { border-top: 1px solid #8e7068; padding-top: 6px; font-size: 13px; }
.docv .rod { text-align: center; font-size: 11px; color: #9b827b; margin-top: 26px; }
.docv .ver { position: absolute; bottom: 22px; left: 0; right: 0; text-align: center; font-size: 10px; color: #b9a39c; }
.docv table.tb { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: 13.5px; }
.docv table.tb th { background: #F6E6E0; color: #5E2A2A; font-weight: 500; font-family: var(--serif); font-size: 14px; padding: 8px; border: 1px solid #EBD3CB; }
.docv table.tb td { border: 1px solid #EBD3CB; padding: 8px; vertical-align: middle; }
.docv table.tb td img { height: 42px; }
@media (max-width: 700px) { .docv { padding: 40px 22px; } .docv ul { columns: 1; } .docv .assin { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------------ gráficos */
.chart svg { width: 100%; height: auto; display: block; }
.legend { display: flex; flex-wrap: wrap; gap: 10px 18px; font-size: 13px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: middle; }

/* ------------------------------------------------------------------ editor de páginas (MAPS) */
.ed-wrap { display: grid; grid-template-columns: 220px minmax(0, 1fr) 380px; gap: 16px; height: 100%; }
.ed-thumbs { overflow-y: auto; padding-right: 4px; }
.ed-thumb { border-radius: 10px; overflow: hidden; border: 2px solid transparent; margin-bottom: 10px; cursor: pointer; position: relative; background: #fff; }
.ed-thumb.on { border-color: var(--vinho); }
.ed-thumb .n { position: absolute; left: 6px; top: 6px; background: rgba(0,0,0,.5); color: #fff; font-size: 11px; border-radius: 6px; padding: 1px 6px; z-index: 2; }
.ed-prev { overflow: auto; display: flex; align-items: flex-start; justify-content: center; background: var(--rosa-4); border-radius: 16px; padding: 16px; }
.ed-form { overflow-y: auto; }
.scaler { transform-origin: top left; }
@media (max-width: 1180px) { .ed-wrap { grid-template-columns: 150px minmax(0, 1fr); } .ed-form { grid-column: 1 / -1; } }

@media print {
  body * { visibility: hidden !important; }
  .print-area, .print-area * { visibility: visible !important; }
  .print-area { position: absolute; left: 0; top: 0; width: 100%; }
  .docv { box-shadow: none; max-width: none; }
}
@media (max-width: 700px) { .top .btn span { display: none; } .top .btn { padding: 0 12px; } .top .titulo .over { display: none; } }
