/* PexDente / OdontoCRM — Executive Clinical White-Label Design System */
:root {
  --bg: #f1f5f9;
  --surface: #ffffff;
  --surface-subtle: #f8fafc;
  --fg: #0f172a;
  --fg-secondary: #334155;
  --muted: #64748b;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;

  /* White-label tokens (sobrescritos dinamicamente por clínica) */
  --brand: #0f766e;
  --accent: #0284c7;
  --sidebar-bg: #0b1623;

  --brand-hover: color-mix(in srgb, var(--brand) 84%, #000000);
  --brand-soft: color-mix(in srgb, var(--brand) 9%, #ffffff);
  --brand-border: color-mix(in srgb, var(--brand) 28%, #ffffff);
  --sidebar-hover: rgba(255, 255, 255, 0.08);
  --sidebar-active: color-mix(in srgb, var(--brand) 28%, transparent);
  --sidebar-fg: #cbd5e1;
  --sidebar-fg-active: #ffffff;

  --ok: #15803d;
  --ok-bg: #f0fdf4;
  --ok-border: #bbf7d0;
  --info: #0369a1;
  --info-bg: #f0f9ff;
  --info-border: #bae6fd;
  --warn: #b45309;
  --warn-bg: #fffbeb;
  --warn-border: #fde68a;
  --danger: #be123c;
  --danger-bg: #fff1f2;
  --danger-border: #fecdd3;
  --wa: #16a34a;
  --wa-hover: #15803d;

  --radius-sm: 7px;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05), 0 1px 2px rgba(15, 23, 42, 0.03);
  --shadow: 0 8px 24px -6px rgba(15, 23, 42, 0.08), 0 2px 6px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 20px 44px -10px rgba(15, 23, 42, 0.16);
  --sidebar-w: 262px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  background: var(--bg);
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}

h1, h2, h3, h4 {
  font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
  margin: 0;
  color: var(--fg);
  letter-spacing: -0.025em;
  line-height: 1.22;
}

h1 { font-size: 1.6rem; font-weight: 800; }
h2 { font-size: 1.05rem; font-weight: 700; }
h3 { font-size: 0.94rem; font-weight: 700; }

a {
  color: var(--brand);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover {
  color: var(--brand-hover);
  text-decoration: underline;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.84em;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  padding: 0.14rem 0.42rem;
  border-radius: 6px;
  color: #0f172a;
}

/* ───── App Shell (Authenticated) ───── */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, transparent 28%),
    var(--sidebar-bg);
  color: var(--sidebar-fg);
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  border-right: 1px solid rgba(255, 255, 255, 0.07);
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.1rem 1.15rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
  text-decoration: none;
}
.sidebar-brand:hover {
  text-decoration: none;
  color: #fff;
}
.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  display: grid;
  place-items: center;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}
.brand-mark.has-logo {
  background: #ffffff;
  padding: 3px;
}
.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.brand-text {
  min-width: 0;
}
.brand-name {
  display: block;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: -0.02em;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-sub {
  display: block;
  font-size: 0.7rem;
  font-weight: 500;
  color: rgba(203, 213, 225, 0.78);
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.85rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.16rem;
}

.nav-section {
  font-size: 0.67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: rgba(148, 163, 184, 0.72);
  padding: 0.9rem 0.75rem 0.35rem;
}
.nav-section:first-child {
  padding-top: 0.2rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.58rem 0.78rem;
  border-radius: 9px;
  color: var(--sidebar-fg);
  font-size: 0.87rem;
  font-weight: 500;
  text-decoration: none;
  position: relative;
  transition: background 0.14s ease, color 0.14s ease;
}
.nav-link svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  opacity: 0.82;
}
.nav-link:hover {
  background: var(--sidebar-hover);
  color: #ffffff;
  text-decoration: none;
}
.nav-link.active {
  background: var(--sidebar-active);
  color: var(--sidebar-fg-active);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--brand);
}
.nav-link.active svg {
  opacity: 1;
}

