/* BoostDesign B2B — sistema visual.
   Direção: instrumento clínico. Tinta profunda, papel claro, réguas finas e leituras em fonte mono. */

:root {
  --blue: #1A56DB; --blue-600: #1749BE; --blue-700: #153E9F; --blue-50: #EFF4FF; --blue-100: #DCE7FE; --blue-200: #BFD3FD;
  --cyan: #06B6D4; --cyan-700: #0E7490; --cyan-50: #ECFEFF; --cyan-200: #A5F3FC;
  --violet: #8B5CF6; --violet-700: #6D28D9; --violet-50: #F5F3FF; --violet-200: #DDD6FE;
  --green: #10B981; --green-700: #047857; --green-50: #ECFDF5; --green-200: #A7F3D0;
  --amber: #F59E0B; --amber-700: #B45309; --amber-50: #FFFBEB; --amber-200: #FDE68A;
  --red: #DC2626; --red-700: #B91C1C; --red-50: #FEF2F2; --red-200: #FECACA;
  --ink: #0F172A; --ink-2: #1E293B; --ink-3: #273449;
  --slate-700: #334155; --slate-600: #475569; --muted: #64748B; --slate-400: #94A3B8; --slate-300: #CBD5E1;
  --line: #E2E8F0; --line-2: #EEF2F7; --bg: #F8FAFC; --surface: #FFFFFF; --surface-2: #F1F5F9;
  --r-sm: 6px; --r: 10px; --r-lg: 14px; --r-xl: 18px;
  --sh-1: 0 1px 2px rgba(15, 23, 42, .05);
  --sh-2: 0 1px 2px rgba(15, 23, 42, .04), 0 6px 16px -6px rgba(15, 23, 42, .08);
  --sh-3: 0 24px 48px -12px rgba(15, 23, 42, .25), 0 2px 8px rgba(15, 23, 42, .06);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --focus: 0 0 0 3px rgba(26, 86, 219, .28);
  --sidebar-w: 252px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 14px; line-height: 1.55; color: var(--ink);
  background: var(--bg); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11", "ss01";
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, p { margin: 0; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }
ul, ol { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }
.ic { flex: none; }

.skip-link { position: absolute; left: 12px; top: -48px; z-index: 100; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; transition: top .15s; }
.skip-link:focus { top: 12px; text-decoration: none; }

/* ───────── Boot ───────── */
.boot { min-height: 100vh; display: grid; place-items: center; }
.boot-mark { animation: boot-pulse 1.4s var(--ease) infinite; border-radius: 10px; }
@keyframes boot-pulse { 0%, 100% { opacity: .55; transform: scale(.96); } 50% { opacity: 1; transform: scale(1); } }
.boot-error { max-width: 520px; margin: 18vh auto 0; padding: 0 16px; }

/* ───────── Botões ───────── */
.btn {
  --b-bg: var(--blue); --b-fg: #fff; --b-bd: transparent; --b-hover: var(--blue-600);
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px; border-radius: 9px; border: 1px solid var(--b-bd);
  background: var(--b-bg); color: var(--b-fg); font-weight: 550; font-size: 14px; letter-spacing: -.005em;
  cursor: pointer; white-space: nowrap; user-select: none; text-decoration: none;
  transition: background-color .15s var(--ease), border-color .15s, box-shadow .15s, transform .08s, color .15s;
}
.btn:hover { background: var(--b-hover); text-decoration: none; }
.btn:active:not(:disabled) { transform: translateY(.5px); }
.btn:focus-visible { outline: none; box-shadow: var(--focus); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn-primary { box-shadow: 0 1px 2px rgba(26, 86, 219, .3), inset 0 1px 0 rgba(255, 255, 255, .14); }
.btn-secondary { --b-bg: #fff; --b-fg: var(--ink); --b-bd: var(--line); --b-hover: var(--surface-2); box-shadow: var(--sh-1); }
.btn-ghost { --b-bg: transparent; --b-fg: var(--slate-700); --b-hover: var(--surface-2); }
.btn-danger { --b-bg: var(--red); --b-hover: var(--red-700); }
.btn-success { --b-bg: var(--green-700); --b-hover: #036349; }
.btn-dark { --b-bg: var(--ink); --b-hover: var(--ink-2); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; gap: 6px; }
.btn-lg { height: 46px; padding: 0 22px; font-size: 15px; border-radius: 11px; }
.btn-icon { width: 38px; padding: 0; }
.btn-sm.btn-icon { width: 32px; }
.btn.is-loading .btn-label, .btn.is-loading > .ic { opacity: 0; }
.btn-spinner { position: absolute; inset: 0; margin: auto; }
.btn-block { width: 100%; }

.spinner { display: inline-block; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; opacity: .85; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ───────── Badges ───────── */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 550; white-space: nowrap; border: 1px solid transparent; line-height: 1; }
.badge .ic { margin-left: -2px; }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tone-blue { background: var(--blue-50); color: var(--blue-700); border-color: var(--blue-100); }
.tone-cyan { background: var(--cyan-50); color: var(--cyan-700); border-color: var(--cyan-200); }
.tone-violet { background: var(--violet-50); color: var(--violet-700); border-color: var(--violet-200); }
.tone-green { background: var(--green-50); color: var(--green-700); border-color: var(--green-200); }
.tone-amber { background: var(--amber-50); color: var(--amber-700); border-color: var(--amber-200); }
.tone-red { background: var(--red-50); color: var(--red-700); border-color: var(--red-200); }
.tone-slate { background: var(--surface-2); color: var(--slate-700); border-color: var(--line); }
.tone-gray { background: #fff; color: var(--muted); border-color: var(--line); }

/* ───────── Formulários ───────── */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.label { font-size: 13px; font-weight: 550; color: var(--ink-2); display: flex; align-items: baseline; gap: 8px; }
.label .opt { font-weight: 400; color: var(--muted); font-size: 12px; }
.hint { font-size: 12.5px; color: var(--muted); }
.field-error { font-size: 12.5px; color: var(--red-700); display: flex; gap: 6px; align-items: center; }
.input {
  width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; background: #fff;
  color: var(--ink); font-size: 14px; transition: border-color .15s, box-shadow .15s; box-shadow: var(--sh-1);
}
.input::placeholder { color: var(--slate-400); }
.input:hover:not(:disabled) { border-color: var(--slate-300); }
.input:focus { outline: none; border-color: var(--blue); box-shadow: var(--focus); }
.input:disabled, .input[readonly] { background: var(--surface-2); color: var(--slate-600); cursor: default; box-shadow: none; }
.input[aria-invalid="true"] { border-color: var(--red); }
.input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgba(220, 38, 38, .2); }
.textarea { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.select { appearance: none; padding-right: 34px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.input-sm { height: 34px; font-size: 13.5px; border-radius: 8px; }
.input-mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.input-group { display: flex; align-items: stretch; }
.input-group .input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group .addon { display: grid; place-items: center; padding: 0 12px; border: 1px solid var(--line); border-left: 0; border-radius: 0 9px 9px 0; background: var(--surface-2); color: var(--slate-600); font-size: 13px; white-space: nowrap; }
.input-group.pre .input { border-radius: 0 9px 9px 0; }
.input-group.pre .addon { border-left: 1px solid var(--line); border-right: 0; border-radius: 9px 0 0 9px; }

.form { display: flex; flex-direction: column; gap: 18px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.span-2 { grid-column: span 2; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }
.form-actions .spacer { flex: 1; }

.field-check .check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); line-height: 1.5; }
.field-check .check:has(input:checked) { background: var(--blue-50); border-color: var(--blue-200); }
.field-check .check:has(input[aria-invalid="true"]) { border-color: var(--red); background: var(--red-50); }
.checkbox { position: absolute; opacity: 0; width: 18px; height: 18px; margin: 0; }
.check-box { flex: none; width: 20px; height: 20px; margin-top: 1px; border-radius: 6px; border: 1.5px solid var(--slate-400); background: #fff; display: grid; place-items: center; color: transparent; transition: all .15s; }
.checkbox:checked + .check-box { background: var(--blue); border-color: var(--blue); color: #fff; }
.checkbox:focus-visible + .check-box { box-shadow: var(--focus); }
.check-text { font-size: 13.5px; color: var(--ink-2); }
.check-text small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }

.switch { position: relative; flex: none; width: 38px; height: 22px; border-radius: 999px; border: 0; background: var(--slate-300); cursor: pointer; padding: 0; transition: background-color .18s var(--ease); }
.switch-thumb { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(15, 23, 42, .25); transition: transform .18s var(--ease); }
.switch[aria-checked="true"] { background: var(--green); }
.switch[aria-checked="true"] .switch-thumb { transform: translateX(16px); }
.switch:disabled { opacity: .5; cursor: not-allowed; }
.switch:focus-visible { outline: none; box-shadow: var(--focus); }
.switch-wrap { display: inline-flex; gap: 10px; align-items: center; font-size: 13.5px; cursor: pointer; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px 0 12px; border-radius: 999px;
  border: 1px solid var(--line); background: #fff; color: var(--slate-700); font-size: 13.5px; font-weight: 500; cursor: pointer;
  transition: all .15s var(--ease); box-shadow: var(--sh-1);
}
.chip:hover:not(:disabled) { border-color: var(--slate-300); background: var(--bg); }
.chip-check { width: 0; overflow: hidden; display: inline-flex; transition: width .15s var(--ease); }
.chip.is-on { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: 0 1px 2px rgba(26, 86, 219, .35); }
.chip.is-on .chip-check { width: 14px; }
.chip:disabled { cursor: default; opacity: .7; }
.chip:focus-visible { outline: none; box-shadow: var(--focus); }

/* Combobox */
.combo { position: relative; }
.combo-ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--slate-400); pointer-events: none; }
.combo .combo-input { padding-left: 36px; }
.combo.combo-noic .combo-input { padding-left: 12px; }
.combo-list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 6px); max-height: 300px; overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--sh-3); padding: 6px; }
.combo-opt { padding: 9px 10px; border-radius: 8px; cursor: pointer; display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.combo-opt[aria-selected="true"], .combo-opt:hover { background: var(--blue-50); }
.combo-empty { padding: 12px 10px; color: var(--muted); font-size: 13px; }
.opt-main { font-weight: 550; color: var(--ink); }
.opt-sub { font-size: 12.5px; color: var(--muted); }
.opt-meta { font-family: var(--mono); font-size: 12px; color: var(--slate-600); white-space: nowrap; }

/* ───────── Cartões, cabeçalhos ───────── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-1); padding: 24px; min-width: 0; }
.card + .card { margin-top: 20px; }
.card-head { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; margin-bottom: 20px; }
.card-title { font-size: 15.5px; font-weight: 620; letter-spacing: -.01em; display: flex; align-items: center; gap: 10px; }
.card-title-ic { color: var(--blue); }
.card-desc { color: var(--muted); font-size: 13.5px; margin-top: 4px; max-width: 64ch; }
.card-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.card-flush { padding: 0; overflow: hidden; }
.card-flush > .card-head { padding: 20px 24px 0; }

.page-head { margin-bottom: 28px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 500; margin-bottom: 12px; }
.back-link:hover { color: var(--ink); text-decoration: none; }
.page-head-row { display: flex; gap: 16px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; }
.page-head-text { min-width: 0; }
.eyebrow { font-size: 11.5px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.page-title { font-size: 26px; line-height: 1.2; font-weight: 680; letter-spacing: -.022em; color: var(--ink); }
.page-title:focus { outline: none; }
.page-sub { color: var(--muted); margin-top: 6px; font-size: 14.5px; max-width: 70ch; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.section-label { font-size: 11.5px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 32px 0 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* Estado vazio, erro, callout */
.empty { text-align: center; padding: 48px 24px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.empty-ic { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--blue-50); color: var(--blue); margin-bottom: 10px; box-shadow: inset 0 0 0 1px var(--blue-100); }
.empty-title { font-size: 15.5px; font-weight: 620; }
.empty-text { color: var(--muted); max-width: 46ch; font-size: 13.5px; }
.empty-action { margin-top: 14px; display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.notfound { padding-top: 10vh; }

.error-box { display: flex; gap: 14px; align-items: flex-start; padding: 18px 20px; border-radius: var(--r-lg); background: #fff; border: 1px solid var(--red-200); color: var(--red-700); box-shadow: var(--sh-1); flex-wrap: wrap; }
.error-box > div { flex: 1; min-width: 200px; }
.error-title { font-weight: 620; color: var(--ink); }
.error-text { color: var(--slate-600); font-size: 13.5px; margin-top: 2px; }

.callout { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; border-width: 1px; border-style: solid; font-size: 13.5px; line-height: 1.5; }
.callout-ic { margin-top: 1px; }
.callout-title { font-weight: 620; }
.callout-body { min-width: 0; }
.callout.tone-amber .callout-body, .callout.tone-red .callout-body, .callout.tone-blue .callout-body, .callout.tone-green .callout-body { color: var(--ink-2); }
.callout-list { display: flex; flex-direction: column; gap: 8px; }

/* Skeleton */
.sk-wrap { width: 100%; }
.sk { display: flex; flex-direction: column; gap: 12px; }
.sk-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.sk-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.sk-card.tall { min-height: 120px; }
.sk-row { display: flex; gap: 16px; align-items: center; padding: 16px 20px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.sk-row .sk-bar { margin: 0; }
.sk-circle { width: 32px; height: 32px; border-radius: 50%; flex: none; }
.sk-bar, .sk-circle { height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--line-2) 0%, #E5EAF1 40%, var(--line-2) 80%); background-size: 300% 100%; animation: shimmer 1.4s ease-in-out infinite; }
.sk-circle { height: 32px; }
.sk-lg { height: 26px; }
.w10 { width: 10%; } .w20 { width: 20%; } .w40 { width: 40%; } .w60 { width: 60%; } .w70 { width: 70%; } .w80 { width: 80%; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* Medidor */
.meter { display: flex; flex-direction: column; gap: 8px; }
.meter-label { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--slate-600); }
.meter-val { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink); }
.meter-track { height: 8px; border-radius: 999px; background: var(--line-2); overflow: hidden; box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .03); }
.meter-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--cyan)); transition: width .6s var(--ease); }
.meter-amber .meter-fill, .meter-amber-soft .meter-fill { background: linear-gradient(90deg, var(--amber), #FBBF24); }
.meter-compact .meter-track { height: 6px; }

/* ───────── Shell ───────── */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; padding: 18px 12px 14px;
  background:
    radial-gradient(120% 60% at 0% 0%, rgba(26, 86, 219, .22), transparent 60%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .025) 0 1px, transparent 1px 28px),
    var(--ink);
  color: #CBD5E1; z-index: 40; overflow-y: auto; scrollbar-width: thin;
}
.sb-brand { padding: 4px 8px 18px; border-bottom: 1px solid rgba(255, 255, 255, .07); margin-bottom: 12px; }
.sb-logo { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 680; font-size: 16px; letter-spacing: -.02em; }
.sb-logo:hover { text-decoration: none; }
.sb-logo:focus-visible { outline-color: var(--cyan); }
.logo-mark { border-radius: 8px; box-shadow: 0 4px 14px -4px rgba(6, 182, 212, .55); }
.sb-empresa { margin-top: 10px; font-size: 12.5px; color: #94A3B8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 38px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-link { position: relative; display: flex; align-items: center; gap: 12px; height: 38px; padding: 0 12px; border-radius: 9px; color: #B6C2D3; font-weight: 500; font-size: 14px; transition: background-color .15s, color .15s; }
.nav-link .ic { color: #7C8BA1; transition: color .15s; }
.nav-link:hover { background: rgba(255, 255, 255, .05); color: #fff; text-decoration: none; }
.nav-link:hover .ic { color: #CBD5E1; }
.nav-link[aria-current="page"] { background: rgba(255, 255, 255, .08); color: #fff; }
.nav-link[aria-current="page"] .ic { color: var(--cyan); }
.nav-link[aria-current="page"]::before { content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: linear-gradient(var(--blue), var(--cyan)); }
.nav-link:focus-visible { outline-color: var(--cyan); }
.sb-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding-top: 16px; }
.sb-plan { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 11px; background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .07); color: #E2E8F0; transition: background-color .15s; }
.sb-plan:hover { background: rgba(255, 255, 255, .07); text-decoration: none; }
.sb-plan:focus-visible { outline-color: var(--cyan); }
.sb-plan-top { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; }
.sb-plan-name { font-weight: 600; color: #fff; }
.sb-plan-count { color: #A9B6C8; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sb-plan-count.is-full { color: #FCD34D; }
.sb-plan-track { height: 4px; border-radius: 999px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.sb-plan-fill { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--cyan)); }
.sb-plan-fill.is-full { background: var(--amber); }
.sb-user { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; border: 0; background: transparent; cursor: pointer; text-align: left; color: #E2E8F0; }
.sb-user:hover, .sb-user[aria-expanded="true"] { background: rgba(255, 255, 255, .06); }
.sb-user:focus-visible { outline: 2px solid var(--cyan); }
.avatar { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 650; letter-spacing: .02em; color: #fff; background: linear-gradient(135deg, var(--violet), var(--blue)); }
.sb-user-text { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.3; }
.sb-user-name { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #fff; }
.sb-user-role { font-size: 12px; color: #94A3B8; }
.sb-user-more { color: #7C8BA1; }

.main { min-width: 0; outline: none; }
.main-inner { max-width: 1180px; margin: 0 auto; padding: 36px 40px 96px; }
.view { animation: view-in .28s var(--ease) both; }
@keyframes view-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.topbar { display: none; }
.scrim { display: none; }

/* Menu suspenso */
.menu-wrap { position: relative; }
.menu { position: absolute; z-index: 50; min-width: 220px; background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--sh-3); padding: 6px; top: calc(100% + 6px); }
.menu-end { right: 0; }
.menu-start { left: 0; }
.menu-up { top: auto; bottom: calc(100% + 6px); }
.menu-item { width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; border: 0; background: none; cursor: pointer; color: var(--ink-2); font-size: 13.5px; text-align: left; }
.menu-item:hover, .menu-item:focus { background: var(--surface-2); outline: none; text-decoration: none; }
.menu-item .ic { color: var(--muted); }
.menu-item.is-danger { color: var(--red-700); }
.menu-item.is-danger .ic { color: var(--red); }
.menu-sep { height: 1px; background: var(--line); margin: 6px 4px; }

/* ───────── Toasts ───────── */
.toasts { position: fixed; z-index: 1000; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; width: min(400px, calc(100vw - 32px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; gap: 12px; align-items: flex-start; padding: 12px 12px 12px 14px; border-radius: 12px; background: var(--ink); color: #fff; box-shadow: var(--sh-3); font-size: 13.5px; transform: translateY(8px); opacity: 0; transition: transform .22s var(--ease), opacity .22s; }
.toast.in { transform: none; opacity: 1; }
.toast.out { transform: translateY(4px); opacity: 0; }
.toast p { flex: 1; padding-top: 1px; }
.toast-ic { margin-top: 1px; }
.toast-success .toast-ic { color: #34D399; }
.toast-error .toast-ic { color: #FCA5A5; }
.toast-info .toast-ic { color: #67E8F9; }
.toast-x { border: 0; background: transparent; color: #94A3B8; cursor: pointer; padding: 2px; border-radius: 6px; display: grid; place-items: center; }
.toast-x:hover { color: #fff; }

/* ───────── Modal e gaveta ───────── */
dialog { padding: 0; border: 0; color: var(--ink); }
.modal, .drawer { background: transparent; max-width: none; max-height: none; overflow: visible; }
.modal::backdrop, .drawer::backdrop { background: rgba(15, 23, 42, .45); backdrop-filter: blur(2px); }
.modal[open] { animation: modal-in .22s var(--ease); }
.modal[open]::backdrop, .drawer[open]::backdrop { animation: fade-in .2s ease; }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal .modal-inner { width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); display: flex; flex-direction: column; background: #fff; border-radius: 16px; box-shadow: var(--sh-3); overflow: hidden; }
.modal-sm .modal-inner { width: min(440px, calc(100vw - 32px)); }
.modal-lg .modal-inner { width: min(720px, calc(100vw - 32px)); }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 20px 20px 0 24px; }
.modal-title { font-size: 17px; font-weight: 650; letter-spacing: -.015em; padding-top: 6px; }
.modal-desc { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.modal-x { margin-right: -4px; }
.modal-body { padding: 18px 24px 22px; overflow-y: auto; }
.modal-text { color: var(--slate-600); font-size: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 24px; border-top: 1px solid var(--line); background: var(--bg); flex-wrap: wrap; }

.drawer { margin: 0 0 0 auto; height: 100vh; height: 100dvh; }
.drawer[open] { animation: drawer-in .26s var(--ease); }
@keyframes drawer-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer .modal-inner { width: min(520px, 100vw); height: 100%; display: flex; flex-direction: column; background: #fff; box-shadow: var(--sh-3); }
.drawer .modal-body { flex: 1; }

/* ───────── Autenticação ───────── */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: #fff; }
.auth-brand {
  position: relative; overflow: hidden; color: #E2E8F0; padding: 48px 56px; display: flex; flex-direction: column;
  background:
    radial-gradient(80% 60% at 100% 0%, rgba(6, 182, 212, .2), transparent 60%),
    radial-gradient(70% 60% at 0% 100%, rgba(139, 92, 246, .22), transparent 60%),
    linear-gradient(160deg, #0F172A 0%, #111C36 55%, #0F172A 100%);
}
.auth-brand::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px); background-size: 32px 32px; mask-image: radial-gradient(ellipse at 40% 50%, #000 30%, transparent 75%); pointer-events: none; }
.auth-brand > * { position: relative; }
.auth-logo { display: flex; align-items: center; gap: 12px; color: #fff; font-weight: 680; font-size: 18px; letter-spacing: -.02em; }
.auth-pitch { margin-top: auto; max-width: 520px; }
.auth-pitch h2 { font-size: 34px; line-height: 1.15; letter-spacing: -.03em; color: #fff; font-weight: 680; }
.auth-pitch h2 em { font-style: normal; background: linear-gradient(90deg, #7DD3FC, var(--cyan)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-pitch p { margin-top: 16px; font-size: 15.5px; color: #B6C2D3; line-height: 1.6; }
.auth-points { margin-top: 28px; display: flex; flex-direction: column; gap: 12px; }
.auth-points li { display: flex; gap: 12px; align-items: center; font-size: 14px; color: #CBD5E1; }
.auth-points .ic { color: var(--cyan); padding: 6px; width: 30px; height: 30px; border-radius: 9px; background: rgba(6, 182, 212, .1); box-shadow: inset 0 0 0 1px rgba(6, 182, 212, .25); }
.auth-readout { margin-top: 36px; border-radius: 16px; border: 1px solid rgba(255, 255, 255, .09); background: rgba(15, 23, 42, .55); backdrop-filter: blur(6px); padding: 18px 20px; max-width: 460px; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .5); }
.readout-top { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: #94A3B8; letter-spacing: .06em; text-transform: uppercase; font-weight: 600; }
.readout-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; align-items: center; padding: 12px 0; border-top: 1px solid rgba(255, 255, 255, .06); }
.readout-row:first-of-type { border-top: 0; }
.readout-name { color: #fff; font-weight: 600; font-size: 14px; }
.readout-dose { font-family: var(--mono); color: #7DD3FC; font-size: 14px; }
.readout-ev { grid-column: 1 / -1; display: flex; gap: 6px; flex-wrap: wrap; }
.readout-ev span { font-size: 11.5px; padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, .06); color: #CBD5E1; }
.auth-foot { margin-top: 32px; font-size: 12.5px; color: #7C8BA1; }
.auth-main { display: flex; flex-direction: column; justify-content: center; padding: 48px 24px; }
.auth-card { width: 100%; max-width: 420px; margin: 0 auto; }
.auth-card h1 { font-size: 26px; letter-spacing: -.025em; font-weight: 680; }
.auth-card .sub { color: var(--muted); margin-top: 6px; font-size: 14.5px; }
.auth-card form { margin-top: 28px; }
.auth-alt { margin-top: 22px; text-align: center; color: var(--muted); font-size: 13.5px; }
.auth-mobile-logo { display: none; }
.link-btn { border: 0; background: none; padding: 0; color: var(--blue); font-weight: 550; cursor: pointer; font-size: 13px; }
.link-btn:hover { text-decoration: underline; text-underline-offset: 3px; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 76px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); height: 28px; padding: 0 10px; border-radius: 6px; border: 0; background: transparent; color: var(--slate-600); font-size: 12.5px; font-weight: 550; cursor: pointer; }
.pw-toggle:hover { background: var(--surface-2); }
.invite-card { display: flex; gap: 14px; align-items: center; padding: 16px; border-radius: 12px; background: var(--blue-50); border: 1px solid var(--blue-100); margin-top: 24px; }
.invite-card .avatar { width: 40px; height: 40px; font-size: 14px; }
.invite-card p { font-size: 13.5px; color: var(--slate-600); }
.invite-card strong { color: var(--ink); }
.form-error { padding: 10px 12px; border-radius: 9px; background: var(--red-50); border: 1px solid var(--red-200); color: var(--red-700); font-size: 13.5px; display: flex; gap: 8px; align-items: flex-start; }

/* ───────── Painel ───────── */
.hero { position: relative; overflow: hidden; display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 28px 32px; border-radius: var(--r-xl); color: #fff; margin-bottom: 24px; flex-wrap: wrap;
  background:
    radial-gradient(80% 140% at 100% 0%, rgba(6, 182, 212, .35), transparent 55%),
    radial-gradient(60% 120% at 0% 100%, rgba(139, 92, 246, .3), transparent 60%),
    linear-gradient(120deg, #0F172A, #142451);
  box-shadow: 0 18px 40px -20px rgba(15, 23, 42, .6);
}
.hero::after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px); background-size: 28px 28px; mask-image: linear-gradient(90deg, transparent, #000 70%); pointer-events: none; }
.hero > * { position: relative; z-index: 1; }
.hero .eyebrow { color: #93C5FD; }
.hero h1 { font-size: 26px; letter-spacing: -.025em; font-weight: 680; }
.hero p.sub { color: #B6C2D3; margin-top: 6px; font-size: 14.5px; }
.hero .pulse-line { position: absolute; right: 220px; bottom: -6px; opacity: .5; z-index: 0; }
.btn-hero { --b-bg: #fff; --b-fg: var(--ink); --b-hover: #EEF4FF; box-shadow: 0 10px 24px -10px rgba(0, 0, 0, .5); }
.btn-hero .ic { color: var(--blue); }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; box-shadow: var(--sh-1); position: relative; color: inherit; transition: border-color .15s, box-shadow .15s, transform .15s; }
a.kpi:hover { text-decoration: none; border-color: var(--blue-200); box-shadow: var(--sh-2); }
.kpi-label { font-size: 12.5px; color: var(--muted); font-weight: 550; display: flex; align-items: center; gap: 8px; }
.kpi-label .ic { color: var(--slate-400); }
.kpi-value { font-size: 30px; line-height: 1.1; font-weight: 680; letter-spacing: -.03em; font-variant-numeric: tabular-nums; color: var(--ink); }
.kpi-value small { font-size: 15px; color: var(--muted); font-weight: 550; letter-spacing: 0; }
.kpi-foot { font-size: 12.5px; color: var(--muted); }
.kpi .meter { margin-top: 6px; }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 20px; margin-top: 20px; align-items: start; }
.dash-grid > .card + .card { margin-top: 0; }

.checklist { display: flex; flex-direction: column; }
.check-item { display: flex; gap: 14px; align-items: center; padding: 12px 6px; border-top: 1px solid var(--line-2); color: inherit; border-radius: 8px; }
.check-item:first-child { border-top: 0; }
a.check-item:hover { background: var(--bg); text-decoration: none; }
.check-dot { flex: none; width: 24px; height: 24px; border-radius: 50%; border: 1.5px dashed var(--slate-300); display: grid; place-items: center; color: transparent; }
.check-item.is-done .check-dot { background: var(--green); border: 0; color: #fff; }
.check-item .check-body { flex: 1; min-width: 0; }
.check-item .check-title { font-weight: 560; font-size: 14px; }
.check-item.is-done .check-title { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--slate-300); }
.check-item .check-sub { font-size: 12.5px; color: var(--muted); }
.check-item .ic-go { color: var(--slate-400); }
.progress-ring-wrap { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }

/* ───────── Listas (linhas que viram cartões no celular) ───────── */
.list { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-1); overflow: hidden; }
.list-head, .list-row { display: grid; align-items: center; gap: 16px; padding: 0 20px; }
.list-head { height: 40px; font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .02em; background: var(--bg); border-bottom: 1px solid var(--line); }
.list-row { min-height: 60px; padding-top: 10px; padding-bottom: 10px; border-top: 1px solid var(--line-2); color: inherit; transition: background-color .12s; }
.list-head + .list-row, .list-row:first-child { border-top: 0; }
a.list-row:hover, .list-row.is-click:hover { background: #FAFBFD; text-decoration: none; }
a.list-row:focus-visible { outline-offset: -2px; }
.cols-atend { grid-template-columns: minmax(0, 2fr) 130px 150px 90px 20px; }
.cols-cli { grid-template-columns: minmax(0, 2fr) minmax(0, 1.2fr) 130px 120px 20px; }
.cols-cat { grid-template-columns: minmax(0, 2fr) minmax(0, 1.5fr) 120px 130px 110px 64px; }
.cell-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cell-main .avatar { width: 34px; height: 34px; font-size: 12px; background: linear-gradient(135deg, #DCE7FE, #CFFAFE); color: var(--blue-700); }
.cell-title { font-weight: 580; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell-sub { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell-text { min-width: 0; }
.cell-muted { color: var(--slate-600); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.cell-go { color: var(--slate-400); }
.cell-label { display: none; }
.row-inactive { opacity: .55; }

.tabs { display: flex; gap: 4px; padding: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 11px; width: max-content; max-width: 100%; overflow-x: auto; scrollbar-width: none; margin-bottom: 16px; }
.tabs::-webkit-scrollbar { display: none; }
.tab { height: 32px; padding: 0 14px; border-radius: 8px; display: inline-flex; align-items: center; gap: 8px; color: var(--slate-600); font-weight: 550; font-size: 13.5px; white-space: nowrap; border: 0; background: transparent; cursor: pointer; }
.tab:hover { color: var(--ink); text-decoration: none; }
.tab[aria-current="page"], .tab[aria-selected="true"] { background: #fff; color: var(--ink); box-shadow: var(--sh-1), 0 0 0 1px var(--line); }
.toolbar { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .combo, .toolbar .search { width: min(360px, 100%); }
.search { position: relative; }
.search .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--slate-400); pointer-events: none; }
.search .input { padding-left: 36px; }

/* ───────── Novo atendimento ───────── */
.pick { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.client-results { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; max-height: 420px; overflow: auto; }
.client-opt { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: #fff; cursor: pointer; text-align: left; width: 100%; transition: all .12s; }
.client-opt:hover { border-color: var(--slate-300); background: var(--bg); }
.client-opt[aria-pressed="true"] { border-color: var(--blue); background: var(--blue-50); box-shadow: 0 0 0 3px rgba(26, 86, 219, .12); }
.client-opt .avatar { width: 34px; height: 34px; font-size: 12px; background: linear-gradient(135deg, #DCE7FE, #CFFAFE); color: var(--blue-700); }
.client-opt .cell-text { flex: 1; }
.client-opt .radio { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--slate-300); flex: none; }
.client-opt[aria-pressed="true"] .radio { border: 5px solid var(--blue); }
.or-sep { display: none; }

/* ───────── Atendimento (tela principal) ───────── */
.at-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 24px; }
.at-title { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.at-meta { display: flex; gap: 6px 16px; flex-wrap: wrap; color: var(--muted); font-size: 13.5px; margin-top: 8px; align-items: center; }
.at-meta span { display: inline-flex; gap: 6px; align-items: center; }
.at-actions { display: flex; gap: 10px; align-items: center; }
.save-ind { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); height: 28px; padding: 0 10px; border-radius: 999px; background: #fff; border: 1px solid var(--line); transition: opacity .2s; }
.save-ind .ic { color: var(--green); }
.save-ind.is-saving .ic { display: none; }
.save-ind.is-error { color: var(--red-700); border-color: var(--red-200); background: var(--red-50); }
.save-ind.is-error .ic { color: var(--red); }
.save-ind.is-idle { display: none; }

.at-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 32px; align-items: start; }
.steps { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 2px; }
.steps-title { font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; font-weight: 650; color: var(--muted); margin: 0 0 10px 10px; }
.step { position: relative; display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 9px; color: var(--slate-600); font-weight: 520; font-size: 13.5px; }
.step:hover { background: #fff; color: var(--ink); text-decoration: none; }
.step-num { position: relative; z-index: 1; flex: none; width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--slate-300); background: var(--bg); display: grid; place-items: center; font-size: 11.5px; font-weight: 650; font-variant-numeric: tabular-nums; color: var(--slate-600); transition: all .2s; }
.step:not(:last-child)::after { content: ""; position: absolute; left: 21.5px; top: 32px; height: 14px; width: 1.5px; background: var(--line); }
.step.is-done .step-num { background: var(--green); border-color: var(--green); color: #fff; }
.step.is-current { background: #fff; color: var(--ink); box-shadow: var(--sh-1), 0 0 0 1px var(--line); }
.step.is-current .step-num { border-color: var(--blue); color: var(--blue); background: var(--blue-50); }
.step.is-current.is-done .step-num { background: var(--green); border-color: var(--green); color: #fff; }
.step.is-locked { color: var(--slate-400); }
.step-sub { font-size: 11.5px; color: var(--muted); display: block; font-weight: 450; }

.sec { scroll-margin-top: 20px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-1); margin-bottom: 20px; min-width: 0; }
.sec-head { display: flex; gap: 14px; align-items: flex-start; justify-content: space-between; padding: 20px 24px 0; flex-wrap: wrap; }
.sec-head-l { display: flex; gap: 14px; align-items: flex-start; min-width: 0; }
.sec-num { flex: none; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-family: var(--mono); font-size: 12.5px; font-weight: 600; color: var(--blue-700); background: var(--blue-50); box-shadow: inset 0 0 0 1px var(--blue-100); }
.sec-title { font-size: 16px; font-weight: 640; letter-spacing: -.012em; }
.sec-desc { color: var(--muted); font-size: 13.5px; margin-top: 2px; max-width: 70ch; }
.sec-body { padding: 20px 24px 24px; display: flex; flex-direction: column; gap: 20px; }
.sec-ro .chip { box-shadow: none; }

/* Medicamentos */
.med-list { display: flex; flex-direction: column; gap: 8px; }
.med { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 220px) auto; gap: 10px; align-items: center; padding: 8px 8px 8px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); }
.med-name { display: flex; align-items: center; gap: 10px; font-weight: 560; min-width: 0; }
.med-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.med-name .ic { color: var(--amber-700); flex: none; }

/* Upload */
.drop { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 28px 20px; border: 1.5px dashed var(--slate-300); border-radius: 14px; background: linear-gradient(180deg, #fff, var(--bg)); text-align: center; cursor: pointer; transition: border-color .15s, background-color .15s; }
.drop:hover, .drop.is-over { border-color: var(--blue); background: var(--blue-50); }
.drop:focus-within { border-color: var(--blue); box-shadow: var(--focus); }
.drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.drop-ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: var(--blue); background: #fff; box-shadow: var(--sh-2), inset 0 0 0 1px var(--blue-100); }
.drop-title { font-weight: 600; }
.drop-title u { color: var(--blue); text-decoration: none; }
.drop-sub { color: var(--muted); font-size: 12.5px; }
.drop.is-busy { pointer-events: none; border-style: solid; border-color: var(--blue-200); background: var(--blue-50); }
.files { display: flex; flex-wrap: wrap; gap: 8px; }
.file-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 10px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12.5px; color: var(--slate-700); max-width: 100%; }
.file-chip .ic { color: var(--red-700); }
.file-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.tbl th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 0 12px 8px; letter-spacing: .02em; white-space: nowrap; }
.tbl td { padding: 10px 12px; border-top: 1px solid var(--line-2); vertical-align: middle; }
.tbl tr:first-child td { border-top: 0; }
.tbl-wrap { border: 1px solid var(--line); border-radius: 12px; padding: 12px 0 2px; overflow-x: auto; }
.tbl .input-sm { width: 110px; }
.tbl .w-range { width: 34%; min-width: 160px; }
.td-marker { font-weight: 560; }
.td-unit { color: var(--muted); white-space: nowrap; }
.td-ideal { font-family: var(--mono); font-size: 12.5px; color: var(--slate-600); white-space: nowrap; }

.add-marker { display: grid; grid-template-columns: minmax(0, 1fr) 140px auto; gap: 10px; align-items: end; padding: 14px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); }

details.disclosure { border: 1px solid var(--line); border-radius: 12px; background: #fff; }
details.disclosure > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 12px 14px; font-weight: 580; border-radius: 12px; }
details.disclosure > summary::-webkit-details-marker { display: none; }
details.disclosure > summary .ic-chev { margin-left: auto; color: var(--muted); transition: transform .2s; }
details.disclosure[open] > summary .ic-chev { transform: rotate(180deg); }
details.disclosure > summary:hover { background: var(--bg); }
details.disclosure > summary:focus-visible { outline-offset: -2px; }
.disclosure-body { padding: 4px 14px 14px; display: flex; flex-direction: column; gap: 10px; }
.gene-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 10px; align-items: center; }

/* Range bar */
.range { width: 100%; min-width: 120px; padding: 6px 0; }
.range-track { position: relative; height: 6px; border-radius: 999px; background: repeating-linear-gradient(90deg, var(--line) 0 1px, var(--line-2) 1px 10%); }
.range-band { position: absolute; top: -2px; bottom: -2px; border-radius: 999px; background: rgba(16, 185, 129, .25); box-shadow: inset 0 0 0 1px rgba(16, 185, 129, .45); }
.range-pin { position: absolute; top: 50%; width: 12px; height: 12px; margin-left: -6px; transform: translateY(-50%) rotate(45deg); border-radius: 2px; background: var(--green-700); box-shadow: 0 0 0 2px #fff, 0 1px 3px rgba(15, 23, 42, .3); }
.range-off .range-pin { background: var(--amber); }

/* Gerar */
.gen { position: relative; overflow: hidden; display: flex; gap: 20px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 22px 24px; border-radius: var(--r-lg); background: linear-gradient(120deg, #F3F7FF, #EFFCFF); border: 1px solid var(--blue-100); }
.gen-summary { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.gen-text h3 { font-size: 15px; font-weight: 640; }
.gen-text p { color: var(--slate-600); font-size: 13.5px; margin-top: 2px; }
.gen-cta { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.gen-cta .hint { text-align: right; }
.gen-loading { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 28px 16px 24px; text-align: center; }
.gen-loading .pulse-line { width: min(320px, 100%); height: auto; }
.pulse-track { stroke: var(--blue-100); stroke-width: 3; }
.pulse-draw { stroke: url(#none); stroke: var(--blue); stroke-width: 3; stroke-dasharray: .28 1; stroke-dashoffset: 1.28; animation: pulse-run 1.8s linear infinite; }
@keyframes pulse-run { to { stroke-dashoffset: 0; } }
.gen-phases { display: flex; flex-direction: column; gap: 8px; text-align: left; min-width: min(340px, 100%); }
.phase { display: flex; gap: 10px; align-items: center; font-size: 13.5px; color: var(--slate-400); transition: color .3s; }
.phase .phase-dot { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--line); color: transparent; flex: none; }
.phase.is-active { color: var(--ink); font-weight: 560; }
.phase.is-active .phase-dot { border-color: var(--blue); border-right-color: transparent; animation: spin .8s linear infinite; }
.phase.is-done { color: var(--slate-600); }
.phase.is-done .phase-dot { background: var(--green); border-color: var(--green); color: #fff; }
.limit-card { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 18px 20px; border-radius: 14px; border: 1px solid var(--amber-200); background: var(--amber-50); }
.limit-card .ic-big { color: var(--amber-700); }
.limit-card h3 { font-size: 15px; font-weight: 640; }
.limit-card p { font-size: 13.5px; color: var(--slate-600); }

/* Protocolo */
.proto-sum { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.proto-sum > div { padding: 16px 18px; border-left: 1px solid var(--line); min-width: 0; }
.proto-sum > div:first-child { border-left: 0; }
.ps-label { font-size: 12px; color: var(--muted); font-weight: 550; display: flex; gap: 6px; align-items: center; }
.ps-value { font-size: 22px; font-weight: 680; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: 2px; display: flex; align-items: center; gap: 8px; }
.ps-value .badge { font-size: 12px; letter-spacing: 0; }
.ps-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.ai-note { display: flex; gap: 12px; padding: 14px 16px; border-radius: 12px; background: linear-gradient(120deg, var(--violet-50), #F3F7FF); border: 1px solid var(--violet-200); font-size: 13.5px; color: var(--slate-700); }
.ai-note .ic { color: var(--violet-700); margin-top: 2px; }
.ai-note strong { color: var(--ink); }

.items { display: flex; flex-direction: column; gap: 14px; }
.item { position: relative; border: 1px solid var(--line); border-radius: 14px; background: #fff; padding: 20px 20px 18px 24px; display: flex; flex-direction: column; gap: 14px; transition: border-color .15s, box-shadow .15s, opacity .2s; }
.item::before { content: ""; position: absolute; left: 0; top: 18px; bottom: 18px; width: 3px; border-radius: 0 3px 3px 0; background: linear-gradient(var(--blue), var(--cyan)); }
.item:hover { box-shadow: var(--sh-2); }
.item.is-out { background: var(--bg); }
.item.is-out::before { background: var(--slate-300); }
.item.is-out .item-name, .item.is-out .dose-big { color: var(--muted); }
.item-top { display: flex; gap: 16px; justify-content: space-between; align-items: flex-start; }
.item-id { min-width: 0; }
.item-name { font-size: 16px; font-weight: 640; letter-spacing: -.012em; }
.item-badges { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; align-items: center; }
.item-dose { text-align: right; flex: none; }
.dose-big { font-family: var(--mono); font-size: 22px; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; color: var(--ink); line-height: 1.15; }
.dose-big small { font-size: 13px; color: var(--muted); font-weight: 500; letter-spacing: 0; margin-left: 2px; }
.dose-time { font-size: 12.5px; color: var(--slate-600); display: inline-flex; gap: 6px; align-items: center; justify-content: flex-end; margin-top: 4px; }
.dose-time .ic { color: var(--amber-700); }
.dose-why { font-size: 12px; color: var(--muted); margin-top: 2px; max-width: 260px; margin-left: auto; }
.reg-text { font-size: 12.5px; color: var(--amber-700); margin-top: 6px; max-width: 70ch; }
.item-grid { display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: 20px; align-items: start; }
.item-k { font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 650; margin-bottom: 8px; }
.score { display: flex; align-items: center; gap: 10px; }
.score-track { position: relative; flex: 1; height: 8px; border-radius: 3px; background: var(--line-2); overflow: hidden; }
.score-fill { height: 100%; background: linear-gradient(90deg, var(--blue), var(--cyan)); border-radius: 3px; }
.score-track::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 2px), #fff calc(10% - 2px) 10%); }
.score-val { font-family: var(--mono); font-size: 13px; font-weight: 600; min-width: 26px; text-align: right; }

.evs { display: flex; flex-wrap: wrap; gap: 6px; }
.ev { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 999px; border: 1px solid; font-size: 12.5px; font-weight: 520; cursor: pointer; background: #fff; max-width: 100%; }
.ev > span.ev-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev:focus-visible { outline: none; box-shadow: var(--focus); }
.ev-exame { color: var(--blue-700); background: var(--blue-50); border-color: var(--blue-100); }
.ev-sintoma { color: var(--violet-700); background: var(--violet-50); border-color: var(--violet-200); }
.ev-deplecao { color: var(--amber-700); background: var(--amber-50); border-color: var(--amber-200); }
.ev-genetica { color: var(--cyan-700); background: var(--cyan-50); border-color: var(--cyan-200); }
.ev-literatura { color: var(--slate-700); background: var(--surface-2); border-color: var(--line); }
.ev[aria-expanded="true"] { box-shadow: 0 0 0 2px currentColor inset; }
.ev-tip { position: absolute; z-index: 20; bottom: calc(100% + 8px); left: 0; width: max-content; max-width: 280px; padding: 8px 10px; border-radius: 8px; background: var(--ink); color: #fff; font-size: 12.5px; font-weight: 450; line-height: 1.45; text-align: left; white-space: normal; box-shadow: var(--sh-3); opacity: 0; transform: translateY(4px); pointer-events: none; transition: opacity .15s, transform .15s; }
@media (hover: hover) and (pointer: fine) {
  .ev:hover .ev-tip, .ev:focus-visible .ev-tip { opacity: 1; transform: none; }
}
.ev-detail { font-size: 13px; color: var(--slate-700); padding: 10px 12px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); display: flex; gap: 8px; align-items: flex-start; }
.ev-detail .ic { margin-top: 2px; }

.cat-line { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--slate-700); }
.cat-line .ic { color: var(--muted); }
.cat-line.is-magistral { color: var(--violet-700); }
.cat-line.is-magistral .ic { color: var(--violet-700); }
.item-alerts { display: flex; flex-direction: column; gap: 6px; }
.item-alert { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--amber-700); }
.item-alert .ic { margin-top: 2px; flex: none; }
.item-note { font-size: 13px; color: var(--slate-700); padding: 10px 12px; border-radius: 10px; background: var(--blue-50); border: 1px solid var(--blue-100); }
.item-note strong { color: var(--blue-700); font-weight: 600; }
.item-foot { display: flex; gap: 12px 24px; flex-wrap: wrap; align-items: center; padding-top: 12px; border-top: 1px dashed var(--line); }

.item-edit { display: grid; grid-template-columns: 170px 170px minmax(0, 1fr); gap: 12px; padding: 14px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); }
.item-edit .span-all { grid-column: 1 / -1; }
.item-edit-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dose-warn { font-size: 12px; color: var(--amber-700); }

.agenda { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.agenda::before { content: ""; position: absolute; left: 24px; right: 24px; top: 21px; height: 2px; background: linear-gradient(90deg, #FCD34D, var(--amber), #A78BFA, var(--violet-700)); opacity: .5; border-radius: 2px; }
.ag-col { position: relative; display: flex; flex-direction: column; gap: 10px; }
.ag-head { display: flex; align-items: center; gap: 10px; font-weight: 640; font-size: 14px; }
.ag-dot { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: #fff; border: 1px solid var(--line); box-shadow: var(--sh-2); flex: none; }
.ag-manha .ag-dot { color: #D97706; }
.ag-almoco .ag-dot { color: var(--amber-700); }
.ag-noite .ag-dot { color: var(--violet-700); }
.ag-items { display: flex; flex-direction: column; gap: 6px; }
.ag-item { display: flex; justify-content: space-between; gap: 10px; padding: 9px 12px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line-2); font-size: 13px; }
.ag-item span:first-child { font-weight: 540; min-width: 0; }
.ag-item .mono { color: var(--slate-600); white-space: nowrap; font-size: 12.5px; }
.ag-empty { font-size: 12.5px; color: var(--slate-400); padding: 9px 12px; border: 1px dashed var(--line); border-radius: 10px; }

.excl { display: flex; flex-direction: column; gap: 8px; }
.excl-item { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; padding: 12px 14px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); }
.excl-item .ic { color: var(--slate-400); grid-row: span 2; margin-top: 2px; }
.excl-name { font-weight: 580; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.excl-text { font-size: 13px; color: var(--slate-600); }
.dir-badge { font-size: 12px; font-weight: 560; }
.dir-baixo { color: var(--amber-700); }
.dir-alto { color: var(--red-700); }
.dir-ok { color: var(--green-700); }
.deplecoes { display: flex; flex-direction: column; gap: 8px; }
.deplecao { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 13.5px; }
.deplecao strong { font-weight: 600; }

.obs-cliente { padding: 14px 16px; border-radius: 12px; background: var(--green-50); border: 1px solid var(--green-200); font-size: 14px; color: var(--ink-2); white-space: pre-wrap; }

.edit-bar-slot { position: sticky; bottom: 16px; z-index: 25; }
.edit-bar { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 12px 12px 12px 18px; border-radius: 14px; background: var(--ink); color: #fff; box-shadow: var(--sh-3); margin-top: 8px; animation: modal-in .2s var(--ease); }
.edit-bar p { font-size: 13.5px; display: flex; gap: 8px; align-items: center; }
.edit-bar p .ic { color: var(--cyan); }
.edit-bar .btn-secondary { --b-bg: transparent; --b-fg: #fff; --b-bd: rgba(255, 255, 255, .2); --b-hover: rgba(255, 255, 255, .08); box-shadow: none; }

/* Aprovação */
.approved { position: relative; overflow: hidden; border-radius: var(--r-xl); border: 1px solid var(--green-200); background: linear-gradient(135deg, #F0FDF7 0%, #fff 60%); padding: 24px; margin-bottom: 20px; scroll-margin-top: 20px; }
.approved::after { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, rgba(16, 185, 129, .18), transparent 70%); pointer-events: none; }
.approved-head { display: flex; gap: 14px; align-items: center; }
.approved-ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--green); color: #fff; box-shadow: 0 8px 18px -8px rgba(16, 185, 129, .8); flex: none; }
.approved h2 { font-size: 18px; font-weight: 660; letter-spacing: -.015em; }
.approved .sub { color: var(--slate-600); font-size: 13.5px; }
.link-box { display: flex; gap: 8px; align-items: center; margin-top: 18px; padding: 6px 6px 6px 14px; border-radius: 11px; background: #fff; border: 1px solid var(--line); box-shadow: var(--sh-1); }
.link-box .ic { color: var(--muted); }
.link-box code { flex: 1; min-width: 0; font-family: var(--mono); font-size: 13px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.approved-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; position: relative; z-index: 1; }

.timeline { position: relative; display: flex; flex-direction: column; gap: 0; }
.tl-item { position: relative; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; padding-bottom: 18px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item:not(:last-child)::before { content: ""; position: absolute; left: 13.5px; top: 28px; bottom: 0; width: 1.5px; background: var(--line); }
.tl-dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: #fff; border: 1px solid var(--line); color: var(--slate-600); }
.tl-motor .tl-dot { color: var(--blue); border-color: var(--blue-100); background: var(--blue-50); }
.tl-revisao .tl-dot { color: var(--violet-700); border-color: var(--violet-200); background: var(--violet-50); }
.tl-aprovacao .tl-dot { color: #fff; border-color: var(--green); background: var(--green); }
.tl-title { font-weight: 580; font-size: 13.5px; padding-top: 4px; }
.tl-meta { font-size: 12.5px; color: var(--muted); }

.approve-box { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 18px 20px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg); }
.approve-box p { font-size: 13.5px; color: var(--slate-600); max-width: 60ch; }
.approve-box h3 { font-size: 15px; font-weight: 640; margin-bottom: 2px; }
.approve-sign { padding: 14px 16px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); font-size: 13.5px; color: var(--slate-700); display: flex; gap: 10px; align-items: flex-start; }
.approve-sign .ic { color: var(--blue); margin-top: 2px; }

.banner-archived { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); color: var(--slate-700); margin-bottom: 20px; font-size: 13.5px; }
.stale-note { margin-top: 10px; }

/* ───────── Catálogo ───────── */
.composto-info { padding: 12px 14px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); font-size: 13px; color: var(--slate-600); display: flex; flex-direction: column; gap: 6px; }
.composto-info strong { color: var(--ink); }
.code-block { font-family: var(--mono); font-size: 12.5px; padding: 10px 12px; border-radius: 9px; background: var(--ink); color: #E2E8F0; overflow-x: auto; white-space: pre; }
.import-result { display: flex; flex-direction: column; gap: 10px; }
.ign-list { max-height: 200px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.ign-list li { display: flex; gap: 12px; padding: 8px 12px; border-top: 1px solid var(--line-2); font-size: 13px; }
.ign-list li:first-child { border-top: 0; }
.ign-list .mono { color: var(--muted); flex: none; }
.unlinked { color: var(--amber-700); font-size: 12.5px; display: inline-flex; gap: 6px; align-items: center; }

/* ───────── Equipe ───────── */
.members { display: flex; flex-direction: column; }
.member { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 16px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line-2); }
.member:first-child { border-top: 0; padding-top: 0; }
.member .avatar { width: 38px; height: 38px; font-size: 13px; }
.member.is-off { opacity: .55; }
.you { font-size: 11.5px; font-weight: 600; color: var(--blue-700); background: var(--blue-50); padding: 1px 7px; border-radius: 999px; margin-left: 6px; }
.invite-result { margin-top: 16px; padding: 16px; border-radius: 12px; background: var(--green-50); border: 1px solid var(--green-200); display: flex; flex-direction: column; gap: 10px; animation: modal-in .2s var(--ease); }
.invite-result p { font-size: 13.5px; color: var(--slate-700); }
.pending { display: flex; flex-direction: column; gap: 8px; }
.pending-item { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); flex-wrap: wrap; }
.equipe-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.equipe-grid > .card + .card, .stack > .card + .card { margin-top: 0; }
.stack { display: flex; flex-direction: column; gap: 20px; }

/* ───────── Empresa ───────── */
.brand-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.color-pick { display: flex; gap: 10px; align-items: center; }
.color-pick input[type=color] { width: 46px; height: 40px; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: #fff; cursor: pointer; }
.color-pick input[type=color]:disabled { cursor: default; }
.color-pick .input { width: 130px; font-family: var(--mono); text-transform: uppercase; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.swatch { width: 26px; height: 26px; border-radius: 8px; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); cursor: pointer; padding: 0; }
.swatch:focus-visible { outline: none; box-shadow: 0 0 0 1px var(--line), var(--focus); }
.logo-up { display: flex; gap: 16px; align-items: center; }
.logo-box { width: 84px; height: 84px; border-radius: 14px; border: 1px dashed var(--slate-300); background: var(--bg); display: grid; place-items: center; overflow: hidden; color: var(--slate-400); flex: none; }
.logo-box img { max-width: 100%; max-height: 100%; object-fit: contain; }
.preview { border-radius: 16px; border: 1px solid var(--line); overflow: hidden; background: #fff; box-shadow: var(--sh-2); }
.preview-bar { height: 6px; }
.preview-head { display: flex; gap: 12px; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--line-2); }
.preview-logo { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 14px; overflow: hidden; flex: none; background: #fff; }
.preview-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.preview-body { padding: 16px 18px 18px; }
.preview-body .pv-hello { font-size: 18px; font-weight: 680; letter-spacing: -.02em; }
.preview-body .pv-sub { font-size: 13px; color: var(--muted); }
.pv-item { display: flex; justify-content: space-between; padding: 10px 12px; border-radius: 10px; margin-top: 12px; border: 1px solid var(--line); font-size: 13px; }
.pv-tag { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.ro-note { margin-bottom: 20px; }

/* ───────── Plano ───────── */
.plan-current { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 24px; align-items: center; }
.plan-current h2 { font-size: 22px; font-weight: 680; letter-spacing: -.02em; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.plan-meters { display: flex; flex-direction: column; gap: 16px; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.plan { position: relative; display: flex; flex-direction: column; gap: 14px; padding: 24px; border-radius: 16px; background: #fff; border: 1px solid var(--line); box-shadow: var(--sh-1); }
.plan.is-featured { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(26, 86, 219, .1), var(--sh-2); }
.plan-ribbon { position: absolute; top: -11px; left: 24px; height: 22px; padding: 0 10px; border-radius: 999px; background: linear-gradient(90deg, var(--blue), var(--cyan)); color: #fff; font-size: 11.5px; font-weight: 650; display: inline-flex; align-items: center; letter-spacing: .02em; }
.plan-name { font-size: 16px; font-weight: 650; }
.plan-desc { color: var(--muted); font-size: 13.5px; min-height: 40px; }
.plan-price { font-size: 30px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.plan-price small { font-size: 14px; color: var(--muted); font-weight: 500; letter-spacing: 0; }
.plan-price.is-tbd { font-size: 17px; color: var(--slate-600); font-weight: 600; letter-spacing: -.01em; padding: 8px 0; }
.plan-feats { display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; color: var(--slate-700); }
.plan-feats li { display: flex; gap: 8px; align-items: center; }
.plan-feats .ic { color: var(--green); }
.plan .btn { margin-top: auto; }
.success-wrap { max-width: 560px; margin: 8vh auto 0; text-align: center; }
.success-ic { width: 72px; height: 72px; margin: 0 auto 20px; border-radius: 22px; display: grid; place-items: center; }
.success-ic.ok { background: var(--green); color: #fff; box-shadow: 0 16px 32px -14px rgba(16, 185, 129, .8); animation: pop .4s var(--ease); }
.success-ic.wait { background: var(--blue-50); color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue-100); }
@keyframes pop { from { transform: scale(.7); opacity: 0; } to { transform: none; opacity: 1; } }
.success-wrap h1 { font-size: 26px; font-weight: 680; letter-spacing: -.025em; }
.success-wrap p { color: var(--slate-600); margin-top: 8px; font-size: 15px; }
.success-wrap .btn { margin-top: 24px; }

/* ───────── Responsivo ───────── */
@media (max-width: 1180px) {
  .dash-grid { grid-template-columns: minmax(0, 1fr); }
  .cols-cat { grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr) 110px 120px 64px; }
  .cols-cat .c-forma { display: none; }
  .item-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1040px) {
  .main-inner { padding: 28px 24px 96px; }
  .kpis, .sk-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .at-layout { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .steps { position: static; flex-direction: row; overflow-x: auto; gap: 6px; padding: 2px 2px 6px; scrollbar-width: none; margin: 0 -2px; }
  .steps::-webkit-scrollbar { display: none; }
  .steps-title { display: none; }
  .step { flex: none; background: #fff; border: 1px solid var(--line); padding: 6px 12px 6px 6px; border-radius: 999px; }
  .step:not(:last-child)::after { display: none; }
  .step-sub { display: none; }
  .equipe-grid, .pick, .brand-row, .plan-current { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .topbar {
    display: flex; position: sticky; top: 0; z-index: 35; height: 56px; align-items: center; gap: 8px; padding: 0 12px 0 8px;
    background: rgba(255, 255, 255, .88); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line);
    transition: transform .22s var(--ease);
  }
  .topbar.is-hidden { transform: translateY(-100%); }
  .topbar-logo { display: flex; align-items: center; gap: 8px; font-weight: 680; letter-spacing: -.02em; color: var(--ink); font-size: 15.5px; }
  .topbar-logo:hover { text-decoration: none; }
  .topbar-plan { margin-left: auto; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--blue-50); color: var(--blue-700); border: 1px solid var(--blue-100); white-space: nowrap; font-variant-numeric: tabular-nums; }
  .topbar-plan.is-full { background: var(--amber-50); color: var(--amber-700); border-color: var(--amber-200); }
  .topbar-plan:hover { text-decoration: none; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: min(300px, 86vw); height: 100%; transform: translateX(-102%); transition: transform .26s var(--ease); box-shadow: none; }
  .shell.nav-open .sidebar { transform: none; box-shadow: var(--sh-3); }
  .scrim { display: block; position: fixed; inset: 0; z-index: 38; background: rgba(15, 23, 42, .45); opacity: 0; pointer-events: none; transition: opacity .2s; }
  .shell.nav-open .scrim { opacity: 1; pointer-events: auto; }
  .main-inner { padding: 20px 16px 88px; }
  .page-title { font-size: 22px; }
  .page-head { margin-bottom: 20px; }
  .card { padding: 18px; }
  .card-head { flex-direction: column; margin-bottom: 16px; }
  .hero { padding: 22px 20px; }
  .hero h1 { font-size: 22px; }
  .hero .pulse-line { display: none; }
  .hero .btn { width: 100%; }

  .list { background: transparent; border: 0; box-shadow: none; overflow: visible; display: flex; flex-direction: column; gap: 10px; }
  .list-head { display: none; }
  .list-row { grid-template-columns: minmax(0, 1fr) auto !important; background: #fff; border: 1px solid var(--line) !important; border-radius: 12px; padding: 14px 16px; gap: 8px 12px; box-shadow: var(--sh-1); }
  .list-row > .cell-main { grid-column: 1 / -1; }
  .list-row > .cell-go { display: none; }
  .cell-label { display: inline; color: var(--muted); font-size: 12px; margin-right: 6px; }
  .cols-cat .c-forma { display: block; }

  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-brand { display: none; }
  .auth-mobile-logo { display: flex; align-items: center; gap: 10px; font-weight: 680; font-size: 17px; letter-spacing: -.02em; margin-bottom: 32px; }
  .auth-main { justify-content: flex-start; padding: 28px 20px 40px; }

  .sec-head { padding: 16px 16px 0; }
  .sec-body { padding: 16px; }
  .proto-sum { grid-template-columns: minmax(0, 1fr); }
  .proto-sum > div { border-left: 0; border-top: 1px solid var(--line); }
  .proto-sum > div:first-child { border-top: 0; }
  .agenda { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .agenda::before { left: 21px; right: auto; top: 22px; bottom: 22px; width: 2px; height: auto; background: linear-gradient(#FCD34D, var(--amber), #A78BFA, var(--violet-700)); }
  .ag-items { padding-left: 54px; }
  .item { padding: 16px 16px 16px 20px; }
  .item-top { flex-direction: column; gap: 10px; }
  .item-dose { text-align: left; }
  .dose-time { justify-content: flex-start; }
  .dose-why { margin-left: 0; }
  .item-edit { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .add-marker { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .add-marker .btn { grid-column: 1 / -1; }
  .med { grid-template-columns: minmax(0, 1fr) auto; }
  .med .med-dose { grid-column: 1 / -1; grid-row: 2; }
  .gen-cta { align-items: stretch; width: 100%; }
  .gen-cta .hint { text-align: left; }
  .edit-bar-slot { bottom: 10px; }
  .edit-bar .form-actions { width: 100%; }
  .edit-bar .btn { flex: 1; }
  .at-actions { width: 100%; }
  .toasts { left: 16px; right: 16px; bottom: 16px; width: auto; }

  /* Tabela de exames vira cartões */
  .tbl-cards thead { display: none; }
  .tbl-cards, .tbl-cards tbody, .tbl-cards tr, .tbl-cards td { display: block; width: 100%; }
  .tbl-wrap:has(.tbl-cards) { border: 0; padding: 0; overflow: visible; }
  .tbl-cards tr { position: relative; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; background: #fff; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 12px; }
  .tbl-cards td { border: 0 !important; padding: 0; }
  .tbl-cards td.td-marker { grid-column: 1 / -1; padding-right: 40px; }
  .tbl-cards td.w-range { grid-column: 1 / -1; }
  .tbl-cards td.td-x { position: absolute; top: 8px; right: 8px; width: auto; }
  .tbl-cards td[data-label]::before { content: attr(data-label); display: block; font-size: 11.5px; color: var(--muted); font-weight: 600; margin-bottom: 2px; }
  .tbl-cards .input-sm { width: 100%; }
}
@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
  .kpis, .sk-kpis { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
  .kpi { padding: 14px; }
  .kpi-value { font-size: 24px; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; }
  .toolbar .combo, .toolbar .search { width: 100%; }
  .toolbar > .btn, .toolbar > div > .btn { flex: 1; }
  .item-edit { grid-template-columns: minmax(0, 1fr); }
  .gene-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; }
  .member { grid-template-columns: minmax(0, 1fr) auto; }
  .member .member-role { grid-column: 1; grid-row: 2; padding-left: 50px; }
  .modal-foot .btn { flex: 1; }
  .approved-actions .btn { flex: 1 1 100%; }
  .link-box { flex-wrap: wrap; padding: 10px; }
  .link-box code { flex-basis: calc(100% - 30px); }
  .link-box .btn { width: 100%; }
  .logo-up { flex-direction: column; align-items: flex-start; }
  .tabs { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .pulse-draw { stroke-dasharray: none; stroke-dashoffset: 0; }
  .spinner, .phase.is-active .phase-dot { animation: spin 1.6s linear infinite !important; animation-duration: 1.6s !important; animation-iteration-count: infinite !important; }
}

@media print {
  .sidebar, .topbar, .scrim, .toasts, .steps, .btn, .edit-bar, .save-ind { display: none !important; }
  .shell { display: block; }
  .main-inner { padding: 0; max-width: none; }
  .sec, .card, .item { box-shadow: none; break-inside: avoid; }
}

/* ───────── Complementos ───────── */
.at-content { min-width: 0; }
.ro-text { padding: 10px 12px; border-radius: 9px; background: var(--bg); border: 1px solid var(--line-2); white-space: pre-wrap; color: var(--ink-2); font-size: 14px; min-height: 40px; }
.ro-text.is-empty { color: var(--slate-400); font-style: normal; }
.badge-sm { height: 20px; padding: 0 7px; font-size: 11px; vertical-align: middle; }
.reg-badge { cursor: pointer; font: inherit; font-size: 12px; font-weight: 550; }
.reg-badge .ic:last-child { opacity: .6; margin-right: -2px; }
.reg-badge:focus-visible { outline: none; box-shadow: var(--focus); }
.reg-badge[aria-expanded="true"] { box-shadow: 0 0 0 2px currentColor inset; }
.banner-exemplo { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-radius: 12px; background: linear-gradient(120deg, var(--violet-50), #F3F7FF); border: 1px solid var(--violet-200); color: var(--ink-2); margin-bottom: 20px; font-size: 13.5px; }
.banner-exemplo .ic { color: var(--violet-700); }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-hero-ghost { --b-bg: rgba(255, 255, 255, .08); --b-fg: #fff; --b-bd: rgba(255, 255, 255, .22); --b-hover: rgba(255, 255, 255, .14); }
.btn-hero-ghost .ic { color: #93C5FD; }
.file-chip { text-decoration: none; transition: border-color .15s, background-color .15s; }
a.file-chip:hover { border-color: var(--blue-200); background: var(--blue-50); text-decoration: none; }
.file-open { display: inline-flex; align-items: center; gap: 4px; color: var(--blue); font-weight: 560; margin-left: 4px; }
.card-flush .list { border: 0; border-radius: 0; box-shadow: none; border-top: 1px solid var(--line); margin-top: 16px; }
.card-flush .empty { padding-bottom: 32px; }
.btn.is-disabled { opacity: .5; pointer-events: none; }
.btn.is-loading::after { content: ""; position: absolute; inset: 0; margin: auto; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
.btn.is-loading:has(.btn-spinner)::after { display: none; }
.btn.is-loading .btn-label { opacity: 0; }
.input-group .select { flex: none; }
.plan-card-current { border-color: var(--blue-100); background: linear-gradient(120deg, #fff 60%, #F3F7FF); }
@media (max-width: 860px) {
  .card-flush .list { padding: 12px; gap: 8px; border-top: 1px solid var(--line); }
  .hero-actions { width: 100%; }
  .hero-actions .btn { flex: 1 1 100%; }
}

.list-compact .cols-atend { grid-template-columns: minmax(0, 1fr) 118px 64px 16px; }
.list-compact .c-upd { display: none; }

.ag-label { background: #fff; padding: 0 10px 0 2px; position: relative; }
.gen-text { flex: 1 1 340px; min-width: 0; }
.gen-cta { flex: 0 0 auto; }
@media (max-width: 860px) { .ag-label { background: transparent; } }

:is(.pick, .dash-grid, .equipe-grid, .stack, .grid-2, .grid-3, .plans, .form, .brand-row) > .card + .card { margin-top: 0; }
@media (min-width: 861px) { .item-edit { grid-template-columns: minmax(190px, 230px) 160px minmax(0, 1fr); } }
@media (max-width: 860px) {
  .card-flush { padding: 0; }
  .card-flush > .card-head { padding: 16px 16px 0; flex-direction: row; align-items: center; margin-bottom: 4px; }
}
@media (max-width: 860px) {
  .tbl-cards td.w-range { width: auto; min-width: 0; }
  .tbl-cards td[data-label]::before { font-family: var(--font); letter-spacing: 0; }
}
@media (max-width: 600px) {
  .add-marker { grid-template-columns: minmax(0, 1fr); }
}
.hero:has(.btn-hero-ghost) .pulse-line { display: none; }
