/* ==========================================================
   Clínica Fácil Web — estilos
   Cor primária vinda do app mobile (#6a5acd)
   ========================================================== */
:root {
    --primary: #6a5acd;
    --primary-hover: #5b4bc0;
    --primary-soft: #efedfb;
    --primary-soft-strong: #d6d1f5;
    --bg: #f5f6fa;
    --surface: #ffffff;
    --surface-2: #fafbfd;
    --border: #e7e9f0;
    --text: #1f2333;
    --text-2: #5f6577;
    --text-3: #9298a8;
    --green: #16a34a; --green-soft: #e7f6ec;
    --red: #dc2626;   --red-soft: #fdecec;
    --orange: #e8833a; --orange-soft: #fdf1e7;
    --teal: #0ea5a4;  --teal-soft: #e3f6f6;
    --radius: 14px;
    --radius-sm: 9px;
    --shadow: 0 1px 2px rgba(20, 22, 40, .04), 0 2px 8px rgba(20, 22, 40, .04);
    --shadow-lg: 0 10px 30px rgba(20, 22, 40, .12);
    --sidebar: 248px;
    --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
    color-scheme: light;
}
[data-theme="dark"] {
    --primary: #8b7ee8;
    --primary-hover: #9c91ee;
    --primary-soft: #2a2647;
    --primary-soft-strong: #3d3770;
    --bg: #12131a;
    --surface: #1a1c25;
    --surface-2: #20222d;
    --border: #2b2e3b;
    --text: #e8e9ef;
    --text-2: #a9adbd;
    --text-3: #757a8c;
    --green-soft: #15301f; --red-soft: #3a1a1a; --orange-soft: #382617; --teal-soft: #123232;
    --shadow: 0 1px 2px rgba(0,0,0,.3);
    color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); font-size: 14.5px; line-height: 1.5; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 24px; font-weight: 700; }
h2 { font-size: 16px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 650; }
small { font-size: 12.5px; }
.muted { color: var(--text-2); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-danger { color: var(--red); }
.text-success { color: var(--green); }
.mono { font-variant-numeric: tabular-nums; white-space: nowrap; }
.table td.text-right, .table tfoot td { white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
svg { flex-shrink: 0; }

/* ---------- Shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar); background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; z-index: 30; padding: 18px 14px; transition: transform .2s ease; }
.main { flex: 1; margin-left: var(--sidebar); min-width: 0; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 20px; font-weight: 700; font-size: 17px; }
.brand-mark { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--primary), #9b6fe0); box-shadow: 0 4px 12px rgba(106, 90, 205, .35); }
.brand-mark-lg { width: 56px; height: 56px; border-radius: 16px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--text-2); font-weight: 500; transition: background .15s, color .15s; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.is-active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.proto-badge { font-size: 11.5px; font-weight: 600; color: var(--orange); background: var(--orange-soft); padding: 6px 10px; border-radius: 8px; text-align: center; }
.user-card { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--border); border-radius: 12px; }
.user-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.user-meta strong { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-meta small { color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; padding: 12px 28px; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.topbar-search { flex: 1; min-width: 0; max-width: 460px; display: flex; align-items: center; gap: 8px; padding: 0 12px; height: 40px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; color: var(--text-3); }
.topbar-search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.topbar-search input { flex: 1; min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; font: inherit; color: var(--text); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.content { padding: 26px 28px 48px; max-width: 1320px; width: 100%; }

/* ---------- Botões ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid transparent; font: inherit; font-weight: 600; cursor: pointer; transition: background .15s, border-color .15s, transform .05s; white-space: nowrap; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 2px 8px rgba(106, 90, 205, .3); }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-ghost:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.btn-sm { height: 32px; padding: 0 11px; font-size: 13px; }
.btn-block { width: 100%; }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 0; background: transparent; color: var(--text-2); cursor: pointer; }
.icon-btn:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.icon-btn:disabled { opacity: .4; cursor: not-allowed; }
.icon-btn.bordered { border: 1px solid var(--border); background: var(--surface); }
.link { display: inline-flex; align-items: center; gap: 2px; color: var(--primary); font-weight: 600; font-size: 13.5px; }
.link:hover { text-decoration: underline; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--text-2); font-weight: 500; margin-bottom: 6px; font-size: 13.5px; }
.back:hover { color: var(--primary); }
.show-dark { display: none; }
[data-theme="dark"] .show-dark { display: contents; }
[data-theme="dark"] .show-light { display: none; }

/* ---------- Página ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; }
.head-actions { display: flex; gap: 10px; align-items: center; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card > h2 { margin-bottom: 14px; }
.card-flush { padding: 0; overflow: hidden; overflow-x: auto; }
.grid-2 > * { min-width: 0; }
.grid-2.grid-rs { grid-template-columns: minmax(0, 1fr) 300px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-head.padded { padding: 16px 20px 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.grid-2-wide { grid-template-columns: 1.6fr 1fr; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 18px; }
.stats-3 { grid-template-columns: repeat(3, 1fr); }
.stat { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.stat > div:last-child { display: flex; flex-direction: column; min-width: 0; }
.stat-label { color: var(--text-2); font-size: 13px; }
.stat-value { font-size: 21px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; }
.stat-icon.sm { width: 34px; height: 34px; border-radius: 10px; }
.tone-primary { background: var(--primary-soft); color: var(--primary); }
.tone-green { background: var(--green-soft); color: var(--green); }
.tone-orange { background: var(--orange-soft); color: var(--orange); }
.tone-teal { background: var(--teal-soft); color: var(--teal); }
.tone-red { background: var(--red-soft); color: var(--red); }

/* ---------- Avatar / pills ---------- */
.avatar { width: 38px; height: 38px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--primary-soft); color: var(--primary); font-weight: 700; font-size: 13px; flex-shrink: 0; object-fit: cover; }
.avatar-sm { width: 32px; height: 32px; font-size: 12px; }
.avatar-lg { width: 64px; height: 64px; font-size: 20px; }
.avatar-xl { width: 76px; height: 76px; font-size: 24px; }
.pill { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); white-space: nowrap; }
.pill-lg { height: 30px; padding: 0 14px; font-size: 13px; }
.pill-primary { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.pill-green { background: var(--green-soft); color: var(--green); border-color: transparent; }
.pill-red { background: var(--red-soft); color: var(--red); border-color: transparent; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c); margin-right: 8px; vertical-align: middle; }
.tooth-badge { display: inline-grid; place-items: center; min-width: 32px; height: 24px; border-radius: 7px; background: var(--teal-soft); color: var(--teal); font-weight: 700; font-size: 12px; }

