/* OdontoCRM — Design System v2 (inspirado no app do Airbnb): branco, generoso, cantos macios, uma cor de destaque (a da clínica),
   navegação por categorias com ícones, barra de abas no celular e folhas (bottom sheets). Carrega DEPOIS de odontocrm.css. */
:root {
  --ink: #222222;
  --ink-2: #484848;
  --muted: #717171;
  --line: #ebebeb;
  --line-strong: #dddddd;
  --paper: #ffffff;
  --paper-2: #f7f7f7;
  --brand: #ff385c;
  --brand-hover: color-mix(in srgb, var(--brand) 86%, #000);
  --brand-soft: color-mix(in srgb, var(--brand) 8%, #fff);
  --brand-border: color-mix(in srgb, var(--brand) 30%, #fff);
  --brand-grad: linear-gradient(135deg, color-mix(in srgb, var(--brand) 100%, #fff), color-mix(in srgb, var(--brand) 80%, #6b0020));

  --bg: #ffffff;
  --surface: #ffffff;
  --surface-subtle: var(--paper-2);
  --fg: var(--ink);
  --fg-secondary: var(--ink-2);
  --border: var(--line);
  --border-strong: var(--line-strong);

  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.18);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --header-h: 80px;
  --tabs-h: 78px;
  --bottom-h: 68px;
}

html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px; line-height: 1.5; background: var(--paper); color: var(--ink);
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, h4 { font-family: inherit; letter-spacing: -0.02em; color: var(--ink); font-weight: 700; }
a { color: var(--ink); text-decoration-color: color-mix(in srgb, var(--ink) 30%, transparent); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--ink); }
::selection { background: color-mix(in srgb, var(--brand) 25%, #fff); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--muted); }
body.ab-lock { overflow: hidden; }

/* ───────── Casca ───────── */
.app-shell { display: block; min-height: 100vh; background: var(--paper); }
.app-main { margin-left: 0; }
.ab-header { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, 0.92); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid transparent; transition: box-shadow 0.2s, border-color 0.2s; }
.ab-header.scrolled { border-color: var(--line); box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05); }
.ab-bar { max-width: 1440px; margin: 0 auto; height: var(--header-h); padding: 0 clamp(16px, 4vw, 40px); display: grid; grid-template-columns: 1fr minmax(0, 520px) 1fr; align-items: center; gap: 16px; }
.ab-logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: 1.12rem; letter-spacing: -0.03em; color: var(--brand); min-width: 0; }
.ab-logo .brand-mark { width: 36px; height: 36px; border-radius: 11px; background: var(--brand-grad); display: grid; place-items: center; flex: none; overflow: hidden; box-shadow: 0 4px 10px color-mix(in srgb, var(--brand) 35%, transparent); }
.ab-logo .brand-mark.has-logo { background: #fff; box-shadow: inset 0 0 0 1px var(--line); }
.ab-logo .brand-mark img { width: 100%; height: 100%; object-fit: cover; }
.ab-logo-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.ab-search { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 12px; width: 100%; height: 52px; padding: 0 8px 0 22px; background: var(--paper); border: 1px solid var(--line-strong); border-radius: 999px; box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08); transition: box-shadow 0.2s var(--ease), transform 0.15s; }
.ab-search:hover { box-shadow: 0 6px 18px rgba(0, 0, 0, 0.14); }
.ab-search:active { transform: scale(0.99); }
.ab-search:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.ab-search-text { flex: 1; color: var(--ink); font-weight: 500; font-size: 0.93rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ab-kbd { font: 600 0.72rem/1 ui-monospace, monospace; color: var(--muted); border: 1px solid var(--line-strong); border-radius: 6px; padding: 4px 7px; background: var(--paper-2); }
.ab-search-go { width: 38px; height: 38px; border-radius: 50%; background: var(--brand-grad); display: grid; place-items: center; flex: none; }

.ab-right { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.ab-link { padding: 11px 16px; border-radius: 999px; font-weight: 600; font-size: 0.9rem; text-decoration: none; color: var(--ink); transition: background 0.15s; white-space: nowrap; }
.ab-link:hover { background: var(--paper-2); }
.ab-icon-btn { all: unset; box-sizing: border-box; position: relative; cursor: pointer; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; color: var(--ink); transition: background 0.15s; }
.ab-icon-btn:hover { background: var(--paper-2); }
.ab-icon-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.ab-badge { position: absolute; top: 2px; right: 1px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; background: var(--brand); color: #fff; font-size: 0.68rem; font-weight: 700; display: grid; place-items: center; border: 2px solid #fff; }
.ab-user { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 8px 0 14px; border: 1px solid var(--line-strong); border-radius: 999px; transition: box-shadow 0.2s; color: var(--ink); }
.ab-user:hover { box-shadow: 0 2px 10px rgba(0, 0, 0, 0.16); }
.ab-user:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.ab-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: var(--paper); font-size: 0.72rem; font-weight: 700; display: grid; place-items: center; }
.ab-pop-wrap { position: relative; }
.ab-pop { position: absolute; right: 0; top: calc(100% + 10px); width: 320px; max-width: calc(100vw - 24px); background: var(--paper); border-radius: 16px; box-shadow: 0 8px 36px rgba(0, 0, 0, 0.2); border: 1px solid var(--line); padding: 8px 0; animation: ab-pop-in 0.16s var(--ease); z-index: 60; }
.ab-pop[hidden] { display: none; }
@keyframes ab-pop-in { from { opacity: 0; transform: translateY(-6px) scale(0.98); } }
.ab-pop-title { padding: 12px 18px 8px; font-weight: 700; font-size: 1.05rem; }
.ab-pop-empty { padding: 16px 18px 20px; color: var(--muted); }
.ab-me { padding: 12px 18px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; display: grid; gap: 2px; }
.ab-me span { color: var(--muted); font-size: 0.83rem; }
.ab-menu-item { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px 18px; cursor: pointer; font-size: 0.93rem; font-weight: 500; color: var(--ink); text-decoration: none; transition: background 0.12s; }
.ab-menu-item:hover { background: var(--paper-2); }
.ab-menu-item.active { font-weight: 700; }
.ab-menu-item svg { color: var(--muted); flex: none; }
.ab-logout { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 6px; }
.ab-note { display: flex; align-items: center; gap: 12px; padding: 11px 18px; text-decoration: none; transition: background 0.12s; }
.ab-note:hover { background: var(--paper-2); }
.ab-note-n { min-width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; font-weight: 700; font-size: 0.85rem; background: var(--paper-2); color: var(--ink); }
.ab-note.atencao .ab-note-n { background: var(--paper)4e5; color: #b45309; }
.ab-note.erro .ab-note-n { background: #ffe8ec; color: #c3002f; }
.ab-note-t { font-size: 0.9rem; line-height: 1.3; }

/* Abas de categoria (como as categorias do Airbnb) */
.ab-tabs { max-width: 1440px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px); }
.ab-tabs-scroll { display: flex; gap: clamp(18px, 2.4vw, 36px); overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding: 2px 4px 0; border-bottom: 1px solid var(--line); }
.ab-tabs-scroll::-webkit-scrollbar { display: none; }
.ab-tab { position: relative; display: grid; justify-items: center; gap: 6px; padding: 10px 6px 14px; color: var(--muted); text-decoration: none; font-size: 0.78rem; font-weight: 600; white-space: nowrap; opacity: 0.85; transition: color 0.15s, opacity 0.15s, transform 0.15s var(--ease); flex: none; }
.ab-tab:hover { color: var(--ink); opacity: 1; }
.ab-tab:hover svg { transform: translateY(-1px); }
.ab-tab svg { transition: transform 0.2s var(--ease); }
.ab-tab.active { color: var(--ink); opacity: 1; }
.ab-tab::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; border-radius: 2px; background: var(--ink); transform: scaleX(0); transition: transform 0.2s var(--ease); }
.ab-tab:hover::after { transform: scaleX(1); background: var(--line-strong); }
.ab-tab.active::after { transform: scaleX(1); background: var(--ink); }

.content-wrap { max-width: 1440px; margin: 0 auto; padding: 32px clamp(16px, 4vw, 40px) 80px; }
.ab-alert { background: var(--paper)4e5; color: #8a4b00; border-radius: 14px; padding: 12px 16px; margin-bottom: 20px; font-weight: 500; }

/* Barra de abas do celular + folha "Menu" */
.ab-bottom, .ab-sheet, .ab-sheet-backdrop { display: none; }

/* ───────── Cabeçalho de página ───────── */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin: 0 0 28px; }
.page-head h1 { font-size: clamp(1.7rem, 3.2vw, 2.25rem); line-height: 1.1; margin: 0; letter-spacing: -0.035em; font-weight: 800; }
.page-sub { margin: 8px 0 0; color: var(--muted); font-size: 1rem; max-width: 62ch; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }
h2 { font-size: 1.35rem; letter-spacing: -0.025em; }
h3 { font-size: 1.1rem; }

/* ───────── Botões ───────── */
button, .btn { font-family: inherit; }
.btn, button[type=submit], button.btn, .page-actions button, [data-api], .btn-block {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer; text-decoration: none; font-weight: 600; font-size: 0.93rem; line-height: 1;
  padding: 14px 22px; border-radius: 12px; color: #fff; background: var(--brand-grad);
  transition: transform 0.12s var(--ease), box-shadow 0.2s, filter 0.2s; box-shadow: 0 2px 6px color-mix(in srgb, var(--brand) 28%, transparent);
}
.btn:hover, button[type=submit]:hover, [data-api]:hover { filter: brightness(1.05); box-shadow: 0 6px 16px color-mix(in srgb, var(--brand) 32%, transparent); }
.btn:active, button[type=submit]:active, [data-api]:active { transform: scale(0.97); }
.btn:disabled, button:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-secondary, button.btn-secondary { background: var(--paper); color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.btn-secondary:hover { background: var(--paper-2); filter: none; box-shadow: inset 0 0 0 1px var(--ink); }
.btn-ghost, button.btn-ghost { background: transparent; color: var(--ink); box-shadow: none; text-decoration: underline; text-underline-offset: 4px; padding-left: 12px; padding-right: 12px; }
.btn-ghost:hover { background: var(--paper-2); box-shadow: none; filter: none; }
.btn-danger, button.btn-danger { background: var(--paper); color: #c3002f; box-shadow: inset 0 0 0 1px #f4b6c1; }
.btn-danger:hover { background: var(--paper)1f3; box-shadow: inset 0 0 0 1px #c3002f; filter: none; }
.btn-wa { background: #25a244; box-shadow: 0 2px 6px rgba(37, 162, 68, 0.3); }
.btn-sm, button.btn-sm { padding: 9px 14px; font-size: 0.82rem; border-radius: 10px; }
.btn-block { width: 100%; padding: 16px 22px; font-size: 1rem; }
.btn-logout { background: transparent; color: var(--ink); box-shadow: none; }
.copilot-fab { background: var(--ink) !important; color: var(--paper); border: 0; border-radius: 999px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3); font-weight: 600; padding: 14px 20px; }

/* ───────── Cartões ───────── */
.card, .kpi-card, .kanban-card, .onboard-card, .lp-plan, .portal-next-box { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: none; }
.card { padding: 0; overflow: hidden; margin-bottom: 28px; transition: box-shadow 0.25s var(--ease); }
.card:hover { box-shadow: var(--shadow); }
.card-head { padding: 22px 26px 6px; border: 0; background: transparent; }
.card-head h2, .card-head h3 { margin: 0; font-size: 1.25rem; }
.card-body { padding: 18px 26px 26px; }
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); }
.card > .table-wrap, .card > table { margin: 0; }

/* KPIs: números grandes, ícone em bolha */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 32px; }
.kpi-card { padding: 22px; transition: transform 0.2s var(--ease), box-shadow 0.25s var(--ease); }
.kpi-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.kpi-label { color: var(--muted); font-weight: 600; font-size: 0.86rem; text-transform: none; letter-spacing: 0; }
.kpi-ico { width: 40px; height: 40px; border-radius: 14px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.kpi-ico.warn { background: var(--paper)4e5; color: #b45309; }
.kpi-ico svg { width: 20px; height: 20px; }
.kpi-value { font-size: 2.2rem; font-weight: 800; letter-spacing: -0.04em; line-height: 1; color: var(--ink); }
.kpi-value.brand { color: var(--brand); }
.kpi-hint { margin-top: 8px; color: var(--muted); font-size: 0.84rem; }

/* ───────── Formulários ───────── */
input, select, textarea { font-family: inherit; font-size: 0.97rem; color: var(--ink); }
input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):not([type=color]), select, textarea {
  width: 100%; padding: 14px 16px; background: var(--paper); border: 1px solid #b0b0b0; border-radius: 12px; transition: border-color 0.15s, box-shadow 0.15s; appearance: none; -webkit-appearance: none;
}
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23222' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px; }
input::placeholder, textarea::placeholder { color: #9a9a9a; }
input:hover:not(:focus), select:hover:not(:focus), textarea:hover:not(:focus) { border-color: var(--ink); }
input:focus:not([type=checkbox]):not([type=radio]), select:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
input[type=checkbox], input[type=radio] { accent-color: var(--brand); width: 18px; height: 18px; }
label { font-weight: 600; font-size: 0.85rem; color: var(--ink); display: block; margin-bottom: 6px; }
.field { margin-bottom: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; align-items: end; }
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 20px; }
.filter-bar input[type=search], .filter-bar input { max-width: 380px; border-radius: 999px; padding-left: 20px; }
.err { background: var(--paper)1f3; color: #c3002f; border-radius: 12px; padding: 12px 14px; margin: 0 0 16px; font-weight: 500; }

/* ───────── Tabelas ───────── */
table { width: 100%; border-collapse: collapse; background: var(--paper); }
th { text-align: left; font-size: 0.74rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); padding: 14px 26px; background: var(--paper); border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 18px 26px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr { transition: background 0.12s; }
tbody tr:hover { background: var(--paper-2); }
tbody tr:last-child td { border-bottom: 0; }
td:first-child { font-weight: 600; }
.td-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.empty-cell { text-align: center; color: var(--muted); padding: 56px 24px !important; font-size: 1rem; }
.empty-cell::before { content: ''; display: block; width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 22px; background: var(--brand-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ff385c' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 3C4.5 3 3 5.2 3 8c0 2.7 1.2 4.3 2 6.8.7 2.2 1.1 5.2 2.5 5.2 1.2 0 1.7-2.2 2.5-4 .5-1.2 1.5-1.2 2-1.2s1.5 0 2 1.2c.8 1.8 1.3 4 2.5 4 1.4 0 1.8-3 2.5-5.2.8-2.5 2-4.1 2-6.8 0-2.8-1.5-5-4-5-1.6 0-2.5.8-3.5.8S8.6 3 7 3z'/%3E%3C/svg%3E") center/32px no-repeat; }

/* ───────── Etiquetas e chips ───────── */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; font-size: 0.76rem; font-weight: 600; background: var(--paper-2); color: var(--ink-2); border: 0; text-transform: capitalize; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.7; }
.badge-ok { background: #e8f7ee; color: #0b7a3b; }
.badge-info { background: #e8f2ff; color: #0b5cc2; }
.badge-warn { background: var(--paper)4e5; color: #a45a00; }
.badge-danger { background: #ffe8ec; color: #c3002f; }
.role-pill, .scope-pill, .meta-pills > * { background: var(--paper-2); color: var(--ink-2); border-radius: 999px; padding: 6px 12px; font-size: 0.78rem; font-weight: 600; }
.tabs-bar { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 0 22px; padding: 2px; border: 0; }
.tabs-bar::-webkit-scrollbar { display: none; }
.tab-btn, .chip-btn, .segmented button { background: var(--paper); color: var(--ink); border: 1px solid var(--line-strong); border-radius: 999px; padding: 10px 18px; font-weight: 600; font-size: 0.88rem; box-shadow: none; cursor: pointer; white-space: nowrap; transition: border-color 0.15s, background 0.15s, transform 0.12s; }
.tab-btn:hover, .chip-btn:hover { border-color: var(--ink); background: var(--paper); filter: none; box-shadow: none; }
.tab-btn.active, .chip-btn.active, .segmented button.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.progress-track { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 999px; background: var(--brand-grad); transition: width 0.6s var(--ease); }
.onboard-card { padding: 22px 26px; margin-bottom: 28px; background: linear-gradient(135deg, var(--brand-soft), var(--paper)); border-color: var(--brand-border); }
.onboard-step { border: 1px solid var(--line); background: var(--paper); border-radius: 14px; padding: 12px 14px; text-decoration: none; font-weight: 500; transition: border-color 0.15s, transform 0.15s var(--ease); }
.onboard-step:hover { border-color: var(--ink); transform: translateY(-2px); }
.onboard-step.done { color: var(--muted); background: var(--paper-2); border-color: var(--line); }

/* ───────── Pacientes: cartões estilo "anúncio" ───────── */
.pt-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 22px; }
.pt-count { color: var(--muted); font-weight: 500; }
.pt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 28px 22px; }
.pt-card { position: relative; display: block; text-decoration: none; color: inherit; border-radius: var(--radius-lg); transition: transform 0.25s var(--ease); }
.pt-card:hover { transform: translateY(-4px); }
.pt-cover { position: relative; aspect-ratio: 4 / 3; border-radius: 20px; display: grid; place-items: center; overflow: hidden; background: var(--g, linear-gradient(135deg, #ffd1d9, #ffb3c1)); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); transition: box-shadow 0.25s var(--ease); }
.pt-card:hover .pt-cover { box-shadow: 0 14px 30px rgba(0, 0, 0, 0.16); }
.pt-initials { font-size: 3.2rem; font-weight: 800; letter-spacing: -0.04em; color: rgba(255, 255, 255, 0.95); text-shadow: 0 2px 12px rgba(0, 0, 0, 0.15); }
.pt-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pt-flags { position: absolute; top: 12px; left: 12px; display: flex; gap: 6px; flex-wrap: wrap; }
.pt-flag { background: rgba(255, 255, 255, 0.95); color: var(--ink); font-size: 0.72rem; font-weight: 700; padding: 5px 10px; border-radius: 999px; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15); }
.pt-flag.alert { color: #c3002f; }
.pt-fav { position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, 0.18); color: #fff; backdrop-filter: blur(4px); }
.pt-body { padding: 14px 4px 0; }
.pt-name { font-weight: 700; font-size: 1rem; letter-spacing: -0.01em; display: flex; justify-content: space-between; gap: 8px; }
.pt-meta { color: var(--muted); font-size: 0.88rem; margin-top: 2px; }
.pt-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.pt-empty { grid-column: 1 / -1; text-align: center; padding: 64px 16px; color: var(--muted); }

/* ───────── Hoje: saudação e resumo ───────── */
.hero-greet { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding: 30px 34px; border-radius: 28px; margin-bottom: 28px; color: #fff; background: radial-gradient(1200px 300px at 100% -40%, color-mix(in srgb, var(--brand) 55%, #fff) 0, transparent 60%), var(--brand-grad); box-shadow: 0 18px 40px -12px color-mix(in srgb, var(--brand) 55%, transparent); }
.hero-greet h1 { color: #fff; margin: 0; font-size: clamp(1.7rem, 3.4vw, 2.4rem); letter-spacing: -0.04em; font-weight: 800; }
.hero-greet p { margin: 6px 0 0; color: rgba(255, 255, 255, 0.88); font-size: 1rem; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-actions .btn, .hero-actions button { background: #fff; color: #222; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18); }
.hero-actions .btn-secondary { background: rgba(255, 255, 255, 0.18); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5); }

/* ───────── Modais e toasts ───────── */
.modal-backdrop { position: fixed; inset: 0; z-index: 1000; background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 16px; animation: ab-fade 0.2s; }
@keyframes ab-fade { from { opacity: 0; } }
.modal-card { background: var(--paper); border-radius: 24px; padding: 26px; width: 100%; max-width: 520px; max-height: 90vh; overflow: auto; box-shadow: var(--shadow-lg); animation: ab-rise 0.28s var(--ease); }
@keyframes ab-rise { from { opacity: 0; transform: translateY(24px) scale(0.98); } }
.toast-stack { position: fixed; z-index: 2000; left: 50%; transform: translateX(-50%); bottom: 28px; display: grid; gap: 10px; justify-items: center; pointer-events: none; }
.toast { pointer-events: auto; background: var(--ink); color: var(--paper); padding: 14px 22px; border-radius: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35); font-weight: 500; animation: ab-rise 0.28s var(--ease); max-width: min(92vw, 460px); }
.toast.error { background: #c3002f; }

/* ───────── Telas de entrada (login/cadastro): duas colunas ───────── */
.public-shell { min-height: 100vh; display: block; background: var(--paper); padding: 0; }
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.auth-hero { position: relative; overflow: hidden; color: #fff; padding: clamp(32px, 5vw, 72px); display: flex; flex-direction: column; justify-content: space-between; background: radial-gradient(900px 500px at 0% 0%, color-mix(in srgb, var(--brand) 40%, #fff) 0, transparent 60%), var(--brand-grad); }
.auth-hero::before, .auth-hero::after { content: ''; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, 0.1); }
.auth-hero::before { width: 520px; height: 520px; right: -160px; bottom: -180px; }
.auth-hero::after { width: 260px; height: 260px; right: 120px; bottom: 160px; background: rgba(255, 255, 255, 0.08); }
.auth-hero .ab-logo { color: #fff; position: relative; z-index: 1; }
.auth-hero .ab-logo .brand-mark { background: rgba(255, 255, 255, 0.2); box-shadow: none; }
.auth-hero h2 { color: #fff; font-size: clamp(2rem, 4vw, 3.2rem); line-height: 1.05; letter-spacing: -0.045em; font-weight: 800; margin: 0 0 22px; position: relative; z-index: 1; max-width: 14ch; }
.auth-points { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; position: relative; z-index: 1; }
.auth-points li { display: flex; gap: 12px; align-items: center; font-weight: 500; font-size: 1.02rem; color: rgba(255, 255, 255, 0.95); }
.auth-points li::before { content: '✓'; flex: none; width: 26px; height: 26px; border-radius: 50%; background: rgba(255, 255, 255, 0.22); display: grid; place-items: center; font-size: 0.8rem; font-weight: 800; }
.auth-form { display: grid; place-items: center; padding: clamp(24px, 5vw, 64px); }
.auth-form .public-card { width: 100%; max-width: 420px; border: 0; box-shadow: none; padding: 0; background: transparent; }
.auth-form h1 { font-size: 2rem; letter-spacing: -0.04em; margin: 0 0 6px; }
.public-card { background: var(--paper); border-radius: 24px; border: 1px solid var(--line); box-shadow: var(--shadow); padding: 36px; max-width: 640px; margin: 0 auto; }
.public-brand { display: flex; justify-content: center; align-items: center; gap: 12px; padding: 28px 16px 8px; font-weight: 800; letter-spacing: -0.03em; }
.public-shell > .public-card, .public-shell > .public-brand { position: relative; }
.public-shell:not(:has(.auth-wrap)) { background: var(--paper-2); padding-bottom: 48px; }

/* ───────── Esqueleto de carregamento e movimento ───────── */
.skeleton { background: linear-gradient(90deg, #f1f1f1 25%, #fafafa 37%, #f1f1f1 63%); background-size: 400% 100%; animation: ab-shimmer 1.3s infinite; border-radius: 12px; color: transparent !important; }
@keyframes ab-shimmer { from { background-position: 100% 50%; } to { background-position: 0 50%; } }
.page-head, .kpi-card, .card, .pt-card { animation: ab-in 0.4s var(--ease) backwards; }
.kpi-card:nth-child(2) { animation-delay: 0.05s; } .kpi-card:nth-child(3) { animation-delay: 0.1s; } .kpi-card:nth-child(4) { animation-delay: 0.15s; }
@keyframes ab-in { from { opacity: 0; transform: translateY(10px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* ───────── Tablet ───────── */
@media (max-width: 1100px) {
  .ab-bar { grid-template-columns: auto minmax(0, 1fr) auto; }
  .ab-link { display: none; }
  .ab-logo-name { display: none; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-hero { min-height: 280px; padding: 28px; }
  .auth-hero h2 { font-size: 2rem; margin-bottom: 14px; }
  .auth-points { display: none; }
}

/* ───────── Celular: app de verdade (barra de abas + folha) ───────── */
@media (max-width: 760px) {
  :root { --header-h: 64px; }
  body { font-size: 15px; padding-bottom: calc(var(--bottom-h) + env(safe-area-inset-bottom)); }
  .ab-bar { grid-template-columns: auto minmax(0, 1fr) auto; height: var(--header-h); gap: 10px; padding: 0 14px; }
  .ab-logo-name { display: none; }
  .ab-search { height: 46px; padding-left: 16px; }
  .ab-search-text { font-size: 0.88rem; }
  .ab-kbd { display: none; }
  .ab-search-go { width: 32px; height: 32px; }
  .ab-user { padding: 0 6px 0 10px; height: 40px; gap: 8px; }
  .ab-user > svg { display: none; }
  .ab-tabs { display: none; }
  .ab-pop { position: fixed; left: 12px; right: 12px; top: calc(var(--header-h) + 6px); width: auto; max-height: 70vh; overflow: auto; }
  .content-wrap { padding: 20px 16px 28px; }
  .page-head { margin-bottom: 20px; }
  .page-actions { width: 100%; }
  .page-actions > * { flex: 1 1 auto; }
  .card-head { padding: 18px 18px 4px; } .card-body { padding: 14px 18px 20px; }
  th, td { padding: 14px 16px; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .kpi-card { padding: 16px; } .kpi-value { font-size: 1.7rem; }
  .pt-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 14px; }
  .pt-initials { font-size: 2.4rem; }
  .hero-greet { padding: 22px; border-radius: 22px; }
  .hero-actions { width: 100%; } .hero-actions > * { flex: 1 1 auto; }
  .modal-backdrop { align-items: end; padding: 0; }
  .modal-card { border-radius: 24px 24px 0 0; max-width: none; max-height: 88vh; padding: 22px 20px calc(22px + env(safe-area-inset-bottom)); animation: ab-sheet-up 0.3s var(--ease); }
  @keyframes ab-sheet-up { from { transform: translateY(100%); } }
  .toast-stack { bottom: calc(var(--bottom-h) + 18px + env(safe-area-inset-bottom)); width: calc(100vw - 24px); }
  .copilot-fab { bottom: calc(var(--bottom-h) + 16px + env(safe-area-inset-bottom)) !important; right: 14px !important; padding: 12px 14px; font-size: 0; }

  .ab-bottom { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 70; height: calc(var(--bottom-h) + env(safe-area-inset-bottom)); padding: 8px 6px calc(8px + env(safe-area-inset-bottom)); background: rgba(255, 255, 255, 0.96); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
  .ab-bt { all: unset; box-sizing: border-box; display: grid; justify-items: center; align-content: center; gap: 3px; color: var(--muted); font-size: 0.68rem; font-weight: 600; text-decoration: none; cursor: pointer; border-radius: 12px; transition: color 0.15s, transform 0.12s; }
  .ab-bt:active { transform: scale(0.92); }
  .ab-bt.active { color: var(--brand); }
  .ab-bt svg { stroke-width: 1.9; }
  .ab-sheet-backdrop { display: block; position: fixed; inset: 0; z-index: 80; background: rgba(0, 0, 0, 0); transition: background 0.22s; }
  .ab-sheet-backdrop.open { background: rgba(0, 0, 0, 0.45); }
  .ab-sheet-backdrop[hidden], .ab-sheet[hidden] { display: none; }
  .ab-sheet { display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 90; background: var(--paper); border-radius: 26px 26px 0 0; padding: 10px 18px calc(22px + env(safe-area-inset-bottom)); max-height: 86vh; overflow: auto; transform: translateY(100%); transition: transform 0.28s var(--ease); box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2); }
  .ab-sheet.open { transform: translateY(0); }
  .ab-sheet-grip { width: 40px; height: 4px; border-radius: 4px; background: #d6d6d6; margin: 4px auto 10px; }
  .ab-sheet .ab-me { border: 0; padding: 6px 4px 14px; margin: 0; }
  .ab-sheet-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .ab-sheet-item { display: grid; justify-items: center; align-content: center; gap: 8px; min-height: 92px; padding: 14px 6px; border-radius: 18px; background: var(--paper-2); text-decoration: none; font-size: 0.78rem; font-weight: 600; text-align: center; color: var(--ink); transition: transform 0.12s, background 0.15s; }
  .ab-sheet-item:active { transform: scale(0.96); }
  .ab-sheet-item.active { background: var(--brand-soft); color: var(--brand); }
  .ab-sheet-out { all: unset; box-sizing: border-box; width: 100%; text-align: center; padding: 16px; margin-top: 14px; border-radius: 14px; font-weight: 700; color: #c3002f; background: var(--paper)1f3; cursor: pointer; }
  .sc-overlay { padding-top: 3vh; }
}
@media (max-width: 380px) { .ab-sheet-grid { grid-template-columns: repeat(2, 1fr); } .pt-grid { gap: 18px 10px; } }
@media print { .ab-header, .ab-bottom, .ab-sheet, .copilot-fab, .toast-stack { display: none !important; } .content-wrap { padding: 0; } }

/* filtros em linha (inputs não ocupam 100%) */
.filter-bar input:not([type=checkbox]):not([type=radio]), .filter-bar select { width: auto !important; min-width: 150px; max-width: 380px; }
.filter-bar input[type=search] { min-width: 240px; }
.page-head .filter-bar { margin-bottom: 0; }
.content-wrap { max-width: 1440px !important; }

/* ───── Modo escuro (manual pelo menu do usuário; padrão segue o sistema) ───── */
:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f3f3f3; --ink-2: #d2d2d2; --muted: #a3a3a3; --line: #2c2c2c; --line-strong: #404040;
  --paper: #151515; --paper-2: #1d1d1d; --bg: #151515; --surface: #151515;
  --brand-soft: color-mix(in srgb, var(--brand) 16%, #151515); --brand-border: color-mix(in srgb, var(--brand) 40%, #151515);
  --shadow: 0 6px 18px rgba(0, 0, 0, 0.5); --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.7);
}
:root[data-theme="dark"] body { background: var(--paper); color: var(--ink); }
:root[data-theme="dark"] input:not([type=checkbox]):not([type=radio]), :root[data-theme="dark"] select, :root[data-theme="dark"] textarea { border-color: #555; color: var(--ink); }
:root[data-theme="dark"] input::placeholder { color: #777; }
:root[data-theme="dark"] .ab-header, :root[data-theme="dark"] .ab-bottom { background: rgba(21, 21, 21, 0.94); }
:root[data-theme="dark"] .btn-secondary, :root[data-theme="dark"] button.btn-secondary { box-shadow: inset 0 0 0 1px var(--line-strong); }
:root[data-theme="dark"] th { background: var(--paper-2); }
:root[data-theme="dark"] .badge { filter: brightness(0.95); }
:root[data-theme="dark"] .toast { box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6); }

/* arrastar e soltar na agenda */
.agenda-block[draggable=true] { cursor: grab; }
.agenda-block.dragging { opacity: 0.45; }
.agenda-slot.drop-ok { outline: 2px dashed var(--brand); outline-offset: -2px; background: var(--brand-soft); }

/* fila da recepção */
.rc-board { display: grid; grid-template-columns: repeat(5, minmax(210px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 8px; }
.rc-col { background: var(--paper-2); border-radius: var(--radius-lg); padding: 14px; min-height: 220px; }
.rc-col h3 { display: flex; justify-content: space-between; align-items: center; margin: 0 0 12px; font-size: 0.95rem; }
.rc-card { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin-bottom: 10px; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow-sm); }
.rc-card .btn { padding: 9px 12px; font-size: 0.88rem; }
@media (max-width: 760px) { .rc-board { grid-template-columns: repeat(5, 82vw); scroll-snap-type: x mandatory; } .rc-col { scroll-snap-align: start; } }