.sidebar-footer {
  padding: 0.85rem 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.user-chip {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}
.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #e2e8f0;
  display: grid;
  place-items: center;
  font-size: 0.76rem;
  font-weight: 700;
  flex-shrink: 0;
}
.user-meta {
  min-width: 0;
}
.user-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-email {
  font-size: 0.7rem;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.btn-logout {
  background: rgba(255, 255, 255, 0.07);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 7px;
  padding: 0.35rem 0.6rem;
  font-size: 0.76rem;
  font-weight: 500;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, color 0.15s ease;
}
.btn-logout:hover {
  background: rgba(244, 63, 94, 0.2);
  color: #fda4af;
  border-color: rgba(244, 63, 94, 0.35);
}

.app-main {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar-mobile {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--sidebar-bg);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 30;
}
.menu-toggle {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 0;
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  z-index: 35;
}

.content-wrap {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.75rem 2rem 3rem;
}

/* ───── Public / Auth Shell ───── */
.public-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background:
    radial-gradient(circle at 12% 15%, rgba(15, 118, 110, 0.08), transparent 40%),
    radial-gradient(circle at 88% 82%, rgba(2, 132, 199, 0.07), transparent 40%),
    var(--bg);
}
.public-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.35rem;
  color: var(--fg);
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}
.public-card {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow);
}
.public-card.wide {
  max-width: 680px;
}

/* ───── Page Header ───── */
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.page-sub {
  color: var(--muted);
  font-size: 0.88rem;
  margin: 0.25rem 0 0;
}
.page-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

/* ───── Cards & Layout Grids ───── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.25rem;
  overflow: hidden;
}
.card-head {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  background: var(--surface);
}
.card-body {
  padding: 1.25rem;
}
.card-body.flush {
  padding: 0;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 0.9rem;
  margin-bottom: 1.35rem;
}
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.05rem 1.15rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.kpi-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.kpi-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.kpi-value {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--fg);
  margin-top: 0.35rem;
  letter-spacing: -0.02em;
}
.kpi-value.ok { color: var(--ok); }
.kpi-value.danger { color: var(--danger); }
.kpi-value.brand { color: var(--brand); }
.kpi-hint {
  font-size: 0.76rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

/* ───── Tables ───── */
.table-wrap {
  width: 100%;
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
th {
  background: var(--surface-subtle);
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: left;
  padding: 0.72rem 1rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td {
  padding: 0.78rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--fg);
}
tbody tr:last-child td {
  border-bottom: 0;
}
tbody tr:hover td {
  background: #f8fafc;
}
.td-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.empty-cell {
  text-align: center;
  padding: 2.25rem 1rem !important;
  color: var(--muted);
}

/* ───── Forms & Inputs ───── */
label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--fg-secondary);
  margin-bottom: 0.35rem;
}
.field {
  margin-bottom: 0.9rem;
}
input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
input[type="tel"],
input[type="search"],
input:not([type]),
select,
textarea {
  width: 100%;
  padding: 0.56rem 0.78rem;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--fg);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}
textarea {
  min-height: 84px;
  resize: vertical;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 0.85rem;
  align-items: end;
}
.filter-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.filter-bar input,
.filter-bar select {
  width: auto;
  min-width: 150px;
}

/* ───── Buttons ───── */
button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.54rem 0.95rem;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.25;
  cursor: pointer;
  border: 1px solid transparent;
  background: var(--brand);
  color: #ffffff;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.08s ease;
  white-space: nowrap;
}
button:hover,
.btn:hover {
  background: var(--brand-hover);
  color: #ffffff;
  text-decoration: none;
}
button:active,
.btn:active {
  transform: translateY(1px);
}
button:disabled,
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-sm {
  padding: 0.36rem 0.68rem;
  font-size: 0.78rem;
  border-radius: 7px;
}
.btn-secondary {
  background: var(--surface);
  color: var(--fg);
  border-color: var(--border-strong);
}
.btn-secondary:hover {
  background: var(--surface-subtle);
  color: var(--fg);
  border-color: #94a3b8;
}
.btn-ghost {
  background: transparent;
  color: var(--fg-secondary);
  border-color: transparent;
}
.btn-ghost:hover {
  background: var(--surface-subtle);
  color: var(--fg);
}
.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: var(--danger-border);
}
.btn-danger:hover {
  background: #ffe4e6;
  color: #9f1239;
}
.btn-wa {
  background: var(--wa);
  color: #fff;
}
.btn-wa:hover {
  background: var(--wa-hover);
  color: #fff;
}
.btn-block {
  width: 100%;
}