/* ---------- Alerts ---------- */
.alert { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 10px; margin-bottom: 16px; font-weight: 500; }
.alert-success { background: var(--green-soft); color: var(--green); }
.alert-error { background: var(--red-soft); color: var(--red); }
.alert-warning { background: var(--orange-soft); color: var(--orange); }
.logout-form { margin: 0; display: inline-flex; }

/* ---------- Tabelas ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); padding: 12px 20px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.table td { padding: 13px 20px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th.text-right { text-align: right; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tfoot td { font-weight: 700; padding: 13px 20px; border-top: 1px solid var(--border); }
.card:not(.card-flush) .table th, .card:not(.card-flush) .table td { padding-left: 0; }
.table-hover tbody tr, tr[data-href] { cursor: pointer; transition: background .1s; }
.table-hover tbody tr:hover, tr[data-href]:hover { background: var(--surface-2); }
.w-time { width: 120px; font-variant-numeric: tabular-nums; color: var(--text-2); }
.w-actions { width: 60px; }
.w-actions-2 { width: 96px; }
.nowrap { white-space: nowrap; }
.row-static .icon-btn { margin-right: -8px; }
.person { display: flex; align-items: center; gap: 12px; }
.person > div { display: flex; flex-direction: column; }
.card-search { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--border); color: var(--text-3); }
.card-search input { flex: 1; border: 0; outline: 0; font: inherit; background: transparent; color: var(--text); }

/* ---------- Listas ---------- */
.rows { list-style: none; margin: 0; padding: 0; }
.rows li + li { border-top: 1px solid var(--border); }
.row-link, .row-static { display: flex; align-items: center; gap: 12px; padding: 11px 4px; }
.row-link:hover { color: var(--primary); }
.swatch { width: 10px; height: 10px; border-radius: 3px; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 36px 20px; color: var(--text-3); text-align: center; }
.empty p { margin: 0; }
.empty-page { max-width: 420px; margin: 12vh auto; text-align: center; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.debug { text-align: left; white-space: pre-wrap; font-size: 12px; background: var(--red-soft); color: var(--text); padding: 14px; border-radius: 10px; max-width: 900px; overflow: auto; }
.empty-page:has(.debug) { max-width: 900px; }
.empty-code { font-size: 64px; font-weight: 800; color: var(--primary); letter-spacing: -.04em; }

/* ---------- Timeline (hoje) ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline-item { display: flex; align-items: center; gap: 14px; padding: 10px 0; position: relative; }
.timeline-item + .timeline-item { border-top: 1px dashed var(--border); }
.timeline-time { width: 46px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text-2); }
.timeline-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 18%, transparent); }
.timeline-body { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.timeline-body small { color: var(--text-2); }
.timeline-body:hover strong { color: var(--primary); }
.timeline-item.is-done { opacity: .55; }
.timeline-item.is-now { background: var(--primary-soft); border-radius: 10px; padding-left: 8px; padding-right: 8px; }

/* ---------- Progresso / gráficos ---------- */
.progress-block { display: flex; flex-direction: column; gap: 10px; }
.progress-numbers { display: flex; justify-content: space-between; }
.progress-numbers > div { display: flex; flex-direction: column; }
.progress-numbers strong { font-size: 19px; }
.progress { height: 10px; background: var(--primary-soft); border-radius: 999px; overflow: hidden; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), #9b6fe0); border-radius: inherit; }
.legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.bars { display: flex; align-items: flex-end; gap: 12px; height: 220px; padding-top: 10px; }
.bar-group { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; color: var(--text-3); }
.bar-group.is-current { color: var(--primary); font-weight: 700; }
.bar-pair { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 5px; }
.bar { width: min(26px, 40%); border-radius: 6px 6px 3px 3px; transition: opacity .15s; }
.bar-a { background: var(--primary-soft-strong); }
.bar-b { background: var(--primary); }
.bar-group:not(.is-current) .bar { opacity: .7; }
.bar-group:hover .bar { opacity: 1; }
.stackbar { display: flex; height: 14px; border-radius: 999px; overflow: hidden; gap: 3px; margin-bottom: 12px; }
.stackbar span { display: block; height: 100%; }

/* ---------- Toolbar / segmentado ---------- */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toolbar-title { font-size: 16px; margin-left: 8px; }
.segmented { display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 2px; }
.segmented a, .segmented label { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 7px; color: var(--text-2); font-weight: 600; font-size: 13px; cursor: pointer; }
.segmented a.is-active, .segmented label:has(input:checked) { background: var(--primary-soft); color: var(--primary); }
.segmented input { display: none; }
.segmented-sm { align-self: flex-start; }
.select-sm, select, input, textarea { font: inherit; color: var(--text); }
.select-sm { height: 38px; padding: 0 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.inline-form { display: inline; }
.chips-filter { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.chip-filter { padding: 6px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-weight: 600; font-size: 13px; color: var(--text-2); }
.chip-filter:hover { border-color: var(--primary); color: var(--primary); }
.chip-filter.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------- Agenda semana ---------- */
.week { --row: 42px; overflow-x: auto; } /* uma linha = 30 min */
.week-head, .week-body { display: grid; grid-template-columns: 64px repeat(6, minmax(130px, 1fr)); min-width: 860px; }
.week-head { border-bottom: 1px solid var(--border); background: var(--surface-2); }
.week-day { padding: 10px; text-align: center; display: flex; flex-direction: column; border-left: 1px solid var(--border); }
.week-day small { text-transform: uppercase; color: var(--text-3); font-weight: 600; letter-spacing: .05em; }
.week-day strong { font-size: 20px; }
.week-day.is-today strong { color: #fff; background: var(--primary); border-radius: 50%; width: 36px; height: 36px; display: grid; place-items: center; margin: 2px auto 0; font-size: 16px; }
.week-hours div { height: var(--row); font-size: 11.5px; color: var(--text-3); text-align: right; padding: 0 8px; transform: translateY(-8px); }
.week-hours div.is-half { font-size: 10px; opacity: .7; }
.week-hours div:first-child { visibility: hidden; }
.week-col { position: relative; border-left: 1px solid var(--border); }
.week-col.is-today { background: color-mix(in srgb, var(--primary-soft) 45%, transparent); }
.week-slot { display: block; height: var(--row); border-bottom: 1px solid var(--border); }
.week-slot:not(.is-half) { border-bottom-style: dashed; } /* linha cheia na hora, tracejada na meia hora */
.week-slot:hover { background: var(--primary-soft); }
.event { position: absolute; left: 4px; right: 4px; top: calc(var(--top) * var(--row) + 2px); height: calc(var(--len) * var(--row) - 4px); background: color-mix(in srgb, var(--c) 14%, var(--surface)); border-left: 3px solid var(--c); border-radius: 7px; padding: 4px 8px; display: flex; flex-direction: column; overflow: hidden; font-size: 12px; line-height: 1.3; transition: box-shadow .15s, transform .1s; }
.event strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.event small { color: var(--text-2); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.event .ev-time { color: var(--text-3); font-weight: 500; font-size: 10.5px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.event.is-short { justify-content: center; padding: 2px 8px; }
.event:hover { box-shadow: var(--shadow-lg); z-index: 2; transform: translateY(-1px); }

/* ---------- Agenda mês ---------- */
.month { display: grid; grid-template-columns: repeat(7, 1fr); }
.month-head { padding: 10px; text-align: center; font-size: 12px; font-weight: 600; text-transform: uppercase; color: var(--text-3); background: var(--surface-2); border-bottom: 1px solid var(--border); }
.month-cell { min-height: 112px; padding: 6px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 3px; }
.month-cell:nth-child(7n) { border-right: 0; }
.month-cell.is-out { background: var(--surface-2); }
.month-cell.is-out .month-num { color: var(--text-3); }
.month-num { font-weight: 600; font-size: 13px; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; }
.month-num:hover { background: var(--primary-soft); }
.month-cell.is-today .month-num { background: var(--primary); color: #fff; }
.chip { font-size: 11.5px; padding: 2px 6px; border-radius: 5px; background: color-mix(in srgb, var(--c) 14%, var(--surface)); border-left: 2px solid var(--c); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.more { font-size: 11.5px; color: var(--primary); font-weight: 600; padding-left: 4px; }

/* ---------- Agenda lista ---------- */
.list-day-head { padding: 10px 20px; background: var(--surface-2); border-bottom: 1px solid var(--border); font-weight: 600; font-size: 13px; color: var(--text-2); text-transform: capitalize; }
.list-day.is-today .list-day-head { color: var(--primary); background: var(--primary-soft); }
.list-day + .list-day { border-top: 1px solid var(--border); }

/* ---------- Formulários ---------- */
.form-card { max-width: 860px; }
.form-section + .form-section { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--border); }
.form-section h3 { margin-bottom: 14px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.col-span-2 { grid-column: span 2; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-weight: 600; font-size: 13px; color: var(--text-2); }
.field input, .field select, .field textarea { height: 42px; padding: 0 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); outline: none; transition: border-color .15s, box-shadow .15s; width: 100%; }
.field textarea { height: auto; padding: 10px 12px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.field.has-error input, .field.has-error select { border-color: var(--red); }
.field-error { color: var(--red); font-weight: 500; }
.hint { color: var(--text-3); font-size: 12.5px; margin: 10px 0 0; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--border); }

/* ---------- Cadastro de paciente ---------- */
.patient-form { max-width: 820px; }
.form-section h3 { display: flex; align-items: center; gap: 8px; }
.form-section h3 svg { color: var(--primary); }
.form-section h3 small { font-weight: 500; }
.stepper { list-style: none; display: flex; gap: 8px; margin: 0 0 24px; padding: 0 0 20px; border-bottom: 1px solid var(--border); counter-reset: s; }
.stepper li { flex: 1; display: flex; align-items: center; gap: 10px; color: var(--text-3); font-weight: 600; font-size: 13.5px; position: relative; }
.stepper li:not(:last-child)::after { content: ""; flex: 1; height: 2px; background: var(--border); border-radius: 2px; margin-right: 8px; }
.stepper-num { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--border); background: var(--surface); flex-shrink: 0; }
.stepper-num svg { display: none; }
.stepper li.is-current { color: var(--primary); }
.stepper li.is-current .stepper-num { border-color: var(--primary); background: var(--primary); color: #fff; box-shadow: 0 0 0 4px var(--primary-soft); }
.stepper li.is-done { color: var(--text); }
.stepper li.is-done .stepper-num { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.stepper li.is-done .stepper-num span { display: none; }
.stepper li.is-done .stepper-num svg { display: block; }
.stepper li.is-done:not(:last-child)::after { background: var(--primary); }
.stepper li[data-clickable] { cursor: pointer; }
.is-wizard .form-section { display: none; }
.is-wizard .form-section.is-current { display: block; margin-top: 0; padding-top: 0; border-top: 0; animation: fadeIn .2s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.contacts { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.contact-row { display: grid; grid-template-columns: 170px 1fr 38px; gap: 10px; align-items: center; }
.contact-row select, .contact-row input { height: 42px; padding: 0 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); outline: none; width: 100%; }
.contact-row select:focus, .contact-row input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.contact-row.has-error input { border-color: var(--red); }
.contact-row .field-error { grid-column: 2 / 4; margin-top: -4px; }
.contact-row:only-child [data-remove-contact] { visibility: hidden; }
.form-grid-addr { grid-template-columns: 1fr 1fr; }
.form-grid-city { display: grid; grid-template-columns: 1fr 80px; gap: 12px; }
.input-icon { position: relative; }
.input-icon .spinner { position: absolute; right: 12px; top: 50%; margin-top: -8px; }
.spinner { width: 16px; height: 16px; border: 2px solid var(--primary-soft-strong); border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.hint-inline { color: var(--text-3); }
.hint-inline.is-error { color: var(--red); }
.hint-inline.is-ok { color: var(--green); }
.upper { text-transform: uppercase; }
[hidden] { display: none !important; }

/* ---------- Consulta ---------- */
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { filter: brightness(.95); }
.btn-danger-ghost:hover:not(:disabled) { border-color: var(--red) !important; color: var(--red) !important; }
.banner { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 12px; margin-bottom: 18px; font-weight: 500; }
.banner-green { background: var(--green-soft); color: var(--green); }
.banner-red { background: var(--red-soft); color: var(--red); }
.summary { display: grid; grid-template-columns: 1fr auto; gap: 8px 0; margin: 0 0 14px; }
.summary dd { padding-left: 12px; }
.summary dt { color: var(--text-2); }
.summary dd { margin: 0; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.summary .summary-strong { padding-top: 8px; border-top: 1px solid var(--border); font-weight: 700; color: var(--text); }
.summary dd.summary-strong { font-size: 17px; }
.note { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--orange); background: var(--orange-soft); padding: 9px 12px; border-radius: 9px; margin: 0 0 12px; }
.note svg { margin-top: 2px; }
.payments { margin-bottom: 12px; }
.checklist { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-direction: column; gap: 10px; }
.checklist li { display: flex; align-items: center; gap: 10px; }
.check-dot { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1.5px solid var(--border); color: var(--text-3); flex-shrink: 0; }
.checklist li.is-ok .check-dot { background: var(--green); border-color: var(--green); color: #fff; }
.small-p { font-size: 13px; margin: -6px 0 12px; }
.pre { white-space: pre-line; margin: 0; }
.link-sm { font-size: 12.5px; background: none; border: 0; padding: 0; cursor: pointer; font-family: inherit; align-self: flex-start; }
.signature-pad { position: relative; border: 1.5px dashed var(--border); border-radius: 12px; background: var(--surface-2); height: 190px; touch-action: none; }
.signature-pad canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; border-radius: 12px; }
.signature-line { position: absolute; left: 24px; right: 24px; bottom: 36px; border-top: 1px solid var(--text-3); padding-top: 4px; font-size: 12px; color: var(--text-3); pointer-events: none; }
.signature-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.signature-img { display: block; max-width: 100%; max-height: 170px; background: #fff; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 10px; }
[data-theme="dark"] .signature-pad { background: #fff; }
[data-theme="dark"] .signature-line { color: #888; border-color: #aaa; }

/* Dialogs */
.dialog { border: 0; border-radius: 16px; padding: 0; width: min(520px, calc(100vw - 24px)); background: var(--surface); color: var(--text); box-shadow: 0 24px 60px rgba(15, 17, 35, .3); }
.dialog-lg { width: min(760px, calc(100vw - 24px)); }
.dialog::backdrop { background: rgba(15, 17, 35, .45); backdrop-filter: blur(2px); }
.dialog[open] { animation: pop .18s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.dialog-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px 6px; }
.dialog-body { padding: 10px 20px 4px; max-height: calc(100vh - 200px); overflow: auto; }
.dialog-body p { margin: 0 0 14px; }
.dialog-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 20px 18px; }
.pay-methods { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.pay-method { position: relative; }
.pay-method input { position: absolute; opacity: 0; }
.pay-method span { display: block; text-align: center; padding: 10px; border: 1.5px solid var(--border); border-radius: 10px; font-weight: 600; cursor: pointer; transition: all .12s; }
.pay-method input:checked + span { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.pay-method input:focus-visible + span { box-shadow: 0 0 0 3px var(--primary-soft); }
.odonto-picker { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 10px; }
.odonto-picker .odonto-tooth { cursor: pointer; position: relative; transition: background .1s; }
.odonto-picker .odonto-tooth:hover { background: var(--primary-soft); }
.odonto-picker input { position: absolute; opacity: 0; pointer-events: none; }
.odonto-picker .odonto-tooth:has(input:checked) { background: var(--primary); }
.odonto-picker .odonto-tooth:has(input:checked) small { color: #fff; font-weight: 700; }
.odonto-picker .odonto-tooth:has(input:checked) .tooth-body { fill: #fff; stroke: #fff; }
.odonto-picker .odonto-tooth:has(input:checked) .tooth-line { stroke: var(--primary); }
.odonto-picker .odonto-tooth .tooth-svg .tooth-body { fill: var(--surface); }

/* Responsável financeiro */
.resp-box { margin-top: 16px; padding: 14px; border: 1px dashed var(--border); border-radius: 12px; display: flex; flex-direction: column; gap: 14px; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--primary); }
.check span { display: flex; flex-direction: column; }

/* Profissionais / Receita Saúde */
.pro-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
.rs-status { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--orange); }
.rs-status.is-ok { color: var(--green); }

/* Receita Saúde */
.banner-orange { background: var(--orange-soft); color: var(--orange); }
.w-check { width: 44px; }
.w-check input { width: 17px; height: 17px; accent-color: var(--primary); }
.link-plain:hover strong { color: var(--primary); }
.btn.is-disabled { opacity: .45; pointer-events: none; }
.rs-resend { display: block; text-align: center; margin-top: 10px; align-self: center; }
.steps-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; font-size: 13.5px; color: var(--text-2); }
.steps-list strong { color: var(--text); }

/* Procedimentos / preços */
.grid-2.grid-adjust { grid-template-columns: 320px minmax(0, 1fr); }
.grid-2.grid-proc { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); align-items: start; }
.grid-proc .table td:first-child { white-space: nowrap; }
.seg-block { display: flex; margin-bottom: 14px; }
.seg-block label { flex: 1; justify-content: center; }
.row-current td { background: color-mix(in srgb, var(--green-soft) 55%, transparent); }
.np-preview { margin: 12px 0 0; font-weight: 600; color: var(--primary); min-height: 20px; }
.np-preview.is-error { color: var(--red); }
.chips-tight { margin: 0; gap: 6px; }
.chips-tight .chip-filter { padding: 4px 10px; font-family: inherit; cursor: pointer; }
tr[data-adj-row].is-off td { opacity: .5; }
tr[data-adj-row].is-off td:first-child { opacity: 1; }

/* WhatsApp */
.pill-orange { background: var(--orange-soft); color: var(--orange); border-color: transparent; }
.pill-wa { gap: 0; }
.pill-wa svg { margin-right: 2px; }
.wa-dot { display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; margin-right: 4px; vertical-align: -2px; color: #fff; }
.wa-dot.wa-confirmada { background: var(--green); }
.wa-dot.wa-enviada { background: var(--orange); }
.wa-dot.wa-remarcar, .wa-dot.wa-falha { background: var(--red); }
.wa-row-remarcar td { background: color-mix(in srgb, var(--red-soft) 50%, transparent); }
.sim-reply { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); }
.var-chip { border: 1px solid var(--border); background: var(--surface-2); border-radius: 6px; padding: 1px 6px; margin: 2px 2px 0 0; font: inherit; font-size: 12px; cursor: pointer; color: var(--primary); }
.var-chip:hover { border-color: var(--primary); }
.phone { border-radius: 18px; overflow: hidden; border: 1px solid var(--border); background: #efe7dd; max-width: 340px; margin: 0 auto; }
.phone-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: #075e54; color: #fff; }
.phone-head .avatar { background: rgba(255,255,255,.2); color: #fff; }
.phone-body { padding: 14px 12px 18px; min-height: 200px; }
.bubble { background: #fff; color: #111b21; border-radius: 0 10px 10px 10px; padding: 8px 10px 4px; font-size: 13.5px; line-height: 1.45; box-shadow: 0 1px 1px rgba(0,0,0,.08); position: relative; }
.bubble-time { display: block; text-align: right; color: #667781; font-size: 11px; }
.bubble-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-top: 4px; }
.bubble-buttons span { background: #fff; color: #027eb5; text-align: center; padding: 8px; border-radius: 8px; font-size: 13px; font-weight: 600; box-shadow: 0 1px 1px rgba(0,0,0,.08); }
.bubble-inline { background: #e7ffdb; border-radius: 10px; margin-bottom: 12px; padding: 10px 12px; }
[data-theme="dark"] .bubble-inline { background: #1f3a2c; color: var(--text); }

/* ---------- Orçamento ---------- */
.budget-items select, .budget-items input, .tiers input { height: 40px; padding: 0 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); width: 100%; outline: none; }
.budget-items select:focus, .budget-items input:focus, .tiers input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.budget-items td { padding-top: 8px; padding-bottom: 8px; }
.budget-items tr.has-error select { border-color: var(--red); }
.w-tooth { width: 130px; }
.w-value { width: 140px; }
.budget-items [data-budget-value] { text-align: right; }
.budget-total td { font-size: 17px; }
.padded-box { padding: 14px 20px 20px; }
.padded-text { padding: 0 20px; margin: 0 0 12px; font-size: 13.5px; }
.mx { margin: 0 20px 12px; }
.pay-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.pay-card { position: relative; cursor: pointer; }
.pay-card input { position: absolute; opacity: 0; }
.pay-card-body { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: 12px; transition: all .12s; height: 100%; }
.pay-card-body b { font-size: 16px; margin-top: 6px; font-variant-numeric: tabular-nums; }
.pay-card input:checked + .pay-card-body { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 3px var(--primary-soft); }
.pay-card input:checked + .pay-card-body strong, .pay-card input:checked + .pay-card-body b { color: var(--primary); }
.installments { display: flex; flex-direction: column; gap: 14px; margin-bottom: 14px; }
.installments[hidden] { display: none !important; }
.entry-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.entry-chips .chip-filter { padding: 4px 12px; cursor: pointer; font-family: inherit; }
.input-suffix, .input-prefix { display: flex; align-items: center; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); overflow: hidden; }
.input-suffix:focus-within, .input-prefix:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.field .input-suffix input, .field .input-prefix input, .tiers .input-suffix input { border: 0 !important; box-shadow: none !important; height: 40px; border-radius: 0; }
.input-suffix span, .input-prefix span { padding: 0 12px; color: var(--text-3); font-weight: 600; background: var(--surface-2); align-self: stretch; display: grid; place-items: center; }
.input-prefix input[readonly] { color: var(--text-2); }
.summary-final { padding-top: 12px; border-top: 1px solid var(--border); margin: 0; }
.summary-final .summary-strong-dd { font-size: 20px; color: var(--primary); }
.table-compact th, .table-compact td { padding: 8px 0 !important; }
.rules-card tr.is-active td { color: var(--primary); font-weight: 700; }
.form-actions-bar { max-width: none; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 20px; position: sticky; bottom: 12px; box-shadow: var(--shadow-lg); margin-top: 18px; }
.form-grid-1 { grid-template-columns: 1fr; }
.tiers td { padding-top: 8px; padding-bottom: 8px; }
.tiers tr.has-error input { border-color: var(--red); }
.example .row-static { font-size: 13.5px; }

/* Documento (orçamento impresso) */
.doc { max-width: 860px; padding: 36px 40px; }
.doc h3 { font-size: 14px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); margin: 28px 0 10px; }
.doc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding-bottom: 20px; border-bottom: 2px solid var(--primary); }
.doc-brand { display: flex; gap: 12px; align-items: center; }
.doc-brand > div { display: flex; flex-direction: column; }
.doc-brand strong { font-size: 19px; }
.doc-meta { display: flex; gap: 24px; }
.doc-meta div { display: flex; flex-direction: column; text-align: right; }
.doc-patient { display: flex; flex-direction: column; padding: 18px 0; }
.doc-patient strong { font-size: 18px; }
.doc .doc-table th, .doc .doc-table td { padding-left: 0; }
.plan-box { display: flex; align-items: center; gap: 24px; padding: 18px 20px; background: var(--primary-soft); border-radius: 12px; }
.plan-box > div { display: flex; flex-direction: column; }
.plan-box > div:last-child { margin-left: auto; }
.plan-big { font-size: 24px; color: var(--primary); font-variant-numeric: tabular-nums; }
.plan-plus { font-size: 22px; color: var(--primary); font-weight: 300; }
.doc-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; margin-top: 64px; }
.doc-sign div { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.doc-sign span { width: 100%; border-top: 1px solid var(--text-2); }
.doc-foot { font-size: 12px; margin: 28px 0 0; text-align: center; }

@media print {
    @page { margin: 14mm; }
    body { background: #fff; }
    .sidebar, .topbar, .no-print, .alert, .backdrop { display: none !important; }
    .main { margin: 0; }
    .content { padding: 0; max-width: none; }
    .doc { border: 0; box-shadow: none; padding: 0; max-width: none; }
    .plan-box { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    [data-theme="dark"] { --surface: #fff; --text: #1f2333; }
}

/* ---------- Detalhes ---------- */
.details { display: grid; grid-template-columns: 110px 1fr; gap: 10px 14px; margin: 0; }
.details dt { color: var(--text-3); font-size: 13px; }
.details dd { margin: 0; font-weight: 500; }

/* ---------- Perfil paciente ---------- */
.profile { display: flex; align-items: center; gap: 20px; margin: 6px 0 16px; }
.profile-main { flex: 1; min-width: 0; }
.profile-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 8px; color: var(--text-2); }
.profile-meta span { display: inline-flex; align-items: center; gap: 6px; }
.profile-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.tabs { display: flex; gap: 4px; box-shadow: inset 0 -1px 0 var(--border); margin-bottom: 18px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; } /* rola de lado no celular, sem barra */
.tab { padding: 10px 16px; font-weight: 600; color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: 0; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--primary); border-bottom-color: var(--primary); }

/* ---------- Foto do paciente ---------- */
.photo { flex-shrink: 0; }
.photo-frame { position: relative; display: block; width: 92px; height: 92px; border-radius: 50%; overflow: hidden; cursor: pointer; background: var(--primary-soft); box-shadow: 0 0 0 4px var(--surface), 0 0 0 5px var(--border); }
.photo-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-empty { display: grid; place-items: center; width: 100%; height: 100%; color: var(--primary); opacity: .7; }
.photo-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: #fff; background: rgba(30, 25, 70, .55); opacity: 0; transition: opacity .15s; font-weight: 600; }
.photo-frame:hover .photo-overlay, .photo-frame.is-loading .photo-overlay { opacity: 1; }
.photo-frame:not(:has(img)) .photo-overlay { opacity: 1; background: transparent; color: var(--primary); justify-content: flex-end; padding-bottom: 8px; }
.photo-frame:not(:has(img)) .photo-overlay svg { display: none; }
.photo-frame:not(:has(img)) .photo-empty { align-items: start; padding-top: 18px; }
@media (hover: none) { .photo-frame:has(img) .photo-overlay { opacity: 1; background: linear-gradient(transparent 55%, rgba(30,25,70,.6) 55%); justify-content: flex-end; padding-bottom: 6px; } .photo-frame:has(img) .photo-overlay svg { display: none; } }

/* ---------- Dentes / odontograma ---------- */
.tooth-svg .tooth-body { fill: var(--surface); stroke: var(--text-3); stroke-width: 1.6; stroke-linejoin: round; }
.tooth-svg .tooth-line { fill: none; stroke: var(--text-3); stroke-width: 1.2; opacity: .7; }
.tooth-svg.is-marked .tooth-body { fill: var(--primary-soft-strong); stroke: var(--primary); }
.tooth-svg.is-marked .tooth-line { stroke: var(--primary); }
.tooth-cell { display: flex; align-items: center; gap: 10px; }
.tooth-cell > div { display: flex; flex-direction: column; line-height: 1.25; }
.odonto-card { margin-bottom: 18px; }
.odonto { display: flex; flex-direction: column; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.odonto-row { display: flex; justify-content: center; align-items: flex-end; gap: 2px; min-width: 560px; }
.odonto-row.is-lower { align-items: flex-start; padding-top: 8px; border-top: 1px dashed var(--border); }
.odonto-tooth { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 34px; padding: 3px 0; border-radius: 8px; }
.odonto-tooth small { font-size: 10.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.odonto-tooth.is-marked { background: var(--primary-soft); }
.odonto-tooth.is-marked small { color: var(--primary); font-weight: 700; }
.odonto-tooth .tooth-svg:not(.is-marked) .tooth-body { fill: var(--surface-2); }
.odonto-mid { width: 1px; align-self: stretch; background: var(--border); margin: 0 6px; }
.legend-tooth { width: 10px !important; height: 12px !important; border-radius: 5px 5px 3px 3px !important; border: 1.5px solid var(--text-3); background: var(--surface-2); }
.legend-tooth.is-marked { border-color: var(--primary); background: var(--primary-soft-strong); }

/* ---------- Profissionais ---------- */
.pro-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; position: relative; overflow: hidden; padding-top: 34px; }
.pro-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 64px; background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 55%, #fff)); opacity: .9; }
.pro-avatar { position: relative; border: 4px solid var(--surface); background: color-mix(in srgb, var(--c) 18%, var(--surface)); color: var(--c); }
.pro-card p { margin: 0; }
.pro-stats { display: flex; justify-content: center; width: 100%; padding: 12px 0; margin: 6px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.pro-stats div { display: flex; flex-direction: column; }
.pro-stats strong { font-size: 22px; }
.pro-stats small { color: var(--text-3); }

/* ---------- Login ---------- */
.login { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; }
.login-hero { background: radial-gradient(circle at 20% 20%, #8f7ff0 0%, transparent 50%), linear-gradient(140deg, #5b4bc0, #6a5acd 45%, #8a5cd6); color: #fff; display: flex; align-items: center; justify-content: center; padding: 48px; position: relative; overflow: hidden; }
.login-hero::after { content: ""; position: absolute; width: 420px; height: 420px; border-radius: 50%; border: 60px solid rgba(255,255,255,.07); right: -140px; bottom: -140px; }
.login-hero-inner { max-width: 420px; position: relative; z-index: 1; }
.login-hero .brand-mark { background: rgba(255,255,255,.18); box-shadow: none; }
.login-hero h1 { font-size: 38px; margin: 22px 0 10px; }
.login-hero p { font-size: 16px; opacity: .9; margin: 0 0 26px; }
.login-points { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.login-points li { display: flex; gap: 10px; align-items: center; opacity: .95; }
.login-form-wrap { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: var(--surface); }
.login-form { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 16px; }
.login-form h2 { font-size: 26px; }
.login-form > p { margin: -10px 0 4px; }

.backdrop { display: none; }
.only-mobile { display: none; }
.show-sm-only { display: none; }

/* ---------- Responsivo ---------- */
@media (max-width: 1100px) {
    .stats { grid-template-columns: repeat(2, 1fr); }
    .grid-2, .grid-2-wide, .grid-2.grid-rs, .grid-2.grid-adjust, .grid-2.grid-proc { grid-template-columns: 1fr; }
    .hide-md { display: none; }
}
@media (max-width: 860px) {
    .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
    body.nav-open .sidebar { transform: none; }
    body.nav-open .backdrop { display: block; position: fixed; inset: 0; background: rgba(15, 17, 30, .4); z-index: 25; }
    .main { margin-left: 0; }
    .only-mobile { display: inline-grid; }
    .topbar { padding: 10px 16px; }
    .topbar-actions .btn span { display: none; }
    .topbar-actions .btn { width: 40px; padding: 0; }
    .content { padding: 20px 16px 40px; }
    .login { grid-template-columns: 1fr; }
    .login-hero { display: none; }
    .profile { flex-wrap: wrap; }
    .profile-side { align-items: flex-start; width: 100%; }
}
@media (max-width: 640px) {
    .stats, .stats-3 { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .col-span-2 { grid-column: auto; }
    .hide-sm { display: none; }
    .show-sm-only { display: block; }
    .table th, .table td { padding: 11px 14px; }
    .month-cell { min-height: 72px; }
    .card-flush { overflow-x: auto; }
    .card-flush .table { min-width: 520px; }
    .odonto-card .legend { display: none; }
    .profile { gap: 14px; }
    .month .chip { display: none; }
    .contact-row { grid-template-columns: 120px 1fr 38px; }
    .head-actions { flex-wrap: wrap; }
    .pay-methods { grid-template-columns: 1fr 1fr; }
    .stepper-label { display: none; }
    .doc { padding: 20px; }
    .doc-head, .plan-box { flex-wrap: wrap; }
    .doc-meta { gap: 14px; }
    .pay-choice { grid-template-columns: 1fr; }
    .stepper li.is-current .stepper-label { display: inline; }
    h1 { font-size: 21px; }
}

/* Busca de CEP pela rua */
.link-btn { background: none; border: 0; padding: 0; color: var(--primary); font: inherit; cursor: pointer; text-decoration: underline; }
.cep-search-grid { display: grid; grid-template-columns: 70px 1fr 1.4fr; gap: 12px; }
@media (max-width: 640px) { .cep-search-grid { grid-template-columns: 70px 1fr; } .cep-search-grid > :last-child { grid-column: 1 / -1; } }
.cep-results { display: flex; flex-direction: column; gap: 6px; margin: 10px 0 14px; max-height: 340px; overflow: auto; }
.cep-result { display: flex; justify-content: space-between; gap: 12px; align-items: center; text-align: left; width: 100%;
    padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.cep-result:hover, .cep-result:focus { border-color: var(--primary); background: var(--primary-soft); outline: none; }
.cep-result small { display: block; color: var(--text-3); }
.cep-result .mono { white-space: nowrap; }

/* ---------- Alerta da anamnese (cruz vermelha) ---------- */
.med-alert { display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 4px; background: var(--red); color: #fff; margin-right: 5px; vertical-align: -2px; flex-shrink: 0; cursor: help; }
.med-alert svg { fill: currentColor; stroke: none; }
.med-alert-lg { width: 24px; height: 24px; border-radius: 6px; margin-right: 10px; vertical-align: 2px; }
.med-alert-sm { width: 13px; height: 13px; border-radius: 3px; vertical-align: -1px; }
.tip { position: fixed; z-index: 1000; max-width: 340px; padding: 10px 12px; border-radius: 10px; background: #1f2333; color: #fff; font-size: 12.5px; line-height: 1.45; white-space: pre-line; box-shadow: 0 12px 30px rgba(15, 17, 35, .35); pointer-events: none; }
.tip::first-line { font-weight: 700; }

/* ---------- Anamnese ---------- */
.anamnese { display: flex; flex-direction: column; }
.anam-row { display: grid; grid-template-columns: minmax(0, 1.4fr) auto minmax(0, 1fr); gap: 14px; align-items: center; padding: 10px 4px; border-bottom: 1px solid var(--border); }
.anam-row.is-alert { background: var(--red-soft); border-radius: 8px; }
.anam-q { display: flex; gap: 10px; align-items: baseline; }
.anam-n { color: var(--text-3); font-size: 12px; min-width: 18px; text-align: right; font-variant-numeric: tabular-nums; }
.anam-obs { width: 100%; }
@media (max-width: 760px) { .anam-row { grid-template-columns: 1fr auto; } .anam-obs { grid-column: 1 / -1; } }

/* ---------- Exames ---------- */
.grid-2.grid-exams { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 900px) { .grid-2.grid-exams { grid-template-columns: 1fr; } }
.rows.exams li { gap: 10px; }

/* ---------- Compromissos do profissional ---------- */
.event.event-busy { --c: var(--text-3); background: repeating-linear-gradient(135deg, var(--surface-2), var(--surface-2) 6px, color-mix(in srgb, var(--text-3) 12%, var(--surface)) 6px, color-mix(in srgb, var(--text-3) 12%, var(--surface)) 12px); color: var(--text-2); z-index: 0; }
.event.event-busy strong svg { vertical-align: -1px; }
.chip.chip-busy { --c: var(--text-3); background: var(--surface-2); color: var(--text-2); }
.row-busy td { color: var(--text-2); background: var(--surface-2); }
.danger-zone { margin-top: 12px; padding: 0; background: none; box-shadow: none; }

/* ---------- Diversos ---------- */
.icon-btn.danger:hover:not(:disabled) { color: var(--red); background: var(--red-soft); }
.field.is-disabled .odonto-picker { opacity: .45; pointer-events: none; }
.anam-obs { padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; font-size: 13.5px; }
.anam-obs:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }

/* ---------- Envios e contas a pagar ---------- */
.stats-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1100px) { .stats-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .stats-4 { grid-template-columns: 1fr; } }
.card.filters { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; padding: 16px 18px; }
.card.filters .field { min-width: 160px; margin: 0; }
.card.filters .check { padding-bottom: 10px; }
.inline-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-row .input { padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; min-width: 220px; }
tr.is-late td { background: var(--red-soft); }
p.small { font-size: 12.5px; }
.report h3.report-group { margin: 22px 0 8px; font-size: 15px; }
.table-report th, .table-report td { padding: 8px 10px; font-size: 12.5px; }
.table-report tfoot td { border-top: 2px solid var(--border); }
.report-total { text-align: right; margin-top: 14px; }
.signatures { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 56px; }
.signatures div { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--text-2); text-align: center; }
.signatures span { border-top: 1px solid var(--text-2); height: 0; }
.guide .details { margin-top: 18px; grid-template-columns: 150px 1fr; }
@media print { .report .table-report th { background: #f1f1f4 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; } tr.is-late td { background: none; } }
p.padded { padding: 12px 20px; margin: 0; }

/* ---------- Horários de atendimento ---------- */
.sched-tools { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; padding: 14px 18px; }
.sched-tools label { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; color: var(--text-2); }
.sched-tools input[type=time] { padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; }
.sched-days { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-check { padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px; cursor: pointer; }
.chip-check:has(input:checked) { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.chip-check input { display: none; }
.sched-wrap { overflow: auto; max-height: 70vh; }
.sched { border-collapse: collapse; width: 100%; min-width: 560px; }
.sched th, .sched td { padding: 0; text-align: center; }
.sched thead th { position: sticky; top: 0; background: var(--surface-2); padding: 10px 4px; z-index: 1; font-size: 13px; }
.sched tbody th { font-size: 11.5px; color: var(--text-3); font-weight: 500; padding: 0 10px; text-align: right; width: 60px; font-variant-numeric: tabular-nums; }
.sched tbody tr.is-hour th { color: var(--text-2); }
.sched tbody tr.is-hour td { border-top: 1px solid var(--border); }
.slot { display: block; padding: 2px 4px; cursor: pointer; }
.slot input { position: absolute; opacity: 0; pointer-events: none; }
.slot span { display: block; height: 18px; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--border); transition: background .1s; }
.slot:hover span { border-color: var(--primary); }
.slot input:checked + span { background: var(--primary); border-color: var(--primary); }
.slot input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 1px; }
tr.is-muted td { opacity: .55; }
.sched thead button { background: none; border: 0; font: inherit; font-weight: 700; color: var(--primary); cursor: pointer; padding: 2px 6px; }
/* Favoritos (Nova consulta e Profissionais) */
.field-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 22px; font-weight: 600; font-size: 13px; color: var(--text-2); }
.fav-btn { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; color: var(--text-3); font: inherit; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; cursor: pointer; }
.fav-btn:hover:not(:disabled) { color: #c98a00; background: color-mix(in srgb, #f5b301 14%, transparent); }
.fav-btn.is-on { color: #c98a00; }
.fav-btn.is-on svg { fill: #f5b301; stroke: #c98a00; }
.fav-btn:disabled { opacity: .45; cursor: default; }
.pro-fav { position: absolute; top: 8px; right: 8px; z-index: 1; margin: 0; }
.pro-fav .fav-btn { background: color-mix(in srgb, var(--surface) 92%, transparent); box-shadow: var(--shadow); }
/* Compromissos recorrentes */
.alert-info { background: var(--primary-soft); color: var(--primary); }
.repeat-box { gap: 10px; }
.repeat-opts { display: flex; flex-direction: column; gap: 12px; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.repeat-opts[hidden] { display: none; }
.weekday-pick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.weekday-pick label { cursor: pointer; }
.weekday-pick input { position: absolute; opacity: 0; pointer-events: none; }
.weekday-pick span { display: inline-block; min-width: 46px; text-align: center; padding: 7px 10px; border: 1px solid var(--border); border-radius: 999px; font-weight: 600; font-size: 13px; color: var(--text-2); background: var(--surface); }
.weekday-pick input:checked + span { background: var(--primary); border-color: var(--primary); color: #fff; }
.weekday-pick input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 1px; }
.repeat-period { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.repeat-period [hidden] { display: none; }
.danger-zone { display: flex; flex-wrap: wrap; gap: 8px; }
/* Verificação em 2 etapas */
.login-single { grid-template-columns: 1fr; }
.login-single .login-form-wrap { background: var(--bg); }
.login-single .login-form { background: var(--surface); padding: 32px; border-radius: 18px; box-shadow: var(--shadow); }
.login-form-wide { max-width: 520px !important; }
.mfa-steps { margin: 0; padding: 0; list-style: none; counter-reset: passo; display: flex; flex-direction: column; gap: 16px; }
.mfa-steps li { counter-increment: passo; position: relative; padding-left: 36px; display: flex; flex-direction: column; gap: 6px; }
.mfa-steps li::before { content: counter(passo); position: absolute; left: 0; top: -1px; width: 24px; height: 24px; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 700; font-size: 13px; display: grid; place-items: center; }
.mfa-qr { width: 200px; height: 200px; border: 1px solid var(--border); border-radius: 12px; padding: 8px; background: #fff; image-rendering: pixelated; }
.mfa-secret { display: inline-block; font: 600 15px ui-monospace, Menlo, Consolas, monospace; letter-spacing: 1px; background: var(--surface-2); border: 1px dashed var(--border); border-radius: 8px; padding: 8px 12px; user-select: all; word-break: break-all; }
.mfa-input { font: 700 24px ui-monospace, Menlo, Consolas, monospace !important; letter-spacing: 6px; text-align: center; }
.mfa-input-sm { width: 150px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; font: 600 15px ui-monospace, Menlo, Consolas, monospace; letter-spacing: 2px; background: var(--surface); color: var(--text); }
.mfa-help summary { cursor: pointer; color: var(--primary); font-weight: 600; font-size: 14px; }
.mfa-help p { font-size: 13px; color: var(--text-2); margin: 8px 0 0; }
.mfa-card { max-width: 640px; }
.mfa-codes { columns: 2; list-style: none; padding: 0; margin: 0 0 8px; }
.mfa-codes li { padding: 6px 0; }
.mfa-codes code { font: 700 17px ui-monospace, Menlo, Consolas, monospace; letter-spacing: 1px; }
.sec-card { display: flex; flex-direction: column; gap: 18px; max-width: 860px; }
.sec-head { display: flex; gap: 14px; align-items: flex-start; }
.sec-head h3 { margin: 0 0 4px; }
.sec-head p { margin: 0; }
.sec-head .pill { margin-left: auto; }
.sec-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-3); flex: none; }
.sec-icon.is-on { background: var(--green-soft); color: var(--green); }
.sec-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.sec-item { border: 1px solid var(--border); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.sec-item p { margin: 0; font-size: 13px; }
@media print { .sidebar, .topbar, .form-actions, .page-head .back { display: none !important; } }
/* Resíduos (MTR) */
.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 36px 24px; color: var(--text-3); }
.empty-state h3 { margin: 6px 0 0; color: var(--text); }
.empty-state p { max-width: 520px; margin: 0 0 8px; }
.mtr-static { min-height: 42px; display: flex; align-items: center; font-size: 14px; }
.mtr-model { display: flex; flex-direction: column; gap: 14px; }
.mtr-model .table input.input { width: 100%; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; }
.mtr-qty { display: inline-flex; width: 150px; }
.mtr-qty input { width: 100%; border: 0; padding: 8px 10px; text-align: right; font: inherit; background: transparent; color: var(--text); outline: none; }
.mtr-who { font-size: 13px; margin: 0; }
.d-block { display: block; margin-top: 3px; }
.mtr-emit { max-width: 720px; display: flex; flex-direction: column; gap: 14px; }
.mtr-item { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.mtr-qty-lg { width: 180px; }
.mtr-qty-lg input { font-size: 20px; font-weight: 700; padding: 10px 12px; }
.mtr-more summary { cursor: pointer; color: var(--primary); font-weight: 600; font-size: 14px; margin-bottom: 10px; }
.mtr-new summary, details.card > summary { cursor: pointer; }
.mtr-new-form { display: flex; flex-direction: column; gap: 14px; margin-top: 14px; }
.mtr-new-form h4 { margin: 6px 0 0; }
.mtr-diag ul { list-style: none; padding: 0; margin: 8px 0; display: flex; flex-direction: column; gap: 8px; }
.mtr-diag li.is-ok svg { color: var(--green); }
.mtr-diag li.is-bad svg { color: var(--red); }
.head-actions form.inline-form { display: inline-flex; gap: 6px; align-items: center; }
