/* Capricho Serviços · Santana de Parnaíba — estilos compartilhados */
:root {
  --bg: #f1f4f3; --surface: #ffffff; --sunk: #e6ecea; --line: #d2dbd8; --ink: #16201e; --muted: #586864;
  --accent: #0c6a5d; --accent-ink: #ffffff; --accent-soft: #d9eee9;
  --gate: #94580a; --gate-soft: #fbeed6;
  --good: #1d7639; --good-soft: #dcf1e2; --bad: #b0271f; --bad-soft: #f8e0dd; --info: #2a5ba6; --info-soft: #e1eaf7;
  --f-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --f-body: "Figtree", "Segoe UI", system-ui, -apple-system, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --r: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1413; --surface: #161f1e; --sunk: #1c2826; --line: #2a3936; --ink: #e4edeb; --muted: #98aaa5;
    --accent: #44b9a5; --accent-ink: #04201b; --accent-soft: #15342e;
    --gate: #e4a74c; --gate-soft: #392a12;
    --good: #5fca7c; --good-soft: #163120; --bad: #f07b71; --bad-soft: #3b1a17; --info: #80a9eb; --info-soft: #192a43;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 15px; line-height: 1.5; }
h1, h2, h3 { font-family: var(--f-display); margin: 0; letter-spacing: -0.01em; text-wrap: balance; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
a { color: var(--accent); }
.mono { font-family: var(--f-mono); font-size: .92em; font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

/* Botões */
.btn { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 8px 14px; cursor: pointer; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; color: var(--ink); }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.good { background: var(--good); border-color: var(--good); color: var(--surface); }
.btn.danger { color: var(--bad); border-color: var(--bad); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.sm { padding: 4px 10px; font-size: 13px; }
.btn.lg { padding: 13px 18px; font-size: 16px; width: 100%; }

/* Campos */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label, .lbl { font-size: 14px; font-weight: 600; }
.field input, .field select, .field textarea { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; width: 100%; font-size: 16px; }
.field textarea { min-height: 90px; resize: vertical; }
.hint { font-size: 13px; color: var(--muted); }
.err { font-size: 13px; color: var(--bad); font-weight: 600; min-height: 0; }
.err:empty { display: none; }
.field.bad input, .field.bad select, .field.bad textarea { border-color: var(--bad); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.opcoes { display: flex; flex-wrap: wrap; gap: 8px; }
.opcao { position: relative; }
.opcao input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.opcao span { display: inline-block; border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 8px 14px; font-weight: 500; cursor: pointer; }
.opcao input:checked + span { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 700; }
.opcao input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.check input { margin-top: 4px; width: 18px; height: 18px; flex: none; }

/* Avisos */
.note { font-size: 14px; border-radius: 8px; padding: 10px 12px; background: var(--info-soft); color: var(--ink); }
.note.gate { background: var(--gate-soft); }
.note.gate b { color: var(--gate); }
.note.bad { background: var(--bad-soft); }
.note.good { background: var(--good-soft); }

/* Pílulas de status */
.pill { display: inline-block; width: fit-content; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 99px; background: var(--sunk); color: var(--muted); }
.t-good { background: var(--good-soft); color: var(--good); }
.t-bad { background: var(--bad-soft); color: var(--bad); }
.t-gate { background: var(--gate-soft); color: var(--gate); }
.t-info { background: var(--info-soft); color: var(--info); }
.t-accent { background: var(--accent-soft); color: var(--accent); }

/* ---------- Formulários públicos ---------- */
.pub-top { background: var(--accent); color: var(--accent-ink); padding: calc(18px + env(safe-area-inset-top, 0px)) 16px 18px; }
.pub-top .inner { max-width: 680px; margin: 0 auto; }
.pub-top small { display: block; opacity: .85; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; font-weight: 700; }
.pub-top h1 { font-size: 26px; margin-top: 4px; }
.pub-top p { margin: 6px 0 0; opacity: .92; }
.pub-main { max-width: 680px; margin: 0 auto; padding: 18px 16px calc(40px + env(safe-area-inset-bottom, 0px)); }
.bloco { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); padding: 18px 16px; display: flex; flex-direction: column; gap: 16px; margin: 0 0 14px; }
.bloco legend { font-family: var(--f-display); font-weight: 700; font-size: 17px; padding: 0 6px; }
.oculto-robo { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.obrigado { text-align: center; padding: 40px 18px; }
.obrigado .icone { width: 64px; height: 64px; border-radius: 50%; background: var(--good-soft); color: var(--good); display: grid; place-items: center; margin: 0 auto 14px; font-size: 30px; font-weight: 700; }
.obrigado h2 { font-size: 24px; margin-bottom: 8px; }
.rodape { text-align: center; color: var(--muted); font-size: 12.5px; margin-top: 18px; }

/* ---------- Área interna ---------- */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); padding: 12px 16px; display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.brand h1 { font-size: 21px; font-weight: 700; }
.brand span { color: var(--muted); font-size: 13px; }
.who { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; }
.roles { display: flex; flex-wrap: wrap; gap: 4px; }
.role { font-size: 11.5px; padding: 2px 8px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.tabs { display: flex; gap: 4px; padding: 8px 16px 0; overflow-x: auto; border-bottom: 1px solid var(--line); background: var(--surface); }
.tab { border: 0; background: none; padding: 8px 12px 10px; cursor: pointer; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; text-decoration: none; }
.tab[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
.wrap { padding: 18px 16px 48px; max-width: 1500px; margin: 0 auto; font-size: 14px; }
.bar-h { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.bar-h p { margin: 0; color: var(--muted); max-width: 72ch; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.col { background: var(--sunk); border-radius: var(--r); padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 160px; }
.col.mine { box-shadow: inset 0 0 0 2px var(--accent); }
.col-h { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; align-items: baseline; padding: 2px 2px 6px; }
.col-f { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.col-h h3 { font-size: 16px; grid-column: 1; }
.count { grid-row: 1 / 3; grid-column: 2; font-family: var(--f-mono); font-size: 13px; background: var(--surface); border-radius: 99px; padding: 1px 9px; align-self: center; }
.col-r { font-size: 11.5px; color: var(--muted); grid-column: 1 / 3; }
.col-r b { color: var(--accent); }
.gatenote { font-size: 11.5px; color: var(--gate); background: var(--gate-soft); border-radius: 6px; padding: 4px 8px; font-weight: 600; }
.card { all: unset; box-sizing: border-box; cursor: pointer; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; display: flex; flex-direction: column; gap: 4px; }
.card:hover { border-color: var(--accent); }
.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.card-n { font-weight: 600; }
.card-m, .card-t { font-size: 12px; color: var(--muted); }
.card-x { font-size: 12px; }
.empty { font-size: 12.5px; color: var(--muted); padding: 8px 4px; }

.scrim { position: fixed; inset: 0; background: rgba(8, 14, 13, .42); z-index: 20; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(600px, 100%); background: var(--bg); z-index: 21; overflow-y: auto; border-left: 1px solid var(--line); display: flex; flex-direction: column; }
.dr-h { position: sticky; top: 0; background: var(--surface); border-bottom: 1px solid var(--line); padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 12px; display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; z-index: 1; }
.dr-h h2 { font-size: 20px; }
.dr-b { padding: 16px; display: flex; flex-direction: column; gap: 16px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.panel h3 { font-size: 15px; }
.panel.act { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.eyebrow { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.wrap .field input, .wrap .field select, .wrap .field textarea, .drawer .field input, .drawer .field select, .drawer .field textarea, .modal .field input, .modal .field select, .modal .field textarea { font-size: 14px; padding: 8px 10px; }
.drawer .field > label, .modal .field > label { font-size: 12.5px; }

.stepper { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--muted); }
.dot { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-family: var(--f-mono); font-size: 11px; background: var(--sunk); border: 1px solid var(--line); }
.step.done .dot { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.step.cur .dot { background: var(--surface); border: 2px solid var(--accent); color: var(--accent); font-weight: 600; }
.step.fail .dot { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); }
.link { width: 12px; height: 1px; background: var(--line); }
.gatechip { font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: 2px 6px; border-radius: 4px; background: var(--gate-soft); color: var(--gate); }
.gatechip.open { background: var(--good-soft); color: var(--good); }

dl.data { display: grid; grid-template-columns: minmax(120px, 34%) 1fr; gap: 6px 12px; margin: 0; }
dl.data dt { color: var(--muted); font-size: 12.5px; }
dl.data dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.hist { list-style: none; margin: 0; padding: 0; }
.hist li { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 12.5px; }
.hist li:first-child { border-top: 0; }
.hist time { grid-row: 1 / 3; color: var(--muted); font-family: var(--f-mono); font-size: 11.5px; white-space: nowrap; }
.hist .by { color: var(--muted); }

.tblwrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
table { border-collapse: collapse; width: 100%; min-width: 720px; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); font-size: 13px; vertical-align: top; }
th { font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); background: var(--sunk); }
tr.rowlink { cursor: pointer; }
tr.rowlink:hover td { background: var(--accent-soft); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filters input, .filters select { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; }
.kpi b { display: block; font-family: var(--f-display); font-size: 28px; font-variant-numeric: tabular-nums; }
.kpi span { font-size: 12.5px; color: var(--muted); }
.cols2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.funnel { display: flex; flex-direction: column; gap: 10px; }
.frow { display: grid; grid-template-columns: 110px 1fr 76px; gap: 10px; align-items: center; font-size: 13px; }
.fbar { height: 14px; background: var(--sunk); border-radius: 4px; overflow: hidden; }
.fbar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.frow.gaterow .fbar i { background: var(--gate); }
.frow small { color: var(--muted); font-family: var(--f-mono); font-size: 11.5px; text-align: right; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 13px; }
.list li:first-child { border-top: 0; }

.chipsmail { display: flex; flex-wrap: wrap; gap: 6px; }
.chipmail { display: inline-flex; align-items: center; gap: 6px; background: var(--accent-soft); color: var(--ink); border-radius: 99px; padding: 4px 6px 4px 12px; font-size: 13px; }
.chipmail button { border: 0; background: var(--surface); border-radius: 50%; width: 22px; height: 22px; cursor: pointer; line-height: 1; color: var(--bad); font-weight: 700; }
.addrow { display: flex; gap: 8px; flex-wrap: wrap; }
.addrow input { flex: 1; min-width: 200px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.perfis-check { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.perfis-check label { display: flex; gap: 6px; align-items: center; font-weight: 500; font-size: 13.5px; }

.modal { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(520px, calc(100% - 32px)); max-height: calc(100% - 32px); overflow-y: auto; background: var(--surface); border-radius: 12px; z-index: 31; padding: 18px; display: flex; flex-direction: column; gap: 12px; border: 1px solid var(--line); }
.modal-scrim { z-index: 30; }
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 8px; z-index: 40; font-weight: 600; max-width: calc(100% - 32px); }
.centro { max-width: 520px; margin: 60px auto; text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: center; padding: 0 16px; }
details summary { cursor: pointer; font-weight: 600; }
@media (prefers-reduced-motion: no-preference) { .drawer { animation: slide .18s ease-out; } @keyframes slide { from { transform: translateX(24px); opacity: .6; } to { transform: none; opacity: 1; } } }
@media (max-width: 520px) { .frow { grid-template-columns: 90px 1fr 64px; } dl.data { grid-template-columns: 1fr; } }