/* ───── Badges & Pills ───── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.18rem 0.58rem;
  border-radius: 999px;
  font-size: 0.73rem;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  color: var(--fg-secondary);
  text-transform: capitalize;
  white-space: nowrap;
}
.badge-ok { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-border); }
.badge-info { background: var(--info-bg); color: var(--info); border-color: var(--info-border); }
.badge-warn { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-border); }
.badge-danger { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-border); }

.muted { color: var(--muted); }
.err {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid var(--danger-border);
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  font-size: 0.84rem;
  margin-bottom: 1rem;
}

/* ───── Progress Bars ───── */
.usage-row {
  margin-bottom: 0.95rem;
}
.usage-row:last-child {
  margin-bottom: 0;
}
.usage-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.84rem;
  margin-bottom: 0.35rem;
}
.progress-track {
  height: 8px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #14b8a6, #0f766e);
  transition: width 0.3s ease;
}

/* ───── Alert Lists ───── */
.alert-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.alert-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 0.9rem;
  border-radius: 9px;
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  color: #78350f;
  font-size: 0.85rem;
}
.alert-item.danger {
  background: var(--danger-bg);
  border-color: var(--danger-border);
  color: #881337;
}

/* ───── Patient Header & Clinical Notes ───── */
.patient-hero {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.patient-avatar {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, #0f766e, #0284c7);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  flex-shrink: 0;
}
.meta-pills {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.3rem;
  align-items: center;
  font-size: 0.84rem;
  color: var(--fg-secondary);
}

.note-item {
  padding: 0.95rem 1.15rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}
.note-item:last-child { border-bottom: 0; }
.note-date {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}
.note-body {
  white-space: pre-wrap;
  color: var(--fg);
  font-size: 0.89rem;
}

/* ───── Interactive SVG Odontogram ───── */
.odonto-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.segmented {
  display: inline-flex;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 3px;
  gap: 3px;
}
.segmented button {
  background: transparent;
  color: var(--fg-secondary);
  border: 0;
  padding: 0.36rem 0.78rem;
  font-size: 0.8rem;
  border-radius: 6px;
}
.segmented button.active {
  background: var(--surface);
  color: var(--brand);
  box-shadow: var(--shadow-sm);
}

.odonto-canvas {
  background: linear-gradient(180deg, #fafcfd 0%, #ffffff 50%, #fafcfd 100%);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 0.75rem;
  overflow-x: auto;
}
.odonto-canvas svg {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  height: auto;
  user-select: none;
}
.tooth-unit {
  cursor: pointer;
}
.tooth-unit .tooth-face {
  transition: opacity 0.12s ease, stroke-width 0.12s ease;
}
.tooth-unit:hover .tooth-crown-outline {
  stroke: #0f766e;
  stroke-width: 1.6;
}
.tooth-unit .tooth-face:hover {
  opacity: 0.82;
}

.odonto-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1rem;
  list-style: none;
  padding: 0;
  margin: 0.9rem 0 0;
  font-size: 0.78rem;
  color: var(--fg-secondary);
}
.odonto-legend li {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
}
.odonto-swatch {
  width: 13px;
  height: 13px;
  border-radius: 4px;
  border: 1px solid rgba(15, 23, 42, 0.22);
  display: inline-block;
  flex-shrink: 0;
}

.odonto-editor {
  margin-top: 1rem;
  padding: 1.1rem 1.2rem;
  background: var(--surface-subtle);
  border: 1px solid var(--brand-border);
  border-radius: 11px;
}
.odonto-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}
.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
}
.chip-btn {
  background: var(--surface);
  color: var(--fg-secondary);
  border: 1px solid var(--border-strong);
  padding: 0.36rem 0.72rem;
  border-radius: 8px;
  font-size: 0.79rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
}
.chip-btn:hover {
  background: #f1f5f9;
  color: var(--fg);
}
.chip-btn.selected {
  background: var(--brand-soft);
  color: var(--brand);
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.14);
}

