/* +Clinikka — sistema visual alinhado à marca (azul-marinho, azul, ciano, verde) */
:root {
  --navy: #0a1f4d; --navy-2: #0d2a63; --navy-3: #133a7c;
  --blue: #0b5fa5; --blue-2: #094e89; --blue-50: #eaf3fc; --blue-100: #d3e6f8;
  --cyan: #00a3c4; --cyan-50: #e6f7fb;
  --teal: #0d8f87; --teal-50: #e5f5f3;
  --green: #3f9f2c; --green-50: #ecf7e8;
  --amber: #9a5b0c; --amber-50: #fff6e6; --amber-100: #f6dfb6;
  --red: #b3261e; --red-50: #fdeeed; --red-100: #f3c9c6;
  --ink: #10223f; --ink-2: #33445f; --muted: #5d6e86; --faint: #8796ab;
  --line: #dde6f0; --line-2: #e9eef5; --bg: #f3f6fa; --card: #ffffff;
  --radius: 14px; --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(10, 31, 77, .05), 0 8px 28px rgba(10, 31, 77, .06);
  --focus: 0 0 0 3px rgba(0, 163, 196, .35);
  --font: Inter, "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 14px/1.5 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--blue); }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ic { width: 18px; height: 18px; flex: 0 0 auto; stroke: currentColor; stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.ic.lg { width: 22px; height: 22px; }
.ic.sm { width: 15px; height: 15px; }
.hidden { display: none !important; }
.mono { font-family: var(--mono); font-size: 12px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.nowrap { white-space: nowrap; }
.right { margin-left: auto; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.nowrap-row { flex-wrap: nowrap; }
.stack > * + * { margin-top: 16px; }
.grow { flex: 1; min-width: 0; }

/* ---------------- Layout ---------------- */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 248px; flex: 0 0 248px; position: sticky; top: 0; height: 100vh; overflow-y: auto; background: linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%); color: #cfdcf2; display: flex; flex-direction: column; padding: 22px 14px 16px; z-index: 40; }
.brand { display: flex; align-items: center; padding: 2px 10px 20px; }
.brand img { height: 38px; width: auto; }
.brand-sub { font-size: 9px; letter-spacing: 1.1px; font-weight: 800; color: #7fd6e6; margin: -12px 0 14px 12px; }
.nav-label { font-size: 10px; font-weight: 800; letter-spacing: 1.6px; color: #7f93b8; padding: 16px 12px 6px; }
.nav-item { display: flex; align-items: center; gap: 11px; width: 100%; padding: 10px 12px; margin: 2px 0; border: 0; background: none; color: #c3d2ec; text-decoration: none; border-radius: 10px; font-weight: 600; font-size: 13.5px; text-align: left; position: relative; }
.nav-item:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav-item.active { background: rgba(0, 163, 196, .16); color: #fff; }
.nav-item.active::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: linear-gradient(180deg, #19c3e0, #6ad04a); }
.nav-item .count { margin-left: auto; background: rgba(255, 255, 255, .12); border-radius: 99px; padding: 1px 8px; font-size: 11px; }
.sidebar-foot { margin-top: auto; border-top: 1px solid rgba(255, 255, 255, .1); padding: 14px 10px 4px; font-size: 11px; color: #93a6c9; line-height: 1.5; }
.env-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 99px; background: rgba(106, 208, 74, .14); color: #b9efa7; font-weight: 700; font-size: 10.5px; letter-spacing: .3px; margin-bottom: 8px; }
.env-pill.demo { background: rgba(255, 196, 92, .16); color: #ffd98f; }
.workarea { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 64px; background: rgba(255, 255, 255, .92); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 14px; padding: 0 28px; position: sticky; top: 0; z-index: 30; }
.crumbs { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; min-width: 0; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--blue); }
.crumbs strong { color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 6px 4px 4px; border-radius: 99px; border: 1px solid transparent; background: none; text-align: left; }
.user-chip:hover { border-color: var(--line); background: #fff; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 12px; color: var(--blue-2); background: linear-gradient(135deg, var(--blue-50), var(--cyan-50)); border: 1px solid var(--blue-100); flex: 0 0 auto; }
.user-chip .who { line-height: 1.2; }
.user-chip .who b { display: block; font-size: 12.5px; }
.user-chip .who span { font-size: 11px; color: var(--muted); }
.main { padding: 26px 28px 80px; width: 100%; max-width: 1440px; margin: 0 auto; }
.menu-btn { display: none; border: 0; background: none; padding: 6px; margin-left: -6px; color: var(--navy); }
.overlay { display: none; }
.mobile-nav { display: none; }

/* ---------------- Cabeçalhos ---------------- */
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .titles { min-width: 0; flex: 1; }
.eyebrow { font-size: 10.5px; font-weight: 800; letter-spacing: 1.8px; text-transform: uppercase; color: var(--teal); margin-bottom: 6px; }
h1 { font-size: 27px; line-height: 1.2; letter-spacing: -.6px; margin: 0; color: var(--navy); }
h2 { font-size: 16px; margin: 0; color: var(--navy); letter-spacing: -.2px; }
h3 { font-size: 13.5px; margin: 0; color: var(--navy); }
.lead { color: var(--muted); margin: 6px 0 0; max-width: 820px; }

/* ---------------- Cartões ---------------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card.pad { padding: 22px; }
.card-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card-head .sub { color: var(--muted); font-size: 12.5px; margin: 3px 0 0; }
.grid { display: grid; gap: 16px; }
.grid > *, .cols-main > *, .stack > * { min-width: 0; }
.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)); }
.cols-main { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.stat { padding: 18px; display: flex; gap: 14px; align-items: center; }
.stat .ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--blue-50); color: var(--blue); flex: 0 0 auto; }
.stat .ico.teal { background: var(--teal-50); color: var(--teal); }
.stat .ico.green { background: var(--green-50); color: var(--green); }
.stat .ico.amber { background: var(--amber-50); color: var(--amber); }
.stat b { display: block; font-size: 24px; letter-spacing: -.8px; color: var(--navy); line-height: 1.1; }
.stat span { font-size: 12px; color: var(--muted); }

/* ---------------- Botões ---------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 8px 15px; border-radius: 10px; border: 1px solid #cdd9e7; background: #fff; color: var(--navy); font-weight: 700; font-size: 13px; text-decoration: none; white-space: nowrap; transition: background .12s, border-color .12s; }
.btn:hover { border-color: var(--blue); background: var(--blue-50); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-2); border-color: var(--blue-2); }
.btn.dark { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.dark:hover { background: var(--navy-3); }
.btn.success { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--blue); }
.btn.ghost:hover { background: var(--blue-50); }
.btn.danger { color: var(--red); border-color: var(--red-100); background: #fff; }
.btn.danger:hover { background: var(--red-50); border-color: var(--red); }
.btn.sm { min-height: 30px; padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.btn.block { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.icon-btn { border: 1px solid transparent; background: none; padding: 6px; border-radius: 8px; color: var(--muted); display: inline-grid; place-items: center; }
.icon-btn:hover { background: var(--blue-50); color: var(--blue); }

/* ---------------- Badges e avisos ---------------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 99px; font-size: 11px; font-weight: 700; border: 1px solid var(--blue-100); background: var(--blue-50); color: var(--blue-2); white-space: nowrap; }
.badge.teal { background: var(--teal-50); border-color: #bfe5e1; color: #0b6d67; }
.badge.green { background: var(--green-50); border-color: #cbe9c1; color: #2f7a20; }
.badge.amber { background: var(--amber-50); border-color: var(--amber-100); color: var(--amber); }
.badge.red { background: var(--red-50); border-color: var(--red-100); color: var(--red); }
.badge.gray { background: #f1f4f8; border-color: var(--line); color: var(--muted); }
.notice { border-radius: 12px; padding: 12px 14px; font-size: 12.5px; line-height: 1.55; border: 1px solid #c8e8ee; background: var(--cyan-50); color: #0b5466; display: flex; gap: 10px; align-items: flex-start; }
.notice .ic { margin-top: 1px; }
.notice.amber { background: var(--amber-50); border-color: var(--amber-100); color: #7a4a0a; }
.notice.red { background: var(--red-50); border-color: var(--red-100); color: #8c1d17; }
.notice.green { background: var(--green-50); border-color: #cbe9c1; color: #2a6b1d; }
.notice.gray { background: #f5f7fa; border-color: var(--line); color: var(--ink-2); }
.notice b { font-weight: 800; }

/* ---------------- Formulários ---------------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 12px; font-weight: 750; color: var(--navy); }
.field .req { color: var(--red); margin-left: 2px; }
.field .hint { font-size: 11px; color: var(--muted); line-height: 1.45; }
.input, select.input, textarea.input { width: 100%; min-height: 40px; padding: 9px 11px; border: 1px solid #cfdae7; border-radius: 9px; background: #fff; font-size: 13.5px; transition: border-color .12s, box-shadow .12s; }
.input:hover { border-color: #b4c5d9; }
.input:focus { outline: none; border-color: var(--cyan); box-shadow: var(--focus); }
.input:disabled, .input[readonly] { background: #f5f8fb; color: var(--ink-2); }
.input[aria-invalid="true"] { border-color: var(--red); }
textarea.input { min-height: 92px; resize: vertical; line-height: 1.55; }
textarea.input.tall { min-height: 160px; }
textarea.input.note { min-height: 360px; font-family: var(--mono); font-size: 12.5px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; line-height: 1.45; cursor: pointer; }
.check input { width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--blue); flex: 0 0 auto; }
.check.boxed { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fafcfe; }
.check.boxed:has(input:checked) { border-color: #9fd3c0; background: var(--teal-50); }
.seg { display: inline-flex; border: 1px solid #cfdae7; border-radius: 10px; padding: 3px; background: #fff; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 6px 12px; border-radius: 7px; font-weight: 700; font-size: 12.5px; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--blue-50); color: var(--blue-2); }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 18px; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { padding: 0; }
.section-title { display: flex; align-items: center; gap: 8px; font-weight: 800; color: var(--navy); font-size: 13.5px; margin: 6px 0 12px; }
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
details.fold { border: 1px solid var(--line); border-radius: 12px; background: #fff; }
details.fold + details.fold { margin-top: 12px; }
details.fold > summary { list-style: none; cursor: pointer; padding: 14px 16px; display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--navy); }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary .chev { margin-left: auto; transition: transform .15s; color: var(--muted); }
details.fold[open] > summary .chev { transform: rotate(90deg); }
details.fold > .fold-body { padding: 4px 16px 18px; border-top: 1px solid var(--line-2); }

/* ---------------- Tabelas e listas ---------------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t th { text-align: left; font-size: 11px; font-weight: 800; color: var(--muted); letter-spacing: .3px; text-transform: uppercase; padding: 10px 12px; background: #f7f9fc; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 11px 12px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
table.t tr:last-child td { border-bottom: 0; }
table.t tr.clickable { cursor: pointer; }
table.t tr.clickable:hover td { background: #f8fbff; }
table.t .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.list-item:last-child { border-bottom: 0; }
.list-item .grow b { display: block; font-size: 13.5px; }
.list-item .grow span { font-size: 12px; color: var(--muted); }
.pt-avatar { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: 13px; color: var(--blue-2); background: linear-gradient(135deg, #e6f1fc, #e2f7f1); flex: 0 0 auto; }
.pt-avatar.lg { width: 54px; height: 54px; font-size: 17px; border-radius: 15px; }
.empty { text-align: center; padding: 34px 16px; color: var(--muted); }
.empty .ic { width: 34px; height: 34px; color: var(--faint); margin: 0 auto 8px; display: block; }
.kv { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 8px 14px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; }

/* ---------------- Paciente ---------------- */
.pt-banner { display: flex; align-items: center; gap: 16px; padding: 16px 20px; margin-bottom: 16px; flex-wrap: wrap; }
.pt-banner .who { flex: 1; min-width: 220px; }
.pt-banner .who b { font-size: 18px; color: var(--navy); letter-spacing: -.3px; }
.pt-banner .meta { font-size: 12.5px; color: var(--muted); margin-top: 3px; display: flex; gap: 6px 14px; flex-wrap: wrap; }
.alert-strip { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: thin; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tab { border: 0; background: none; padding: 11px 14px; font-weight: 700; font-size: 13px; color: var(--muted); border-bottom: 2.5px solid transparent; white-space: nowrap; display: inline-flex; gap: 7px; align-items: center; text-decoration: none; }
.tab:hover { color: var(--navy); }
.tab[aria-selected="true"] { color: var(--blue-2); border-bottom-color: var(--blue); }
.tab .lock { color: var(--amber); }

/* ---------------- Consulta ---------------- */
.steps { display: flex; gap: 6px; overflow-x: auto; padding: 6px; background: #fff; border: 1px solid var(--line); border-radius: 14px; margin-bottom: 16px; scrollbar-width: thin; }
.step { border: 0; background: none; display: inline-flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 10px; font-weight: 700; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.step .n { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; background: #eef2f7; color: var(--muted); }
.step.done .n { background: var(--teal-50); color: var(--teal); }
.step[aria-current="step"] { background: var(--blue-50); color: var(--blue-2); }
.step[aria-current="step"] .n { background: var(--blue); color: #fff; }
.save-state { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.save-state .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.save-state.saving .dot { background: var(--cyan); animation: pulse 1s infinite; }
.save-state.error .dot { background: var(--red); }
.save-state.dirty .dot { background: var(--amber); }
@keyframes pulse { 50% { opacity: .3; } }
.side-card { position: sticky; top: 84px; }
.check-line { display: flex; gap: 9px; align-items: flex-start; font-size: 12.5px; padding: 6px 0; color: var(--ink-2); }
.check-line .ic { margin-top: 1px; }
.check-line.ok .ic { color: var(--teal); }
.check-line.todo .ic { color: var(--faint); }
.milestone { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 10px 16px; padding: 14px 0; border-bottom: 1px solid var(--line-2); align-items: start; }
.milestone:last-child { border-bottom: 0; }
.milestone b { font-size: 13.5px; }
.milestone .hint { font-size: 12px; color: var(--muted); }
.milestone .note-in { grid-column: 1 / -1; }

/* ---------------- Crescimento ---------------- */
.ind-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.chart-wrap { border: 1px solid var(--line); border-radius: 12px; background: linear-gradient(180deg, #fbfdff, #fff); padding: 8px; }
.chart-wrap svg { width: 100%; height: auto; display: block; }
.chart-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); padding: 6px 4px 0; }
.chart-legend i { display: inline-block; width: 18px; height: 0; border-top: 2px solid; vertical-align: middle; margin-right: 6px; }
.lg-median { border-color: #0d8f87 !important; }
.lg-2 { border-color: #e39a3b !important; border-top-style: dashed !important; }
.lg-3 { border-color: #c2413a !important; border-top-style: dotted !important; }
.lg-pt { border-color: var(--navy) !important; border-top-width: 3px !important; }
.zcell { font-variant-numeric: tabular-nums; font-weight: 700; }
.zcell.warn { color: var(--amber); }
.zcell.alert { color: var(--red); }
.result-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.result { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: #fbfdff; }
.result .cap { font-size: 11px; color: var(--muted); font-weight: 700; }
.result b { display: block; font-size: 18px; color: var(--navy); margin-top: 2px; font-variant-numeric: tabular-nums; }
.result small { font-size: 11px; color: var(--muted); }
.result.na b { font-size: 13px; color: var(--muted); font-weight: 600; }
.result.flag { border-color: var(--amber-100); background: var(--amber-50); }

/* ---------------- Linha do tempo ---------------- */
.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 4px; bottom: 4px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding: 0 0 18px; }
.tl-item::before { content: ""; position: absolute; left: -20px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 3px solid var(--cyan); }
.tl-item.encounter::before { border-color: var(--blue); }
.tl-item.measurement::before { border-color: var(--teal); }
.tl-item.immunization::before { border-color: var(--green); }
.tl-item.eye::before { border-color: var(--amber); }
.tl-item b { font-size: 13px; }
.tl-item .when { font-size: 11.5px; color: var(--muted); }
.tl-item p { margin: 4px 0 0; font-size: 12.5px; color: var(--ink-2); }

/* ---------------- Mídia ---------------- */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.media-card { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; display: flex; flex-direction: column; }
.media-card .thumb { aspect-ratio: 4 / 3; background: #eef3f8; display: grid; place-items: center; color: var(--faint); overflow: hidden; }
.media-card .thumb img, .media-card .thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-card .body { padding: 10px 12px; font-size: 12px; }
.media-card .body b { display: block; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dropzone { border: 2px dashed #c6d5e6; border-radius: 12px; padding: 18px; text-align: center; background: #fafcfe; }
.dropzone.over { border-color: var(--cyan); background: var(--cyan-50); }

/* ---------------- Modal e toast ---------------- */
dialog.modal { border: 0; padding: 0; border-radius: 16px; width: min(560px, calc(100vw - 24px)); box-shadow: 0 30px 80px rgba(10, 31, 77, .3); color: var(--ink); }
dialog.modal.wide { width: min(820px, calc(100vw - 24px)); }
dialog.modal::backdrop { background: rgba(10, 31, 77, .45); }
.modal-head { padding: 18px 20px 6px; display: flex; align-items: flex-start; gap: 10px; }
.modal-head h2 { font-size: 17px; }
.modal-body { padding: 8px 20px 4px; max-height: min(70vh, 720px); overflow-y: auto; }
.modal-foot { padding: 14px 20px 18px; display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.toast { background: var(--navy); color: #fff; padding: 12px 16px; border-radius: 12px; font-size: 13px; box-shadow: 0 14px 40px rgba(10, 31, 77, .3); display: flex; gap: 10px; align-items: flex-start; animation: tin .18s ease-out; }
.toast.err { background: #8c1d17; }
.toast.ok { background: #0b5f59; }
.toast.warn { background: #7a4a0a; }
@keyframes tin { from { transform: translateY(8px); opacity: 0; } }

/* ---------------- Autenticação ---------------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.auth-art { background: radial-gradient(1200px 600px at -10% 120%, rgba(79, 184, 58, .35), transparent 60%), radial-gradient(900px 500px at 110% -10%, rgba(0, 163, 196, .4), transparent 60%), linear-gradient(160deg, var(--navy) 0%, #0b2d6e 100%); color: #dbe6f7; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-art img { height: 50px; width: auto; align-self: flex-start; }
.auth-art h2 { color: #fff; font-size: 30px; line-height: 1.2; letter-spacing: -.8px; max-width: 460px; margin: 0 0 14px; }
.auth-art p { max-width: 460px; color: #b9c9e4; line-height: 1.6; }
.auth-art ul { padding: 0; margin: 18px 0 0; list-style: none; display: grid; gap: 10px; max-width: 460px; }
.auth-art li { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: #d4e0f3; }
.auth-art li .ic { color: #7fe0a4; margin-top: 2px; }
.auth-panel { display: grid; place-items: center; padding: 32px 20px; background: #fff; }
.auth-box { width: min(400px, 100%); }
.auth-box h1 { font-size: 24px; }
.auth-box .lead { margin-bottom: 22px; }
.auth-box .field + .field { margin-top: 14px; }
.otp-input { letter-spacing: 8px; font-size: 22px !important; text-align: center; font-family: var(--mono); }
.qr { width: 200px; height: 200px; margin: 6px auto 10px; border: 1px solid var(--line); border-radius: 12px; padding: 8px; background: #fff; }
.qr svg { width: 100%; height: 100%; }
.terms-text { white-space: pre-wrap; font-size: 12.5px; line-height: 1.6; background: #f7f9fc; border: 1px solid var(--line); border-radius: 12px; padding: 14px; max-height: 46vh; overflow-y: auto; }
.pw-meter { height: 6px; border-radius: 99px; background: #e9eef5; overflow: hidden; margin-top: 6px; }
.pw-meter span { display: block; height: 100%; width: 0; background: var(--red); transition: width .2s, background .2s; }

/* ---------------- Responsivo ---------------- */
@media (max-width: 1180px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols-main { grid-template-columns: 1fr; }
  .side-card { position: static; }
}
@media (max-width: 860px) {
  .app { display: block; }
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-105%); transition: transform .2s ease; box-shadow: 0 30px 60px rgba(10, 31, 77, .45); }
  .sidebar.open { transform: none; }
  .overlay.open { display: block; position: fixed; inset: 0; background: rgba(10, 31, 77, .45); z-index: 35; }
  .menu-btn { display: inline-grid; }
  .topbar { padding: 0 14px; height: 58px; }
  .user-chip .who { display: none; }
  .main { padding: 18px 14px 96px; }
  h1 { font-size: 23px; }
  .g3, .g2, .form-grid, .form-grid.three { grid-template-columns: 1fr; }
  .milestone { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 8px; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-art { padding: 28px 22px; min-height: auto; }
  .auth-art h2 { font-size: 22px; }
  .auth-art ul, .auth-art .art-foot { display: none; }
  .mobile-nav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: #fff; border-top: 1px solid var(--line); padding: 6px 6px max(6px, env(safe-area-inset-bottom)); justify-content: space-around; }
  .mobile-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 700; color: var(--muted); text-decoration: none; padding: 6px 2px; border-radius: 10px; }
  .mobile-nav a.active { color: var(--blue); background: var(--blue-50); }
  .toasts { left: 16px; right: 16px; bottom: 86px; }
  .tabs { margin-left: -14px; margin-right: -14px; padding: 0 8px; }
  .pt-banner { padding: 14px; }
  .hide-sm { display: none !important; }
  .chart-wrap { overflow-x: auto; }
  .chart-wrap svg { min-width: 640px; }
}
@media (max-width: 520px) {
  .g4 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 13px; gap: 10px; }
  .stat .ico { width: 34px; height: 34px; }
  .stat b { font-size: 20px; }
}

/* ---------------- Impressão ---------------- */
.print-only { display: none; }
.print-note { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; }
@media print {
  body { background: #fff; }
  .sidebar, .topbar, .mobile-nav, .steps, .tabs, .no-print, .toasts, .btn, .overlay { display: none !important; }
  .app, .workarea { display: block; }
  .main { padding: 0; max-width: none; }
  .card { box-shadow: none; border: 0; }
  .print-only { display: block; }
  .print-note { white-space: pre-wrap; font-family: var(--mono); font-size: 11px; line-height: 1.5; }
}