/* ───── Public NPS Scale ───── */
.nps-scale {
  display: grid;
  grid-template-columns: repeat(11, minmax(0, 1fr));
  gap: 0.35rem;
  margin: 1.25rem 0 0.5rem;
}
.nps-btn {
  padding: 0.75rem 0.2rem;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: 9px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--fg);
}
.nps-btn.detractor:hover { background: #fff1f2; border-color: #fb7185; color: #be123c; }
.nps-btn.passive:hover { background: #fffbeb; border-color: #fbbf24; color: #b45309; }
.nps-btn.promoter:hover { background: #f0fdf4; border-color: #4ade80; color: #15803d; }

/* ───── Checkbox Pills (Scopes) ───── */
.scope-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.65rem 0 0.9rem;
}
.scope-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  margin: 0;
}
.scope-pill input {
  width: auto;
  margin: 0;
  accent-color: var(--brand);
}

/* ───── Toast Notifications ───── */
.toast-stack {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 360px;
}
.toast {
  background: #0f172a;
  color: #f8fafc;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-size: 0.85rem;
  box-shadow: var(--shadow-lg);
  border-left: 4px solid #14b8a6;
  animation: toast-in 0.2s ease;
}
.toast.error {
  border-left-color: #f43f5e;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ───── Executive Sticky Topbar ───── */
.topbar-desktop {
  position: sticky;
  top: 0;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.72rem 2rem;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar-search {
  position: relative;
  width: 100%;
  max-width: 340px;
}
.topbar-search svg {
  position: absolute;
  left: 0.78rem;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--muted);
  pointer-events: none;
}
.topbar-search input {
  padding-left: 2.2rem;
  background: var(--surface-subtle);
  border-color: var(--border);
  height: 36px;
  border-radius: 999px;
  font-size: 0.84rem;
}
.topbar-search input:focus {
  background: #fff;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.role-pill {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.25rem 0.62rem;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  border: 1px solid var(--brand-border);
}

/* ───── Enhanced KPI Icons & Stat Strips ───── */
.kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.kpi-ico {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--brand-soft);
  color: var(--brand);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.kpi-ico.ok { background: var(--ok-bg); color: var(--ok); }
.kpi-ico.warn { background: var(--warn-bg); color: var(--warn); }
.kpi-ico.danger { background: var(--danger-bg); color: var(--danger); }
.kpi-ico.info { background: var(--info-bg); color: var(--info); }
.kpi-ico svg { width: 17px; height: 17px; }

.avatar-sm {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  color: #fff;
  font-weight: 700;
  font-size: 0.76rem;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
}
.row-user {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
}

/* ───── White-Label Branding Studio (/admin) ───── */
.preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 0.6rem;
  margin-bottom: 1.1rem;
}
.preset-btn {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.72rem;
  border-radius: 10px;
  background: var(--surface);
  color: var(--fg);
  border: 1px solid var(--border-strong);
  font-size: 0.79rem;
  font-weight: 600;
  justify-content: flex-start;
  text-align: left;
}
.preset-btn:hover {
  background: var(--surface-subtle);
  color: var(--fg);
  border-color: var(--brand);
}
.preset-dots {
  display: inline-flex;
  flex-shrink: 0;
}
.preset-dots span {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid #fff;
  margin-left: -4px;
}
.preset-dots span:first-child { margin-left: 0; }

.color-field {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.color-field input[type="color"] {
  width: 44px;
  height: 38px;
  padding: 2px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: #fff;
  cursor: pointer;
  flex-shrink: 0;
}
.brand-asset-box {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
  background: var(--surface-subtle);
  flex-wrap: wrap;
}
.brand-preview-thumb {
  width: 58px;
  height: 58px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 6px;
  flex-shrink: 0;
}
.brand-preview-thumb img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* ───── Patient Portal (Dedicated Client Page) ───── */
.portal-wrap {
  min-height: 100vh;
  background:
    radial-gradient(circle at 0% 0%, color-mix(in srgb, var(--brand) 10%, transparent), transparent 44%),
    radial-gradient(circle at 100% 10%, color-mix(in srgb, var(--accent) 8%, transparent), transparent 40%),
    var(--bg);
}
.portal-nav {
  background: var(--sidebar-bg);
  color: #fff;
  padding: 0.9rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.portal-nav-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.portal-container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 1.75rem 1.25rem 3.5rem;
}
.portal-hero {
  background: linear-gradient(135deg, var(--brand) 0%, color-mix(in srgb, var(--brand) 65%, var(--accent)) 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem;
  margin-bottom: 1.4rem;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.portal-hero h1 {
  color: #fff;
  font-size: 1.75rem;
}
.portal-hero p {
  color: rgba(255, 255, 255, 0.88);
  margin: 0.3rem 0 0;
}
.portal-next-box {
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 12px;
  padding: 0.9rem 1.2rem;
  min-width: 240px;
}

/* ───── Lightweight Dialog Modal ───── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.56);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  padding: 1rem;
}
.modal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 520px;
  padding: 1.5rem;
}

/* ───── Responsive ───── */
@media (max-width: 960px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-backdrop.open {
    display: block;
  }
  .app-main {
    margin-left: 0;
  }
  .topbar-mobile {
    display: flex;
  }
  .topbar-desktop {
    display: none;
  }
  .content-wrap {
    padding: 1.2rem 1rem 2.5rem;
  }
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .nps-scale {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
  .public-card {
    padding: 1.4rem;
  }
}

/* ───── Visualização Dentária 3D (Modal Studio WebGL) ───── */
.d3d-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: #070d16;
  color: #f8fafc;
  display: flex;
  flex-direction: column;
}
.d3d-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  background: #0b1623;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}
.d3d-close {
  background: rgba(255, 255, 255, 0.08);
  color: #f1f5f9;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}
.d3d-close:hover {
  background: rgba(244, 63, 94, 0.22);
  border-color: rgba(244, 63, 94, 0.4);
  color: #fecdd3;
}
.d3d-body {
  flex: 1;
  min-height: 0;
  display: flex;
}
.d3d-stage {
  flex: 1;
  position: relative;
  min-width: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 45%, #16263d 0%, #0a1220 62%, #050911 100%);
}
.d3d-stage canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}
.d3d-controls-bar {
  position: absolute;
  top: 0.85rem;
  left: 0.85rem;
  right: 0.85rem;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  flex-wrap: wrap;
  pointer-events: none;
}
.d3d-preset-group,
.d3d-toggles {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  background: rgba(11, 22, 35, 0.82);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 0.3rem;
  pointer-events: auto;
}
.d3d-preset-group button,
.d3d-pill-toggle {
  background: transparent;
  color: #cbd5e1;
  border: 1px solid transparent;
  padding: 0.35rem 0.68rem;
  font-size: 0.77rem;
  font-weight: 600;
  border-radius: 7px;
  cursor: pointer;
}
.d3d-preset-group button:hover,
.d3d-pill-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}
.d3d-pill-toggle.active {
  background: rgba(20, 184, 166, 0.22);
  border-color: rgba(45, 212, 191, 0.45);
  color: #5eead4;
}
.d3d-slider-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  padding: 0 0.45rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #cbd5e1;
}
.d3d-slider-label input[type="range"] {
  width: 84px;
  accent-color: #14b8a6;
  padding: 0;
  border: 0;
  background: transparent;
}
.d3d-labels {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.d3d-fdi-tag {
  position: absolute;
  top: 0;
  left: 0;
  font-size: 10px;
  font-weight: 700;
  color: rgba(241, 245, 249, 0.82);
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 5px;
  padding: 1px 4px;
  line-height: 1.25;
}
.d3d-fdi-tag.active {
  background: #0f766e;
  color: #fff;
  border-color: #5eead4;
}
.d3d-tooltip {
  position: absolute;
  z-index: 20;
  pointer-events: none;
  background: rgba(11, 22, 35, 0.94);
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  padding: 0.38rem 0.65rem;
  font-size: 0.78rem;
  white-space: nowrap;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
}
.d3d-inspector {
  width: 356px;
  flex-shrink: 0;
  background: #0f1b2b;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.d3d-panel-head {
  padding: 1rem 1.15rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}
.d3d-panel-head h3 {
  color: #f8fafc;
  font-size: 1rem;
}
.d3d-panel-body {
  padding: 1rem 1.15rem 1.5rem;
  overflow-y: auto;
  flex: 1;
}
.d3d-muted {
  color: #94a3b8;
  font-size: 0.82rem;
}
.d3d-section {
  margin-top: 1rem;
  padding-top: 0.95rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.d3d-section:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
.d3d-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  margin-bottom: 0.55rem;
}
.d3d-legend-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.42rem 0.6rem;
  font-size: 0.78rem;
  color: #e2e8f0;
}
.d3d-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 0.42rem;
  vertical-align: middle;
  border: 1px solid rgba(255, 255, 255, 0.35);
}
.d3d-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.d3d-tooth-pill {
  border: 1px solid;
  border-radius: 8px;
  padding: 0.3rem 0.58rem;
  font-size: 0.77rem;
  font-weight: 600;
  cursor: pointer;
}
.d3d-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.73rem;
  font-weight: 600;
  border: 1px solid;
}
.d3d-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.d3d-list li {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 0.82rem;
}
.d3d-icon-btn {
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 7px;
  padding: 0.3rem 0.6rem;
  font-size: 0.76rem;
  cursor: pointer;
}
.d3d-icon-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}
.d3d-form label {
  color: #cbd5e1;
  font-size: 0.76rem;
  margin-top: 0.55rem;
}
.d3d-form select,
.d3d-form input {
  background: #0b1623;
  color: #f8fafc;
  border-color: rgba(255, 255, 255, 0.16);
}
.d3d-form select:focus,
.d3d-form input:focus {
  border-color: #14b8a6;
}

@media (max-width: 900px) {
  .d3d-body {
    flex-direction: column;
  }
  .d3d-stage {
    min-height: 52vh;
  }
  .d3d-inspector {
    width: 100%;
    max-height: 44vh;
    border-left: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }
}

/* ───── Assinatura Digital em Tela ───── */
.sig-wrap {
  border: 1.5px dashed var(--border-strong);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}
.sig-canvas {
  display: block;
  width: 100%;
  height: 140px;
  touch-action: none;
  cursor: crosshair;
  background: #fff;
}
.sig-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.35rem 0.7rem;
  background: var(--surface-subtle);
  border-top: 1px solid var(--border);
}

/* ───── Alerta Médico Crítico (Anamnese) ───── */
.med-alert-banner {
  background: linear-gradient(135deg, #fff1f2, #ffe4e6);
  border: 1.5px solid #fda4af;
  border-radius: 12px;
  padding: 0.85rem 1.1rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.med-alert-banner strong {
  color: #9f1239;
  font-size: 0.86rem;
}

/* ───── Tabs de Navegação Interna ───── */
.tabs-bar {
  display: flex;
  gap: 0.35rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.25rem;
  overflow-x: auto;
}
.tab-btn {
  background: transparent;
  color: var(--muted);
  border: 0;
  border-bottom: 2.5px solid transparent;
  border-radius: 0;
  padding: 0.65rem 1rem;
  font-size: 0.86rem;
  font-weight: 600;
}
.tab-btn:hover {
  background: transparent;
  color: var(--fg);
}
.tab-btn.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
}

/* ───── Agenda Visual em Grade por Dentista ───── */
.agenda-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(210px, 1fr);
  gap: 0.75rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}
.agenda-col {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.agenda-col-head {
  padding: 0.7rem 0.9rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: 0.86rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.agenda-slot {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.45rem 0.65rem;
  border-bottom: 1px solid var(--border);
  min-height: 52px;
  font-size: 0.8rem;
}
.agenda-slot:last-child { border-bottom: 0; }
.agenda-hour {
  width: 42px;
  flex-shrink: 0;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.74rem;
  padding-top: 0.15rem;
}
.agenda-block {
  flex: 1;
  background: var(--brand-soft);
  border: 1px solid var(--brand-border);
  border-left: 3.5px solid var(--brand);
  border-radius: 7px;
  padding: 0.4rem 0.55rem;
}
.agenda-block.confirmado, .agenda-block.concluido { background: var(--ok-bg); border-color: var(--ok-border); border-left-color: var(--ok); }
.agenda-block.faltou, .agenda-block.cancelado { background: var(--danger-bg); border-color: var(--danger-border); border-left-color: var(--danger); }
.agenda-empty-btn {
  flex: 1;
  background: transparent;
  color: transparent;
  border: 1px dashed transparent;
  border-radius: 6px;
  padding: 0.35rem 0.5rem;
  font-size: 0.74rem;
  justify-content: flex-start;
}
.agenda-slot:hover .agenda-empty-btn {
  color: var(--brand);
  border-color: var(--brand-border);
  background: var(--brand-soft);
}

/* ───── Kanban de Leads ───── */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(210px, 1fr));
  gap: 0.85rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}
.kanban-col {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-height: 260px;
}
.kanban-col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--fg-secondary);
  padding: 0.15rem 0.25rem;
}
.kanban-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem;
  box-shadow: var(--shadow-sm);
}

/* ───── Comparador Antes × Depois ───── */
.ba-stage {
  position: relative;
  width: 100%;
  max-width: 640px;
  aspect-ratio: 16 / 10;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #0f172a;
  margin: 0.75rem auto 0;
}
.ba-stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
}
.ba-after-clip {
  position: absolute;
  inset: 0;
  overflow: hidden;
  clip-path: inset(0 0 0 50%);
}
.ba-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: #fff;
  box-shadow: 0 0 10px rgba(0,0,0,.5);
  pointer-events: none;
}

/* ───── QR Code Pix ───── */
.qr-box {
  width: 210px;
  height: 210px;
  margin: 0.75rem auto;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  display: grid;
  place-items: center;
}
.qr-box svg {
  width: 100%;
  height: 100%;
}

/* ───── Onboarding Checklist ───── */
.onboard-card {
  background: linear-gradient(135deg, var(--brand-soft), #ffffff);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.4rem;
  margin-bottom: 1.35rem;
}
.onboard-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.55rem;
  margin-top: 0.85rem;
}
.onboard-step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.72rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: 0.8rem;
  color: var(--fg);
}
.onboard-step.done {
  color: var(--ok);
  border-color: var(--ok-border);
  background: var(--ok-bg);
}

/* ───── Copiloto IA Flutuante ───── */
.copilot-fab {
  position: fixed;
  right: 1.35rem;
  bottom: 1.35rem;
  z-index: 80;
  border-radius: 999px;
  padding: 0.72rem 1.15rem;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  color: #fff;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.25);
  border: 0;
  font-weight: 700;
  font-size: 0.84rem;
  gap: 0.5rem;
}
.copilot-drawer {
  position: fixed;
  right: 1.35rem;
  bottom: 4.9rem;
  z-index: 85;
  width: 370px;
  max-width: calc(100vw - 2rem);
  height: 490px;
  max-height: calc(100vh - 7rem);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.copilot-head {
  background: var(--sidebar-bg);
  color: #fff;
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.copilot-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  background: var(--surface-subtle);
}
.copilot-bubble {
  padding: 0.68rem 0.85rem;
  border-radius: 12px;
  font-size: 0.83rem;
  line-height: 1.45;
  max-width: 92%;
}
.copilot-bubble.bot {
  background: #fff;
  border: 1px solid var(--border);
  align-self: flex-start;
}
.copilot-bubble.user {
  background: var(--brand);
  color: #fff;
  align-self: flex-end;
}
.copilot-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem;
}
.copilot-chip {
  background: #fff;
  color: var(--brand);
  border: 1px solid var(--brand-border);
  border-radius: 999px;
  padding: 0.3rem 0.65rem;
  font-size: 0.74rem;
  font-weight: 600;
}
.copilot-chip:hover {
  background: var(--brand-soft);
  color: var(--brand);
}
.copilot-form {
  display: flex;
  gap: 0.45rem;
  padding: 0.65rem;
  border-top: 1px solid var(--border);
  background: #fff;
}

/* ───── Landing Page Comercial SaaS ───── */
.lp-wrap {
  min-height: 100vh;
  background: #ffffff;
  color: var(--fg);
}
.lp-nav {
  max-width: 1140px;
  margin: 0 auto;
  padding: 1.15rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.lp-hero {
  max-width: 1140px;
  margin: 0 auto;
  padding: 3.5rem 1.5rem 4rem;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2.5rem;
  align-items: center;
}
.lp-hero h1 {
  font-size: clamp(2rem, 4vw, 3.1rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}
.lp-section {
  max-width: 1140px;
  margin: 0 auto;
  padding: 3.5rem 1.5rem;
}
.lp-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.1rem;
  margin-top: 2rem;
}
.lp-feat {
  padding: 1.35rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.lp-pricing {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}
.lp-plan {
  padding: 1.6rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
}
.lp-plan.featured {
  border: 2px solid var(--brand);
  box-shadow: var(--shadow-lg);
}
@media (max-width: 860px) {
  .lp-hero { grid-template-columns: 1fr; padding-top: 2rem; }
}

@media print {
  .sidebar,
  .topbar-mobile,
  .topbar-desktop,
  .no-print,
  .odonto-editor,
  .odonto-toolbar button,
  .toast-stack,
  .d3d-overlay,
  .copilot-fab,
  .copilot-drawer {
    display: none !important;
  }
  .app-main {
    margin-left: 0 !important;
  }
  .card {
    box-shadow: none !important;
    border-color: #cbd5e1 !important;
  }
  body {
    background: #fff !important;
  }
}
