/* ============================================================
   DESIGN TOKENS
   ============================================================ */

:root {
  /* Colors */
  --bg: #f3f2ef;
  --surface: rgba(255, 255, 255, 0.96);
  --surface-strong: #ffffff;
  --border: rgba(22, 45, 61, 0.08);
  --text: #334155;
  --muted: #7b8794;
  --brand: #39cf90;
  --brand-deep: #26b67b;
  --brand-soft: #dff8ec;
  --accent: #10b981;

  /* Shadows */
  --shadow: 0 20px 50px rgba(52, 71, 103, 0.08);
  --shadow-sm: 0 8px 18px rgba(21, 43, 63, 0.06);
  --shadow-md: 0 12px 24px rgba(52, 71, 103, 0.08);
  --shadow-lg: 0 22px 48px rgba(15, 23, 42, 0.16);

  /* Border radii */
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;

  /* Transitions */
  --transition: 160ms ease;

  /* Brand gradient */
  --gradient-brand: linear-gradient(135deg, var(--brand), var(--brand-deep));
}


/* ============================================================
   RESET & BASE
   ============================================================ */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI Variable Text", "Segoe UI", "Trebuchet MS", Verdana, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(57, 207, 144, 0.16), transparent 24%),
    linear-gradient(180deg, #fafaf8 0%, var(--bg) 100%);
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

/* Hide number input arrows */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type=number] {
  -moz-appearance: textfield;
}

.hidden {
  display: none !important;
}

body.modal-open {
  overflow: hidden;
}


/* ============================================================
   LAYOUT
   ============================================================ */

.page-shell {
  width: min(1680px, calc(100% - 20px));
  margin: 0 auto;
  padding: 18px 0 40px;
}

.dashboard {
  padding: 22px 0 0;
}

.app-view.hidden {
  display: none;
}

[hidden] {
  display: none !important;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.dashboard-main,
.dashboard-side {
  min-width: 0;
}

.dashboard-side {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 128px;
  gap: 18px;
  margin-bottom: 14px;
}


/* ============================================================
   TOPBAR & NAVIGATION — Liquid Glass
   Pílula glass branca com aurora vazando atrás. Marca compacta
   à esquerda, nav centralizado, ícones + perfil à direita.
   ============================================================ */

.topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 8px 10px 8px 8px;
  border-radius: 22px;
  background: var(--glass-bg, rgba(255, 255, 255, 0.62));
  -webkit-backdrop-filter: saturate(140%) blur(20px);
  backdrop-filter: saturate(140%) blur(20px);
  border: 1px solid var(--glass-border-soft, rgba(255, 255, 255, 0.35));
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset,
              0 8px 24px -8px rgba(15, 23, 42, 0.18),
              0 2px 6px -2px rgba(15, 23, 42, 0.08);
  position: relative;
  overflow: visible;
  /* Acima das views (dashboard-view etc.) que ganharam position:relative
     ao receberem aurora + glass — sem isso o profile-dropdown fica
     coberto pelo conteúdo da página seguinte no DOM. */
  z-index: 20;
}

/* Linha de luz no topo (highlight Apple). */
.topbar::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  border-radius: 22px 22px 0 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.85), transparent);
  pointer-events: none;
}

/* --- BRAND --- */
.brand-block {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px;
  height: auto;
  background: transparent;
  border-radius: 14px;
  text-decoration: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), background 0.18s ease;
}

.brand-block:hover {
  background: rgba(255, 255, 255, 0.45);
  transform: translateY(-0.5px);
}

.brand-block:active {
  transform: scale(0.98);
}

.brand-mark {
  width: 38px;
  height: 38px;
  position: relative;
  border-radius: 12px;
  background: linear-gradient(180deg, #34d399, #10b981);
  box-shadow: 0 4px 10px -2px rgba(16, 185, 129, 0.45),
              inset 0 1px 0 0 rgba(255, 255, 255, 0.35);
}

.brand-mark::before,
.brand-mark::after,
.brand-mark span {
  content: "";
  position: absolute;
  background: #fff;
}

.brand-mark::before {
  inset: 8px 13px 9px;
  border-radius: 14px 14px 18px 18px;
}

.brand-mark::after {
  width: 7px;
  height: 7px;
  top: 3px;
  left: 16px;
  border-radius: 7px 7px 0 7px;
  transform: rotate(45deg);
}

.brand-mark span {
  display: none;
}

/* --- Logo Nutrie --- */
.brand-logo {
  display: block;
  width: auto;
  height: 29px;
  max-height: 29px;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(16, 185, 129, 0.08));
  transition: transform 0.18s ease, filter 0.18s ease;
}

.brand-logo:hover {
  filter: drop-shadow(0 2px 8px rgba(16, 185, 129, 0.18));
}

.brand-logo-lg {
  display: block;
  width: auto;
  height: 48px;
  max-height: 54px;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(16, 185, 129, 0.12));
}

/* --- NAV --- */
.main-nav {
  display: inline-flex;
  gap: 2px;
  justify-self: center;
  overflow: visible;
  flex-wrap: wrap;
  padding: 0;
}

.main-nav::-webkit-scrollbar {
  display: none;
}

.nav-menu-shell {
  position: relative;
}

.nav-item {
  min-width: max-content;
  padding: 9px 16px;
  border-radius: 12px;
  color: #64748b;
  background: transparent;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
  border: 0;
  cursor: pointer;
  transition: background 0.18s cubic-bezier(0.16, 1, 0.3, 1),
              color 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-item:hover {
  background: rgba(15, 23, 42, 0.04);
  color: #0f172a;
}

.nav-item-active,
.nav-item-active:hover {
  background: var(--glass-bg-strong, rgba(255, 255, 255, 0.82));
  color: #0f172a;
  box-shadow: inset 0 1px 0 0 var(--glass-highlight, rgba(255, 255, 255, 0.85)),
              0 2px 6px -2px rgba(15, 23, 42, 0.10);
}

.nav-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 190px;
  padding: 8px;
  border: 1px solid var(--glass-border-soft, rgba(255, 255, 255, 0.35));
  border-radius: 16px;
  background: var(--glass-bg-strong, rgba(255, 255, 255, 0.92));
  -webkit-backdrop-filter: saturate(140%) blur(20px);
  backdrop-filter: saturate(140%) blur(20px);
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.6),
              0 16px 40px -12px rgba(15, 23, 42, 0.22);
  z-index: 15;
}

/* --- ACTIONS --- */
.topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Separador sutil entre ícones e o profile chip */
.topbar-actions::before {
  content: "";
  display: inline-block;
  width: 1px;
  height: 22px;
  background: rgba(15, 23, 42, 0.10);
  margin: 0 4px;
  order: 99; /* fica antes do profile-chip naturalmente */
}
.topbar-actions .profile-menu-shell {
  order: 100;
}

.profile-menu-shell {
  position: relative;
}

.icon-button {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 0;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  position: relative;
  transition: background 0.18s cubic-bezier(0.16, 1, 0.3, 1),
              color 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.icon-button:hover {
  background: rgba(15, 23, 42, 0.05);
  color: #0f172a;
}

.icon-button svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* Dot vermelho de notificação */
.icon-button.has-badge::after {
  content: "";
  position: absolute;
  top: 8px;
  right: 9px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 0 2px var(--glass-bg-strong, rgba(255, 255, 255, 0.82));
}

.icon-button.accent svg {
  fill: currentColor;
}

.profile-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 4px 4px 4px 14px;
  border-radius: 999px;
  border: 1px solid var(--glass-border-soft, rgba(255, 255, 255, 0.35));
  background: var(--glass-bg, rgba(255, 255, 255, 0.62));
  box-shadow: inset 0 1px 0 0 var(--glass-highlight, rgba(255, 255, 255, 0.85));
  color: #0f172a;
  cursor: pointer;
  transition: background 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.profile-chip:hover {
  background: var(--glass-bg-strong, rgba(255, 255, 255, 0.82));
}

.profile-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.15;
}

.profile-label {
  font-size: 9.5px;
  color: #64748b;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 1;
}

.profile-copy strong {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.005em;
}

.profile-avatar {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #34d399, #10b981);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 2px 6px -1px rgba(16, 185, 129, 0.35),
              inset 0 1px 0 0 rgba(255, 255, 255, 0.35);
}

.profile-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 230px;
  padding: 8px;
  border: 1px solid var(--glass-border-soft, rgba(255, 255, 255, 0.35));
  border-radius: 16px;
  background: var(--glass-bg-strong, rgba(255, 255, 255, 0.92));
  -webkit-backdrop-filter: saturate(140%) blur(20px);
  backdrop-filter: saturate(140%) blur(20px);
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.6),
              0 16px 40px -12px rgba(15, 23, 42, 0.22);
  z-index: 15;
}

.dropdown-item {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  text-align: left;
  background: transparent;
  color: #0f172a;
  font-size: 13px;
  font-weight: 600;
  border: 0;
  cursor: pointer;
  transition: background 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.dropdown-item:hover {
  background: rgba(16, 185, 129, 0.10);
  color: var(--mp-accent-strong, #059669);
}


/* ============================================================
   HERO
   ============================================================ */

.hero {
  padding: 10px 0 24px;
}

.hero-greeting {
  max-width: 720px;
  text-align: left;
}

.hero-greeting h1 {
  margin: 0 0 8px;
  color: #162d3d;
  font-size: 34px;
  line-height: 1.1;
}

.hero-greeting p {
  margin: 0;
  color: #70808f;
  font-size: 17px;
}


/* ============================================================
   PANELS
   ============================================================ */

.searchbar,
.filter-select,
.panel {
  background: var(--surface);
  box-shadow: var(--shadow);
}

.searchbar,
.filter-select {
  display: flex;
  align-items: center;
  border-radius: 10px;
}

.panel {
  border: 1px solid var(--border);
  border-radius: 45px;
}

.large-panel {
  padding: 18px 18px 16px;
}

.side-panel {
  padding: 26px;
}

.side-panel-tall {
  display: flex;
  flex-direction: column;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  margin-bottom: 22px;
}

.panel-heading-split {
  justify-content: space-between;
}

.panel-heading-main {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.panel-heading h2 {
  margin: 0;
  font-size: 21px;
}

.side-panel-add-button {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 50%;
  border: 0;
  background: var(--gradient-brand);
  color: #fff;
  box-shadow: 0 10px 18px rgba(36, 184, 125, 0.22);
  transition: transform var(--transition), filter var(--transition), box-shadow var(--transition);
}

.side-panel-add-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
  box-shadow: 0 12px 20px rgba(36, 184, 125, 0.26);
}

.side-panel-add-button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(57, 207, 144, 0.18), 0 10px 18px rgba(36, 184, 125, 0.22);
}

.side-panel-add-button svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.panel-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
}

.panel-icon.mint {
  background: #5dd7a3;
}

.panel-icon.teal {
  background: #3ccf96;
}

.panel-icon svg {
  width: 22px;
  fill: #fff;
}

.panel-body {
  min-height: 520px;
  max-height: 520px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 10px;
  scrollbar-width: auto;
  scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
}

.panel-body::-webkit-scrollbar,
.appointments-list::-webkit-scrollbar {
  width: 8px;
}

.panel-body::-webkit-scrollbar-track,
.appointments-list::-webkit-scrollbar-track {
  background: transparent;
}

.panel-body::-webkit-scrollbar-thumb,
.appointments-list::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 10px;
}


.panel-footer {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding-top: 18px;
}

.sync-note {
  margin: 0;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.empty-state {
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
}

.empty-state svg {
  width: 28px;
  margin-bottom: 12px;
  fill: #b9c5cf;
}


/* ============================================================
   TABS
   ============================================================ */

.tabs {
  display: flex;
  gap: 16px;
  padding: 4px 6px 16px;
  border-bottom: 1px solid rgba(22, 45, 61, 0.06);
}

.tab {
  padding: 8px 0;
  border-radius: 0;
  color: var(--muted);
  background: transparent;
  font-weight: 700;
}

.tab-active {
  color: var(--brand);
  box-shadow: inset 0 -2px 0 var(--brand);
}


/* ============================================================
   BUTTONS
   ============================================================ */

/* Shared button transitions */
.secondary-button,
.danger-button,
.arrow-button,
.primary-button,
.primary-inline-button,
.ghost-button,
.tiny-button {
  transition: transform var(--transition), background var(--transition), color var(--transition), border-color var(--transition);
}

.secondary-button:hover,
.danger-button:hover,
.arrow-button:hover,
.primary-button:hover,
.primary-inline-button:hover,
.ghost-button:hover,
.tiny-button:hover {
  transform: translateY(-1px);
}

/* Primary */
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 20px;
  border-radius: 12px;
  border: 0;
  background: linear-gradient(180deg, #10b981 0%, #059669 100%);
  color: #fff;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px -2px rgba(16, 185, 129, 0.4),
              inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}

.primary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px -2px rgba(16, 185, 129, 0.5),
              inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.primary-button:active {
  transform: translateY(0);
}

/* Liquid Glass override do .primary-button dentro do preview de atendimento */
#care-preview-stage .primary-button {
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(180deg, #34d399 0%, #10b981 100%);
  box-shadow: 0 6px 16px -2px rgba(16, 185, 129, 0.45),
              inset 0 1px 0 0 rgba(255, 255, 255, 0.4);
  font-weight: 700;
  letter-spacing: -0.005em;
}
#care-preview-stage .primary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px -2px rgba(16, 185, 129, 0.55),
              inset 0 1px 0 0 rgba(255, 255, 255, 0.45);
}

.primary-inline-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 18px;
  border-radius: 12px;
  border: 0;
  background: linear-gradient(180deg, #10b981 0%, #059669 100%);
  color: #fff;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}

/* Secondary */
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(15, 23, 42, 0.04);
  color: #475569;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: transform var(--transition), background var(--transition), color var(--transition), border-color var(--transition);
}

.secondary-button:hover {
  transform: translateY(-1px);
  background: rgba(15, 23, 42, 0.08);
  border-color: rgba(15, 23, 42, 0.2);
  color: #0f172a;
}

.secondary-button:active {
  transform: translateY(0);
}

/* Ghost */
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 18px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: transparent;
  color: #475569;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}

.ghost-button:hover {
  background: rgba(15, 23, 42, 0.05);
  color: #0f172a;
}

/* Danger */
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border-radius: 12px;
  border: 1px solid rgba(239, 68, 68, 0.2);
  background: rgba(239, 68, 68, 0.08);
  color: #dc2626;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--transition), background var(--transition), color var(--transition), border-color var(--transition);
}

.danger-button:hover {
  transform: translateY(-1px);
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.35);
  color: #b91c1c;
}

.danger-button:active {
  transform: translateY(0);
}

.secondary-button svg,
.danger-button svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.danger-button.hidden {
  display: none;
}

/* Arrow */
.arrow-button {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  border: 2px solid rgba(57, 207, 144, 0.52);
  background: transparent;
  color: var(--brand);
  font-size: 24px;
  line-height: 1;
}

/* Tiny */
.tiny-button {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 2px solid rgba(57, 207, 144, 0.42);
  background: transparent;
  color: var(--brand);
  font-size: 22px;
  line-height: 1;
}

/* Warn / danger variants (applied on top of tiny-button or action-button) */
.warn-button {
  border-color: rgba(245, 158, 11, 0.32);
  color: #c78509;
  background: rgba(245, 158, 11, 0.08);
}

.danger-tiny-button {
  border-color: rgba(255, 107, 87, 0.34);
  color: #d84a3a;
  background: rgba(255, 107, 87, 0.08);
}

.warn-action-button {
  border-color: rgba(245, 158, 11, 0.32);
  color: #b97706;
  background: rgba(245, 158, 11, 0.08);
}

.danger-action-button {
  border-color: rgba(255, 107, 87, 0.34);
  color: #cf3f30;
  background: rgba(255, 107, 87, 0.08);
}

/* Action Icon Buttons */
.action-icon-button {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 0;
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  transition: transform var(--transition), filter var(--transition);
}

.action-icon-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.edit-icon-button {
  background: linear-gradient(135deg, #60a5fa, #3b82f6);
}

.delete-icon-button {
  background: linear-gradient(90deg, rgb(255, 137, 137) 0%, rgba(255, 82, 82, 0.81) 100%);
}

.action-icon-button svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}


/* ============================================================
   SEARCHBAR
   ============================================================ */

.searchbar {
  padding: 0 16px 0 20px;
  overflow: hidden;
}

.searchbar input {
  width: 100%;
  height: 55px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.searchbar input::placeholder {
  color: #9aa7b4;
}

.search-icon {
  width: 50px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 20px 5px 5px 20px;
  background: var(--brand-soft);
  margin-right: -1px;
  transform: translate(calc(var(--search-icon-x, 0) * 1px),
      calc(var(--search-icon-y, 0) * 1px));
}

.search-icon svg {
  width: 20px;
  fill: var(--brand);
}

.filter-select {
  padding: 0 16px;
}

.filter-select select {
  width: 100%;
  height: 56px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-weight: 600;
}

.searchbar-action-button {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-sm);
  color: #64748b;
  cursor: pointer;
  padding: 0;
  transition: all 0.18s ease;
}

.searchbar-action-button svg {
  width: 20px;
  height: 20px;
  display: block;
}

.searchbar-action-button:hover {
  border-color: rgba(236, 72, 153, 0.4);
  color: #ec4899;
  transform: translateY(-1px);
}

.searchbar-action-button[aria-pressed="true"],
.searchbar-action-button.searchbar-action-button-active {
  background: linear-gradient(135deg, rgba(253, 232, 240, 0.9) 0%, rgba(251, 207, 232, 0.6) 100%);
  border-color: rgba(244, 114, 182, 0.6);
  color: #be185d;
  box-shadow: 0 3px 10px -2px rgba(219, 39, 119, 0.25);
}


/* ============================================================
   QUICK ACTION BUTTONS
   ============================================================ */

.quick-action-button {
  min-width: 220px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 8px;
  border: 1px solid var(--border);
  border-radius: 10px 28px 28px 10px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-md);
  color: #243746;
  font-weight: 600;
}

.quick-action-button#open-patient-modal {
  --new-patient-icon-x: 0;
  --new-patient-icon-y: 0;
}

.quick-action-button#open-patient-modal .quick-action-icon-green {
  transform: translate(calc(var(--new-patient-icon-x, 0) * 1px),
      calc(var(--new-patient-icon-y, 0) * 1px));
  transform-origin: center;
}

.quick-action-button:hover {
  border-color: rgba(57, 207, 144, 0.18);
}

.quick-action-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border-radius: 4px 20px 20px 4px;
  font-size: 22px;
  line-height: 1;
  margin-left: -2px;
}

.quick-action-icon svg {
  width: 20px;
  height: 20px;
}

.quick-action-icon-green {
  background: rgba(57, 207, 144, 0.1);
  color: #2cb67d;
}

.quick-action-icon-blue {
  background: rgba(96, 165, 250, 0.1);
  color: #4f8ff7;
  font-size: 17px;
}

.quick-action-copy {
  display: grid;
  text-align: left;
}

.quick-action-copy strong {
  font-size: 15px;
  color: #243746;
  letter-spacing: 0.01em;
  font-weight: 600;
}

.quick-action-arrow {
  margin-left: auto;
  color: #98a4af;
  font-size: 16px;
  line-height: 1;
}


/* ============================================================
   PATIENT PANEL TOOLBAR
   ============================================================ */

.patient-panel-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 12px;
}

.patient-panel-search-group {
  display: flex;
  align-items: stretch;
  gap: 12px;
  min-width: 0;
}

.patient-panel-searchbar {
  min-width: 0;
  width: 100%;
  height: 55px;
  padding-top: 0;
  padding-bottom: 0;
  border: 1px solid var(--border);
  --search-icon-x: 9;
  --search-icon-y: 0;
}

.patient-panel-actions {
  margin-bottom: 0;
  flex-wrap: nowrap;
  justify-content: flex-end;
  min-width: fit-content;
}

.patient-panel-actions .quick-action-button {
  min-width: 198px;
  width: auto;
  height: 55px;
}

.patients-toolbar {
  display: flex;
  justify-content: flex-start;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}


/* ============================================================
   PATIENT LIST
   ============================================================ */

/* ============================================================
   PATIENT LIST (PREMIUM REDESIGN)
   ============================================================ */

.patient-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 10px 0;
}

.patient-card {
  background: var(--surface);
  border: 1px solid rgba(0, 0, 0, 0.04);
  border-radius: 24px;
  padding: 14px;
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
}

.patient-card:hover {
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.06);
  border-color: rgba(36, 184, 125, 0.2);
}

.patient-card.deactivated {
  filter: grayscale(1);
  opacity: 0.6;
}

.patient-card.deactivated:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.04);
  cursor: default;
}

.patient-card.deactivated:hover .patient-card-actions-inline {
  opacity: 0;
  visibility: hidden;
}

.patient-card.deactivated .status-switch {
  cursor: pointer;
}

/* Tags at top */
.patient-card-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.patient-tag-dot-only {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  position: relative;
  top: 2px;
  background: var(--tag-color);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--tag-color) 18%, transparent);
  transition: transform 0.12s ease;
  cursor: default;
}

.patient-tag-dot-only:hover {
  transform: scale(1.25);
}

/* Tooltip = réplica visual de .patient-tag (menu Atendimento):
   pill com fundo glass branco, borda discreta, texto na cor da tag. */
.patient-tag-dot-only::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--tag-color);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 1.4;
  white-space: nowrap;
  border-radius: 99px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.6),
              0 4px 12px rgba(15, 23, 42, 0.12);
  -webkit-backdrop-filter: saturate(140%) blur(6px);
  backdrop-filter: saturate(140%) blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease, transform 0.12s ease;
  z-index: 100;
}

.patient-tag-dot-only:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Header Info */
.patient-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.patient-card-actions-inline {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.patient-card:hover .patient-card-actions-inline {
  opacity: 1;
  visibility: visible;
}

.patient-card-header-main {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.patient-card-name {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #162d3d;
  line-height: 1.2;
}

.patient-card-subtitle {
  font-size: 13px;
  color: #70808f;
  margin-top: 4px;
}

.patient-card-price {
  font-size: 14px;
  font-weight: 700;
  color: #162d3d;
}

/* Divider */
.patient-card-divider {
  height: 1px;
  background: rgba(0, 0, 0, 0.05);
  margin: 2px 0;
}

/* Footer Row */
.patient-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.patient-card-status-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  user-select: none;
}

.patient-card-status-toggle.active {
  color: #2cb67d;
}

/* Switch Styles */
.status-switch {
  position: relative;
  display: inline-block;
  width: 34px;
  height: 18px;
}

.status-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.status-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #e2e8f0;
  transition: .3s;
  border-radius: 18px;
}

.status-slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

input:checked+.status-slider {
  background-color: #2cb67d;
}

input:checked+.status-slider:before {
  transform: translateX(16px);
}

.patient-card-identity {
  display: flex;
  align-items: center;
  gap: 12px;
}

.patient-card-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #39cf90, #24b87d);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 12px;
  box-shadow: 0 4px 8px rgba(36, 184, 125, 0.2);
}

.patient-card-socials {
  display: flex;
  gap: 6px;
}

.social-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: transparent;
  color: #b2becd;
  transition: all 0.2s;
  border: 0;
  padding: 0;
  outline: none;
  cursor: pointer;
}

.social-icon-btn:hover {
  background: #fff;
  color: var(--brand);
}

.social-icon-btn svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.social-icon-btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Tamanhos individuais dos botões sociais */
.social-btn-whatsapp svg {
  width: 22px;
  height: 22px;
}

.social-btn-email svg {
  width: 22px;
  height: 22px;
}

.social-btn-edit {
  opacity: 0.5;
  /* Controle de opacidade individual */
}

.social-btn-edit svg {
  width: 21px;
  height: 21px;
  position: relative;
  top: -1px;
  left: 0px;
}

/* Progress / Status */
.patient-card-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #70808f;
  font-size: 13px;
  font-weight: 600;
}

.progress-check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid #d1d5db;
  display: grid;
  place-items: center;
}

.progress-check.active {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.progress-check svg {
  width: 10px;
  height: 10px;
  fill: currentColor;
}

/* Inline Actions */
.patient-card-actions-inline {
  display: flex;
  gap: 8px;
}

.btn-main-sm {
  background: var(--gradient-brand);
  color: #fff;
  padding: 8px 16px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 13px;
  box-shadow: 0 4px 10px rgba(36, 184, 125, 0.2);
}

.btn-sub-sm {
  background: #f1f5f9;
  color: #475569;
  padding: 8px 16px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 13px;
}

.btn-sub-sm:hover {
  background: #e2e8f0;
}


/* ============================================================
   BIRTHDAY CARD
   ============================================================ */

.birthday-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 8px;
  border-bottom: 1px dashed rgba(22, 45, 61, 0.09);
}

.birthday-text strong,
.birthday-text span {
  display: block;
}

.birthday-text span {
  margin-top: 4px;
  color: var(--muted);
}


/* ============================================================
   MINI CALENDAR
   ============================================================ */

.mini-calendar-card {
  display: grid;
  gap: 12px;
}

.mini-calendar-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.mini-calendar-icon-button {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
  color: #5c6f7f;
  box-shadow: var(--shadow-sm);
}

.mini-calendar-icon-button:hover {
  color: var(--brand-deep);
  border-color: rgba(57, 207, 144, 0.24);
}

.mini-calendar-icon-button svg {
  width: 18px;
  fill: currentColor;
}

.mini-calendar-weekdays,
.mini-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.mini-calendar-weekdays {
  color: #7a8894;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.mini-calendar-day {
  position: relative;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #5f6d79;
  font-size: 13px;
  font-weight: 800;
}

.mini-calendar-day-active {
  background: #dff8ec;
  color: var(--brand-deep);
}

/* Calendar day type variants share same text color */
.mini-calendar-day-consulta,
.mini-calendar-day-retorno,
.mini-calendar-day-block {
  color: #ffffff;
}

.mini-calendar-day-consulta {
  background: rgba(71, 190, 125, 0.8);
}

.mini-calendar-day-retorno {
  background: rgba(62, 151, 255, 0.9);
}

.mini-calendar-day-block {
  background: rgba(217, 33, 78, 0.8);
}

.mini-calendar-day-mixed {
  background: linear-gradient(135deg, rgba(71, 190, 125, 0.8), rgba(62, 151, 255, 0.8));
  color: #ffffff;
}

.mini-calendar-day-today {
  border: 2px solid rgba(57, 207, 144, 0.42);
  box-shadow: 0 0 0 3px rgba(57, 207, 144, 0.12);
}

.mini-calendar-day-muted {
  opacity: 0.38;
}


/* ============================================================
   APPOINTMENTS
   ============================================================ */

.appointments-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  height: 200px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 10px;
  scrollbar-width: auto;
  scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
}


.appointment-card-premium {
  display: flex;
  align-items: stretch;
  flex-shrink: 0;
  min-height: 65px;
  background: transparent;
  padding: 0;
  border-bottom: 1px dashed rgba(22, 45, 61, 0.09);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: background-color var(--transition);
}

.appointment-card-premium:last-child {
  border-bottom: 0;
}

.appointment-card-premium:hover {
  background-color: rgba(22, 45, 61, 0.03);
  border-radius: var(--radius-sm);
  margin-right: 3px;
}

.appointment-card-premium::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 8px;
  bottom: 8px;
  width: 4px;
  border-radius: 4px;
  z-index: 2;
}

.appointment-card-premium.appointment-type-consulta::before {
  background: #47be7d;
}

.appointment-card-premium.appointment-type-retorno::before {
  background: #3e97ff;
}

.appointment-card-premium.appointment-type-bloqueio::before {
  background: #d9214e;
}

.appointment-card-premium.appointment-type-compromisso::before {
  background: #f59e0b;
}

.appointment-time-column {
  min-width: 95px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: transparent;
  padding: 12px 16px 12px 28px;
}

.appointment-hour {
  font-size: 18px;
  font-weight: 800;
  color: #1e293b;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.appointment-content-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 8px 20px;
}

.appointment-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.appointment-header strong {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
}

.appointment-badge {
  --badge-color: #10b981;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 3px 9px 3px 8px;
  border-radius: 999px;
  line-height: 1;
  text-transform: uppercase;
  flex-shrink: 0;
  background: color-mix(in srgb, var(--badge-color) 12%, rgba(255, 255, 255, 0.7));
  border: 1px solid color-mix(in srgb, var(--badge-color) 22%, transparent);
  color: var(--badge-color);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.6);
}
.appointment-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--badge-color);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--badge-color) 25%, transparent);
  flex-shrink: 0;
}

.appointment-badge.badge-today {
  --badge-color: #10b981;
}

.appointment-badge.badge-tomorrow {
  --badge-color: #8b5cf6;
}

.appointment-badge.hidden {
  display: none;
}

.appointment-footer {
  display: flex;
  align-items: center;
  gap: 16px;
}

.appointment-date,
.appointment-location {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #64748b;
  font-size: 13px;
  font-weight: 500;
}

.appointment-type-label {
  --label-color: #64748b;
  position: absolute;
  right: 20px;
  top: 50%;
  opacity: 0;
  transform: translateY(-50%) translateX(10px);
  transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 11px 4px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--label-color) 12%, rgba(255, 255, 255, 0.7));
  border: 1px solid color-mix(in srgb, var(--label-color) 22%, transparent);
  color: var(--label-color);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.6);
  pointer-events: none;
  white-space: nowrap;
  z-index: 5;
}
.appointment-type-label::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--label-color);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--label-color) 25%, transparent);
  flex-shrink: 0;
}

.appointment-card-premium.appointment-type-consulta .appointment-type-label { --label-color: #10b981; }
.appointment-card-premium.appointment-type-retorno .appointment-type-label { --label-color: #3b82f6; }
.appointment-card-premium.appointment-type-bloqueio .appointment-type-label { --label-color: #ef4444; }
.appointment-card-premium.appointment-type-compromisso .appointment-type-label { --label-color: #f59e0b; }

.appointment-card-premium:hover .appointment-type-label {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}


/* ============================================================
   DIARY
   ============================================================ */

.diary-list {
  min-height: 250px;
}


/* ============================================================
   PAGES (profile, agenda, care, etc.)
   ============================================================ */

.profile-page {
  padding: 28px 0 0;
}

.agenda-page {
  padding: 24px 0 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  height: calc(100vh - 24px);
  overflow: hidden;
  box-sizing: border-box;
}

.agenda-page-month,
.agenda-page-expanded {
  height: auto;
  overflow: visible;
}

/* Shared page layout for sub-pages */
.exam-requests-page,
.energy-expenditure-page,
.plan-alimentar-page,
.anthropometry-page {
  width: min(1440px, calc(100vw - 52px));
  margin: 28px auto 40px;
  display: grid;
  gap: 18px;
}

/* === FUNDO AURORA da Antropometria (idêntico ao Plano Alimentar) ===
   3 orbs concentradas com filter:blur enorme. Ativas só enquanto
   .anthropometry-page estiver visível. */
.anthropometry-page {
  position: relative;
  z-index: 1;
}

body:has(.anthropometry-page:not(.hidden)) {
  position: relative;
  overflow-x: hidden;
  background: linear-gradient(180deg, #fdfcff 0%, #f5f3fa 35%, #f0f7f4 100%);
}

body:has(.anthropometry-page:not(.hidden))::before,
body:has(.anthropometry-page:not(.hidden))::after {
  content: "";
  position: fixed;
  pointer-events: none;
  z-index: 0;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
}

body:has(.anthropometry-page:not(.hidden))::before {
  /* Orb verde-menta no topo-esquerdo */
  top: -10%;
  left: -8%;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, #6ee7c7 0%, transparent 70%);
}

body:has(.anthropometry-page:not(.hidden))::after {
  /* Orb violeta-lavanda no topo-direito */
  top: -5%;
  right: -10%;
  width: 580px;
  height: 580px;
  background: radial-gradient(circle, #c4b5fd 0%, transparent 70%);
}

/* Terceiro orb (coral) — embaixo via pseudo na própria página */
.anthropometry-page:not(.hidden)::before {
  content: "";
  position: fixed;
  pointer-events: none;
  z-index: -1;
  bottom: -20%;
  left: 30%;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.40;
  background: radial-gradient(circle, #fca5a5 0%, transparent 70%);
}


/* ============================================================
   AGENDA
   ============================================================ */

.agenda-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.agenda-header h1 {
  margin: 4px 0 6px;
  font-size: 34px;
}

.agenda-header p {
  margin: 0;
  color: var(--muted);
}

.agenda-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.agenda-layout {
  display: grid;
  grid-template-columns: minmax(280px, 320px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.agenda-layout-expanded {
  overflow: visible;
}

.agenda-sidebar {
  display: grid;
  gap: 12px;
  padding: 24px;
  min-width: 0;
}

.agenda-sidebar-header {
  display: flex;
  gap: 10px;
}

.agenda-mini-calendar-label {
  margin: 0;
  color: #6f7d8a;
  font-size: 16px;
  font-weight: 600;
  text-transform: none;
}

.agenda-sidebar-create-button {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 18px;
  background: var(--gradient-brand);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
}

.agenda-sidebar-create-button:hover {
  transform: none;
  box-shadow: 0 14px 28px rgba(36, 184, 125, 0.24);
}

.agenda-mini-calendar {
  gap: 12px;
}

.agenda-legend {
  display: grid;
  gap: 10px;
  padding-top: 2px;
}

.agenda-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #5f6d79;
  font-size: 13px;
  font-weight: 600;
}

.agenda-legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  flex: 0 0 12px;
}

.agenda-legend-consulta {
  background: #47be7d;
}

.agenda-legend-retorno {
  background: #3e97ff;
}

.agenda-legend-bloqueio {
  background: #d9214e;
}

.agenda-legend-compromisso {
  background: #f59e0b;
}

.agenda-panel {
  padding: 24px;
  display: grid;
  gap: 18px;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  min-width: 0;
}

.agenda-panel-expanded {
  grid-template-rows: auto auto;
  overflow: visible;
}

.agenda-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.agenda-toolbar strong {
  font-size: 22px;
  text-transform: none;
  text-align: center;
}

.agenda-toolbar-nav,
.agenda-view-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.agenda-toolbar-nav .ghost-button,
.agenda-toolbar-nav .primary-button,
.agenda-view-switch .ghost-button {
  margin-top: 0;
}

.agenda-toolbar-nav .primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  min-width: 57px;
  padding: 0;
  text-align: center;
}

.agenda-toolbar-nav .ghost-button {
  width: 38px;
  height: 38px;
  min-width: 38px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: #667482;
}

.agenda-toolbar-nav .ghost-button:hover {
  transform: none;
  background: rgba(52, 71, 103, 0.06);
}

.agenda-toolbar-nav .ghost-button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(57, 207, 144, 0.18);
}

.agenda-view-button {
  min-width: 0;
  height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 18px;
  background: transparent;
  box-shadow: none;
  color: #667482;
  font-weight: 600;
}

.agenda-view-active {
  background: rgba(52, 71, 103, 0.06);
}

.agenda-view-button:hover {
  transform: none;
  background: rgba(52, 71, 103, 0.06);
}

.agenda-view-button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(57, 207, 144, 0.18);
}

.agenda-grid-shell {
  overflow: auto;
  border-radius: var(--radius-lg);
  min-height: 0;
  max-height: calc(100vh - 270px);
  scrollbar-gutter: stable;
}

.agenda-grid-shell-month {
  overflow: visible;
  max-height: none;
}

/* agenda-grid-shell-week duplicates the base; max-height is already set */
.agenda-grid-shell-week {
  overflow: auto;
  max-height: calc(100vh - 270px);
  scrollbar-gutter: stable;
}

.agenda-grid-shell-expanded {
  max-height: none;
  overflow: visible;
}

.agenda-grid {
  display: grid;
  gap: 18px;
  min-height: 0;
}

.agenda-timeline {
  display: grid;
  gap: 10px;
  width: 99%;
  min-width: 0;
}

.agenda-timeline-head,
.agenda-timeline-body {
  display: grid;
  gap: 10px;
}

.agenda-time-spacer {
  width: 68px;
  min-width: 68px;
}

.agenda-day-head {
  min-height: 36px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(22, 45, 61, 0.04);
  background: rgba(255, 255, 255, 0.92);
  outline: 1px solid rgba(21, 43, 63, 0.05);
  color: #55626f;
  font-size: 13px;
  font-weight: 800;
  /*box-shadow: 0 8px 20px rgba(21, 43, 63, 0.05);*/
}

.agenda-day-head-today {
  /*border-color: rgba(57, 207, 144, 0.28);*/
  color: #0f7a4f;
  background: linear-gradient(135deg, rgba(57, 207, 144, 0.16), rgba(57, 207, 144, 0.07));
}

.agenda-time-rail {
  position: relative;
  width: 68px;
  height: var(--agenda-track-height);
  color: #73808d;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.agenda-time-rail span {
  position: absolute;
  left: 0;
  width: 100%;
  text-align: center;
  transform: translateY(-50%);
}

.agenda-time-rail-end {
  transform: translateY(-100%);
}

.agenda-day-track {
  position: relative;
  height: var(--agenda-track-height);
  border-radius: 18px;
  outline: 1px solid rgba(21, 43, 63, 0.05);
  overflow: hidden;
  cursor: crosshair;
}

.agenda-day-track.agenda-dragging {
  cursor: ns-resize;
}

.agenda-day-track .agenda-event {
  cursor: pointer;
}

.agenda-selection-preview {
  position: absolute;
  left: 8px;
  right: 8px;
  z-index: 3;
  border-radius: var(--radius-md);
  background: rgba(57, 207, 144, 0.22);
  border: 2px dashed var(--brand);
  pointer-events: none;
  transition: height 0.15s ease;
}

.agenda-day-track-today {
  border-color: rgba(57, 207, 144, 0.28);
  box-shadow: 0 0 0 1px rgba(57, 207, 144, 0.3), var(--shadow);
}

.agenda-grid-lines {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(to bottom,
      rgba(22, 45, 61, 0.04) 0,
      rgba(22, 45, 61, 0.04) 1px,
      transparent 1px,
      transparent var(--agenda-slot-height));
  pointer-events: none;
}

.agenda-day-track-empty {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 1;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: #7a8894;
  font-size: 11px;
  font-weight: 800;
}

.agenda-event,
.agenda-event-buffer {
  position: absolute;
  left: 8px;
  right: 8px;
  border-radius: var(--radius-md);
}

.agenda-event {
  z-index: 2;
  display: grid;
  gap: 3px;
  padding: 10px 10px 11px;
  border: 0;
  color: #fff;
  text-align: left;
  overflow: hidden;
  box-shadow: 0 14px 26px rgba(21, 43, 63, 0.16);
}

.agenda-event strong {
  font-size: 13px;
  line-height: 1.2;
}

.agenda-event span {
  font-size: 11px;
  line-height: 1.2;
  opacity: 0.95;
}

.agenda-event-time {
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.agenda-event-consulta {
  background: linear-gradient(135deg, #47be7d, #5cd692);
}

.agenda-event-retorno {
  background: linear-gradient(135deg, #3e97ff, #6eb1ff);
}

.agenda-event-block {
  background: linear-gradient(135deg, #d9214e, #eb587a);
}

.agenda-event-compromisso {
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
}

.agenda-event-buffer {
  z-index: 1;
  background: linear-gradient(180deg, rgba(124, 58, 237, 0.35), rgba(124, 58, 237, 0.14));
  border: 1px dashed rgba(124, 58, 237, 0.28);
}

.agenda-current-time {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  z-index: 10;
  pointer-events: auto;
  cursor: pointer;
}

.agenda-current-time::before {
  content: "";
  position: absolute;
  left: -4px;
  top: -4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
}

.agenda-current-time::after {
  content: attr(data-time);
  position: absolute;
  left: 10px;
  top: -30px;
  background: #1e293b;
  color: #fff;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  z-index: 20;
}

.agenda-current-time:hover::after {
  opacity: 1;
  transform: translateY(0);
}

/* Month view */
.agenda-month-grid {
  display: grid;
  gap: 12px;
  min-height: 0;
}

.agenda-month-weekdays,
.agenda-month-cells {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
}

.agenda-month-weekdays {
  color: #6a7784;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.agenda-month-day {
  position: relative;
  height: 132px;
  display: grid;
  gap: 5px;
  align-content: start;
  padding: 10px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  overflow: hidden;
  box-sizing: border-box;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
}

.agenda-month-day:hover {
  background: var(--surface-strong);
  border-color: rgba(57, 207, 144, 0.4);
  box-shadow: var(--shadow-md);
}

.agenda-month-day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
}

.agenda-month-day-add {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.2s ease;
}

.agenda-month-day:hover .agenda-month-day-add {
  opacity: 1;
  transform: scale(1);
}

.agenda-month-day-add:hover {
  background: var(--brand-deep);
  transform: scale(1.1) !important;
}

.agenda-month-day-add svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.agenda-month-day-muted {
  opacity: 0.42;
}

.agenda-month-day-today {
  border: 2px solid rgba(57, 207, 144, 0.3);
}

.agenda-month-day-number {
  font-weight: 800;
  color: #31404c;
}

.agenda-month-day-chips {
  display: grid;
  gap: 4px;
  overflow: hidden;
}

.agenda-month-chip,
.agenda-month-chip-more {
  display: block;
  padding: 3px 6px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.agenda-month-chip {
  color: #fff;
}

.agenda-month-chip-more {
  background: rgba(22, 45, 61, 0.08);
  color: #51606e;
  text-align: center;
  font-size: 9px;
  font-weight: 800;
  opacity: 0.8;
  padding: 2px 6px;
}


/* ============================================================
   CALENDAR (full page)
   ============================================================ */

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
}

.calendar-weekdays {
  margin-bottom: 12px;
  color: #6a7784;
  font-weight: 800;
  text-align: center;
}

.calendar-day {
  height: 132px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: #fff;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.calendar-day-today {
  border: 2px solid rgba(57, 207, 144, 0.42);
  box-shadow: 0 0 0 3px rgba(57, 207, 144, 0.12), var(--shadow);
}

.calendar-day-number {
  font-weight: 800;
}

.calendar-day-events {
  width: 100%;
  display: grid;
  gap: 4px;
  overflow: hidden;
}

.calendar-event-pill {
  display: block;
  padding: 4px 7px;
  border-radius: var(--radius-sm);
  background: #eef8f4;
  color: var(--brand-deep);
  font-size: 11px;
  font-weight: 700;
  text-align: left;
}

.calendar-event-pill-consulta {
  background: rgba(71, 190, 125, 0.15);
  color: #47be7d;
}

.calendar-event-pill-retorno {
  background: rgba(62, 151, 255, 0.15);
  color: #3e97ff;
}

.calendar-event-pill-block {
  background: rgba(217, 33, 78, 0.15);
  color: #d9214e;
}

.calendar-event-more {
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  min-height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: #f0f4f7;
  color: #667482;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.calendar-add {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.calendar-day-muted {
  opacity: 0.48;
}

.day-appointments-list {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.day-appointment-item {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #f9fcfb;
}

.day-appointment-item strong,
.day-appointment-item span {
  display: block;
}

.day-appointment-item span {
  margin-top: 4px;
  color: var(--muted);
}


/* ============================================================
   CARE — Liquid Glass (sidebar + preview panel dentro do modal)
   Os painéis viram cards glass-bg sobre a janela glass-bg-strong.
   Nav items perdem a barra verde lateral; active state usa pill
   glass + ícone com inset highlight + texto escuro.
   ============================================================ */

.care-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

/* Override do .panel base (border-radius 45px) só dentro do care */
.care-sidebar.panel,
.care-preview-panel.panel {
  border-radius: 20px;
  /* Liquid Glass real: translúcido + blur + border branca + inset highlight.
     Como o modal-window agora é branco quase puro com orbs coloridas,
     o glass aqui captura essa cor e ganha vida. */
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.55);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  backdrop-filter: saturate(180%) blur(22px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset,
              0 12px 28px -14px rgba(40, 30, 60, 0.18),
              0 4px 10px -6px rgba(40, 30, 60, 0.08);
  position: relative;
}
/* Linha de luz superior nos paneis Liquid Glass */
.care-sidebar.panel::before,
.care-preview-panel.panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  border-radius: 20px 20px 0 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.9), transparent);
  pointer-events: none;
}
.care-sidebar.panel::before,
.care-preview-panel.panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  border-radius: 20px 20px 0 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.85), transparent);
  pointer-events: none;
}

.care-sidebar,
.care-preview-panel {
  padding: 18px;
}

.care-preview-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
  height: min(700px, calc(100vh - 180px));
  min-height: 560px;
  overflow: hidden;
}

.care-nav {
  display: grid;
  gap: 2px;
}

.care-nav-group {
  display: grid;
  gap: 2px;
}

.care-nav-group + .care-nav-group {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.care-nav-group-title {
  color: #94a3b8;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  padding: 0 10px;
  margin-bottom: 6px;
}

.care-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  background: transparent;
  border: 1px solid transparent;
  color: #64748b;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
  text-align: left;
  transition: background 0.18s cubic-bezier(0.16, 1, 0.3, 1),
              color 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
  width: 100%;
  cursor: pointer;
}

.care-nav-item:hover {
  color: #0f172a;
  background: rgba(15, 23, 42, 0.04);
}

.care-nav-item-active,
.care-nav-item-active:hover {
  /* Liquid Glass real: translúcido + blur + border branca + inset highlight.
     Deixa o orbe da aurora atrás do panel atravessar e tingir o botão ativo. */
  background: rgba(255, 255, 255, 0.45);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  color: #0f172a;
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.9),
              0 4px 12px -4px rgba(40, 30, 60, 0.12),
              0 1px 3px -1px rgba(40, 30, 60, 0.06);
}

.care-nav-icon-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: rgba(100, 116, 139, 0.08);
  color: #64748b;
  transition: background 0.18s cubic-bezier(0.16, 1, 0.3, 1),
              color 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.4);
}

.care-nav-item:hover .care-nav-icon-container {
  background: rgba(15, 23, 42, 0.07);
  color: #0f172a;
}

.care-nav-item-active .care-nav-icon-container {
  background: rgba(16, 185, 129, 0.12);
  color: var(--mp-accent, #10b981);
}

.care-nav-text {
  flex: 1;
}

.care-preview-header {}

.care-preview-header h2 {
  margin: 4px 0 6px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #0f172a;
}

.care-preview-header p {
  margin: 0;
  color: #64748b;
}

.care-preview-stage {
  min-height: 0;
  height: 100%;
  border: 1px solid var(--glass-border-soft, rgba(255, 255, 255, 0.35));
  border-radius: 18px;
  background: var(--glass-bg, rgba(255, 255, 255, 0.62));
  -webkit-backdrop-filter: saturate(140%) blur(20px);
  backdrop-filter: saturate(140%) blur(20px);
  box-shadow: inset 0 1px 0 0 var(--glass-highlight, rgba(255, 255, 255, 0.85));
  display: grid;
  align-content: start;
  padding: 20px;
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
}

.care-preview-placeholder {
  display: grid;
  gap: 8px;
  text-align: center;
  color: #64748b;
  min-height: 100%;
  align-content: center;
  justify-items: center;
}

.care-preview-placeholder strong {
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.01em;
}


/* ============================================================
   ENERGY EXPENDITURE
   ============================================================ */

/* Headers do gasto energético e antropometria foram migrados para
   .app-hero (definido na seção EXAM REQUESTS). Antigas regras removidas. */

/* Energy Expenditure — Liquid Glass Panel */
.energy-expenditure-panel {
  position: relative;
  overflow: hidden;
  padding: 24px;
  background: var(--glass-bg, rgba(255, 255, 255, 0.65));
  -webkit-backdrop-filter: var(--glass-blur, blur(20px));
  backdrop-filter: var(--glass-blur, blur(20px));
  border: 1px solid var(--glass-border-soft, rgba(255, 255, 255, 0.6));
  border-radius: 24px;
  box-shadow: var(--glass-shadow, 0 10px 30px -5px rgba(0, 0, 0, 0.05));
}

.energy-expenditure-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.85) 50%,
    transparent 100%);
  pointer-events: none;
}

.energy-expenditure-panel > * {
  position: relative;
  z-index: 1;
}

/* Anthropometry — Liquid Glass (idem plano alimentar) */
/* Anthropometry — Liquid Glass (receita do dashboard) */
.anthropometry-panel {
  position: relative;
  overflow: hidden;
  padding: 20px;
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border-soft);
  border-radius: 24px;
  box-shadow: var(--glass-shadow);
}

.anthropometry-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.85) 50%,
    transparent 100%);
  pointer-events: none;
}

.anthropometry-panel > * {
  position: relative;
  z-index: 1;
}

/* ============================================================
   ENERGY EXPENDITURE — Minimalist Functional Design System
   ============================================================ */

.energy-panel {
  position: relative;
  overflow: hidden;
  padding: 20px;
  background: var(--glass-bg, #ffffff);
  -webkit-backdrop-filter: var(--glass-blur, blur(20px));
  backdrop-filter: var(--glass-blur, blur(20px));
  border: 1px solid var(--glass-border-soft, rgba(226, 232, 240, 0.8));
  border-radius: 24px;
  box-shadow: var(--glass-shadow, 0 4px 20px rgba(0, 0, 0, 0.04));
}

.energy-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border, #e2e8f0);
}

.energy-toolbar-title {
  font-size: 15px;
  font-weight: 700;
  color: #1e293b;
}

.energy-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.energy-date-field input {
  height: 38px;
  width: 130px;
  padding: 0 12px;
  border-radius: var(--radius-md, 10px);
  border: 1px solid var(--border, #cbd5e1);
  background: #ffffff;
  color: #1e293b;
  font-size: 13.5px;
  font-weight: 600;
  text-align: center;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.energy-date-field input:focus {
  border-color: var(--mp-accent, #10b981);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.energy-save-button {
  height: 38px;
  padding: 0 18px;
  font-size: 13.5px;
  font-weight: 600;
  border-radius: var(--radius-md, 10px);
}

/* Layout: 2 Columns (Form + Results Side) */
.energy-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) 340px;
  gap: 20px;
  align-items: start;
}

@media (max-width: 980px) {
  .energy-layout {
    grid-template-columns: 1fr;
  }
}

.energy-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Section Cards inside Form */
.energy-section-card {
  background: #ffffff;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 16px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.energy-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.energy-section-header h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
  letter-spacing: -0.01em;
}

.energy-sync-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: #059669;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.energy-sync-button svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.energy-sync-button:hover {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.35);
}

.energy-add-met-btn {
  height: 32px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 8px;
}

/* Field Grids */
.energy-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

@media (max-width: 640px) {
  .energy-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

.energy-grid-formula {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.energy-grid-formula .energy-field-span-full {
  grid-column: 1 / -1;
}

.energy-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

@media (max-width: 640px) {
  .energy-grid-3 {
    grid-template-columns: 1fr;
  }
}

.energy-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width: 500px) {
  .energy-grid-2 {
    grid-template-columns: 1fr;
  }
}

/* Subcards de Estratégias no Formulário */
.energy-strategies-form-grid {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 14px;
}

@media (max-width: 768px) {
  .energy-strategies-form-grid {
    grid-template-columns: 1fr;
  }
}

.energy-strategy-subcard {
  background: rgba(248, 250, 252, 0.75);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.energy-strategy-subcard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.energy-strategy-subcard-header h4 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
}

.energy-strategy-subcard-tag {
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(100, 116, 139, 0.1);
  color: #475569;
}

.energy-venta-feedback-inline {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-top: 2px;
  font-size: 12px;
  color: #64748b;
}

.energy-venta-feedback-inline strong {
  color: #0f172a;
}

/* MET List & Rows */
.energy-met-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.energy-met-row {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) 100px 80px 110px 32px;
  gap: 10px;
  align-items: end;
  padding: 10px 12px;
  background: rgba(248, 250, 252, 0.75);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
}

@media (max-width: 640px) {
  .energy-met-row {
    grid-template-columns: 1fr 1fr;
  }
  .energy-met-field-activity {
    grid-column: 1 / -1;
  }
}

.energy-met-remove-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border, #e2e8f0);
  background: #ffffff;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-bottom: 2px;
}

.energy-met-remove-btn svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.energy-met-remove-btn:hover {
  background: #fff1f2;
  border-color: #fecdd3;
  color: #f43f5e;
}

/* Results Aside (Clean, matches Anthropometry) */
.energy-results.panel {
  background: #ffffff;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 16px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.energy-results-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.energy-results-divider {
  height: 1px;
  background: var(--border, #e2e8f0);
  margin: 2px 0;
}

.energy-results-header h2 {
  margin: 2px 0 0;
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
}

.energy-hero-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  background: #f8fafc;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
}

.energy-hero-box-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}

.energy-hero-box-val {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.energy-hero-box-val strong {
  font-size: 26px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1;
}

.energy-hero-box-unit {
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
}

.energy-status-tag {
  display: inline-flex;
  align-self: flex-start;
  margin-top: 4px;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  font-size: 11.5px;
  font-weight: 600;
}

.energy-metrics-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.energy-metric-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid var(--border, #e2e8f0);
}

.energy-metric-header {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.energy-metric-header strong {
  font-size: 12.5px;
  color: #1e293b;
}

.energy-metric-header span {
  font-size: 11px;
  color: #64748b;
}

.energy-metric-value {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.energy-metric-value strong {
  font-size: 14.5px;
  font-weight: 700;
  color: #0f172a;
}

.energy-metric-value small {
  font-size: 11px;
  color: #64748b;
}

/* Stack de Estratégias Desconectadas no Painel Lateral */
.energy-strategies-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.energy-strategy-card {
  padding: 12px 14px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid var(--border, #e2e8f0);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.energy-strategy-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.energy-strategy-card-head strong {
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
  display: block;
}

.energy-strategy-card-head span {
  font-size: 11px;
  color: #64748b;
}

.energy-strategy-val-row {
  display: flex;
  align-items: baseline;
}

.energy-strategy-main-val {
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
}

.energy-strategy-main-val small {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
}

/* Care Modal Preview for Energy */
.energy-preview-top-actions,
.exam-preview-top-actions {
  margin-bottom: 14px;
}

.energy-preview-list,
.exam-preview-cards-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.energy-preview-card,
.exam-preview-card {
  border-radius: 14px;
  border: 1px solid var(--border, #e2e8f0);
  background: #ffffff;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.energy-preview-card-header,
.exam-preview-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.energy-preview-card-title-group,
.exam-preview-card-title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.energy-preview-title-row,
.exam-preview-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.energy-preview-title,
.exam-preview-title {
  font-size: 14.5px;
  font-weight: 700;
  color: #0f172a;
}

.energy-preview-date,
.exam-preview-date {
  font-size: 12px;
  color: #64748b;
}

.energy-preview-formula-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
  font-size: 11px;
  font-weight: 600;
}

.exam-preview-count-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(59, 130, 246, 0.1);
  color: #2563eb;
  font-size: 11px;
  font-weight: 600;
}

.energy-preview-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

@media (max-width: 768px) {
  .energy-preview-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.energy-preview-kpi {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid var(--border, #e2e8f0);
}

.energy-preview-kpi-highlight {
  background: rgba(16, 185, 129, 0.04);
  border-color: rgba(16, 185, 129, 0.25);
}

.energy-preview-kpi-label {
  font-size: 10px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
}

.energy-preview-kpi-val {
  font-size: 13.5px;
  font-weight: 700;
  color: #0f172a;
}

.energy-preview-kpi-val small {
  font-size: 10px;
  color: #64748b;
}

/* Exam preview body & chips */
.exam-preview-card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.exam-preview-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.exam-preview-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 7px;
  background: #f8fafc;
  border: 1px solid var(--border, #e2e8f0);
  font-size: 12px;
  color: #1e293b;
}

.exam-preview-chip-name {
  font-weight: 600;
}

.exam-preview-chip-cat {
  font-size: 10px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  background: rgba(100, 116, 139, 0.08);
  padding: 1px 5px;
  border-radius: 4px;
}

.exam-preview-more-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 7px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 11.5px;
  font-weight: 600;
}

.exam-preview-notes-line {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 12px;
  color: #64748b;
  background: #f8fafc;
  padding: 6px 10px;
  border-radius: 6px;
  border-left: 3px solid rgba(59, 130, 246, 0.4);
}

.exam-preview-notes-line svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  fill: currentColor;
  margin-top: 1px;
}

/* Card Actions Footers — Aligning Actions and Edit Button to Bottom Right Corner */
.anthropometry-preview-actions,
.energy-preview-card-actions,
.exam-preview-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

/* Exam/energy cards têm padding próprio (14px 16px); compensa para que os
   botões fiquem a 12px da borda direita e 8px da borda inferior, como no
   card de avaliação antropométrica. */
.energy-preview-card .anthropometry-preview-actions,
.exam-preview-card .anthropometry-preview-actions {
  padding: 0 12px 8px;
  margin: 4px -16px -14px 0;
}


.care-empty-state-modern {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 40px 20px;
  gap: 12px;
}

.care-empty-icon {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.care-empty-icon svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}

.energy-icon-emerald {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
}

.energy-icon-blue {
  background: rgba(59, 130, 246, 0.12);
  color: #2563eb;
}

.energy-icon-green {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
}

.care-empty-state-modern h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
}

.care-empty-state-modern p {
  margin: 0;
  font-size: 13.5px;
  color: #64748b;
  max-width: 380px;
  line-height: 1.45;
}

.energy-create-record-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.energy-create-record-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* Suppress number spinners */
.energy-expenditure-page input[type="number"]::-webkit-outer-spin-button,
.energy-expenditure-page input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.energy-expenditure-page input[type="number"] {
  -moz-appearance: textfield;
}


/* ============================================================
   ANTHROPOMETRY
   ============================================================ */

.anthropometry-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.anthropometry-view-tabs {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border-radius: 18px;
  background: rgba(238, 246, 242, 0.92);
  border: 1px solid rgba(22, 45, 61, 0.06);
}

.anthropometry-view-tab {
  min-width: 102px;
  height: 42px;
  padding: 0 18px;
  border-radius: 14px;
  background: transparent;
  color: #667686;
  font-size: 14px;
  font-weight: 800;
  border: 0;
  transition: background var(--transition), color var(--transition), box-shadow var(--transition);
}

.anthropometry-view-tab-active {
  background: var(--gradient-brand);
  color: #fff;
  box-shadow: 0 10px 20px rgba(36, 184, 125, 0.18);
}

.anthropometry-save-button {
  min-width: 200px;
  height: 38px;
}

.anthropometry-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.anthropometry-date-field {
  display: flex;
  align-items: center;
  min-width: 136px;
}

.anthropometry-date-field.hidden {
  display: none;
}

.anthropometry-date-field input {
  height: 38px;
  width: 136px;
  padding: 0 12px;
  border-radius: 25px;
  border: 1px solid rgba(22, 45, 61, 0.09);
  background: rgba(255, 255, 255, 0.95);
  color: #24364a;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  outline: none;
}

.anthropometry-date-field input:focus {
  border-color: rgba(57, 207, 144, 0.45);
  box-shadow: 0 0 0 4px rgba(57, 207, 144, 0.12);
}

.anthropometry-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.6fr) minmax(480px, 1.4fr);
  gap: 20px;
  align-items: start;
}

.anthropometry-layout.hidden {
  display: none;
}

.anthropometry-form {
  display: grid;
  gap: 14px;
}

.anthropometry-section {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #ffffff, #fbfdfd);
  box-shadow: 0 8px 24px rgba(21, 43, 63, 0.04);
  overflow: hidden;
}

.anthropometry-section-toggle {
  position: relative;
  overflow: hidden;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  padding: 14px 20px;
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border-soft);
  border-radius: 24px;
  box-shadow: var(--glass-shadow);
  color: #24364a;
  font-size: 16px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition: box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.anthropometry-section-toggle::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.85) 50%,
    transparent 100%);
  pointer-events: none;
}

.anthropometry-section-toggle > * {
  position: relative;
  z-index: 1;
}

.anthropometry-section-toggle:hover {
  box-shadow: var(--glass-shadow-lg);
}

.anthropometry-section-header-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition);
}

.anthropometry-section-header-icon svg {
  width: 20px;
  height: 20px;
}

/* Section Specific Colors */
.anthropometry-section-dados-basicos .anthropometry-section-header-icon {
  background: rgba(6, 182, 212, 0.1);
  color: #0891b2;
}

.anthropometry-section-circunferencias .anthropometry-section-header-icon {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
}

.anthropometry-section-dobras-cutaneas .anthropometry-section-header-icon {
  background: rgba(139, 92, 246, 0.1);
  color: #7c3aed;
}

.anthropometry-section-diametros-osseos .anthropometry-section-header-icon {
  background: rgba(59, 130, 246, 0.1);
  color: #2563eb;
}

.anthropometry-section-bioimpedancia .anthropometry-section-header-icon {
  background: rgba(20, 184, 166, 0.1);
  color: #0d9488;
}

.anthropometry-section-toggle-label {
  flex: 1;
  font-weight: 800;
  color: #24364a;
}


.anthropometry-section-arrow,
.anthropometry-subgroup-arrow,
.anthropometry-evolution-section-arrow {
  color: var(--muted);
  transition: transform var(--transition);
}

.anthropometry-section-arrow {
  font-size: 18px;
}

.anthropometry-subgroup-arrow {
  font-size: 16px;
}

.anthropometry-evolution-section-arrow {
  font-size: 16px;
}

.anthropometry-section-open .anthropometry-section-arrow,
.anthropometry-subgroup-open .anthropometry-subgroup-arrow,
.anthropometry-evolution-section-open .anthropometry-evolution-section-arrow {
  transform: rotate(90deg);
}

.anthropometry-section-body {
  padding: 10px 20px 20px;
  display: grid;
  gap: 24px;
}

.anthropometry-section-body.hidden,
.anthropometry-subgroup-body.hidden,
.anthropometry-evolution-section-body.hidden {
  display: none;
}

.anthropometry-subgroup {
  display: grid;
  gap: 18px;
}

.anthropometry-subgroup-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0;
  background: transparent;
  border: 0;
  text-align: left;
}

.anthropometry-subgroup-title {
  color: #4c5e6f;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.anthropometry-select-field {
  max-width: 360px;
  transition: opacity 0.2s ease, filter 0.2s ease;
}

.anthropometry-select-field.disabled {
  opacity: 0.45;
  pointer-events: none;
  filter: grayscale(80%);
}

.anthropometry-checkbox-field {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: rgba(248, 250, 252, 0.85);
  border: 1.5px solid rgba(226, 232, 240, 0.9);
  border-radius: 12px;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 480px;
}

.anthropometry-checkbox-field:hover:not(.disabled) {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.anthropometry-checkbox-field.active {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.4);
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.1);
}

.anthropometry-checkbox-field input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #059669;
  cursor: pointer;
  flex-shrink: 0;
}

.anthropometry-checkbox-field.disabled {
  opacity: 0.45;
  pointer-events: none;
  filter: grayscale(80%);
}

.anthropometry-checkbox-label-text {
  font-size: 13.5px;
  font-weight: 600;
  color: #334155;
  line-height: 1.35;
}

.anthropometry-checkbox-field.active .anthropometry-checkbox-label-text {
  color: #047857;
  font-weight: 700;
}

.anthropometry-fields-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

/* Compact grid variants share same column/gap pattern */
.anthropometry-fields-grid-compact,
.anthropometry-fields-grid-diametros,
.anthropometry-fields-grid-tronco {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px 24px;
}

.anthropometry-field {
  gap: 12px;
}

.anthropometry-field-compact {
  gap: 10px;
}

.anthropometry-field-compact>span {
  font-size: 13px;
  font-weight: 700;
  color: #5a6d82;
}

.anthropometry-input-shell {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: fit-content;
}

.anthropometry-input-shell input {
  flex: 0 0 100px;
  width: 100px;
  max-width: 100px;
  padding: 14px 44px 14px 18px;
  border-radius: 12px;
  border: 1px solid rgba(22, 45, 61, 0.05);
  background: #fdfdfd;
  color: #1e293b;
  font-size: 14px;
  font-weight: 800;
  text-align: left;
  box-shadow: inset 0 2px 4px rgba(22, 45, 61, 0.02);
  transition: all var(--transition);
}

.anthropometry-input-shell input:focus {
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(57, 207, 144, 0.08), inset 0 2px 4px rgba(22, 45, 61, 0.02);
}

.anthropometry-input-unit {
  font-size: 14px;
  font-weight: 700;
  color: #718096;
  opacity: 0.8;
}


.anthropometry-field-compact .anthropometry-input-shell input {
  max-width: 100px;
}

.anthropometry-field-compact .anthropometry-input-shell small {
  min-width: 28px;
}

.anthropometry-input-highlighted {
  border-color: rgba(57, 207, 144, 0.42) !important;
}

.anthropometry-bilateral-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0;
  align-items: start;
}

.anthropometry-bilateral-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 0 8px;
}

.anthropometry-bilateral-divider {
  width: 1px;
  align-self: stretch;
  background: rgba(22, 45, 61, 0.08);
  margin: 4px 0;
}

.anthropometry-bilateral-field span {
  font-size: 13px;
  font-weight: 700;
  color: #5a6d82;
}

/* Suppress number spinners */
.anthropometry-input-shell input::-webkit-outer-spin-button,
.anthropometry-input-shell input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.anthropometry-input-shell input[type="number"] {
  -moz-appearance: textfield;
}

.anthropometry-input-shell small {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  min-width: 0;
  color: #738391;
  font-size: 12px;
  font-weight: 700;
  text-transform: lowercase;
  pointer-events: none;
}

/* Results */
.anthropometry-results {
  position: relative;
  overflow: hidden;
  padding: 24px;
  min-height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 18px;
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border-soft);
  border-radius: 24px;
  box-shadow: var(--glass-shadow);
}

.anthropometry-results::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.85) 50%,
    transparent 100%);
  pointer-events: none;
}

.anthropometry-results > * {
  position: relative;
  z-index: 1;
}

.anthropometry-results-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.anthropometry-results-header h2 {
  margin: 4px 0 6px;
  font-size: 26px;
  color: #24364a;
}

.anthropometry-results-header p {
  margin: 0;
  color: var(--muted);
}

.anthropometry-results-stage {
  min-height: 640px;
  display: grid;
  padding: 20px;
  border-radius: var(--radius-xl);
  background: var(--glass-bg, rgba(255, 255, 255, 0.4));
  -webkit-backdrop-filter: var(--glass-blur, saturate(140%) blur(20px));
  backdrop-filter: var(--glass-blur, saturate(140%) blur(20px));
  border: 1px solid var(--glass-border, rgba(15, 23, 42, 0.06));
  box-shadow: var(--glass-shadow,
              inset 0 1px 0 0 rgba(255, 255, 255, 0.6),
              0 12px 30px -12px rgba(15, 23, 42, 0.18),
              0 4px 12px -6px rgba(15, 23, 42, 0.10));
}

/* Toggle switch */
.anthropometry-results-switch {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #5c6f7f;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.anthropometry-results-switch-control {
  position: relative;
  display: inline-flex;
  width: 50px;
  height: 30px;
}

.anthropometry-results-switch-control input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.anthropometry-results-switch-slider {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: rgba(22, 45, 61, 0.12);
  box-shadow: inset 0 1px 2px rgba(22, 45, 61, 0.08);
  transition: background var(--transition);
}

.anthropometry-results-switch-slider::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 4px 10px rgba(22, 45, 61, 0.16);
  transition: transform var(--transition);
}

.anthropometry-results-switch-control input:checked+.anthropometry-results-switch-slider {
  background: var(--gradient-brand);
}

.anthropometry-results-switch-control input:checked+.anthropometry-results-switch-slider::after {
  transform: translateX(20px);
}

/* Anthropometry Gauge Chart — sem moldura própria; herda o glass do
   .anthropometry-results (única moldura visível na seção Resultados). */
.anthropometry-gauge-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  padding: 32px 12px;
}

.anthropometry-gauge-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 0 24px;
}

.anthropometry-gauge-card:nth-child(-n+3) {
  border-right: 1px solid rgba(22, 45, 61, 0.08);
}



.gauge-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gauge-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.gauge-value-wrapper {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.gauge-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
}

.gauge-unit {
  font-size: 16px;
  font-weight: 600;
  color: var(--muted);
}

.gauge-visual {
  position: relative;
  padding-top: 30px;
  /* Space for marker and label */
}

.gauge-track {
  height: 10px;
  background: #f1f5f9;
  border-radius: 99px;
  display: flex;
  overflow: hidden;
}

.gauge-segment {
  height: 100%;
}

.gauge-segment.low {
  background: #60a5fa;
  width: 33.33%;
}

.gauge-segment.moderate {
  background: #fbbf24;
  width: 33.34%;
}

.gauge-segment.ideal {
  background: #34d399;
  width: 33.34%;
}

.gauge-segment.high {
  background: #fb7185;
  width: 33.33%;
}

.gauge-marker {
  position: absolute;
  top: 35px;
  transform: translate(-50%, -50%);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 4px solid #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: left 0.8s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.2s ease;
  cursor: help;
  z-index: 2;
}

.gauge-marker:hover {
  transform: translate(-50%, -50%) scale(1.2);
}

.gauge-marker-label {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: #1e293b;
  padding: 4px 10px;
  border-radius: 6px;
  white-space: nowrap;
  margin-bottom: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.gauge-marker-label::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid #1e293b;
}

.gauge-marker:hover .gauge-marker-label {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(-2px);
}

.gauge-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
}

.gauge-label-item {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Graphs panel */
.anthropometry-graphs-panel {
  position: relative;
  overflow: hidden;
  min-height: 640px;
  padding: 28px;
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border-soft);
  border-radius: 24px;
  box-shadow: var(--glass-shadow);
}

.anthropometry-graphs-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.85) 50%,
    transparent 100%);
  pointer-events: none;
}

.anthropometry-graphs-panel > * {
  position: relative;
  z-index: 1;
}

.anthropometry-graphs-panel.hidden {
  display: none;
}

/* Evolution */
.anthropometry-evolution-shell {
  display: grid;
  gap: 18px;
  align-content: start;
}

.anthropometry-evolution-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.anthropometry-evolution-toolbar-copy {
  display: grid;
  gap: 4px;
}

.anthropometry-evolution-toolbar-copy strong {
  color: #24364a;
  font-size: 18px;
}

.anthropometry-evolution-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.anthropometry-evolution-filter-button {
  padding: 9px 14px;
  font-size: 13px;
}

.anthropometry-evolution-chips {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.anthropometry-evolution-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.anthropometry-evolution-chip input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.anthropometry-evolution-chip span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.9);
  color: #617382;
  font-size: 13px;
  font-weight: 700;
  transition: border-color var(--transition), background var(--transition), color var(--transition), transform var(--transition);
}

.anthropometry-evolution-chip input:checked+span {
  border-color: rgba(57, 207, 144, 0.28);
  background: linear-gradient(135deg, rgba(57, 207, 144, 0.18), rgba(57, 207, 144, 0.08));
  color: var(--brand-deep);
}

.anthropometry-evolution-chip:hover span {
  transform: translateY(-1px);
}

/* Charts */
.anthropometry-charts-shell {
  display: grid;
  gap: 14px;
  align-content: start;
}

.anthropometry-charts-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 6px;
}

.anthropometry-charts-toolbar h3 {
  margin: 4px 0 0;
  font-size: 24px;
  color: #24364a;
}

.anthropometry-charts-switch {
  flex-shrink: 0;
}

.anthropometry-chart-card {
  border-radius: 20px;
  border: 1px solid var(--border);
  background: #ffffff;
  box-shadow: 0 14px 28px rgba(21, 43, 63, 0.04);
  padding: 10px 12px 8px;
}

.anthropometry-chart-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px 6px;
}

.anthropometry-chart-card-header strong {
  font-size: 17px;
  font-weight: 800;
}

.anthropometry-chart-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.anthropometry-chart-svg {
  height: auto;
  display: block;
  min-width: 100%;
}

/* SVG chart strokes */
.anthropometry-chart-axis {
  stroke: rgba(22, 45, 61, 0.08);
  stroke-width: 1.5;
}

.anthropometry-chart-guide {
  stroke: rgba(22, 45, 61, 0.08);
  stroke-width: 1.5;
  stroke-dasharray: 6 6;
}

.anthropometry-chart-column-guide {
  stroke: rgba(22, 45, 61, 0.1);
  stroke-width: 1.2;
  stroke-dasharray: 3 5;
}

.anthropometry-chart-axis-label {
  fill: #8a99a7;
  font-size: 10px;
  font-weight: 700;
}

.anthropometry-chart-point-label {
  font-size: 10px;
  font-weight: 800;
}

.anthropometry-chart-stem {
  stroke-width: 1.5;
  opacity: 0.14;
}

/* Evolution sections */
.anthropometry-evolution-section {
  display: grid;
  gap: 14px;
}

.anthropometry-evolution-section-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 0;
  background: transparent;
  border: 0;
  text-align: left;
}

.anthropometry-evolution-section-body {
  display: grid;
  gap: 14px;
  padding: 0;
}

.anthropometry-evolution-group {
  display: grid;
  gap: 8px;
}

.anthropometry-evolution-group h4 {
  margin: 0;
  color: #4c5e6f;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Evolution table */
.anthropometry-evolution-table-shell {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.8);
  width: fit-content;
  max-width: 100%;
}

.anthropometry-evolution-table {
  width: max-content;
  min-width: 560px;
  border-collapse: collapse;
  table-layout: fixed;
}

.anthropometry-evolution-table th,
.anthropometry-evolution-table td {
  padding: 9px 12px;
  border-bottom: 1px solid rgba(22, 45, 61, 0.06);
  border-right: 1px solid rgba(22, 45, 61, 0.06);
  text-align: left;
  font-size: 12px;
  color: #4f6172;
  background: rgba(255, 255, 255, 0.6);
  white-space: nowrap;
}

.anthropometry-evolution-table th:last-child,
.anthropometry-evolution-table td:last-child {
  border-right: 0;
}

.anthropometry-evolution-table tr:last-child td {
  border-bottom: 0;
}

.anthropometry-evolution-table th {
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #284057;
  background: rgba(57, 207, 144, 0.08);
}

.anthropometry-evolution-table th:first-child,
.anthropometry-evolution-table td:first-child {
  font-weight: 700;
  color: #24364a;
  width: 190px !important;
  min-width: 190px !important;
  max-width: 190px !important;
  white-space: normal;
  word-break: break-word;
  line-height: 1.3;
  position: sticky;
  left: 0;
  z-index: 2;
}

.anthropometry-evolution-table th:first-child {
  z-index: 3;
  background: rgba(234, 248, 241, 0.98);
}

.anthropometry-evolution-table td:first-child {
  background: rgba(255, 255, 255, 0.98);
}

.anthropometry-evolution-table th:not(:first-child),
.anthropometry-evolution-table td:not(:first-child) {
  width: 96px !important;
  min-width: 96px !important;
  max-width: 96px !important;
}

.anthropometry-evolution-table tbody td:not(:first-child) {
  text-align: center;
}

.anthropometry-evolution-cell-value {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 700;
  color: #2a3e54;
}

.anthropometry-evolution-delta {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.anthropometry-evolution-delta-positive {
  color: #1f9a62;
}

.anthropometry-evolution-delta-negative {
  color: #cb5b59;
}

.anthropometry-evolution-delta-neutral {
  color: #8a98a6;
}

/* Preview card */
.anthropometry-preview-shell {
  width: 100%;
  max-width: 100%;
  margin: 0;
  box-sizing: border-box;
}

.anthropometry-preview-card {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--glass-bg-strong, rgba(255, 255, 255, 0.82));
  -webkit-backdrop-filter: saturate(140%) blur(20px);
  backdrop-filter: saturate(140%) blur(20px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset,
              0 4px 12px -4px rgba(15, 23, 42, 0.10);
  display: grid;
  position: relative;
  overflow: hidden;
}
.anthropometry-preview-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.85), transparent);
  pointer-events: none;
}

.anthropometry-preview-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px 6px;
}

.anthropometry-preview-card-header>div {
  display: grid;
  gap: 2px;
}

.anthropometry-preview-card-header strong {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #22374b;
  font-size: 14px;
}

.anthropometry-preview-card-header span {
  color: #667887;
  font-size: 14px;
}

.anthropometry-preview-formula {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.2;
  text-align: center;
  background: rgba(15, 23, 42, 0.05);
  color: #475569;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.anthropometry-preview-primary-grid,
.anthropometry-preview-grid {
  display: none;
}

.anthropometry-preview-kpi-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 4px;
  padding: 0 12px 6px;
}

.anthropometry-preview-kpi {
  display: flex;
  align-items: stretch;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--glass-border-soft, rgba(255, 255, 255, 0.35));
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.6);
}

.anthropometry-preview-kpi-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 24px;
  color: #8a99a7;
}

.anthropometry-preview-kpi-icon svg {
  width: 20px;
  height: 20px;
}

.anthropometry-preview-kpi-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.anthropometry-preview-kpi span {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6d7c89;
}

.anthropometry-preview-kpi strong {
  font-size: 15px;
  line-height: 1;
  color: #22374b;
}

.anthropometry-preview-item {
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(22, 45, 61, 0.06);
  display: grid;
  gap: 3px;
}

.anthropometry-preview-item span {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #6b7b89;
}

.anthropometry-preview-item strong {
  font-size: 12px;
  color: #24364a;
}

.anthropometry-preview-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 0 12px 8px;
}

.anthropometry-preview-mini-charts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 0 12px 8px;
}

.preview-mini-chart-item {
  display: grid;
  gap: 2px;
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--glass-border-soft, rgba(255, 255, 255, 0.35));
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.6);
  min-width: 0;
}

.preview-mini-chart-title {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #6b7b89;
  padding: 0 4px;
}

.preview-mini-chart {
  width: 100%;
  height: auto;
  display: block;
}

.preview-mini-chart-label {
  font-size: 9px;
  font-weight: 800;
}

.preview-mini-chart-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 58px;
  color: #b0bac3;
  font-size: 12px;
}

/* Anthropometry preview actions standardized below */


/* ============================================================
   EXAM REQUESTS
   ============================================================ */

/* ----- Page container + aurora backdrop (same recipe as anthropometry) ----- */

.exam-requests-page {
  position: relative;
  isolation: isolate;
  padding-bottom: 110px;
  /* deixa espaço para o footer sticky */
}

body:has(.exam-requests-page:not(.hidden)) {
  background: linear-gradient(180deg, #fdfcff 0%, #f5f3fa 35%, #f0f7f4 100%);
}

body:has(.exam-requests-page:not(.hidden))::before,
body:has(.exam-requests-page:not(.hidden))::after {
  content: "";
  position: fixed;
  pointer-events: none;
  z-index: 0;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
}

body:has(.exam-requests-page:not(.hidden))::before {
  top: -10%;
  left: -8%;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, #6ee7c7 0%, transparent 70%);
}

body:has(.exam-requests-page:not(.hidden))::after {
  top: -5%;
  right: -10%;
  width: 580px;
  height: 580px;
  background: radial-gradient(circle, #a5d8ff 0%, transparent 70%);
}

.exam-aurora {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  border-radius: 28px;
}

.exam-aurora-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.35;
}

.exam-aurora-blob-1 {
  top: 10%;
  left: -8%;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, #a7f3d0 0%, transparent 70%);
}

.exam-aurora-blob-2 {
  bottom: -10%;
  right: -6%;
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, #c4b5fd 0%, transparent 70%);
}

/* ----- Hero reutilizável (mesma anatomia do agenda-hero) -----
   Usado em: solicitação de exames, antropometria, gasto energético,
   plano alimentar. Estrutura HTML:
     <header class="app-hero">
       <div class="app-hero-title">
         <span class="app-hero-eyebrow">Módulo</span>
         <h1 class="app-hero-name">Nome do paciente</h1>
         <div class="app-hero-subtitle">
           <strong>Estado</strong>
         </div>
       </div>
       <div class="app-hero-controls">…botões</div>
     </header>
*/

.app-hero {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: 22px 28px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.65);
  -webkit-backdrop-filter: saturate(160%) blur(20px);
  backdrop-filter: saturate(160%) blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8),
              0 10px 28px -12px rgba(15, 23, 42, 0.08),
              0 2px 6px -2px rgba(15, 23, 42, 0.04);
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  margin-bottom: 18px;
}

.app-hero::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.9), transparent);
  pointer-events: none;
}

.app-hero-title {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.app-hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #059669;
}

.app-hero-eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.app-hero-name {
  margin: 0;
  font-size: 48px;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.1;
  color: #0f172a;
}

.app-hero-subtitle {
  font-size: 13.5px;
  color: #64748b;
  font-weight: 500;
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.app-hero-subtitle strong {
  color: #0f172a;
  font-weight: 700;
}

.app-hero-subtitle .dot-sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.25);
}

.app-hero-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .app-hero {
    flex-direction: column;
    align-items: flex-start;
    padding: 18px 20px;
  }

  .app-hero-name {
    font-size: 34px;
  }

  .app-hero-controls {
    justify-content: flex-start;
  }
}

/* ----- Glass shell único ----- */

.exam-glass-shell {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding: 0;
  border-radius: 24px;
  background: var(--glass-bg-strong, rgba(255, 255, 255, 0.82));
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  backdrop-filter: saturate(180%) blur(22px);
  border: 1px solid var(--glass-border-soft, rgba(255, 255, 255, 0.4));
  box-shadow:
    inset 0 1px 0 0 var(--glass-highlight, rgba(255, 255, 255, 0.85)),
    0 30px 60px rgba(21, 43, 63, 0.08);
  overflow: hidden;
}

/* ----- Toolbar interna ----- */

.exam-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 280px) auto;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--glass-border-soft, rgba(255, 255, 255, 0.4));
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0));
}

.exam-toolbar-search,
.exam-toolbar-filter {
  margin: 0;
}

.exam-toolbar-search {
  min-width: 0;
}

.exam-toolbar-counter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 4px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.exam-toolbar-counter strong {
  color: var(--brand-deep);
  font-weight: 700;
}

.exam-toolbar-counter-sep {
  opacity: 0.45;
}

/* ----- Split 2 colunas com hairline vertical ----- */

.exam-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  min-height: 540px;
}

.exam-split-column {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-width: 0;
  padding: 8px 4px 4px;
}

.exam-split-column-selected {
  border-left: 1px solid var(--glass-border-soft, rgba(255, 255, 255, 0.4));
}

.exam-column-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 8px 18px 10px;
}

.exam-column-head h3 {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #6b7a88;
  font-weight: 700;
}

.exam-clear-button {
  padding: 4px 8px;
  border: 0;
  background: transparent;
  color: var(--brand-deep);
  font-size: 12px;
  font-weight: 700;
  border-radius: 8px;
  letter-spacing: 0.02em;
}

.exam-clear-button:hover:not(:disabled) {
  background: rgba(38, 182, 123, 0.1);
}

.exam-clear-button:disabled {
  opacity: 0.35;
  cursor: default;
}

/* ----- Lista (catálogo e pedido compartilham anatomia) ----- */

.exam-list {
  list-style: none;
  margin: 0;
  padding: 0 6px;
  max-height: 520px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(21, 43, 63, 0.16) transparent;
}

.exam-list::-webkit-scrollbar {
  width: 6px;
}

.exam-list::-webkit-scrollbar-thumb {
  background: rgba(21, 43, 63, 0.14);
  border-radius: 4px;
}

.exam-list-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 0;
  background: transparent;
  text-align: left;
  width: 100%;
  cursor: pointer;
  border-radius: 10px;
  transition: background 120ms ease;
}

.exam-list-row + .exam-list-row {
  box-shadow: inset 0 1px 0 0 rgba(21, 43, 63, 0.05);
}

.exam-list-row:hover {
  background: rgba(255, 255, 255, 0.55);
}

.exam-list-row-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.exam-list-row-name {
  color: #2a3a4a;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.exam-list-row-category {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 500;
}

.exam-list-row-selected .exam-list-row-name {
  color: var(--brand-deep);
}

.exam-list-row-check {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(38, 182, 123, 0.14);
  color: var(--brand-deep);
  font-size: 12px;
  font-weight: 700;
}

/* ----- Linhas da coluna 'Pedido' (drag + remove) ----- */

.exam-list-selected .exam-list-row {
  grid-template-columns: 16px minmax(0, 1fr) 24px;
  padding: 10px 14px;
  cursor: default;
}

.exam-list-row-handle {
  width: 16px;
  height: 16px;
  border: 0;
  padding: 0;
  background: transparent;
  color: #b1bcc6;
  cursor: grab;
  opacity: 0;
  transition: opacity 120ms ease;
}

.exam-list-selected .exam-list-row:hover .exam-list-row-handle {
  opacity: 1;
}

.exam-list-row-handle svg {
  width: 14px;
  fill: currentColor;
}

.exam-list-row-remove {
  width: 24px;
  height: 24px;
  border: 0;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  color: #b1bcc6;
  font-size: 18px;
  line-height: 1;
  opacity: 0;
  transition: opacity 120ms ease, background 120ms ease, color 120ms ease;
}

.exam-list-selected .exam-list-row:hover .exam-list-row-remove {
  opacity: 1;
}

.exam-list-row-remove:hover {
  background: rgba(207, 63, 48, 0.12);
  color: #cf3f30;
}

.selected-exam-card-dragging {
  opacity: 0.55;
}

/* ----- Empty state (coluna Pedido) ----- */

.exam-list-empty {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 8px;
  padding: 40px 20px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
  list-style: none;
}

.exam-list-empty-icon {
  width: 56px;
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--glass-border-soft, rgba(255, 255, 255, 0.4));
  color: #a7b3bf;
  font-size: 22px;
  margin-bottom: 4px;
}

/* ----- Botão "adicionar exame personalizado" — última linha da lista ----- */

.exam-add-custom-row {
  margin: 4px 10px 10px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px dashed rgba(38, 182, 123, 0.45);
  border-radius: 12px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}

.exam-add-custom-row:hover {
  background: rgba(38, 182, 123, 0.06);
  border-color: rgba(38, 182, 123, 0.7);
}

.exam-add-custom-icon {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(38, 182, 123, 0.14);
  color: var(--brand-deep);
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
}

.exam-add-custom-text {
  display: grid;
  gap: 2px;
}

.exam-add-custom-text strong {
  color: #2a3a4a;
  font-size: 13.5px;
  font-weight: 600;
}

.exam-add-custom-text small {
  color: var(--muted);
  font-size: 11.5px;
}

/* ----- Footer sticky com glass próprio ----- */

.exam-footer-sticky {
  position: sticky;
  bottom: 16px;
  z-index: 5;
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  border-radius: 20px;
  background: var(--glass-bg-strong, rgba(255, 255, 255, 0.85));
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid var(--glass-border-soft, rgba(255, 255, 255, 0.4));
  box-shadow:
    inset 0 1px 0 0 var(--glass-highlight, rgba(255, 255, 255, 0.85)),
    0 18px 40px rgba(21, 43, 63, 0.1);
}

.exam-footer-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Variante do mp-ghost-button para fundos claros (footer sticky de exames).
   Mesma anatomia (padding/radius/font) do ghost do plano alimentar, mas
   com texto escuro e fundo branco translúcido em vez de branco-sobre-verde. */
/* Ghost button para fundos claros (hero glass + footer sticky).
   Mesma formatação do .mp-meal-add-button: glass + blur(20px) saturate(180%)
   + inner highlight, com variáveis --glass-* do projeto. */
/* Especificidade .mp-ghost-button.mp-ghost-button-light (0,2,0) para
   sobrescrever .mp-ghost-button { color: #fff } definido mais abaixo
   no arquivo. */
.mp-ghost-button.mp-ghost-button-light {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  color: #1f2933;
  border: 1px solid var(--glass-border-soft);
  box-shadow: inset 0 1px 0 0 var(--glass-highlight);
}

.mp-ghost-button.mp-ghost-button-light:hover {
  transform: translateY(-1px);
  background: var(--glass-bg-strong);
  color: #0f172a;
  box-shadow: inset 0 1px 0 0 var(--glass-highlight);
}

.mp-ghost-button.mp-ghost-button-light:active {
  transform: translateY(0);
}

.mp-ghost-button.mp-ghost-button-light svg {
  color: var(--brand-deep);
}

.exam-preview-shell {
  width: 100%;
  max-width: 100%;
  margin: 0;
  display: grid;
  gap: 18px;
  justify-items: stretch;
  align-self: start;
  box-sizing: border-box;
}

.exam-preview-grid {
  width: 100%;
  display: grid;
  gap: 12px;
}

.exam-request-card {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 14px 0 0;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--glass-bg, rgba(255, 255, 255, 0.62));
  -webkit-backdrop-filter: saturate(140%) blur(20px);
  backdrop-filter: saturate(140%) blur(20px);
  display: grid;
  box-shadow:
    inset 0 1px 0 0 var(--glass-highlight, rgba(255, 255, 255, 0.85)),
    0 14px 30px rgba(21, 43, 63, 0.06);
}

.exam-request-card-header {
  display: grid;
  gap: 4px;
  padding: 0 16px 10px;
}

.exam-request-card-header strong {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #22374b;
  font-size: 16px;
  text-align: left;
}

.exam-request-title-edit-button {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(57, 207, 144, 0.08);
  color: #1f9c69;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.exam-request-title-edit-button svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
}

.exam-request-card-header span {
  color: #667887;
  font-size: 14px;
}

.exam-request-card-body {
  display: grid;
}

.exam-request-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-top: 1px dashed rgba(22, 45, 61, 0.12);
}

.exam-request-row-icon {
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  border-radius: 999px;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.78);
}

.exam-request-row-icon-1 {
  background: linear-gradient(180deg, #ffd34d, #ffb703);
}

.exam-request-row-icon-2 {
  background: linear-gradient(180deg, #ffd54f, #ffca28);
}

.exam-request-row-icon-3 {
  background: linear-gradient(180deg, #ff7b72, #ef4444);
}

.exam-request-row-copy {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}

.exam-request-row-copy strong {
  color: #25384c;
  font-size: 13px;
  font-weight: 700;
}

.exam-request-row-copy span {
  color: #72818d;
  font-size: 13px;
}

.exam-request-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
}

.exam-request-card-actions-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.exam-request-extra-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(57, 207, 144, 0.1);
  color: var(--brand-deep);
  font-size: 11px;
  font-weight: 700;
}

/* Shared exam card action button base — Liquid Glass pills.
   Icon-only (24×24 quadradinhos arredondados) ou pílula com texto
   (Editar avaliação). Cor sutil em fundo translúcido, com inset
   highlight pra unificar com o resto da estética Apple. */
.download-button,
.exam-request-delete-button,
.exam-request-rename-button,
.exam-request-edit-button,
.anthropometry-preview-edit-button,
.anthropometry-preview-delete-button {
  margin: 0;
  height: 26px;
  padding: 0 8px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: -0.005em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  box-sizing: border-box;
  /* Estado neutro: fundo branco translúcido + borda cinza, ícone cinza médio */
  background: rgba(255, 255, 255, 0.7);
  color: #64748b;
  border: 1px solid rgba(15, 23, 42, 0.10);
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition: background 0.18s cubic-bezier(0.16, 1, 0.3, 1),
              color 0.18s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.download-button svg,
.exam-request-delete-button svg,
.anthropometry-preview-delete-button svg,
.exam-request-rename-button svg,
.exam-request-edit-button svg,
.anthropometry-preview-edit-button svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  fill: currentColor;
}

#delete-patient-modal-button svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  fill: currentColor;
}

/* Delete — cor vermelha SÓ no hover */
.exam-request-delete-button:hover,
.anthropometry-preview-delete-button:hover {
  background: rgba(239, 68, 68, 0.10);
  color: #dc2626;
  border-color: rgba(239, 68, 68, 0.30);
}

/* Download — cor azul SÓ no hover */
.download-button:hover {
  background: rgba(59, 130, 246, 0.10);
  color: #2563eb;
  border-color: rgba(59, 130, 246, 0.30);
}

/* Evolução/Rename/Editar — cor verde SÓ no hover */
.exam-request-rename-button:hover,
.exam-request-edit-button:hover,
.anthropometry-preview-edit-button:hover {
  background: rgba(16, 185, 129, 0.10);
  color: var(--mp-accent-strong, #059669);
  border-color: rgba(16, 185, 129, 0.30);
}


/* ============================================================
   PROFILE
   ============================================================ */

.profile-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.profile-sidebar,
.profile-content {
  padding: 24px;
}

.profile-summary {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 8px 0 24px;
}

.profile-summary-avatar,
.photo-upload-preview {
  width: 102px;
  height: 102px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: linear-gradient(145deg, #34cb8e, #7ae2b8);
  color: #fff;
  font-size: 28px;
  font-weight: 800;
}

.profile-summary-avatar.has-photo,
.photo-upload-preview.has-photo,
.profile-avatar.has-photo {
  background: #eef7f2;
}

.profile-summary-avatar img,
.photo-upload-preview img,
.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-summary strong,
.profile-summary span {
  text-align: center;
}

.profile-summary span {
  color: var(--muted);
}

.profile-nav {
  display: grid;
}

.profile-nav-item {
  padding: 14px 0;
  text-align: left;
  background: transparent;
  color: #61707d;
  font-weight: 600;
  border-bottom: 1px dashed rgba(22, 45, 61, 0.1);
}

.profile-nav-item-active {
  color: var(--brand);
}

.professional-form {
  display: grid;
  gap: 20px;
}

.photo-upload-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 20px;
  border: 1px dashed rgba(57, 207, 144, 0.35);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #fbfdfc, #f6faf8);
  cursor: pointer;
}

.photo-upload-copy {
  display: grid;
  gap: 6px;
}

.photo-upload-label {
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.photo-upload-copy strong {
  font-size: 20px;
}

.photo-upload-copy span:last-child {
  color: var(--muted);
}

.professional-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.appointment-time-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

.profile-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.profile-actions-center {
  justify-content: center;
}

/* ============================================================
   APPOINTMENT MODAL — Liquid Glass Adaptive System
   ============================================================ */

.appointment-modal-window {
  max-width: 620px;
  width: 100%;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.95);
  -webkit-backdrop-filter: saturate(160%) blur(24px);
  backdrop-filter: saturate(160%) blur(24px);
  box-shadow: 0 24px 50px -12px rgba(15, 23, 42, 0.22),
              inset 0 1px 0 rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.85);
}

.appointment-type-switch {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 20px;
  background: rgba(15, 23, 42, 0.04);
  padding: 4px;
  border-radius: 14px;
}

.appointment-type-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  color: #64748b;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s ease;
}

.appointment-type-btn:hover {
  color: #0f172a;
}

.appointment-type-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.08);
  color: #64748b;
  display: grid;
  place-items: center;
  transition: all 0.18s ease;
}

/* Consulta active */
.appointment-type-btn-active[data-appointment-type="consulta"] {
  border-color: rgba(16, 185, 129, 0.3);
  background: #ffffff;
  color: #047857;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.15), inset 0 1px 0 #ffffff;
}
.appointment-type-btn-active[data-appointment-type="consulta"] .appointment-type-icon {
  background: #10b981;
  color: #ffffff;
}

/* Retorno active */
.appointment-type-btn-active[data-appointment-type="retorno"] {
  border-color: rgba(59, 130, 246, 0.3);
  background: #ffffff;
  color: #1d4ed8;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15), inset 0 1px 0 #ffffff;
}
.appointment-type-btn-active[data-appointment-type="retorno"] .appointment-type-icon {
  background: #3b82f6;
  color: #ffffff;
}

/* Compromisso active */
.appointment-type-btn-active[data-appointment-type="compromisso"] {
  border-color: rgba(245, 158, 11, 0.35);
  background: #ffffff;
  color: #b45309;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.18), inset 0 1px 0 #ffffff;
}
.appointment-type-btn-active[data-appointment-type="compromisso"] .appointment-type-icon {
  background: #f59e0b;
  color: #ffffff;
}

/* Bloqueio active */
.appointment-type-btn-active[data-appointment-type="bloqueio"] {
  border-color: rgba(239, 68, 68, 0.3);
  background: #ffffff;
  color: #b91c1c;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.15), inset 0 1px 0 #ffffff;
}
.appointment-type-btn-active[data-appointment-type="bloqueio"] .appointment-type-icon {
  background: #ef4444;
  color: #ffffff;
}

/* Appointment Form Fields */
.appointment-form-grid {
  gap: 16px 18px;
}

.appointment-modal-window .field {
  display: grid;
  gap: 6px;
}

.appointment-modal-window .field span {
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.appointment-modal-window .field span small {
  font-weight: 500;
  color: #94a3b8;
  text-transform: none;
  font-size: 11px;
}

.appointment-modal-window .field input,
.appointment-modal-window .field select {
  height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.85);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  color: #0f172a;
  padding: 0 14px;
  transition: all 0.15s ease;
}

.appointment-modal-window .field input:focus,
.appointment-modal-window .field select:focus {
  border-color: #10b981;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.appointment-modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

@media (max-width: 640px) {
  .appointment-type-switch {
    grid-template-columns: repeat(2, 1fr);
  }
}

.profile-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.profile-section-header h2 {
  margin: 4px 0 6px;
  font-size: 28px;
}

.profile-section-header p {
  margin: 0;
  color: var(--muted);
}

.locations-list {
  display: grid;
  gap: 16px;
}

.location-card {
  padding: 20px;
}

.location-card-main {
  display: flex;
  align-items: center;
  gap: 18px;
}

.location-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.location-logo {
  width: 78px;
  height: 78px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 24px;
  background: linear-gradient(145deg, #34cb8e, #7ae2b8);
  color: #fff;
  font-size: 24px;
  font-weight: 800;
}

.location-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.location-copy strong,
.location-copy span {
  display: block;
}

.location-copy strong {
  font-size: 18px;
}

.location-copy span {
  margin-top: 5px;
  color: var(--muted);
}

.photo-upload-preview-square {
  border-radius: 24px;
}

/* ============================================================
   MEUS DADOS — Liquid Glass Design System
   ============================================================ */

body:has(.profile-page:not(.hidden)) {
  position: relative;
  overflow-x: hidden;
  background: linear-gradient(180deg, #fdfcff 0%, #f5f3fa 35%, #f0f7f4 100%);
}

body:has(.profile-page:not(.hidden))::before,
body:has(.profile-page:not(.hidden))::after {
  content: "";
  position: fixed;
  pointer-events: none;
  z-index: 0;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
}

body:has(.profile-page:not(.hidden))::before {
  top: -12%;
  left: -8%;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, #6ee7c7 0%, transparent 70%);
}

body:has(.profile-page:not(.hidden))::after {
  top: -8%;
  right: -10%;
  width: 580px;
  height: 580px;
  background: radial-gradient(circle, #c4b5fd 0%, transparent 70%);
}

/* Terceiro orb (coral) — embaixo via pseudo na própria página */
.profile-page:not(.hidden)::before {
  content: "";
  position: fixed;
  pointer-events: none;
  z-index: -1;
  bottom: -20%;
  left: 30%;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.4;
  background: radial-gradient(circle, #fca5a5 0%, transparent 70%);
}

#meus-dados-view .profile-layout {
  gap: 20px;
}

#meus-dados-view .profile-sidebar,
#meus-dados-view .profile-content,
#meus-dados-view .location-card {
  background: rgba(255, 255, 255, 0.62);
  -webkit-backdrop-filter: saturate(160%) blur(20px);
  backdrop-filter: saturate(160%) blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 22px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8),
              0 14px 30px -14px rgba(15, 23, 42, 0.08),
              0 2px 6px -2px rgba(15, 23, 42, 0.04);
  position: relative;
  overflow: hidden;
}

#meus-dados-view .profile-sidebar::before,
#meus-dados-view .profile-content::before,
#meus-dados-view .location-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.9), transparent);
  pointer-events: none;
}

/* Nav lateral — segmentado glass */
#meus-dados-view .profile-nav {
  display: grid;
  gap: 4px;
  padding: 4px;
  margin-top: 6px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

#meus-dados-view .profile-nav-item {
  padding: 11px 14px;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 10px;
  color: #64748b;
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

#meus-dados-view .profile-nav-item:hover {
  background: rgba(15, 23, 42, 0.05);
  color: #0f172a;
}

#meus-dados-view .profile-nav-item-active {
  background: rgba(255, 255, 255, 0.95);
  color: #0f172a;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9),
              0 2px 6px -2px rgba(15, 23, 42, 0.1);
}

/* Inputs — glass sutil (padrão Energy/Anthropometry) */
#meus-dados-view .field input,
#meus-dados-view .field select,
#meus-dados-view .field textarea {
  background: rgba(255, 255, 255, 0.6);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  backdrop-filter: saturate(140%) blur(10px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

#meus-dados-view .field input:focus,
#meus-dados-view .field select:focus,
#meus-dados-view .field textarea:focus {
  background: rgba(255, 255, 255, 0.78);
}

/* Foto de perfil — dropzone glass */
#meus-dados-view .photo-upload-card {
  background: rgba(255, 255, 255, 0.55);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  backdrop-filter: saturate(140%) blur(12px);
  border: 1px dashed rgba(57, 207, 144, 0.35);
  border-radius: 18px;
  transition: background 0.18s ease;
}

#meus-dados-view .photo-upload-card:hover {
  background: rgba(255, 255, 255, 0.72);
}

/* Botões primários — CTA padrão do sistema */
#meus-dados-view .primary-button {
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(180deg, #34d399 0%, #10b981 100%);
  box-shadow: 0 6px 16px -4px rgba(16, 185, 129, 0.45),
              inset 0 1px 0 0 rgba(255, 255, 255, 0.4);
  font-weight: 700;
  letter-spacing: -0.005em;
}

#meus-dados-view .primary-button:hover {
  box-shadow: 0 8px 20px -4px rgba(16, 185, 129, 0.55),
              inset 0 1px 0 0 rgba(255, 255, 255, 0.45);
}

/* Formulário — colapso em degraus */
@media (max-width: 1180px) {
  #meus-dados-view .professional-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  #meus-dados-view .professional-grid {
    grid-template-columns: 1fr;
  }
}


/* ============================================================
   MODAL
   ============================================================ */

/* --- MODAL: Liquid Glass overlay + janela ---
   Overlay mais translúcido (deixa o aurora vazar) e blur mais forte
   pra simular o frosted glass. Janela usa glass-bg-strong para
   continuar legível com o overlay escuro atrás. */
.modal-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  /* Overlay quente e suave, sem o cinza-azulado do slate */
  background: rgba(40, 30, 60, 0.32);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  z-index: 20;
}

/* Modais aninhados (recibo/declaração abrem por cima do modal de atendimento).
   Mesmo z-index ficaria atrás porque o #care-modal vem depois no DOM. */
#receipt-modal.modal-overlay,
#declaration-modal.modal-overlay {
  z-index: 40;
}

.modal-overlay.hidden {
  display: none;
}

.modal-window {
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 28px;
  /* Branco quase puro pra os orbs e cards glass aparecerem por cima */
  background: rgba(255, 255, 255, 0.94);
  -webkit-backdrop-filter: saturate(160%) blur(24px);
  backdrop-filter: saturate(160%) blur(24px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset,
              0 24px 50px -20px rgba(40, 30, 60, 0.30),
              0 8px 18px -10px rgba(40, 30, 60, 0.15);
  position: relative;
}

/* Linha de luz superior (highlight Apple) */
.modal-window::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  border-radius: 28px 28px 0 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.85), transparent);
  pointer-events: none;
}

.modal-window-narrow {
  width: min(760px, 100%);
}

.modal-window-care {
  width: min(1240px, 100%);
  /* Container das orbs internas — clip pra não vazar do border-radius */
  overflow: hidden auto;
  isolation: isolate;
  /* Scrollbar fina e translúcida que respeita o border-radius arredondado */
  scrollbar-width: thin;
  scrollbar-color: rgba(40, 30, 60, 0.18) transparent;
}
.modal-window-care::-webkit-scrollbar {
  width: 10px;
}
.modal-window-care::-webkit-scrollbar-track {
  background: transparent;
}
.modal-window-care::-webkit-scrollbar-thumb {
  background: rgba(40, 30, 60, 0.20);
  border-radius: 999px;
  /* Borders transparentes criam o "padding" interno que afasta o thumb
     das bordas arredondadas do modal — top, bottom e right. */
  border-top: 24px solid transparent;
  border-bottom: 24px solid transparent;
  border-right: 3px solid transparent;
  border-left: 3px solid transparent;
  background-clip: padding-box;
}
.modal-window-care::-webkit-scrollbar-thumb:hover {
  background: rgba(40, 30, 60, 0.35);
  background-clip: padding-box;
}

/* Orbs auroras dentro do care modal — dão vida ao branco e servem de
   "background" pros cards filhos Liquid Glass refletirem.
   Posicionadas absolute relativo ao .modal-window (que já é position: relative). */
.modal-window-care::after {
  content: "";
  position: absolute;
  top: -100px;
  left: -80px;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  background: radial-gradient(circle, #6ee7c7 0%, transparent 70%);
  filter: blur(70px);
  opacity: 0.45;
  pointer-events: none;
  z-index: 0;
}
.modal-window-care .modal-care-orb-2,
.modal-window-care .modal-care-orb-3 {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  pointer-events: none;
  z-index: 0;
}
.modal-window-care .modal-care-orb-2 {
  top: -60px;
  right: -100px;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, #c4b5fd 0%, transparent 70%);
  opacity: 0.40;
}
.modal-window-care .modal-care-orb-3 {
  bottom: -140px;
  left: 35%;
  width: 460px;
  height: 460px;
  background: radial-gradient(circle, #fbcfe8 0%, transparent 70%);
  opacity: 0.35;
}

/* Conteúdo do modal acima das orbs */
.modal-window-care > *:not(.modal-care-orb-2):not(.modal-care-orb-3) {
  position: relative;
  z-index: 1;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.modal-header h2 {
  margin: 6px 0 8px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #0f172a;
}

.modal-header p {
  margin: 0;
  color: #64748b;
}

.modal-eyebrow {
  color: var(--mp-accent, #10b981);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.10em;
  text-transform: uppercase;
}

.modal-close {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid var(--glass-border-soft, rgba(255, 255, 255, 0.35));
  background: var(--glass-bg, rgba(255, 255, 255, 0.62));
  -webkit-backdrop-filter: saturate(140%) blur(20px);
  backdrop-filter: saturate(140%) blur(20px);
  box-shadow: inset 0 1px 0 0 var(--glass-highlight, rgba(255, 255, 255, 0.85));
  color: #64748b;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.18s cubic-bezier(0.16, 1, 0.3, 1),
              color 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-close:hover {
  background: var(--glass-bg-strong, rgba(255, 255, 255, 0.82));
  color: #0f172a;
}

.modal-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border-radius: 18px;
  background: rgba(238, 246, 242, 0.92);
  border: 1px solid rgba(22, 45, 61, 0.06);
  margin-bottom: 20px;
  width: max-content;
}

.modal-tab {
  min-width: 102px;
  height: 42px;
  padding: 0 18px;
  border-radius: 14px;
  background: transparent;
  color: #667686;
  font-size: 14px;
  font-weight: 800;
  border: 0;
  transition: background var(--transition), color var(--transition), box-shadow var(--transition);
}

.modal-tab-active {
  background: var(--gradient-brand);
  color: #fff;
  box-shadow: 0 10px 20px rgba(36, 184, 125, 0.18);
}

.modal-form {
  display: grid;
  gap: 18px;
}

.modal-panel {
  padding: 4px 2px 0;
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}


/* ============================================================
   FORM FIELDS
   ============================================================ */

.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

#patient-form .form-grid:has(#pregnancy-field:not(.hidden)) {
  grid-template-columns: 1fr 1fr auto 1fr 1fr;
}

.field {
  display: grid;
  gap: 8px;
}

.field.hidden {
  display: none;
}

.field-span-2 {
  grid-column: span 2;
}

.field-span-3 {
  grid-column: span 3;
}

.field-span-full {
  grid-column: 1 / -1;
}

.field span {
  color: #5b6875;
  font-size: 13px;
  font-weight: 800;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  height: 36px;
  padding: 0px 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  outline: 0;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.field textarea {
  resize: vertical;
  height: 53px;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: rgba(57, 207, 144, 0.48);
  box-shadow: 0 0 0 4px rgba(57, 207, 144, 0.12);
}

/* Field with Unit positioning */
.field-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.field-unit {
  position: absolute;
  pointer-events: none;
  transition: all 0.2s ease;
  color: #94a3b8;
  z-index: 2;
}

/* Base input padding to avoid text overlap with unit */
.field-wrapper input {
  padding-right: 60px !important;
}

/* Case 1: Empty field (Suggestion mode) */
.field-wrapper input:placeholder-shown:not(:focus)+.field-unit {
  left: 16px;
  font-size: 15px;
  opacity: 0.6;
}

/* Case 2: Field has content or is focused (Indicator mode) */
.field-wrapper input:not(:placeholder-shown)+.field-unit,
.field-wrapper input:focus+.field-unit {
  right: 16px;
  left: auto;
  font-size: 12px;
  color: #64748b;
  opacity: 1;
}

/* Hide the native placeholder to use the field-unit instead */
.field-wrapper input::placeholder {
  color: transparent;
}



.checkbox-field {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 53px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.checkbox-field input {
  width: 18px;
  height: 18px;
  accent-color: var(--brand);
}

.checkbox-field span {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.checkbox-field-simple {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  width: max-content;
  align-self: end;
}


/* ============================================================
   RESPONSIVE â€” 1180px
   ============================================================ */

@media (max-width: 1180px) {
  .topbar {
    grid-template-columns: auto 1fr;
    padding: 8px 14px 14px 10px;
  }

  .topbar-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
    padding: 0 10px 0 14px;
  }

  .workspace-grid,
  .profile-layout,
  .care-layout,
  .agenda-layout,
  .professional-grid,
  .appointment-time-grid {
    grid-template-columns: 1fr;
  }

  .exam-split {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .exam-split-column-selected {
    border-left: 0;
    border-top: 1px solid var(--glass-border-soft, rgba(255, 255, 255, 0.4));
  }

  .exam-toolbar {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .calendar-weekdays,
  .calendar-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}


/* ============================================================
   RESPONSIVE â€” 760px
   ============================================================ */

@media (max-width: 760px) {
  .page-shell {
    width: min(100%, calc(100% - 16px));
  }

  .toolbar,
  .patient-card,
  .appointment-row {
    grid-template-columns: 1fr;
  }

  .patient-actions,
  .topbar-actions {
    flex-wrap: wrap;
  }

  .profile-chip {
    width: 100%;
    justify-content: space-between;
  }

  .profile-dropdown {
    left: 0;
    right: auto;
    width: 100%;
  }

  .panel-body {
    min-height: auto;
    max-height: none;
  }

  .exam-requests-page,
  .energy-expenditure-page,
  .plan-alimentar-page,
  .anthropometry-page {
    width: min(100%, calc(100% - 16px));
    margin: 22px auto 30px;
  }

  /* (responsivo dos headers agora vive em .app-hero @media (max-width: 760px)) */

  .exam-footer-sticky {
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 8px;
  }

  .exam-footer-actions {
    justify-content: space-between;
  }

  .exam-footer-save {
    flex: 1;
  }

  .energy-expenditure-top-row,
  .energy-expenditure-grid-basic,
  .energy-expenditure-grid-formula,
  .energy-expenditure-grid-venta,
  .energy-expenditure-grid-met,
  .energy-expenditure-grid-results,
  .energy-expenditure-grid-selects,
  .anthropometry-toolbar,
  .anthropometry-layout,
  .anthropometry-fields-grid,
  .anthropometry-fields-grid-compact,
  .appointment-time-grid {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .anthropometry-bilateral-grid {
    grid-template-columns: 1fr;
  }

  .anthropometry-bilateral-divider {
    width: 100%;
    height: 1px;
    margin: 4px 0;
  }

  .energy-expenditure-section-initial,
  .energy-expenditure-section-formula,
  .energy-expenditure-section-venta,
  .energy-expenditure-section-results,
  .energy-expenditure-section-instructions,
  .energy-expenditure-section-met {
    grid-column: auto !important;
    grid-row: auto !important;
  }

  .energy-expenditure-grid-basic .field.field-span-full {
    grid-column: auto;
  }

  .exam-toolbar-counter {
    justify-content: center;
  }

  .side-panel,
  .large-panel {
    padding: 18px;
  }

  .modal-overlay {
    padding: 12px;
  }

  .modal-window {
    padding: 18px;
    border-radius: 24px;
  }

  .modal-header,
  .modal-actions,
  .photo-upload-card,
  .profile-actions,
  .profile-section-header,
  .location-card-main,
  .agenda-header,
  .agenda-header-actions,
  .agenda-toolbar,
  .agenda-toolbar-nav,
  .agenda-view-switch,
  .patient-panel-toolbar,
  .patient-panel-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .patient-panel-toolbar {
    grid-template-columns: 1fr;
  }

  .patient-panel-search-group {
    flex-direction: column;
  }

  .searchbar-action-button,
  .patient-panel-actions .quick-action-button {
    width: 100%;
  }

  .agenda-view-button,
  .agenda-toolbar-nav .ghost-button,
  .agenda-toolbar-nav .primary-button {
    width: 100%;
  }

  .calendar-weekdays,
  .calendar-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .field-span-2,
  .field-span-full {
    grid-column: span 1;
  }

  .anthropometry-preview-kpi-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .anthropometry-preview-mini-charts {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   TAGS SYSTEM
   ============================================================ */

.care-patient-tags {
  margin-top: 8px;
  min-height: 24px;
}

.care-patient-tags .patient-tags-list {
  justify-content: flex-start;
}


.patient-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

/* Dot + texto pill estilo Linear/Notion.
   A cor da tag vem da custom property --tag-color (set inline pelo JS).
   O fundo é branco glass neutro; só o dot e o texto carregam a cor. */
.patient-tag {
  padding: 4px 10px 4px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  /* Fundo glass neutro — não compete com a cor da tag */
  background: rgba(255, 255, 255, 0.7);
  color: var(--tag-color, #475569);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.6),
              0 1px 2px -1px rgba(15, 23, 42, 0.06);
  -webkit-backdrop-filter: saturate(140%) blur(6px);
  backdrop-filter: saturate(140%) blur(6px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin-top: 2px;
}

/* Dot colorido — 6×6 da cor da tag, com leve halo pra dar "luz" */
.patient-tag-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--tag-color, #94a3b8);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--tag-color, #94a3b8) 18%, transparent);
  flex-shrink: 0;
}

.patient-tag-removable {
  cursor: default;
}

.patient-tag-removable:hover {
  padding-right: 6px;
}

.patient-tag-remove-x {
  width: 0;
  height: 12px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  border: 0;
  background: transparent;
  color: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  margin-left: 0;
  padding: 0;
}

.patient-tag-removable:hover .patient-tag-remove-x {
  width: 12px;
  opacity: 1;
  pointer-events: auto;
}

.patient-tag-remove-x:hover {
  background: transparent;
  transform: scale(1.1);
}


.patient-add-tag-button {
  width: 20px;
  height: 20px;
  padding: 0;
  border-radius: 11px;
  border: 1px solid #98a4af40;
  background: transparent;
  color: #98a4af;
  display: grid;
  place-items: center;
  transition: all var(--transition);
  cursor: pointer;
}

.patient-add-tag-button:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-soft);
}

.tag-menu-popover {
  position: absolute;
  min-width: 200px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-lg);
  z-index: 100;
}

.tag-menu-popover-header {
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.tag-menu-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
  margin-bottom: 10px;
}

.tag-menu-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.tag-menu-item {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  border: 0;
}

.tag-menu-item:hover {
  background: rgba(22, 45, 61, 0.04);
}

.tag-menu-delete {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: #ef4444;
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
  flex-shrink: 0;
}

.tag-menu-delete:hover {
  background: #ef4444;
  color: #fff;
}

.tag-menu-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.tag-menu-action {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.tag-menu-action:hover {
  background: var(--brand-soft);
  color: var(--brand-deep);
}


.tag-menu-create-button {
  width: 100%;
  padding: 8px;
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand-deep);
  font-weight: 700;
  font-size: 12px;
  text-align: center;
  border: 0;
  cursor: pointer;
}

.tag-menu-create-button:hover {
  background: #d1f4e3;
}

.tag-color-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 10px;
}

.tag-color-option {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.2s;
}

.tag-color-option:hover {
  transform: scale(1.1);
}

.tag-color-option-selected {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

.modal-window-mini {
  width: 180px;
  max-width: 100%;
  padding: 14px;
  border-radius: 14px;
}

.modal-header-mini {
  margin-bottom: 12px;
  padding-bottom: 0;
  border-bottom: 0;
  align-items: center;
}

.modal-header-mini h2 {
  font-size: 15px;
  margin: 0;
}

.modal-header-mini .modal-close {
  top: 12px;
  right: 12px;
  width: 24px;
  height: 24px;
  font-size: 20px;
}

.field-mini {
  margin-bottom: 10px;
}

.field-mini span {
  font-size: 11px;
  margin-bottom: 4px;
}

.field-mini input {
  height: 36px;
  font-size: 13px;
  border-radius: 8px;
}

.tag-color-grid-mini {
  grid-template-columns: repeat(4, 24px);
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
}

.tag-color-grid-mini .tag-color-option {
  width: 24px;
  height: 24px;
}

.tag-save-mini-button {
  width: 100%;
  height: 36px;
  padding: 0 16px;
  font-size: 13px;
}

/* ============================================================
   PLANO ALIMENTAR — Design premium (9.1 Variáveis + Hero + Toolbar)
   ============================================================ */

:root {
  --mp-prot: #f47171;
  --mp-prot-soft: rgba(244, 113, 113, 0.16);
  --mp-carb: #5b9bd5;
  --mp-carb-soft: rgba(91, 155, 213, 0.16);
  --mp-lip: #f4b942;
  --mp-lip-soft: rgba(244, 185, 66, 0.18);
  --mp-kcal: #10b981;
  --mp-kcal-soft: rgba(16, 185, 129, 0.12);
  /* Vermelho destrutivo (apagar, perigo). NÃO confundir com --mp-lip
     (amarelo, macro de lipídios). */
  --mp-danger: #ef4444;
  --mp-danger-soft: rgba(239, 68, 68, 0.10);
  --mp-bg-soft: #f6f8fb;
  --mp-border: rgba(22, 45, 61, 0.08);
  --mp-border-strong: rgba(22, 45, 61, 0.14);
  --mp-text: #0f172a;
  --mp-muted: #64748b;
  --mp-radius-sm: 10px;
  --mp-radius-md: 14px;
  --mp-radius-lg: 18px;
  --mp-shadow-sm: 0 4px 10px rgba(15, 23, 42, 0.05);
  --mp-shadow-md: 0 10px 25px rgba(15, 23, 42, 0.07);
  --mp-shadow-lg: 0 24px 50px rgba(15, 23, 42, 0.10);

  /* === Liquid Plate — Fase 1 (glass + aurora) === */
  /* Cor-base do plano alimentar (verde kcal) para tints e auras. */
  --mp-accent: #10b981;
  --mp-accent-strong: #059669;

  /* Camadas de vidro: bg semi-transparente + border + sombras suaves. */
  --glass-bg: rgba(255, 255, 255, 0.4);
  --glass-bg-strong: rgba(255, 255, 255, 0.78);
  --glass-border: rgba(15, 23, 42, 0.06);
  --glass-border-strong: rgba(15, 23, 42, 0.10);
  /* Borda branca suave (rim de luz) e highlight superior interno — usadas
     em botões ghost para o look "iOS Liquid Glass" do preview. */
  --glass-border-soft: rgba(255, 255, 255, 0.35);
  --glass-highlight: rgba(255, 255, 255, 0.85);
  --glass-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset,
                  0 12px 30px -12px rgba(15, 23, 42, 0.18),
                  0 4px 12px -6px rgba(15, 23, 42, 0.10);
  --glass-shadow-lg: 0 1px 0 rgba(255, 255, 255, 0.7) inset,
                     0 30px 60px -24px rgba(15, 23, 42, 0.25),
                     0 12px 24px -12px rgba(15, 23, 42, 0.05);
  --glass-blur: saturate(140%) blur(20px);

  /* Curva de easing Apple-style. */
  --mp-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Aurora background na página do plano alimentar --- */
/* === FUNDO AURORA do Plano Alimentar (Liquid Plate) ===
   Estratégia (igual ao preview): orbs concentradas com filter:blur enorme,
   ancoradas no <body> via :has(.plan-alimentar-page). Ficam DEBAIXO do
   conteúdo (z-index: 0 + page-shell com posição/z-index acima), e dão a
   textura colorida que o backdrop-filter dos cards "amassa" em transparência.

   Ficam ativas SÓ enquanto a página de plano alimentar estiver montada;
   ao trocar de rota o :has() falha e o body volta ao background padrão. */
body:has(.plan-alimentar-page:not(.hidden)) {
  position: relative;
  overflow-x: hidden;
  background:
    linear-gradient(180deg, #fdfcff 0%, #f5f3fa 35%, #f0f7f4 100%);
}

body:has(.plan-alimentar-page:not(.hidden))::before,
body:has(.plan-alimentar-page:not(.hidden))::after {
  content: "";
  position: fixed;
  pointer-events: none;
  z-index: 0;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
}

body:has(.plan-alimentar-page:not(.hidden))::before {
  /* Orb verde-menta no topo-esquerdo */
  top: -10%;
  left: -8%;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, #6ee7c7 0%, transparent 70%);
}

body:has(.plan-alimentar-page:not(.hidden))::after {
  /* Orb violeta-lavanda no topo-direito */
  top: -5%;
  right: -10%;
  width: 580px;
  height: 580px;
  background: radial-gradient(circle, #c4b5fd 0%, transparent 70%);
}

/* Orb extra rosa-coral embaixo (via div, já que ::before/::after foram usados) */
.plan-alimentar-page .mp-aurora-orb-3 {
  position: fixed;
  bottom: -20%;
  left: 30%;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.4;
  background: radial-gradient(circle, #fda4af 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* Garante que o conteúdo do app fique ACIMA das orbs do body. */
body:has(.plan-alimentar-page:not(.hidden)) .page-shell {
  position: relative;
  z-index: 1;
}

.plan-alimentar-page {
  position: relative;
}

/* Hero do plano alimentar migrado para .app-hero (definição reutilizável
   na seção EXAM REQUESTS). Regras .mp-hero / .mp-hero-left / .mp-eyebrow /
   .mp-hero-subtitle / .mp-hero-actions foram removidas. */

/* --- Botões base do módulo --- */
.mp-primary-button,
.mp-ghost-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.18s var(--mp-ease),
              box-shadow 0.18s var(--mp-ease),
              background 0.18s var(--mp-ease);
  border: 1px solid transparent;
  text-decoration: none;
  white-space: nowrap;
}

/* Primário (Apple iOS-style): gradiente verde top→bottom com inner-highlight
   no topo (rebatendo "luz" do ambiente) e drop-shadow colorido. */
.mp-primary-button {
  background: linear-gradient(180deg, #34d399 0%, #10b981 100%);
  color: #fff;
  box-shadow:
    0 6px 16px -2px rgba(16, 185, 129, 0.45),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.4);
}

.mp-primary-button:hover {
  transform: translateY(-1px);
  box-shadow:
    0 10px 22px -2px rgba(16, 185, 129, 0.55),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.5);
}

.mp-primary-button:active {
  transform: translateY(0);
}

.mp-primary-button svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.mp-ghost-button {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(6px);
}

.mp-ghost-button:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.30);
}

.mp-ghost-button svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* --- Toolbar (filtro de tabela + busca global) --- */
.mp-toolbar {
  display: flex;
  gap: 24px;
  align-items: stretch;
  padding: 18px 24px;
  background: #fff;
  border: 1px solid var(--mp-border);
  border-radius: var(--mp-radius-md);
  box-shadow: var(--mp-shadow-sm);
}

.mp-toolbar-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mp-toolbar-search {
  flex: 1;
  min-width: 280px;
}

.mp-toolbar-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--mp-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.mp-chip-row {
  display: inline-flex;
  background: var(--mp-bg-soft);
  border-radius: 12px;
  padding: 4px;
  gap: 2px;
}

.mp-chip {
  border: none;
  background: transparent;
  color: var(--mp-muted);
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.mp-chip:hover {
  color: var(--mp-text);
  background: rgba(15, 23, 42, 0.06);
}

.mp-chip.active {
  background: #fff;
  color: var(--mp-text);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.mp-search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.mp-search-wrapper svg {
  position: absolute;
  left: 14px;
  width: 16px;
  height: 16px;
  fill: var(--mp-muted);
  pointer-events: none;
}

.mp-search-wrapper input {
  width: 100%;
  padding: 12px 16px 12px 40px;
  border: 1px solid var(--mp-border);
  border-radius: 12px;
  font-size: 14px;
  color: var(--mp-text);
  background: var(--mp-bg-soft);
  transition: all 0.2s;
}

.mp-search-wrapper input:focus {
  outline: none;
  background: #fff;
  border-color: var(--mp-kcal);
  box-shadow: 0 0 0 4px var(--mp-kcal-soft);
}

.mp-search-wrapper input::placeholder {
  color: var(--mp-muted);
}

/* ============================================================
   DASHBOARD STATS GRID (Pacientes / Agendados / Faturamento)
   ============================================================ */

.dashboard-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 6px;
}

.stat-summary-card {
  border-radius: 28px !important;
  padding: 14px 18px !important;
  display: flex;
  flex-direction: row !important;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border);
}

.stat-summary-icon {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-summary-icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.stat-summary-icon.pink {
  background: rgba(236, 72, 153, 0.1);
  color: #ec4899;
}

.stat-summary-icon.blue {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.stat-summary-icon.green {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.stat-summary-info {
  display: flex;
  flex-direction: column;
}

.stat-summary-label {
  font-size: 10px;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.2;
}

.stat-summary-value {
  font-size: 18px;
  color: #162d3d;
  font-weight: 800;
  line-height: 1.2;
}

.revenue-prefix {
  font-size: 0.85em;
  font-weight: 700;
  margin-right: 2px;
  opacity: 0.8;
}

/* ============================================================
   PLANO ALIMENTAR — 9.2 Layout + Card de Refeição
   ============================================================ */

.mp-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 24px;
  align-items: start;
}

.mp-meals-column {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* === Barra mínima acima das refeições ===
   Sem card de vidro: só uma linha leve com o contador (texto puro) à esquerda
   e o botão flutuante "+ Nova refeição ▾" à direita. Sem fundo, sem borda,
   sem sombra — deixa o card de cada refeição respirar. */
.mp-meals-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 0 4px 4px;
  background: transparent;
  border: none;
  box-shadow: none;
  position: relative;
  overflow: visible; /* permite o menu dropdown vazar pra fora */
}

/* Contador como texto puro (sem pill, sem fundo) */
.mp-meals-count {
  display: inline-flex;
  align-items: center;
  padding: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--mp-muted);
  background: transparent;
  border: none;
  border-radius: 0;
  letter-spacing: 0.02em;
  transition: color 0.2s;
}

.mp-meals-count.has-content {
  color: var(--mp-kcal);
}

/* === Dropdown único "+ Nova refeição ▾" === */
.mp-meal-add-wrap {
  position: relative;
  flex-shrink: 0;
}

/* Botão "Nova refeição" — Liquid Glass real, mesma receita do preview:
   background --glass-bg, rim branco --glass-border-soft, só inset highlight.
   O destaque vem do "+" verde com gradiente, não da sombra do botão. */
.mp-meal-add-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px 9px 10px;
  border-radius: 14px;
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--glass-border-soft);
  box-shadow: inset 0 1px 0 0 var(--glass-highlight);
  font-size: 13px;
  font-weight: 600;
  color: var(--mp-text);
  cursor: pointer;
  transition: transform 0.18s var(--mp-ease),
              box-shadow 0.18s var(--mp-ease),
              background 0.18s var(--mp-ease);
}

.mp-meal-add-button:hover,
.mp-meal-add-button[aria-expanded="true"] {
  transform: translateY(-1px);
  background: var(--glass-bg-strong);
  box-shadow: inset 0 1px 0 0 var(--glass-highlight);
}

.mp-meal-add-button:active {
  transform: translateY(0);
}

/* Quadradinho verde com o "+" — gradiente + sombra colorida.
   Usamos SVG (em vez de glyph "+") porque cada fonte coloca o "+" em
   uma posição ligeiramente diferente dentro do box do caractere,
   causando a impressão de descentralização. SVG é centralizável pixel-
   perfect via viewBox simétrico (0..24, "+" em 12,12). */
.mp-meal-add-plus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 8px;
  background: linear-gradient(180deg, #34d399 0%, #10b981 100%);
  color: #fff;
  box-shadow: 0 2px 6px -1px rgba(16, 185, 129, 0.5),
              inset 0 1px 0 0 rgba(255, 255, 255, 0.4);
  flex-shrink: 0;
}

.mp-meal-add-plus svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
  display: block;
}

.mp-meal-add-caret {
  font-size: 10px;
  color: var(--mp-muted);
  margin-left: 2px;
}

/* Menu suspenso */
.mp-meal-add-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 220px;
  background: #fff;
  border: 1px solid var(--mp-border);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12), 0 2px 6px rgba(15, 23, 42, 0.06);
  padding: 6px;
  z-index: 50;
  display: flex;
  flex-direction: column;
}

.mp-meal-add-menu[hidden] {
  display: none;
}

.mp-meal-add-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: transparent;
  border: 0;
  border-radius: 8px;
  text-align: left;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--mp-text);
  cursor: pointer;
  transition: background-color 0.12s ease, color 0.12s ease;
}

.mp-meal-add-item:hover,
.mp-meal-add-item:focus-visible {
  background: var(--mp-kcal-soft);
  color: var(--mp-kcal);
  outline: none;
}

.mp-meal-add-item-icon {
  width: 20px;
  display: inline-flex;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.mp-meal-add-divider {
  height: 1px;
  background: var(--mp-border);
  margin: 4px 2px;
}

/* === Filtro de tabela dentro do popover de busca de alimento === */
.mp-popover-table-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--mp-border);
  background: var(--mp-bg-soft);
}

.mp-popover-table-chip {
  padding: 4px 12px;
  border: 1px solid var(--mp-border);
  background: #fff;
  color: var(--mp-muted);
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.12s, color 0.12s, border-color 0.12s;
}

.mp-popover-table-chip:hover {
  border-color: var(--mp-kcal);
  color: var(--mp-kcal);
}

.mp-popover-table-chip.is-active {
  background: var(--mp-kcal);
  color: #fff;
  border-color: var(--mp-kcal);
}

/* --- Container de refeições --- */
.mp-meals-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* --- Card de uma refeição --- */
.mp-meal-card {
  position: relative;
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--mp-radius-lg);
  box-shadow: var(--glass-shadow);
  overflow: hidden;
  transition: box-shadow 0.25s var(--mp-ease), transform 0.25s var(--mp-ease);
}

.mp-meal-card:hover {
  box-shadow: var(--glass-shadow-lg);
}

/* Highlight de 1px no topo (luz do vidro), igual ao hero e sidebar */
.mp-meal-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.8) 50%,
    transparent 100%);
  pointer-events: none;
  z-index: 1;
}

/* Cabeçalho do card — design "preview Apple"
   Avatar redondo temático + bloco de id (eyebrow + nome) + ações no canto direito.
   As cores vêm de --meal-color* setadas inline no .mp-meal-card pelo JS. */
.mp-meal-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: transparent;
  border-bottom: 1px solid var(--glass-border);
}

/* Avatar redondo com ícone temático */
.mp-meal-avatar {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--meal-color-soft, rgba(16, 185, 129, 0.12));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--meal-color, var(--mp-kcal));
  box-shadow: 0 1px 0 0 rgba(255, 255, 255, 0.5) inset,
              0 0 0 1px color-mix(in srgb, var(--meal-color, var(--mp-kcal)) 12%, transparent) inset;
  transition: transform 0.25s var(--mp-ease);
}

.mp-meal-card:hover .mp-meal-avatar {
  transform: scale(1.04);
}

.mp-meal-avatar svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
  display: block;
}

/* Bloco do id da refeição (eyebrow + nome) */
.mp-meal-id-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 0 1 auto;
}

.mp-meal-eyebrow {
  font-size: 10px;
  font-weight: 800;
  color: var(--meal-color, var(--mp-muted));
  text-transform: uppercase;
  letter-spacing: 0.12em;
  line-height: 1;
}

/* Linha com nome da refeição + chip do horário ao lado */
.mp-meal-name-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.mp-meal-name-input {
  border: none;
  background: transparent;
  font-size: 17px;
  font-weight: 800;
  color: var(--mp-text);
  height: 26px;
  line-height: 26px;
  padding: 0;
  box-sizing: border-box;
  letter-spacing: -0.01em;
  width: auto;
  min-width: 120px;
  max-width: 520px;
  field-sizing: content;
  text-overflow: ellipsis;
}

.mp-meal-name-input:focus {
  outline: none;
  box-shadow: inset 0 -2px 0 0 var(--meal-color, var(--mp-kcal));
}

.mp-meal-name-input::placeholder {
  color: var(--mp-muted);
  font-weight: 700;
}

/* Bloco de ações: chips compactos + menu de 3 pontinhos */
.mp-meal-card-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

/* Chip do horário — compacto, vidro claro */
.mp-meal-time {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px;
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 8px;
  box-sizing: border-box;
  line-height: 1;
}

.mp-meal-time svg {
  width: 12px;
  height: 12px;
  fill: var(--mp-muted);
  flex-shrink: 0;
}

.mp-meal-time-input {
  border: none;
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  color: var(--mp-text);
  width: 44px;
  text-align: center;
  padding: 0;
  height: 100%;
  font-variant-numeric: tabular-nums;
}

.mp-meal-time-input:focus {
  outline: none;
}

.mp-meal-time-input::placeholder {
  color: var(--mp-muted);
}

/* Chip de kcal — pill temática.
   align-items: center + line-height: 1 nos filhos centraliza valor e unidade
   no eixo vertical do chip (baseline causava a unidade "kcal" subindo demais). */
.mp-meal-kcal-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 30px;
  padding: 0 12px;
  background: var(--meal-color-soft, rgba(16, 185, 129, 0.10));
  border: 1px solid color-mix(in srgb, var(--meal-color, var(--mp-kcal)) 18%, transparent);
  border-radius: 8px;
  box-sizing: border-box;
  color: var(--meal-color-text, var(--meal-color, var(--mp-kcal)));
  white-space: nowrap;
  line-height: 1;
}

.mp-meal-kcal-chip-value,
.mp-meal-kcal-chip > span:first-child {
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.mp-meal-kcal-chip-unit,
.mp-meal-kcal-chip small {
  font-size: 11px;
  font-weight: 700;
  text-transform: lowercase;
  letter-spacing: 0.02em;
  line-height: 1;
  opacity: 0.9;
}

/* Menu de 3 pontinhos */
.mp-meal-menu {
  position: relative;
}

.mp-meal-menu-trigger {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--mp-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.18s var(--mp-ease),
              color 0.18s var(--mp-ease),
              border-color 0.18s var(--mp-ease);
  padding: 0;
}

.mp-meal-menu-trigger svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.mp-meal-menu-trigger:hover {
  background: rgba(15, 23, 42, 0.05);
  color: var(--mp-text);
  border-color: rgba(15, 23, 42, 0.06);
}

.mp-meal-menu-trigger[aria-expanded="true"] {
  background: rgba(15, 23, 42, 0.06);
  color: var(--mp-text);
}

/* Dropdown — painel glass com itens */
.mp-meal-menu-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 30;
  min-width: 240px;
  padding: 6px;
  background: var(--glass-bg-strong, rgba(255, 255, 255, 0.92));
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  box-shadow: 0 14px 40px -10px rgba(15, 23, 42, 0.18),
              0 4px 12px -4px rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  gap: 2px;
  animation: mp-meal-menu-in 0.18s var(--mp-ease) both;
  transform-origin: top right;
}

.mp-meal-menu-dropdown[hidden] {
  display: none;
}

@keyframes mp-meal-menu-in {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.mp-meal-menu-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--mp-text);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s var(--mp-ease), color 0.15s var(--mp-ease);
  line-height: 1.2;
  white-space: nowrap;
}

.mp-meal-menu-item svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
  flex-shrink: 0;
  opacity: 0.85;
}

.mp-meal-menu-item:hover,
.mp-meal-menu-item:focus-visible {
  background: rgba(15, 23, 42, 0.05);
  outline: none;
}

.mp-meal-menu-item.danger {
  color: var(--mp-danger);
}

.mp-meal-menu-item.danger svg {
  fill: var(--mp-danger);
  opacity: 1;
}

.mp-meal-menu-item.danger:hover,
.mp-meal-menu-item.danger:focus-visible {
  background: var(--mp-danger-soft);
  color: var(--mp-danger);
}

/* Separador opcional entre grupos de itens do menu */
.mp-meal-menu-separator {
  height: 1px;
  margin: 4px 6px;
  background: var(--glass-border);
  border: 0;
}

/* --- Abas (Principal | Opção…) — segmented control glass ---
   Container vira uma pílula com fundo levemente recuado; a aba ativa
   é uma pill flutuante de vidro com sombra Apple-style. */
.mp-tabs-row {
  display: inline-flex;
  gap: 2px;
  margin: 10px 22px 6px;
  padding: 4px;
  background: rgba(15, 23, 42, 0.04);
  border-radius: 12px;
  overflow-x: auto;
  scrollbar-width: thin;
  width: fit-content;
  max-width: calc(100% - 44px);
}

.mp-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--mp-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.22s var(--mp-ease),
    color 0.22s var(--mp-ease),
    box-shadow 0.22s var(--mp-ease),
    transform 0.22s var(--mp-ease);
  white-space: nowrap;
}

.mp-tab-icon {
  width: 13px;
  height: 13px;
  fill: currentColor;
  opacity: 0.85;
}

.mp-tab:hover {
  color: var(--mp-text);
  background: rgba(255, 255, 255, 0.45);
}

.mp-tab.active {
  background: var(--glass-bg-strong);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-color: var(--glass-border-strong);
  color: var(--mp-text);
  font-weight: 700;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.7) inset,
    0 1px 2px rgba(15, 23, 42, 0.06),
    0 4px 12px rgba(15, 23, 42, 0.05);
}

.mp-tab.active .mp-tab-icon {
  opacity: 1;
  color: var(--mp-accent);
}

.mp-tab-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  margin-left: 4px;
  color: var(--mp-muted);
  font-size: 14px;
  line-height: 1;
  transition: all 0.15s;
}

.mp-tab-close:hover {
  background: var(--mp-lip-soft);
  color: var(--mp-lip);
}

/* Input de renomear substituta dentro da aba ativa.
   Tem que parecer "texto editável" e não input — sem borda, fundo herdado.
   Largura dinâmica via field-sizing (Chromium) + atributo size dinâmico (fallback). */
.mp-tab-rename {
  border: none;
  background: transparent;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  font-family: inherit;
  padding: 2px 4px;
  margin: -2px 0;
  border-radius: 4px;
  /* Largura "abraça" o conteúdo: começa colada no texto ("Substituta 1") e
       cresce conforme o usuário digita, até o teto. Sem min-width para não
       sobrar espaço vazio à direita. */
  width: auto;
  max-width: 220px;
  field-sizing: content;
  /* sublinha pontilhada discreta indicando que é editável */
  border-bottom: 1px dashed transparent;
  transition: border-color 0.15s, background 0.15s;
}

.mp-tab-rename:hover {
  border-bottom-color: rgba(16, 185, 129, 0.4);
}

.mp-tab-rename:focus {
  outline: none;
  background: var(--mp-kcal-soft);
  border-bottom-color: var(--mp-kcal);
}

.mp-tab-rename::placeholder {
  color: var(--mp-muted);
  font-style: italic;
}

/* Corpo do card (lista de alimentos vem aqui) */
.mp-meal-body {
  padding: 0;
  background: transparent;
}

/* Rodapé do card */
.mp-meal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 22px;
  background: rgba(15, 23, 42, 0.015);
  border-top: 1px solid var(--glass-border);
}

.mp-meal-footer-macros {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.mp-mini {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--mp-muted);
}

.mp-mini i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.mp-mini-prot i {
  background: var(--mp-prot);
}

.mp-mini-carb i {
  background: var(--mp-carb);
}

.mp-mini-lip i {
  background: var(--mp-lip);
}

.mp-mini strong {
  color: var(--mp-text);
  font-weight: 800;
}

.mp-add-food-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: transparent;
  border: 1px dashed var(--mp-border-strong);
  border-radius: 10px;
  color: var(--mp-muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s;
}

.mp-add-food-button svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.mp-add-food-button:hover {
  border-color: var(--mp-kcal);
  color: var(--mp-kcal);
  background: var(--mp-kcal-soft);
  border-style: solid;
}

/* Empty state global das refeições */
.mp-empty-state {
  background: rgba(255, 255, 255, 0.55);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  backdrop-filter: saturate(140%) blur(14px);
  border: 2px dashed rgba(15, 23, 42, 0.14);
  border-radius: var(--mp-radius-md);
  padding: 48px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.75);
}

.mp-empty-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--mp-kcal-soft);
  color: var(--mp-kcal);
  display: flex;
  align-items: center;
  justify-content: center;
}

.mp-empty-icon svg {
  width: 30px;
  height: 30px;
  fill: currentColor;
}

.mp-empty-state strong {
  font-size: 16px;
  font-weight: 800;
  color: var(--mp-text);
}

.mp-empty-state span {
  font-size: 13px;
  color: var(--mp-muted);
  max-width: 360px;
  line-height: 1.5;
}

/* ============================================================
   PLANO ALIMENTAR — 9.3 Alimentos (Liquid Plate)
   ============================================================
   - <ul.mp-meal-foods> com <li.mp-meal-food> em linha única.
   - Grid: nome (1fr flex) · macros (auto) · kcal (auto) · chevron (22px).
   - Inputs (nome / quantidade) e botão de medida ficam inline, parecendo
     texto — hover/foco revelam o estado editável.
   - Estado .has-subs adiciona chevron; .is-expanded revela substitutos.
   ============================================================ */

.mp-meal-foods {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.mp-meal-food {
  display: grid;
  /* nome (até ~38%) | qty+medida (fixa 160px) | spacer 1fr (empurra à direita)
     | macros (auto) | kcal+ações (auto) | chevron (22px ou 0 quando ausente)
     A coluna "qty" tem largura fixa para alinhar verticalmente entre linhas. */
  grid-template-columns:
    minmax(0, 38%)   /* 1. nome */
    160px            /* 2. qty + medida (alinhamento vertical) */
    1fr              /* 3. spacer — empurra o resto para a direita */
    auto             /* 4. macros */
    auto             /* 5. kcal + ações */
    22px;            /* 6. chevron substitutos */
  align-items: center;
  column-gap: 16px;
  padding: 6px 12px 6px 22px;
  min-height: 36px;
  border-bottom: 1px solid var(--glass-border);
  transition: background 0.18s var(--mp-ease);
}

/* Linhas SEM substitutos: colapsa a coluna 6 e o gap antes dela
   para que o kcal encoste na borda direita do cartão. */
.mp-meal-food:not(.has-subs) {
  grid-template-columns:
    minmax(0, 38%)
    160px
    1fr
    auto
    auto
    0;
}

.mp-meal-food:hover {
  background: rgba(15, 23, 42, 0.025);
}

.mp-meal-food:last-child {
  border-bottom: none;
}

/* Quando expandido, mantemos align-items: center (herdado de .mp-meal-food)
   para a linha principal — todas as células do PAI vivem na row 1 do grid;
   o bloco de substitutos ocupa a row 2 (grid-column: 1/-1 implicitamente
   empurra pra a próxima row). Mudar para align-items: start aqui faria a
   kcal "descer" dentro de .mp-meal-food-info (cuja altura é ditada pelos
   botões de ação de 24px), criando o desalinhamento vertical visto antes. */
.mp-meal-food.is-expanded {
  height: auto;
  min-height: 36px;
  padding-bottom: 10px;
}

/* ---- Coluna 1: nome do alimento ---- */
.mp-meal-food-name {
  grid-column: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 13px;
  color: var(--mp-text);
}

/* ---- Coluna 2: quantidade + medida (largura fixa = alinhamento vertical) ---- */
.mp-meal-food-qty {
  grid-column: 2;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--mp-muted);
  font-size: 13px;
  white-space: nowrap;
  justify-content: flex-start;
}

/* Coluna 3: spacer 1fr — não precisa de elemento, fica vazia.
   As próximas células assumem colunas 4, 5, 6 explicitamente. */

/* Input do nome — invisível no estado base */
.mp-food-name-input {
  flex: 1;
  min-width: 0;
  border: 1px solid transparent;
  background: transparent;
  padding: 2px 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--mp-text);
  border-radius: 6px;
  transition: background 0.15s var(--mp-ease), box-shadow 0.15s var(--mp-ease);
}

.mp-food-name-input:hover {
  background: rgba(15, 23, 42, 0.04);
}

.mp-food-name-input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 0 0 3px var(--mp-kcal-soft);
}

.mp-food-name-input::placeholder {
  color: var(--mp-muted);
  font-weight: 500;
}

/* Tag da tabela (TACO/TBCA/IBGE) — empurrada para o fim da célula do nome
   (margin-left: auto) para que TODAS as tags fiquem na mesma coluna visual,
   independentemente do tamanho do nome do alimento. */
.mp-food-table-tag {
  display: inline-flex;
  align-items: center;
  margin-left: auto;
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  flex-shrink: 0;
}

.mp-tag-taco {
  background: rgba(16, 185, 129, 0.10);
  color: #047857;
}

.mp-tag-tbca {
  background: rgba(37, 99, 235, 0.10);
  color: #1d4ed8;
}

.mp-tag-ibge {
  background: rgba(168, 85, 247, 0.10);
  color: #7e22ce;
}

.mp-tag-todas {
  background: rgba(100, 116, 139, 0.10);
  color: #475569;
}

/* Input da quantidade — invisível, alinhado pela direita,
   parecendo texto até hover/foco. Largura fixa = alinhamento vertical
   entre linhas (1, 2, 10 ficam na mesma coluna visual). */
.mp-food-qty-input {
  width: 32px;
  padding: 2px 4px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--mp-text);
  text-align: center;
  -moz-appearance: textfield;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  transition: background 0.15s var(--mp-ease), box-shadow 0.15s var(--mp-ease);
}

.mp-food-qty-input::-webkit-outer-spin-button,
.mp-food-qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.mp-food-qty-input:hover {
  background: rgba(15, 23, 42, 0.04);
}

.mp-food-qty-input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 0 0 3px var(--mp-kcal-soft);
}

/* Botão de medida — chevron pequeno; invisível até hover */
.mp-food-measure-button {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 4px 2px 6px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--mp-muted);
  transition: background 0.15s var(--mp-ease), box-shadow 0.15s var(--mp-ease), color 0.15s var(--mp-ease);
}

.mp-food-measure-button:hover {
  background: rgba(15, 23, 42, 0.05);
  color: var(--mp-text);
}

.mp-food-measure-button:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.7);
  color: var(--mp-text);
  box-shadow: 0 0 0 3px var(--mp-kcal-soft);
}

.mp-measure-label {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.mp-measure-hint {
  font-size: 10px;
  color: var(--mp-muted);
  font-weight: 600;
  margin-left: 4px;
}

.mp-food-measure-button svg {
  width: 11px;
  height: 11px;
  fill: currentColor;
  opacity: 0.7;
  flex-shrink: 0;
}

/* ---- Macros (badges inline) — coluna 4 ---- */
.mp-meal-food-macros {
  grid-column: 4;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.mp-meal-food-macro {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  font-size: 12px;
  color: var(--mp-muted);
  font-weight: 500;
  line-height: 1;
}

.mp-meal-food-macro strong {
  font-size: 13px;
  font-weight: 700;
  color: var(--mp-text);
}

.mp-meal-food-macro small {
  font-size: 10px;
  font-weight: 700;
  margin-left: 1px;
}

.mp-meal-food-macro.prot strong { color: var(--mp-prot); }
.mp-meal-food-macro.prot small  { color: var(--mp-prot); }
.mp-meal-food-macro.carb strong { color: var(--mp-carb); }
.mp-meal-food-macro.carb small  { color: var(--mp-carb); }
.mp-meal-food-macro.lip  strong { color: var(--mp-lip);  }
.mp-meal-food-macro.lip  small  { color: var(--mp-lip);  }

/* ---- Info: kcal + ações — coluna 5 ---- */
.mp-meal-food-info {
  grid-column: 5;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  justify-self: end; /* gruda na borda direita da própria coluna */
}

.mp-meal-food-kcal {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  color: var(--mp-muted);
}

.mp-meal-food-kcal strong {
  font-size: 13px;
  font-weight: 800;
  color: var(--mp-kcal);
}

.mp-meal-food-kcal small {
  font-size: 10px;
  color: var(--mp-muted);
  font-weight: 600;
}

.mp-meal-food-actions {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.18s var(--mp-ease);
}

.mp-meal-food:hover .mp-meal-food-actions,
.mp-meal-food:focus-within .mp-meal-food-actions {
  opacity: 1;
}

.mp-food-swap,
.mp-food-remove {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--mp-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s var(--mp-ease);
}

.mp-food-swap svg,
.mp-food-remove svg {
  width: 13px;
  height: 13px;
  fill: currentColor;
}

.mp-food-swap:hover {
  background: rgba(37, 99, 235, 0.10);
  color: var(--mp-carb);
}

.mp-food-remove:hover {
  background: var(--mp-lip-soft);
  color: var(--mp-lip);
}

/* ---- Chevron de substitutos — coluna 6 ---- */
.mp-meal-food-subs-toggle {
  grid-column: 6;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--mp-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s var(--mp-ease), background 0.15s var(--mp-ease), color 0.15s var(--mp-ease);
}

.mp-meal-food-subs-toggle svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.mp-meal-food-subs-toggle:hover {
  background: rgba(15, 23, 42, 0.05);
  color: var(--mp-text);
}

.mp-meal-food.is-expanded .mp-meal-food-subs-toggle {
  transform: rotate(180deg);
  color: var(--mp-accent);
}

/* ---- Bloco de substitutos (expandido) — estilo Liquid Plate ----
   Container ocupa toda a largura do <li>, com border-left colorida (accent).
   Cada substituto é uma pill com bullet · nome · qty · macros · remove. */
/* Container das alternativas — ocupa o ROW INTEIRO do <li> pai.
   Crucial: NÃO acrescenta padding-left horizontal nem margin-left, para que
   cada sub-row possa usar exatamente o MESMO grid-template-columns da linha
   principal. Sem accent vertical à esquerda (a indicação de "filhote" vem
   do bullet verde de cada item). */
.mp-meal-food-subs {
  grid-column: 1 / -1;
  position: relative;
  margin: 4px 0 6px;
  padding: 8px 0 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mp-meal-food-subs[hidden] {
  display: none;
}

.mp-meal-food-subs-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 0 4px 6px;
  font-size: 11px;
  color: var(--mp-muted);
}

.mp-meal-food-subs-label {
  font-weight: 700;
  color: var(--mp-text);
  font-size: 10px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
}

.mp-meal-food-subs-hint {
  font-style: italic;
  opacity: 0.85;
  font-size: 10.5px;
}

/* Linha individual do substituto — espelha EXATAMENTE o grid da linha
   principal (.mp-meal-food) para que nome, qty, macros e kcal alinhem
   verticalmente com a refeição "pai". O bullet vive DENTRO do .name como
   um filho flex, não como uma coluna própria. */
.mp-meal-food-sub {
  display: grid;
  grid-template-columns:
    minmax(0, 38%)   /* 1. nome (com bullet flex interno) */
    160px            /* 2. qty + medida */
    1fr              /* 3. spacer */
    auto             /* 4. macros */
    auto             /* 5. kcal */
    22px;            /* 6. botão remover (espelha o chevron do pai) */
  align-items: center;
  column-gap: 16px;
  padding: 4px 0;
  border-radius: 8px;
  cursor: default;
  transition: background 0.15s var(--mp-ease);
  min-height: 28px;
}

/* Posiciona cada célula explicitamente para casar com .mp-meal-food */
.mp-meal-food-sub-name        { grid-column: 1; }
.mp-meal-food-sub-qty         { grid-column: 2; }
.mp-meal-food-sub-macros      { grid-column: 4; }
.mp-meal-food-sub-info        { grid-column: 5; justify-self: end; }
.mp-meal-food-sub-remove      { grid-column: 6; }

.mp-meal-food-sub:hover {
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

.mp-meal-food-sub-bullet {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--mp-accent) 70%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--mp-accent) 12%, transparent);
  flex-shrink: 0;
}

/* Célula 1 do sub-row. O TEXTO precisa começar EXATAMENTE no mesmo X do
   nome do alimento pai — sem padding-left. O bullet vive como filho
   absolutamente posicionado em NEGATIVE-SPACE à esquerda (fora da coluna),
   onde o padding-left do <li> pai (22px) deixa folga. Assim o nome do
   substituto alinha perfeitamente com o nome do pai. */
.mp-meal-food-sub-name {
  position: relative;
  display: block;
  font-size: 12.5px;
  color: var(--mp-text);
  font-weight: 500;
  min-width: 0;
  padding-left: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mp-meal-food-sub-name .mp-meal-food-sub-bullet {
  position: absolute;
  left: -14px;
  top: 50%;
  transform: translateY(-50%);
}

/* Mesmo gap (4px) e mesma altura visual do .mp-meal-food-qty pai,
   para que o número alinhe com o pai pixel-a-pixel. */
.mp-meal-food-sub-qty {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--mp-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Input de quantidade do substituto — mesma largura (32px), padding
   (2px 4px) e alinhamento (right) do .mp-food-qty-input pai. Assim o
   "9" do sub e o "10" do pai compartilham o mesmo eixo vertical (borda
   direita do input). */
.mp-meal-food-sub-qty .mp-food-alt-grams-input {
  width: 32px;
  text-align: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 2px 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--mp-text);
  -moz-appearance: textfield;
  appearance: textfield;
  font-variant-numeric: tabular-nums;
  transition: background 0.15s var(--mp-ease), box-shadow 0.15s var(--mp-ease);
}

.mp-meal-food-sub-qty .mp-food-alt-grams-input::-webkit-outer-spin-button,
.mp-meal-food-sub-qty .mp-food-alt-grams-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.mp-meal-food-sub-qty .mp-food-alt-grams-input:hover {
  background: rgba(15, 23, 42, 0.04);
}

.mp-meal-food-sub-qty .mp-food-alt-grams-input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 0 0 3px var(--mp-kcal-soft);
}

.mp-meal-food-sub-measure {
  font-size: 11px;
  color: var(--mp-muted);
  font-weight: 600;
}

.mp-meal-food-sub-grams-note {
  font-size: 10px;
  color: var(--mp-muted);
  opacity: 0.8;
  margin-left: 2px;
}

/* Macros + kcal alinhados à direita, como na linha principal */
.mp-meal-food-sub-macros {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-variant-numeric: tabular-nums;
}

.mp-meal-food-sub-macro {
  display: inline-flex;
  align-items: baseline;
  gap: 1px;
  font-size: 11px;
  color: var(--mp-muted);
  font-weight: 500;
  line-height: 1;
}

.mp-meal-food-sub-macro strong {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--mp-text);
}

.mp-meal-food-sub-macro small {
  font-size: 9px;
  font-weight: 700;
  margin-left: 1px;
}

.mp-meal-food-sub-macro.prot strong, .mp-meal-food-sub-macro.prot small { color: var(--mp-prot); }
.mp-meal-food-sub-macro.carb strong, .mp-meal-food-sub-macro.carb small { color: var(--mp-carb); }
.mp-meal-food-sub-macro.lip  strong, .mp-meal-food-sub-macro.lip  small { color: var(--mp-lip);  }

/* Célula 5 do sub-row: agrupa o kcal (espelha .mp-meal-food-info do pai) */
.mp-meal-food-sub-info {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.mp-meal-food-sub-kcal {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  font-size: 11px;
  color: var(--mp-muted);
}

.mp-meal-food-sub-kcal strong {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--mp-kcal);
}

.mp-meal-food-sub-kcal small {
  font-size: 9px;
  font-weight: 600;
}

/* Botão remover substituto — só aparece no hover.
   Ocupa col 6 (22px) — espelha o chevron do pai para alinhamento perfeito. */
.mp-meal-food-sub-remove {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--mp-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: all 0.15s var(--mp-ease);
  justify-self: center;
  padding: 0;
}

.mp-meal-food-sub-remove svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
}

.mp-meal-food-sub:hover .mp-meal-food-sub-remove {
  opacity: 1;
}

.mp-meal-food-sub-remove:hover {
  background: var(--mp-danger-soft);
  color: var(--mp-danger);
}

/* ---- Empty state ---- */
.mp-food-empty {
  padding: 24px;
  text-align: center;
  font-size: 13px;
  color: var(--mp-muted);
  list-style: none;
}

/* ============================================================
   PLANO ALIMENTAR — 9.4 Sidebar de Adequação (Liquid Plate)
   ============================================================
   - .mp-sidebar-card: vidro grande com Activity Rings + macros
   - 3 anéis SVG concêntricos (proteína externo, carbo meio, lipídio interno)
   - kcal totais no centro do ring
   - 3 macro-rows com mini-barra animada e percentual
   ============================================================ */

.mp-sidebar {
  position: sticky;
  top: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Card glass — mesma linguagem visual do hero */
.mp-sidebar-card {
  position: relative;
  padding: 28px 24px;
  border-radius: var(--mp-radius-lg);
  overflow: hidden;
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow-lg);
}

/* Highlight de 1px no topo (luz no vidro) */
.mp-sidebar-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.8) 50%,
    transparent 100%);
  pointer-events: none;
}

/* Header */
.mp-sidebar-header {
  text-align: center;
  margin-bottom: 24px;
}

.mp-sidebar-eyebrow {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--glass-border);
  color: var(--mp-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
}

.mp-sidebar-title {
  margin: 10px 0 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--mp-text);
}

/* ===== Activity Ring (SVG) ===== */
.mp-ring-wrap {
  position: relative;
  width: 260px;
  height: 260px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mp-ring-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg); /* início no topo (12h) */
}

.mp-ring-track {
  fill: none;
  stroke: rgba(15, 23, 42, 0.06);
  stroke-width: 14;
}

.mp-ring-fill {
  fill: none;
  stroke-width: 14;
  stroke-linecap: round;
  /* O dashoffset é controlado por app.js: dasharray=perímetro fixo no HTML;
     offset = perímetro * (1 - min(pct,100)/100). */
  transition: stroke-dashoffset 1.2s var(--mp-ease);
}

/* Cores dos anéis — gradientes por macro (ids definidos no <defs> do SVG) */
.mp-ring-fill.prot { stroke: url(#grad-prot); }
.mp-ring-fill.carb { stroke: url(#grad-carb); }
.mp-ring-fill.lip  { stroke: url(#grad-lip); }

/* Texto central do ring — kcal grande */
.mp-ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  text-align: center;
}

.mp-ring-kcal-value {
  font-size: 44px;
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--mp-text);
  font-variant-numeric: tabular-nums;
}

.mp-ring-kcal-unit {
  margin-top: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--mp-muted);
}

.mp-ring-kcal-goal {
  margin-top: 8px;
  font-size: 12px;
  color: var(--mp-muted);
  font-weight: 500;
}
.mp-ring-kcal-goal strong {
  color: var(--mp-text);
  font-weight: 600;
}
/* #mp-pct-kcal vive dentro do .mp-ring-kcal-goal — usa span normal,
   sem a "pill" antiga. Mantém apenas o número. */
.mp-ring-kcal-goal #mp-pct-kcal {
  font-weight: 600;
  color: var(--mp-text);
}

/* ===== Macro stats (3 linhas com mini-barra) ===== */
.mp-macros-stats {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.mp-macro-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
}

.mp-macro-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.5);
}
.mp-macro-row.prot .mp-macro-dot { background: #34d399; }
.mp-macro-row.carb .mp-macro-dot { background: #818cf8; }
.mp-macro-row.lip  .mp-macro-dot { background: #fb923c; }

.mp-macro-info {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.mp-macro-name-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.mp-macro-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--mp-text);
}

.mp-macro-values {
  font-size: 12px;
  color: var(--mp-muted);
  font-variant-numeric: tabular-nums;
}
.mp-macro-values strong {
  color: var(--mp-text);
  font-weight: 700;
}

.mp-macro-bar {
  position: relative;
  height: 5px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  overflow: hidden;
}

.mp-macro-bar-fill {
  position: absolute;
  inset: 0;
  width: 0%;
  border-radius: inherit;
  transform-origin: left center;
  transition: width 0.9s var(--mp-ease);
}
.mp-macro-row.prot .mp-macro-bar-fill {
  background: linear-gradient(90deg, #34d399, #10b981);
}
.mp-macro-row.carb .mp-macro-bar-fill {
  background: linear-gradient(90deg, #818cf8, #6366f1);
}
.mp-macro-row.lip .mp-macro-bar-fill {
  background: linear-gradient(90deg, #fb923c, #f97316);
}
/* Quando ultrapassa a meta, vira vermelho */
.mp-macro-bar-fill.over {
  background: linear-gradient(90deg, #fca5a5, #ef4444) !important;
}

.mp-macro-pct {
  min-width: 38px;
  text-align: right;
  font-size: 12px;
  font-weight: 700;
  color: var(--mp-text);
  font-variant-numeric: tabular-nums;
}
/* Modulação de cor quando o macro atinge/excede a meta */
.mp-macro-pct.hit  { color: #059669; }
.mp-macro-pct.over { color: #b91c1c; }
.mp-macro-pct.under{ color: var(--mp-text); }

/* Footer leve no card */
.mp-sidebar-footer {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--mp-muted);
  text-align: center;
}

/* ============================================================
   PLANO ALIMENTAR — 9.5 Popovers (food, measure, meal)
   ============================================================ */

.mp-popover {
  position: absolute;
  z-index: 9000;
  background: var(--glass-bg-strong);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border-strong);
  border-radius: 14px;
  box-shadow: var(--glass-shadow-lg, 0 18px 60px -20px rgba(15, 23, 42, 0.25), 0 6px 20px -10px rgba(15, 23, 42, 0.12));
  overflow: hidden;
  animation: mpPopIn 0.22s var(--mp-ease);
}

.mp-popover.hidden {
  display: none;
}

@keyframes mpPopIn {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.mp-popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0.25) 100%);
  border-bottom: 1px solid var(--glass-border);
  font-size: 12px;
  font-weight: 700;
  color: var(--mp-text);
}

.mp-popover-header>span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.mp-popover-header svg {
  width: 14px;
  height: 14px;
  fill: var(--mp-muted);
}

.mp-popover-header b {
  color: var(--mp-kcal);
}

.mp-popover-count {
  padding: 3px 10px;
  background: var(--mp-bg-soft);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  color: var(--mp-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Lista de resultados do popover de alimentos */
.mp-popover-list {
  max-height: 360px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.mp-popover-list::-webkit-scrollbar {
  width: 6px;
}

.mp-popover-list::-webkit-scrollbar-thumb {
  background: var(--mp-border-strong);
  border-radius: 999px;
}

.mp-popover-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 10px 16px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--glass-border);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s var(--mp-ease);
}

.mp-popover-item:last-child {
  border-bottom: none;
}

.mp-popover-item:hover,
.mp-popover-item.active {
  background: linear-gradient(90deg, var(--mp-kcal-soft) 0%, rgba(16, 185, 129, 0.04) 100%);
}

.mp-popover-item.active {
  box-shadow: inset 3px 0 0 var(--mp-kcal);
}

.mp-popover-item-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.mp-popover-item-main strong {
  font-size: 13px;
  font-weight: 700;
  color: var(--mp-text);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.mp-popover-item-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.mp-popover-group {
  font-size: 10px;
  font-weight: 600;
  color: var(--mp-muted);
}

.mp-popover-base {
  font-size: 10px;
  font-weight: 700;
  color: var(--mp-muted);
  background: var(--mp-bg-soft);
  padding: 2px 7px;
  border-radius: 6px;
}

.mp-popover-item-macros {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.mp-pop-macro {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}

.mp-pop-macro b {
  font-size: 12px;
  font-weight: 800;
}

.mp-pop-macro small {
  font-size: 8px;
  font-weight: 700;
  color: var(--mp-muted);
  text-transform: uppercase;
  margin-top: 2px;
}

.mp-pop-prot b {
  color: var(--mp-prot);
}

.mp-pop-carb b {
  color: var(--mp-carb);
}

.mp-pop-lip b {
  color: var(--mp-lip);
}

.mp-pop-kcal {
  padding: 4px 8px;
  background: var(--mp-kcal-soft);
  color: var(--mp-kcal);
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
  line-height: 1.1;
  min-width: 40px;
}

.mp-pop-kcal small {
  display: block;
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
}

.mp-popover-footer {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 8px 16px;
  background: #fafbfd;
  border-top: 1px solid var(--mp-border);
  font-size: 10px;
  color: var(--mp-muted);
}

.mp-popover-footer kbd {
  display: inline-block;
  padding: 1px 6px;
  background: #fff;
  border: 1px solid var(--mp-border-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
  font-family: ui-monospace, monospace;
  font-size: 10px;
  font-weight: 700;
  color: var(--mp-text);
  margin-right: 4px;
}

.mp-popover-empty {
  padding: 32px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.mp-popover-empty svg {
  width: 28px;
  height: 28px;
  fill: var(--mp-muted);
  opacity: 0.5;
  margin-bottom: 4px;
}

.mp-popover-empty strong {
  font-size: 13px;
  color: var(--mp-text);
}

.mp-popover-empty span {
  font-size: 11px;
  color: var(--mp-muted);
}

/* --- Popover de medidas caseiras --- */
.mp-measure-list {
  max-height: 320px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.mp-measure-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 10px 14px;
  background: #fff;
  border: none;
  border-bottom: 1px solid var(--mp-border);
  cursor: pointer;
  text-align: left;
  transition: background 0.12s;
}

.mp-measure-item:last-child {
  border-bottom: none;
}

.mp-measure-item:hover {
  background: var(--mp-bg-soft);
}

.mp-measure-item.active {
  background: var(--mp-kcal-soft);
  box-shadow: inset 3px 0 0 var(--mp-kcal);
}

.mp-measure-item-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.mp-measure-item-main strong {
  font-size: 13px;
  font-weight: 700;
  color: var(--mp-text);
}

.mp-measure-item-main small {
  font-size: 11px;
  color: var(--mp-muted);
}

.mp-measure-check {
  width: 16px;
  height: 16px;
  fill: var(--mp-kcal);
  flex-shrink: 0;
}

/* ============================================================
   PLANO ALIMENTAR — 9.6 Modal de Metas
   ============================================================ */

.mp-goals-modal {
  width: min(680px, calc(100vw - 32px));
  max-height: calc(100vh - 60px);
  overflow-y: auto;
  padding: 28px;
}

.mp-goals-modal .modal-header {
  padding: 0 0 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--mp-border);
}

/* Linha de peso + kcal */
.mp-goals-top {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 18px;
}

.mp-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mp-field>span {
  font-size: 11px;
  font-weight: 800;
  color: var(--mp-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.mp-field input {
  padding: 12px 14px;
  border: 1px solid var(--mp-border);
  border-radius: 10px;
  background: var(--mp-bg-soft);
  font-size: 14px;
  font-weight: 700;
  color: var(--mp-text);
  transition: all 0.18s;
}

.mp-field input:focus {
  outline: none;
  background: #fff;
  border-color: var(--mp-kcal);
  box-shadow: 0 0 0 4px var(--mp-kcal-soft);
}

/* Toggle modo % / g/kg */
.mp-goals-mode-row {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.mp-goals-mode-toggle {
  position: relative;
  display: inline-flex;
  background: var(--mp-bg-soft);
  border: 1px solid var(--mp-border);
  border-radius: 999px;
  padding: 4px;
  width: 320px;
}

.mp-goals-mode-toggle input {
  display: none;
}

.mp-goals-mode-toggle label {
  flex: 1;
  text-align: center;
  padding: 9px 12px;
  font-size: 12px;
  font-weight: 800;
  color: var(--mp-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  border-radius: 999px;
  z-index: 1;
  transition: color 0.25s ease;
}

.mp-goals-mode-toggle input:checked+label {
  color: #fff;
}

.mp-goals-mode-slider {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 4px);
  background: linear-gradient(135deg, #10b981, #059669);
  border-radius: 999px;
  box-shadow: 0 6px 14px rgba(16, 185, 129, 0.30);
  transition: transform 0.32s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

#goals-mode-gkg:checked~.mp-goals-mode-slider {
  transform: translateX(100%);
}

/* Grid de cards de macros */
.mp-macro-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.mp-macro-card {
  background: #fff;
  border: 1px solid var(--mp-border);
  border-radius: var(--mp-radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.18s, box-shadow 0.18s;
}

.mp-macro-card:hover {
  box-shadow: var(--mp-shadow-sm);
}

.mp-macro-prot {
  border-left: 4px solid var(--mp-prot);
}

.mp-macro-carb {
  border-left: 4px solid var(--mp-carb);
}

.mp-macro-lip {
  border-left: 4px solid var(--mp-lip);
}

.mp-macro-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mp-macro-tag {
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.mp-macro-prot .mp-macro-tag {
  background: var(--mp-prot-soft);
  color: var(--mp-prot);
}

.mp-macro-carb .mp-macro-tag {
  background: var(--mp-carb-soft);
  color: #b45309;
}

.mp-macro-lip .mp-macro-tag {
  background: var(--mp-lip-soft);
  color: var(--mp-lip);
}

.mp-macro-name {
  font-size: 14px;
  font-weight: 800;
  color: var(--mp-text);
  flex: 1;
}

.mp-macro-auto {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #b45309;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s;
}

.mp-macro-auto.visible {
  display: inline-flex;
  animation: mpPopIn 0.25s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

.mp-macro-auto:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 14px rgba(245, 158, 11, 0.30);
}

.mp-macro-auto svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.mp-macro-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}

.mp-macro-input,
.mp-macro-result {
  position: relative;
  display: flex;
  align-items: center;
}

.mp-macro-input input,
.mp-macro-result input {
  width: 100%;
  padding: 9px 36px 9px 12px;
  border: 1px solid var(--mp-border);
  border-radius: 10px;
  background: var(--mp-bg-soft);
  font-size: 14px;
  font-weight: 700;
  color: var(--mp-text);
  transition: all 0.18s;
  -moz-appearance: textfield;
}

.mp-macro-input input::-webkit-outer-spin-button,
.mp-macro-input input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.mp-macro-input input:focus {
  outline: none;
  background: #fff;
  border-color: var(--mp-kcal);
  box-shadow: 0 0 0 3px var(--mp-kcal-soft);
}

.mp-macro-result input {
  background: rgba(16, 185, 129, 0.06);
  border-color: rgba(16, 185, 129, 0.20);
  color: var(--mp-text);
  font-weight: 800;
}

.mp-macro-unit {
  position: absolute;
  right: 10px;
  font-size: 11px;
  font-weight: 700;
  color: var(--mp-muted);
  pointer-events: none;
}

/* Esconder inputs do modo inativo */
.mp-goals-modal.mp-mode-pct .mp-macro-input-gkg {
  display: none;
}

.mp-goals-modal.mp-mode-gkg .mp-macro-input-pct {
  display: none;
}

.mp-goals-modal.mp-mode-pct .mp-macro-inputs,
.mp-goals-modal.mp-mode-gkg .mp-macro-inputs {
  grid-template-columns: 1fr 1fr;
}

/* Totais do rodapé */
.mp-goals-total-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 6px;
}

.mp-goals-total {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px;
  background: var(--mp-bg-soft);
  border: 1px solid var(--mp-border);
  border-radius: 12px;
}

.mp-goals-total-label {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--mp-muted);
  margin-bottom: 4px;
}

.mp-goals-total strong {
  font-size: 18px;
  font-weight: 800;
  color: var(--mp-text);
  font-variant-numeric: tabular-nums;
}

.mp-goals-total-pct strong.ok {
  color: #059669;
}

.mp-goals-total-pct strong.off {
  color: #b91c1c;
}

/* Esconder a soma de % no modo g/kg */
.mp-goals-modal.mp-mode-gkg .mp-goals-total-pct {
  display: none;
}

.mp-goals-modal.mp-mode-gkg .mp-goals-total-row {
  grid-template-columns: 1fr;
}

/* Ações */
.mp-goals-actions {
  margin-top: 22px;
  display: flex;
  justify-content: center;
}

/* ============================================================
   PLANO ALIMENTAR — 9.7 Preview no card de atendimento
   ============================================================ */

/* === Botao “Criar novo plano” ===
   Usa .primary-button (herda #care-preview-stage .primary-button => altura 42,
   border-radius 14, gradiente verde, bold). .mp-plan-create sobrepoem SOMENTE
   layout (icon sizing + flex) — NADA de visual que gere drift do botao unificado. */
#care-preview-stage .mp-plan-create {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  padding: 0px 20px;
  font-size: 14px;
  font-weight: 700;
}
#care-preview-stage .mp-plan-create svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.mp-preview-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.mp-preview-empty {
  background: #fff;
  border: 2px dashed var(--mp-border-strong);
  border-radius: var(--mp-radius-md);
  padding: 40px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
}

.mp-preview-empty-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--mp-kcal-soft);
  color: var(--mp-kcal);
  display: flex;
  align-items: center;
  justify-content: center;
}

.mp-preview-empty-icon svg {
  width: 26px;
  height: 26px;
  fill: currentColor;
}

.mp-preview-empty strong {
  font-size: 15px;
  font-weight: 800;
  color: var(--mp-text);
}

.mp-preview-empty span {
  font-size: 13px;
  color: var(--mp-muted);
}

/* Card de um plano salvo */
.mp-record-card {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--glass-bg-strong, rgba(255, 255, 255, 0.82));
  -webkit-backdrop-filter: saturate(140%) blur(20px);
  backdrop-filter: saturate(140%) blur(20px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset,
              0 4px 12px -4px rgba(15, 23, 42, 0.10);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.mp-record-card:hover {
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset,
              0 8px 20px -6px rgba(15, 23, 42, 0.14);
}

.mp-record-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.85), transparent);
  pointer-events: none;
}

.mp-record-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.mp-record-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.mp-record-title strong {
  font-size: 16px;
  font-weight: 800;
  color: var(--mp-text);
  letter-spacing: -0.01em;
}

.mp-record-rename {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--mp-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s;
}

.mp-record-rename svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.mp-record-rename:hover {
  background: var(--mp-bg-soft);
  color: var(--mp-kcal);
}

.mp-record-date {
  font-size: 11px;
  color: var(--mp-muted);
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
}

/* Stats do plano salvo */
.mp-record-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 14px;
  background: var(--mp-bg-soft);
  border-radius: 12px;
  border: 1px solid var(--mp-border);
}

.mp-record-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
  position: relative;
}

.mp-record-stat-label {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--mp-muted);
}

.mp-record-stat strong {
  font-size: 18px;
  font-weight: 800;
  color: var(--mp-text);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.mp-record-stat strong small {
  font-size: 10px;
  font-weight: 700;
  color: var(--mp-muted);
  margin-left: 2px;
}

.mp-record-stat.mp-stat-kcal strong {
  color: var(--mp-kcal);
}

.mp-record-stat.mp-stat-prot strong {
  color: var(--mp-prot);
}

.mp-record-stat.mp-stat-carb strong {
  color: #b45309;
}

.mp-record-stat.mp-stat-lip strong {
  color: var(--mp-lip);
}

.mp-record-pct {
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--mp-bg-soft);
  color: var(--mp-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 2px;
}

.mp-record-pct.hit {
  background: rgba(16, 185, 129, 0.10);
  color: #059669;
}

.mp-record-pct.over {
  background: rgba(239, 68, 68, 0.10);
  color: #b91c1c;
}

.mp-record-pct.under {
  background: rgba(245, 158, 11, 0.12);
  color: #b45309;
}

.mp-record-meta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.mp-record-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--mp-muted);
  font-weight: 700;
}

.mp-record-meta svg {
  width: 13px;
  height: 13px;
  fill: currentColor;
}

.mp-record-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--mp-border);
}

/* ============================================================
   PLANO ALIMENTAR — 9.8 Icon Buttons + Ghost (outside hero)
   ============================================================ */

/* Ghost button em contextos com fundo claro — Liquid Glass real
   (idêntico ao preview-meal-plan-fase1.html).
   Pontos-chave da receita:
   - background: --glass-bg (0.62) — translúcido pra deixar o aurora vazar
   - border: --glass-border-soft (white 0.35) — rim de luz branca, NÃO borda
     escura. É o que dá o "anel iluminado" das fotos do iOS.
   - box-shadow: APENAS inset top highlight. Nada de drop-shadow externo.
     A profundidade vem do contraste com o aurora, não de sombra. */
.mp-toolbar .mp-ghost-button,
.mp-meals-toolbar .mp-ghost-button,
.mp-record-actions .mp-ghost-button {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  color: var(--mp-text);
  border-color: var(--glass-border-soft);
  box-shadow: inset 0 1px 0 0 var(--glass-highlight);
}

.mp-toolbar .mp-ghost-button:hover,
.mp-meals-toolbar .mp-ghost-button:hover,
.mp-record-actions .mp-ghost-button:hover {
  background: var(--glass-bg-strong);
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 0 var(--glass-highlight);
}

/* ============================================================
   PLANO ALIMENTAR — 9.9 Responsividade + Refinamentos
   ============================================================ */

/* Animação de entrada das refeições */
.mp-meal-card {
  animation: mpFadeUp 0.32s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

@keyframes mpFadeUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Pulsação sutil quando bate a meta */
.mp-stat-pct.hit {
  animation: mpPulseHit 1.8s ease-in-out;
}

@keyframes mpPulseHit {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }

  50% {
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.18);
  }
}

/* Scrollbars suaves no popover de medidas */
.mp-measure-list::-webkit-scrollbar {
  width: 6px;
}

.mp-measure-list::-webkit-scrollbar-thumb {
  background: var(--mp-border-strong);
  border-radius: 999px;
}

/* Tablets / janelas médias */
@media (max-width: 1180px) {
  .mp-layout {
    grid-template-columns: 1fr;
  }

  .mp-sidebar {
    position: static;
    order: -1;
  }

  .mp-summary-card {
    box-shadow: var(--mp-shadow-sm);
  }

  .mp-meals-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .mp-meal-add-wrap {
    align-self: flex-end;
  }
}

/* Notebooks pequenos / tablets */
@media (max-width: 980px) {

  .mp-toolbar {
    flex-direction: column;
    gap: 14px;
  }

  .mp-food-row {
    grid-template-columns: 1fr 70px 130px 60px 60px 60px 50px 32px;
    gap: 6px;
    padding: 8px 16px;
  }

  .mp-food-row-header {
    padding: 10px 16px;
  }

  .mp-meal-header {
    padding: 14px 16px;
  }

  .mp-meal-footer {
    padding: 12px 16px;
  }

  .mp-tabs-row {
    padding-left: 16px;
    padding-right: 16px;
  }
}

/* Mobile */
@media (max-width: 720px) {

  .mp-meal-add-button {
    padding: 8px 12px;
    font-size: 12.5px;
  }

  .mp-meal-add-menu {
    min-width: 200px;
  }

  .mp-food-row-header {
    display: none;
  }

  .mp-food-row {
    grid-template-columns: 1fr 60px 110px 50px 50px 50px 28px;
    gap: 5px;
  }

  .mp-food-col-kcal {
    display: none;
  }

  /* Em telas estreitas, esconde o chip de horário para liberar espaço.
     O kcal e o menu de 3 pontinhos continuam visíveis. */
  .mp-meal-card-actions .mp-meal-time {
    display: none;
  }

  .mp-meal-header {
    padding: 14px 16px;
    gap: 10px;
  }

  .mp-meal-avatar {
    width: 38px;
    height: 38px;
  }

  .mp-meal-avatar svg {
    width: 18px;
    height: 18px;
  }

  .mp-meal-name-input {
    font-size: 15px;
    width: 100%;
    min-width: 0;
  }

  .mp-record-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .mp-goals-top {
    grid-template-columns: 1fr;
  }

  .mp-goals-mode-toggle {
    width: 100%;
  }

  .mp-macro-inputs {
    grid-template-columns: 1fr;
  }

  .mp-goals-modal.mp-mode-pct .mp-macro-inputs,
  .mp-goals-modal.mp-mode-gkg .mp-macro-inputs {
    grid-template-columns: 1fr;
  }

  .mp-popover {
    width: calc(100vw - 16px) !important;
    left: 8px !important;
  }

  .mp-popover-item-macros {
    gap: 6px;
  }

  .mp-pop-kcal {
    min-width: 36px;
  }
}

/* Foco-visible global do módulo.
   Aplica a botões e elementos interativos, mas NÃO a inputs de texto —
   inputs têm tratamento de foco próprio (border-bottom no :focus). Um outline
   adicional de 2px com offset estoura a altura do input e quebra o alinhamento
   com os controles vizinhos do header. */
.mp-meal-card :focus-visible:not(input):not(textarea),
.mp-summary-card :focus-visible:not(input):not(textarea),
.mp-popover :focus-visible:not(input):not(textarea) {
  outline: 2px solid var(--mp-kcal);
  outline-offset: 2px;
  border-radius: 6px;
}

/* Modo escuro do sistema (apenas leve adaptação) */
@media (prefers-reduced-motion: reduce) {

  .mp-meal-card,
  .mp-popover,
  .mp-stat-pct.hit,
  .mp-bar-fill,
  .mp-dist,
  .mp-goals-mode-slider {
    animation: none !important;
    transition: none !important;
  }
}

/* Body Composition Section */
.anthropometry-composition-container {
  grid-column: 1 / -1;
  margin-top: 32px;
  padding-top: 32px;
  border-top: 1px solid rgba(22, 45, 61, 0.08);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.composition-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.composition-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
}

.composition-subtitle {
  font-size: 13px;
  color: var(--muted);
}

.composition-content {
  display: flex;
  align-items: center;
  gap: 48px;
  padding: 12px 0;
}

.composition-chart-wrapper {
  position: relative;
  width: 200px;
  height: 200px;
  flex-shrink: 0;
}

.composition-donut {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.donut-bg {
  fill: none;
  stroke: #f1f5f9;
  stroke-width: 10;
}

.donut-segment {
  fill: none;
  stroke-width: 10;
  stroke-linecap: butt;
  transition: stroke-dashoffset 0.5s ease;
}

.donut-segment.lean {
  stroke: #34d399;
}

.donut-segment.fat {
  stroke: #ffd770;
}

.donut-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  display: flex;
  flex-direction: column;
}

.donut-percent {
  font-size: 28px;
  font-weight: 900;
  color: var(--text);
  line-height: 1;
}

.donut-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  margin-top: 2px;
}

.composition-details {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 40px;
}

.composition-legend {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 240px;
}

.legend-item {
  display: flex;
  gap: 12px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 4px;
  flex-shrink: 0;
}

.legend-item.fat .legend-dot {
  background: #ef4444;
}

.legend-item.lean .legend-dot {
  background: #10b981;
}

.legend-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.legend-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.legend-value {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
}

.legend-value small {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-left: 4px;
}

.legend-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  width: fit-content;
  margin-top: 6px;
}

.tag-fat {
  background: rgba(239, 68, 68, 0.08);
  color: #ef4444;
}

.tag-lean {
  background: rgba(16, 185, 129, 0.08);
  color: #10b981;
}

.legend-divider {
  height: 1px;
  background: rgba(22, 45, 61, 0.06);
  width: 100%;
}

.composition-info-card {
  flex: 1;
  max-width: 320px;
  background: rgba(22, 45, 61, 0.02);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
}

.info-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.08);
  color: #10b981;
  display: flex;
  align-items: center;
  justify-content: center;
}

.info-card-icon svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.composition-info-card p {
  font-size: 13px;
  line-height: 1.5;
  color: #4b5563;
  margin: 0;
}

/* ============================================================
   PLANO ALIMENTAR — Alimentos substitutos (alternativas individuais)
   ============================================================ */

/* Botão de troca/swap na coluna de ação da linha de alimento */
.mp-food-swap {
  position: relative;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  color: var(--mp-muted, #6b7280);
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.mp-food-swap:hover {
  background: var(--mp-kcal-soft, #ecfdf5);
  color: var(--mp-kcal, #10b981);
  border-color: var(--mp-kcal, #10b981);
}
.mp-food-swap svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}
.mp-food-swap-has-alts {
  color: var(--mp-kcal, #10b981);
}
.mp-food-swap-count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--mp-kcal, #10b981);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  box-shadow: 0 1px 2px rgba(0,0,0,.2);
}

/* Bloco colapsável das alternativas (logo abaixo da linha do alimento) */
/* Bloco de alternativas — borda esquerda colorida, fundo levemente afundado.
   Visualmente "filho" do alimento de cima. */
.mp-food-alternatives {
  margin: 4px 22px 10px 36px;
  padding: 6px 14px 10px;
  border-left: 2px solid rgba(16, 185, 129, 0.20);
  background: rgba(16, 185, 129, 0.025);
  border-radius: 0 8px 8px 0;
}

.mp-food-alternatives-header {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: none;
  padding: 4px 8px;
  margin: 0 0 4px;
  font-size: 12px;
  color: var(--mp-muted, #6b7280);
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.15s var(--mp-ease), color 0.15s var(--mp-ease);
}
.mp-food-alternatives-header:hover {
  background: rgba(16,185,129,.08);
  color: var(--mp-accent-strong, #059669);
}
.mp-food-alt-arrow {
  font-size: 12px;
  line-height: 1;
  color: var(--mp-kcal, #10b981);
  width: 12px;
  text-align: center;
}
.mp-food-alt-summary {
  font-weight: 600;
  color: var(--mp-text, #111827);
}
.mp-food-alt-hint {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--mp-muted, #6b7280);
  font-weight: 500;
  padding: 2px 6px;
  background: #f3f4f6;
  border-radius: 4px;
  margin-left: 4px;
}

.mp-food-alt-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 14px;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
}
.mp-food-alt-row:hover {
  background: rgba(16,185,129,.04);
}

.mp-food-alt-name-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--mp-text, #111827);
  min-width: 0;
}
.mp-food-alt-bullet {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--mp-kcal, #10b981);
  flex-shrink: 0;
}
.mp-food-alt-name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mp-food-alt-meta {
  color: var(--mp-muted, #6b7280);
  font-size: 11px;
}

.mp-food-alt-numbers {
  display: flex;
  gap: 14px;
  font-size: 11px;
  color: var(--mp-muted, #6b7280);
  font-variant-numeric: tabular-nums;
}
.mp-food-alt-numbers span small {
  margin-left: 2px;
  opacity: .7;
}
.mp-food-alt-numbers strong {
  color: var(--mp-text, #111827);
  font-weight: 600;
}

.mp-food-alt-remove {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--mp-muted, #6b7280);
  font-size: 16px;
  cursor: pointer;
  line-height: 1;
}
.mp-food-alt-remove:hover {
  background: #fee2e2;
  color: #dc2626;
}

/* ============================================================
   Modal de substituição (mp-swap-overlay + mp-swap-popover)
   ============================================================ */

/* Overlay: cobre toda a viewport, centraliza o painel e escurece o fundo */
.mp-swap-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(15, 23, 42, 0.45);  /* slate-900 a 45% */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: mp-swap-overlay-in .15s ease-out;
}
.mp-swap-overlay.hidden { display: none; }

@keyframes mp-swap-overlay-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes mp-swap-panel-in {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}

/* Trava o scroll do body enquanto o modal está aberto */
body.mp-swap-modal-open {
  overflow: hidden;
}

/* Painel: o popover em si. Já não é "absolute" — fica centralizado pelo flex
   do overlay. Tamanho controlado por width/max-height; conteúdo rola dentro. */
.mp-swap-popover {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 520px;
  max-height: min(85vh, 720px);
  background: #fff;
  border: 1px solid var(--mp-border, #e5e7eb);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  font-size: 13px;
  animation: mp-swap-panel-in .18s ease-out;
}

.mp-swap-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--mp-border, #e5e7eb);
}

/* === Barra de busca === */
.mp-swap-search-wrapper {
  position: relative;
  padding: 10px 16px;
  border-bottom: 1px solid var(--mp-border, #e5e7eb);
  background: #fff;
}
.mp-swap-search-icon {
  position: absolute;
  left: 26px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  fill: var(--mp-muted, #6b7280);
  pointer-events: none;
}
.mp-swap-search-input {
  width: 100%;
  height: 38px;
  padding: 0 36px 0 36px;
  border: 1px solid var(--mp-border, #e5e7eb);
  border-radius: 8px;
  font-size: 13px;
  color: var(--mp-text, #111827);
  background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
  outline: none;
}
.mp-swap-search-input:focus {
  border-color: var(--mp-kcal, #10b981);
  box-shadow: 0 0 0 3px rgba(16,185,129,.15);
}
.mp-swap-search-input::placeholder {
  color: var(--mp-muted, #9ca3af);
}
.mp-swap-search-clear {
  position: absolute;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: #f3f4f6;
  color: var(--mp-muted, #6b7280);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color .15s ease, color .15s ease;
}
.mp-swap-search-clear:hover {
  background: #e5e7eb;
  color: var(--mp-text, #111827);
}

/* Banner de aviso (fallback de busca) */
.mp-swap-warning {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 16px;
  margin: 0;
  background: #fef3c7;     /* amber-100 */
  color: #78350f;          /* amber-900 */
  font-size: 12px;
  line-height: 1.45;
  border-bottom: 1px solid #fcd34d;
}
.mp-swap-warning svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  fill: #b45309;           /* amber-700 */
  margin-top: 1px;
}
.mp-swap-warning strong { color: #78350f; }

/* Toggle de grupo desabilitado durante busca textual */
.mp-swap-group-toggle-muted {
  opacity: 0.5;
  cursor: not-allowed;
}
.mp-swap-group-toggle-muted input { cursor: not-allowed; }

/* Highlight do termo buscado no nome do alimento */
.mp-swap-hl {
  background: #fef08a;     /* yellow-200 */
  color: inherit;
  padding: 0 2px;
  border-radius: 2px;
  font-weight: 700;
}

/* === Quantidade na lista de sugestões (somente leitura) ===
   Antes era um input editável grande com borda; agora é texto discreto.
   A edição da quantidade acontece apenas na mini-lista do rodapé, depois
   que o usuário selecionou o item. Aqui na lista, foco é "escolher". */
.mp-swap-qty-readonly {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  font-variant-numeric: tabular-nums;
  color: var(--mp-text, #111827);
  white-space: nowrap;
}
.mp-swap-qty-readonly strong {
  font-size: 13px;
  font-weight: 700;
  color: var(--mp-kcal, #10b981);
}
.mp-swap-qty-readonly small {
  font-size: 11px;
  font-weight: 500;
  color: var(--mp-muted, #6b7280);
}
.mp-swap-qty-readonly .mp-swap-qty-grams {
  color: var(--mp-muted, #9ca3af);
}
/* Marca "editado" sutil: número em âmbar quando o usuário sobrescreveu */
.mp-swap-qty-edited strong { color: #b45309; }  /* amber-700 */

/* === Input de gramatura editável (só rodapé) === */
.mp-swap-grams-input {
  width: 44px;
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 700;
  color: var(--mp-kcal, #10b981);
  text-align: right;
  font-variant-numeric: tabular-nums;
  outline: none;
  padding: 0;
  /* esconde os spinners do type="number" */
  -moz-appearance: textfield;
  appearance: textfield;
}
.mp-swap-grams-input::-webkit-outer-spin-button,
.mp-swap-grams-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* No rodapé: prévia do selecionado — input maior, mais destacado */
.mp-swap-selection-grams {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px 8px 3px 6px;
  border: 1px solid var(--mp-kcal, #10b981);
  border-radius: 6px;
  background: #fff;
  margin-right: 2px;
  cursor: text;
}
.mp-swap-selection-grams:focus-within {
  box-shadow: 0 0 0 2px rgba(16,185,129,.25);
}
.mp-swap-selection-grams-input {
  width: 52px;
  font-size: 14px;
  font-weight: 800;
}
.mp-swap-selection-grams > span {
  font-size: 12px;
  color: var(--mp-kcal, #10b981);
  font-weight: 700;
}

/* Badge "editado" — quando o usuário sobrescreveu a gramatura sugerida */
.mp-swap-edited {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 2px 6px;
  border-radius: 4px;
  background: #fef3c7;     /* amber-100 */
  color: #92400e;          /* amber-800 */
  margin-left: 4px;
}

/* (Removidas) As regras globais antigas de .mp-food-alt-grams-input,
   .mp-food-alt-measure-label e .mp-food-alt-grams-note viviam aqui.
   Foram substituídas pelas versões escopadas em
   .mp-meal-food-sub-qty .mp-food-alt-grams-input (linha ~7660), que
   alinham com o input de quantidade do alimento PAI.
   Especificamente: `field-sizing: content` + `text-align: center` da
   regra antiga colidiam com `width: 32px` + `text-align: right` da
   nova, deixando o "3" descentralizado dentro do focus ring. */
.mp-swap-grams-note {
  margin-left: 4px;
  font-size: 10px;
  color: var(--mp-muted, #6b7280);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  align-self: center;
}

.mp-swap-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.mp-swap-title strong {
  font-size: 13px;
  color: var(--mp-text, #111827);
}
.mp-swap-title span {
  font-size: 12px;
  color: var(--mp-muted, #6b7280);
}
.mp-swap-close {
  background: transparent;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  color: var(--mp-muted, #6b7280);
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
}
.mp-swap-close:hover { background: #f3f4f6; color: var(--mp-text, #111827); }

.mp-swap-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--mp-border, #e5e7eb);
  background: #f9fafb;
}
.mp-swap-macro-toggle {
  display: inline-flex;
  background: #fff;
  border: 1px solid var(--mp-border, #e5e7eb);
  border-radius: 8px;
  overflow: hidden;
  width: fit-content;
}
.mp-swap-macro-toggle button {
  background: transparent;
  border: none;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--mp-muted, #6b7280);
  cursor: pointer;
  border-right: 1px solid var(--mp-border, #e5e7eb);
}
.mp-swap-macro-toggle button:last-child { border-right: none; }
.mp-swap-macro-toggle button:hover { background: #f3f4f6; color: var(--mp-text, #111827); }
.mp-swap-macro-toggle button.active {
  background: var(--mp-kcal, #10b981);
  color: #fff;
}

.mp-swap-group-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--mp-text, #111827);
  cursor: pointer;
}
.mp-swap-group-toggle input { accent-color: var(--mp-kcal, #10b981); }

.mp-swap-context {
  padding: 8px 16px;
  background: var(--mp-kcal-soft, #ecfdf5);
  border-bottom: 1px solid var(--mp-border, #e5e7eb);
  font-size: 11px;
  color: var(--mp-text, #111827);
}
.mp-swap-context strong { font-weight: 600; }
.mp-swap-context em { color: var(--mp-muted, #6b7280); font-style: normal; }

.mp-swap-results {
  list-style: none;
  margin: 0;
  padding: 4px 0;
  overflow-y: auto;
  flex: 1;
  min-height: 0;   /* permite encolher dentro do flex column */
}
.mp-swap-empty {
  padding: 22px 16px;
  text-align: center;
  font-size: 12px;
  color: var(--mp-muted, #6b7280);
}
.mp-swap-item {
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-left: 3px solid transparent;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease;
}
.mp-swap-item:hover { background: #f9fafb; }
.mp-swap-item.selected {
  background: var(--mp-kcal-soft, #ecfdf5);
  border-left-color: var(--mp-kcal, #10b981);
}

/* Coluna do check: vazia por padrão (círculo discreto); preenchida e verde quando selecionado */
.mp-swap-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--mp-border, #e5e7eb);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  transition: background-color .15s ease, border-color .15s ease;
}
.mp-swap-check svg {
  width: 14px;
  height: 14px;
  fill: #fff;
  opacity: 0;
  transition: opacity .15s ease;
}
.mp-swap-item.selected .mp-swap-check {
  background: var(--mp-kcal, #10b981);
  border-color: var(--mp-kcal, #10b981);
}
.mp-swap-item.selected .mp-swap-check svg {
  opacity: 1;
}

.mp-swap-item-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.mp-swap-item-used {
  opacity: 0.6;
}
.mp-swap-item-main {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.mp-swap-item-main strong {
  font-size: 13px;
  color: var(--mp-text, #111827);
}
.mp-swap-group-tag {
  font-size: 10px;
  padding: 2px 6px;
  background: #f3f4f6;
  border-radius: 4px;
  color: var(--mp-muted, #6b7280);
  text-transform: uppercase;
  letter-spacing: .03em;
}
.mp-swap-already {
  font-size: 10px;
  padding: 2px 6px;
  background: #fef3c7;
  color: #92400e;
  border-radius: 4px;
}
.mp-swap-item-numbers {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: var(--mp-muted, #6b7280);
  font-variant-numeric: tabular-nums;
}
.mp-swap-item-numbers strong {
  color: var(--mp-text, #111827);
  font-weight: 600;
}
.mp-swap-grams strong {
  color: var(--mp-kcal, #10b981);
  font-size: 13px;
}
.mp-swap-item-numbers .mp-delta {
  margin-left: 2px;
  font-weight: 500;
}

/* Deltas codificados por cor */
.mp-swap-item.mp-delta-good .mp-delta { color: #10b981; }
.mp-swap-item.mp-delta-warn .mp-delta { color: #d97706; }
.mp-swap-item.mp-delta-bad  .mp-delta { color: #dc2626; }

/* Badge de similaridade nutricional (match %) */
.mp-swap-item-numbers .mp-swap-match {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  font-weight: 700;
  margin-left: auto;
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 11px;
}
.mp-swap-item-numbers .mp-swap-match small {
  font-size: 8px;
  font-weight: 600;
  opacity: .7;
  text-transform: uppercase;
}
.mp-swap-match.mp-match-good { background: #ecfdf5; color: #059669; }
.mp-swap-match.mp-match-ok   { background: #fef9c3; color: #a16207; }
.mp-swap-match.mp-match-low  { background: #fef2f2; color: #b91c1c; }

/* Tags de contexto (relacionado / catálogo / sem dados) */
.mp-swap-tag {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  letter-spacing: .02em;
}
.mp-swap-tag-related  { background: #e0e7ff; color: #4338ca; }
.mp-swap-tag-catalog  { background: #fce7f3; color: #be185d; }
.mp-swap-tag-nodata   { background: #f1f5f9; color: #475569; }

/* Banner informativo de contexto (auto-expand / sem dados) */
.mp-swap-info {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 8px 12px 0;
  padding: 8px 10px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  font-size: 11px;
  line-height: 1.4;
  color: #1e40af;
}
.mp-swap-info svg { width: 16px; height: 16px; flex: 0 0 16px; margin-top: 1px; fill: currentColor; }
.mp-swap-info strong { color: #1e3a8a; }

/* Permite quebra da linha de números em telas estreitas */
.mp-swap-item-numbers { flex-wrap: wrap; }

/* Botão "mostrar mais" no fim da lista */
.mp-swap-more {
  padding: 8px 16px;
  list-style: none;
  border-top: 1px dashed var(--mp-border, #e5e7eb);
  margin-top: 4px;
}
.mp-swap-more button {
  width: 100%;
  padding: 8px 12px;
  background: transparent;
  border: 1px solid var(--mp-border, #e5e7eb);
  border-radius: 8px;
  color: var(--mp-kcal, #10b981);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease;
}
.mp-swap-more button:hover {
  background: var(--mp-kcal-soft, #ecfdf5);
  border-color: var(--mp-kcal, #10b981);
}
.mp-swap-more button small {
  font-weight: 400;
  color: var(--mp-muted, #6b7280);
  margin-left: 4px;
}

.mp-swap-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 16px;
  border-top: 1px solid var(--mp-border, #e5e7eb);
  background: #fff;
}
/* Quando há item(ns) selecionado(s), o footer cresce e mostra mini-lista
   de seleção + botão de confirmar */
.mp-swap-footer-has-selection {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding: 10px 12px 14px;
  background: var(--mp-kcal-soft, #ecfdf5);
  border-top: 1px solid var(--mp-kcal, #10b981);
}
.mp-swap-selection-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.mp-swap-selection-title {
  display: flex;
  align-items: center;
  gap: 8px;
}
.mp-swap-selection-title small {
  font-size: 11px;
  color: var(--mp-muted, #6b7280);
}
.mp-swap-selection-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 3px 9px;
  border-radius: 9999px;
  background: var(--mp-kcal, #10b981);
  color: #fff;
}

/* Mini-lista scrollável de itens selecionados */
.mp-swap-preview-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 180px;
  overflow-y: auto;
  padding: 2px;
  background: #fff;
  border: 1px solid var(--mp-border, #e5e7eb);
  border-radius: 8px;
}
.mp-swap-preview-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 12px;
  transition: background-color .12s ease;
}
.mp-swap-preview-item + .mp-swap-preview-item {
  border-top: 1px dashed var(--mp-border, #e5e7eb);
}
.mp-swap-preview-item:hover { background: #f9fafb; }
.mp-swap-preview-already { opacity: 0.5; }
.mp-swap-preview-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.mp-swap-preview-main strong {
  font-size: 12px;
  color: var(--mp-text, #111827);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mp-swap-preview-nums {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--mp-muted, #6b7280);
  font-variant-numeric: tabular-nums;
}
.mp-swap-preview-nums .mp-delta {
  font-weight: 600;
}
.mp-swap-preview-item.mp-delta-good .mp-delta { color: #10b981; }
.mp-swap-preview-item.mp-delta-warn .mp-delta { color: #d97706; }
.mp-swap-preview-item.mp-delta-bad  .mp-delta { color: #dc2626; }

.mp-swap-preview-remove {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--mp-muted, #6b7280);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.mp-swap-preview-remove:hover {
  background: #fee2e2;
  color: #dc2626;
}

.mp-swap-footer-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.mp-swap-clear-selection {
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--mp-border, #e5e7eb);
  background: #fff;
  color: var(--mp-text, #111827);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color .15s ease;
}
.mp-swap-clear-selection:hover { background: #f3f4f6; }

.mp-swap-hint {
  font-size: 11px;
  color: var(--mp-muted, #6b7280);
}
.mp-swap-add-selected {
  padding: 8px 14px;
  border-radius: 8px;
  border: none;
  background: var(--mp-kcal, #10b981);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color .15s ease, opacity .15s ease;
}
.mp-swap-add-selected:hover { background: #059669; }
.mp-swap-add-selected:disabled {
  background: #d1d5db;
  cursor: not-allowed;
  opacity: 0.7;
}

@media (max-width: 720px) {
  .mp-swap-overlay {
    padding: 12px;
  }
  .mp-swap-popover {
    max-width: 100%;
    max-height: 92vh;
  }
  .mp-food-alternatives {
    margin-left: 12px;
    padding-left: 10px;
  }
  .mp-food-alt-row {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
  }
  .mp-food-alt-numbers {
    grid-column: 1 / -1;
  }
}

/* ============================================================
   DASHBOARD — Liquid Glass (Fase 1)
   Aurora orbs + panels translúcidos + tipografia Apple. Todos
   os seletores são scopados via #dashboard-view ou via
   body:has(#dashboard-view:not(.hidden)) para não afetar outras
   telas. Mesma receita do plano alimentar (--glass-bg,
   --glass-border-soft, --glass-highlight, inset highlight, sem
   drop-shadow pesado).
   ============================================================ */

/* --- Aurora background do dashboard (mint + lavender + coral) --- */
body:has(#dashboard-view:not(.hidden)) {
  position: relative;
  overflow-x: hidden;
  background: linear-gradient(180deg, #fdfcff 0%, #f5f3fa 35%, #f0f7f4 100%);
}

body:has(#dashboard-view:not(.hidden))::before,
body:has(#dashboard-view:not(.hidden))::after {
  content: "";
  position: fixed;
  pointer-events: none;
  z-index: 0;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
}

body:has(#dashboard-view:not(.hidden))::before {
  /* Mint top-left */
  top: -12%;
  left: -8%;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, #6ee7c7 0%, transparent 70%);
}

body:has(#dashboard-view:not(.hidden))::after {
  /* Lavender top-right */
  top: -8%;
  right: -10%;
  width: 580px;
  height: 580px;
  background: radial-gradient(circle, #c4b5fd 0%, transparent 70%);
}

#dashboard-view .dashboard-aurora-orb-3 {
  /* Coral bottom (div, pois ::before/::after foram usados) */
  position: fixed;
  bottom: -22%;
  left: 28%;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.4;
  background: radial-gradient(circle, #fbcfe8 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* Conteúdo acima dos orbs. */
body:has(#dashboard-view:not(.hidden)) .page-shell {
  position: relative;
  z-index: 1;
}

#dashboard-view {
  position: relative;
}

/* --- HERO com eyebrow Apple --- */
#dashboard-view .hero {
  padding: 6px 4px 18px;
}
#dashboard-view .hero-greeting {
  max-width: 720px;
}
#dashboard-view .hero-greeting h1 {
  margin: 0 0 6px;
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: #0f172a;
  font-weight: 700;
}
#dashboard-view .hero-greeting p {
  margin: 0;
  color: #64748b;
  font-size: 15px;
}

/* --- WORKSPACE: margens mais enxutas --- */
#dashboard-view {
  padding-top: 12px;
}
#dashboard-view .workspace-grid {
  gap: 16px;
}
#dashboard-view .dashboard-side {
  gap: 14px;
}

/* --- PANEL base (glass) --- */
#dashboard-view .panel {
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border-soft);
  border-radius: 24px;
  box-shadow: var(--glass-shadow);
  position: relative;
  overflow: hidden;
}
#dashboard-view .panel::before {
  /* Linha de luz superior (highlight Apple). */
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.85) 50%,
    transparent 100%);
  pointer-events: none;
}
#dashboard-view .large-panel {
  padding: 14px 14px 16px;
}
#dashboard-view .side-panel {
  padding: 16px 18px 14px;
}

/* --- PANEL HEADING --- */
#dashboard-view .panel-heading {
  margin-bottom: 14px;
  gap: 10px;
}
#dashboard-view .panel-heading-main {
  gap: 10px;
}
#dashboard-view .panel-heading h2 {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #0f172a;
}
#dashboard-view .panel-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.4);
}
#dashboard-view .panel-icon.mint,
#dashboard-view .panel-icon.teal {
  background: var(--mp-accent-soft, rgba(16, 185, 129, 0.10));
  color: var(--mp-accent);
}
#dashboard-view .panel-icon svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* --- SIDE PANEL ADD BUTTON (Novo agendamento, ＋) --- */
#dashboard-view .side-panel-add-button {
  width: 30px;
  height: 30px;
  background: linear-gradient(180deg, #34d399 0%, #10b981 100%);
  box-shadow: 0 4px 10px -2px rgba(16, 185, 129, 0.45),
              inset 0 1px 0 0 rgba(255, 255, 255, 0.4);
}
#dashboard-view .side-panel-add-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px -2px rgba(16, 185, 129, 0.55),
              inset 0 1px 0 0 rgba(255, 255, 255, 0.45);
  filter: none;
}
#dashboard-view .side-panel-add-button svg {
  width: 14px;
  height: 14px;
}

/* --- SEARCHBAR (glass) --- */
#dashboard-view .searchbar,
#dashboard-view .patient-panel-searchbar {
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border-soft);
  box-shadow: inset 0 1px 0 0 var(--glass-highlight);
  border-radius: 14px;
  padding: 0 14px 0 12px;
  overflow: hidden;
}
#dashboard-view .patient-panel-searchbar {
  height: 44px;
}
#dashboard-view .searchbar input {
  height: 44px;
  font-size: 13.5px;
  color: #0f172a;
}
#dashboard-view .searchbar input::placeholder {
  color: #94a3b8;
}
#dashboard-view .searchbar .search-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: rgba(16, 185, 129, 0.10);
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.4);
  margin-right: 6px;
}
#dashboard-view .searchbar .search-icon svg {
  width: 15px;
  height: 15px;
  fill: var(--mp-accent);
}

/* --- SEARCHBAR ACTION BUTTON (Aniversariantes) --- */
#dashboard-view .searchbar-action-button {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.65);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border-soft);
  box-shadow: inset 0 1px 0 0 var(--glass-highlight),
              0 2px 6px -1px rgba(15, 23, 42, 0.04);
  color: #64748b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

#dashboard-view .searchbar-action-button .sort-birthday-icon {
  width: 20px;
  height: 20px;
  transition: transform 0.18s ease;
}

#dashboard-view .searchbar-action-button:hover {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(244, 114, 182, 0.45);
  color: #ec4899;
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 0 #ffffff,
              0 4px 14px -2px rgba(236, 72, 153, 0.22);
}

#dashboard-view .searchbar-action-button:hover .sort-birthday-icon {
  transform: scale(1.08) rotate(-3deg);
}

#dashboard-view .searchbar-action-button[aria-pressed="true"],
#dashboard-view .searchbar-action-button.searchbar-action-button-active {
  background: linear-gradient(135deg, rgba(253, 232, 240, 0.95) 0%, rgba(251, 207, 232, 0.75) 100%);
  border-color: rgba(244, 114, 182, 0.65);
  color: #be185d;
  box-shadow: inset 0 1px 0 0 #ffffff,
              0 4px 14px -2px rgba(219, 39, 119, 0.28);
}

#dashboard-view .searchbar-action-button[aria-pressed="true"] .sort-birthday-icon,
#dashboard-view .searchbar-action-button.searchbar-action-button-active .sort-birthday-icon {
  transform: scale(1.05);
}

/* --- QUICK ACTION BUTTON (Novo Paciente) --- */
#dashboard-view .quick-action-button {
  min-width: auto;
  padding: 6px 14px 6px 6px;
  border-radius: 999px;
  border: 1px solid var(--glass-border-soft);
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: inset 0 1px 0 0 var(--glass-highlight);
  color: #0f172a;
  gap: 10px;
  height: 44px;
}
#dashboard-view .quick-action-button:hover {
  background: var(--glass-bg-strong);
  border-color: var(--glass-border-soft);
}
#dashboard-view .quick-action-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  margin-left: 0;
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.4);
}
#dashboard-view .quick-action-icon-green {
  background: linear-gradient(180deg, #34d399 0%, #10b981 100%);
  color: #fff;
  box-shadow: 0 4px 10px -2px rgba(16, 185, 129, 0.45),
              inset 0 1px 0 0 rgba(255, 255, 255, 0.4);
}
#dashboard-view .quick-action-icon svg {
  width: 14px;
  height: 14px;
}
#dashboard-view .quick-action-copy strong {
  font-size: 13.5px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.005em;
}

/* --- PATIENT PANEL TOOLBAR --- */
#dashboard-view .patient-panel-toolbar {
  gap: 10px;
  margin-bottom: 12px;
}
#dashboard-view .patient-panel-search-group {
  gap: 8px;
}

/* --- PANEL BODY (lista de pacientes) --- */
#dashboard-view .panel-body {
  min-height: 480px;
  max-height: 520px;
  padding-right: 4px;
}

/* --- STATS GRID --- */
#dashboard-view .dashboard-stats-grid {
  gap: 12px;
  margin-bottom: 0;
}
#dashboard-view .stat-summary-card {
  border-radius: 18px !important;
  padding: 12px 14px !important;
  border: 1px solid var(--glass-border-soft);
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-shadow);
  gap: 10px;
}
#dashboard-view .stat-summary-icon {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.4);
}
#dashboard-view .stat-summary-icon svg {
  width: 17px;
  height: 17px;
}
#dashboard-view .stat-summary-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  line-height: 1.2;
}
#dashboard-view .stat-summary-value {
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.01em;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

/* --- PATIENT CARD (lista) --- */
#dashboard-view .patient-card {
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 16px;
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.6);
  transition: background 0.18s var(--mp-ease), transform 0.18s var(--mp-ease);
}
#dashboard-view .patient-card:hover {
  background: var(--glass-bg-strong);
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.7),
              0 4px 12px -4px rgba(15, 23, 42, 0.12);
}

/* --- BOTÃO ATENDIMENTO (.btn-main-sm dentro do card) --- */
#dashboard-view .btn-main-sm {
  background: linear-gradient(180deg, #34d399 0%, #10b981 100%);
  color: #fff;
  padding: 7px 14px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: -0.005em;
  border: 0;
  box-shadow: 0 4px 10px -2px rgba(16, 185, 129, 0.35),
              inset 0 1px 0 0 rgba(255, 255, 255, 0.4);
  opacity: 0.88;
  transition: opacity 0.18s var(--mp-ease),
              box-shadow 0.18s var(--mp-ease),
              transform 0.18s var(--mp-ease);
}
#dashboard-view .patient-card:hover .btn-main-sm {
  opacity: 1;
  box-shadow: 0 6px 14px -2px rgba(16, 185, 129, 0.45),
              inset 0 1px 0 0 rgba(255, 255, 255, 0.45);
}
#dashboard-view .btn-main-sm:hover {
  transform: translateY(-1px);
}

/* --- APPOINTMENTS list height ajuste --- */
#dashboard-view .appointments-list {
  height: auto;
  max-height: 280px;
  padding-right: 4px;
}
#dashboard-view .appointment-card-premium {
  border-bottom: 1px dashed rgba(15, 23, 42, 0.08);
}
#dashboard-view .appointment-card-premium:hover {
  background-color: rgba(255, 255, 255, 0.35);
}

/* --- page-shell mais enxuta quando dashboard ativo --- */
body:has(#dashboard-view:not(.hidden)) .page-shell {
  padding: 18px 8px 56px;
}


/* ============================================================
   ✦ LIQUID GLASS — AGENDA VIEW
   Mesma estética Apple do dashboard/care: aurora background,
   panels translúcidos, cards glass, botões e pílulas refinadas.
   Escopado em #agenda-view e body:has(#agenda-view:not(.hidden))
   pra não vazar pra outras telas.
   ============================================================ */

/* --- Aurora background (3 orbs) — idêntico ao financeiro e pré-consulta --- */
body:has(#agenda-view:not(.hidden)) {
  background: linear-gradient(180deg, #fdfcff 0%, #f5f3fa 35%, #f0f7f4 100%);
  position: relative;
  overflow-x: hidden;
}
body:has(#agenda-view:not(.hidden))::before,
body:has(#agenda-view:not(.hidden))::after {
  content: "";
  position: fixed;
  pointer-events: none;
  z-index: 0;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
}
body:has(#agenda-view:not(.hidden))::before {
  top: -12%;
  left: -8%;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, #6ee7c7 0%, transparent 70%);
}
body:has(#agenda-view:not(.hidden))::after {
  top: -8%;
  right: -10%;
  width: 580px;
  height: 580px;
  background: radial-gradient(circle, #c4b5fd 0%, transparent 70%);
}
#agenda-view .agenda-aurora-orb-3 {
  position: fixed;
  bottom: -22%;
  left: 28%;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.4;
  background: radial-gradient(circle, #fbcfe8 0%, transparent 70%);
  pointer-events: none;
}
#agenda-view { position: relative; z-index: 1; }

/* --- page-shell mais enxuta quando agenda ativa --- */
body:has(#agenda-view:not(.hidden)) .page-shell {
  position: relative;
  z-index: 1;
  padding: 18px 8px 56px;
}

/* --- Panels (sidebar + main) — Liquid Glass containers --- */
#agenda-view .panel.agenda-sidebar,
#agenda-view .panel.agenda-panel {
  background: rgba(255, 255, 255, 0.62);
  -webkit-backdrop-filter: saturate(140%) blur(20px);
  backdrop-filter: saturate(140%) blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 22px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset,
              0 10px 24px -10px rgba(40, 30, 60, 0.14),
              0 2px 6px -2px rgba(40, 30, 60, 0.06);
  padding: 18px;
  position: relative;
  overflow: hidden;
}
/* Linha de luz superior (highlight Apple) */
#agenda-view .panel.agenda-sidebar::before,
#agenda-view .panel.agenda-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.85), transparent);
  pointer-events: none;
}

/* O grid-shell precisa permitir overflow visual mas o panel já clipa */
#agenda-view .agenda-grid-shell {
  overflow: auto;
}

/* --- CTA "Agendar Compromisso" — pílula gradient verde --- */
#agenda-view .agenda-sidebar-create-button {
  background: linear-gradient(180deg, #34d399 0%, #10b981 100%);
  border-radius: 14px;
  height: 40px;
  box-shadow: 0 6px 16px -4px rgba(16, 185, 129, 0.45),
              inset 0 1px 0 0 rgba(255, 255, 255, 0.4);
  transition: opacity 0.18s var(--mp-ease, cubic-bezier(0.16, 1, 0.3, 1)),
              transform 0.18s var(--mp-ease, cubic-bezier(0.16, 1, 0.3, 1)),
              box-shadow 0.18s var(--mp-ease, cubic-bezier(0.16, 1, 0.3, 1));
}
#agenda-view .agenda-sidebar-create-button:hover {
  box-shadow: 0 8px 18px -2px rgba(16, 185, 129, 0.50),
              inset 0 1px 0 0 rgba(255, 255, 255, 0.45);
  transform: translateY(-1px);
}

/* --- Toolbar buttons (prev/next/today/view-switch) --- */
#agenda-view .agenda-toolbar strong {
  font-weight: 700;
  letter-spacing: -0.015em;
  color: #0f172a;
}

#agenda-view .agenda-toolbar-nav .ghost-button {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.6);
}
#agenda-view .agenda-toolbar-nav .ghost-button:hover {
  background: rgba(255, 255, 255, 0.85);
  color: #0f172a;
}
#agenda-view .agenda-toolbar-nav .primary-button {
  background: linear-gradient(180deg, #34d399 0%, #10b981 100%);
  border-radius: 12px;
  border: 0;
  height: 38px;
  font-weight: 700;
  letter-spacing: -0.005em;
  box-shadow: 0 4px 10px -2px rgba(16, 185, 129, 0.40),
              inset 0 1px 0 0 rgba(255, 255, 255, 0.4);
}

/* View switch (Mês/Semana/Dia) — pílula segmentada glass */
#agenda-view .agenda-view-switch {
  padding: 4px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.6);
  gap: 2px;
}
#agenda-view .agenda-view-button {
  height: 32px;
  border-radius: 10px;
  padding: 0 14px;
  color: #64748b;
  font-weight: 600;
  font-size: 13px;
  transition: background 0.18s var(--mp-ease, cubic-bezier(0.16, 1, 0.3, 1)),
              color 0.18s var(--mp-ease, cubic-bezier(0.16, 1, 0.3, 1));
}
#agenda-view .agenda-view-button:hover {
  background: rgba(15, 23, 42, 0.04);
  color: #0f172a;
}
#agenda-view .agenda-view-button.agenda-view-active {
  background: rgba(255, 255, 255, 0.95);
  color: #0f172a;
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.9),
              0 2px 6px -2px rgba(40, 30, 60, 0.12);
}

/* --- Mini calendar (sidebar) — glass sutil + cell rounded --- */
#agenda-view .agenda-mini-calendar {
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.6);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  backdrop-filter: saturate(140%) blur(10px);
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.7);
}

/* --- Legenda — chips suaves --- */
#agenda-view .agenda-legend {
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.6);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  backdrop-filter: saturate(140%) blur(10px);
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.7);
}
#agenda-view .agenda-legend-swatch {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.6),
              0 1px 3px -1px rgba(15, 23, 42, 0.15);
}

/* --- Appointment cards (lista timeline) --- */
#agenda-view .appointment-card-premium {
  border-radius: 14px;
  border-bottom: 1px dashed rgba(15, 23, 42, 0.08);
  margin: 2px 0;
  transition: background 0.18s var(--mp-ease, cubic-bezier(0.16, 1, 0.3, 1)),
              box-shadow 0.18s var(--mp-ease, cubic-bezier(0.16, 1, 0.3, 1));
}
#agenda-view .appointment-card-premium:hover {
  background: rgba(255, 255, 255, 0.55);
  border-radius: 14px;
  margin-right: 0;
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.6),
              0 4px 10px -4px rgba(40, 30, 60, 0.10);
}

/* --- Month grid cells — Liquid Glass cards --- */
#agenda-view .agenda-month-day {
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.62);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  backdrop-filter: saturate(140%) blur(14px);
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.7),
              0 4px 10px -6px rgba(40, 30, 60, 0.08);
}
#agenda-view .agenda-month-day:hover {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(255, 255, 255, 0.85);
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.8),
              0 8px 18px -8px rgba(40, 30, 60, 0.15);
}
#agenda-view .agenda-month-day-today {
  border: 1px solid rgba(16, 185, 129, 0.45);
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.7),
              0 0 0 3px rgba(16, 185, 129, 0.10),
              0 4px 10px -6px rgba(16, 185, 129, 0.20);
}
#agenda-view .agenda-month-day-add {
  background: linear-gradient(180deg, #34d399 0%, #10b981 100%);
  box-shadow: 0 4px 10px -2px rgba(16, 185, 129, 0.40),
              inset 0 1px 0 0 rgba(255, 255, 255, 0.4);
}

/* --- Timeline events (semana/dia) — sombra mais suave + inset highlight --- */
#agenda-view .agenda-hero {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: 22px 28px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.65);
  -webkit-backdrop-filter: saturate(160%) blur(20px);
  backdrop-filter: saturate(160%) blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8),
              0 10px 28px -12px rgba(15, 23, 42, 0.08),
              0 2px 6px -2px rgba(15, 23, 42, 0.04);
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}
#agenda-view .agenda-hero::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.9), transparent);
  pointer-events: none;
}
#agenda-view .agenda-hero-title {
  display: grid;
  gap: 4px;
  min-width: 0;
}
#agenda-view .agenda-hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #059669;
}
#agenda-view .agenda-hero-eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}
#agenda-view .agenda-hero-month {
  margin: 0;
  font-size: 48px;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.1;
  color: #0f172a;
}
#agenda-view .agenda-hero-subtitle {
  font-size: 13.5px;
  color: #64748b;
  font-weight: 500;
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
#agenda-view .agenda-hero-subtitle strong {
  color: #0f172a;
  font-weight: 700;
}
#agenda-view .agenda-hero-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
#agenda-view .agenda-range-label-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  border: 0;
}

/* Pílula de nav prev/today/next */
#agenda-view .agenda-nav {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}
#agenda-view .agenda-nav-button {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  border-radius: 8px;
  color: #64748b;
  cursor: pointer;
  padding: 0;
  transition: all 0.18s ease;
}
#agenda-view .agenda-nav-button:hover {
  background: rgba(15, 23, 42, 0.06);
  color: #0f172a;
}
#agenda-view .agenda-nav-button svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}
#agenda-view .agenda-today-pill {
  height: 32px;
  padding: 0 14px;
  border: 0;
  background: rgba(255, 255, 255, 0.95);
  color: #0f172a;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9),
              0 2px 4px -1px rgba(15, 23, 42, 0.08);
  transition: transform 0.18s ease, background 0.18s ease;
}
#agenda-view .agenda-today-pill:hover {
  background: #ffffff;
  transform: translateY(-1px);
}

/* CTA Agendar (verde gradient) */
#agenda-view .agenda-cta {
  height: 40px;
  padding: 0 18px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(180deg, #34d399 0%, #10b981 100%);
  color: #fff;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: -0.005em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 6px 16px -4px rgba(16, 185, 129, 0.45),
              inset 0 1px 0 0 rgba(255, 255, 255, 0.4);
  transition: transform 0.18s var(--mp-ease, cubic-bezier(0.16, 1, 0.3, 1)),
              box-shadow 0.18s var(--mp-ease, cubic-bezier(0.16, 1, 0.3, 1));
}
#agenda-view .agenda-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px -4px rgba(16, 185, 129, 0.55),
              inset 0 1px 0 0 rgba(255, 255, 255, 0.45);
}
#agenda-view .agenda-cta svg {
  width: 14px; height: 14px;
  fill: currentColor;
}

@media (max-width: 640px) {
  #agenda-view .agenda-hero {
    flex-direction: column;
    align-items: flex-start;
    padding: 18px 20px;
  }
  #agenda-view .agenda-hero-month { font-size: 34px; }
}

/* ---- FASE 2: SIDEBAR (mantém mini-calendar + legenda dots) - */
#agenda-view .agenda-sidebar.panel {
  padding: 16px;
  gap: 14px;
  display: flex;
  flex-direction: column;
}
#agenda-view .agenda-legend-dots {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
}
#agenda-view .agenda-legend-dots .agenda-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  color: #475569;
}
#agenda-view .agenda-legend-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
#agenda-view .agenda-legend-dot.agenda-legend-consulta {
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
}
#agenda-view .agenda-legend-dot.agenda-legend-retorno {
  background: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}
#agenda-view .agenda-legend-dot.agenda-legend-bloqueio {
  background: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18);
}
#agenda-view .agenda-legend-dot.agenda-legend-compromisso {
  background: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18);
}

/* ---- FASE 4.2: MONTH CHIPS (dot + hora + nome) ------------- */
#agenda-view .agenda-month-day {
  --month-cell-pad: 8px;
  padding: var(--month-cell-pad);
  min-height: 110px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
#agenda-view .agenda-month-day-chips {
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow: hidden;
  flex: 1;
}
#agenda-view .agenda-month-chip {
  --chip-color: #10b981;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 8px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--chip-color) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--chip-color) 20%, transparent);
  color: #0f172a;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
  cursor: grab;
  overflow: hidden;
  white-space: nowrap;
  transition: transform 0.15s var(--mp-ease, cubic-bezier(0.16, 1, 0.3, 1)),
              box-shadow 0.15s var(--mp-ease, cubic-bezier(0.16, 1, 0.3, 1));
}
#agenda-view .agenda-month-chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px -3px color-mix(in srgb, var(--chip-color) 30%, transparent);
}
#agenda-view .agenda-month-chip:active { cursor: grabbing; }
#agenda-view .agenda-month-chip::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--chip-color);
  flex-shrink: 0;
}
#agenda-view .agenda-month-chip .agenda-month-chip-time {
  color: var(--chip-color);
  font-weight: 700;
  flex-shrink: 0;
}
#agenda-view .agenda-month-chip .agenda-month-chip-name {
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
#agenda-view .agenda-month-chip.agenda-event-consulta { --chip-color: #10b981; }
#agenda-view .agenda-month-chip.agenda-event-retorno { --chip-color: #3b82f6; }
#agenda-view .agenda-month-chip.agenda-event-bloqueio,
#agenda-view .agenda-month-chip.agenda-event-block { --chip-color: #ef4444; }
#agenda-view .agenda-month-chip.agenda-event-compromisso { --chip-color: #f59e0b; }

#agenda-view .agenda-month-chip-more {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(15, 23, 42, 0.08);
  color: #64748b;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 1px;
  width: fit-content;
}
#agenda-view .agenda-month-chip-more:hover {
  background: rgba(15, 23, 42, 0.10);
  color: #0f172a;
}

/* Hoje: número em pílula gradient verde */
#agenda-view .agenda-month-day-today .agenda-month-day-number {
  display: inline-grid;
  place-items: center;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: linear-gradient(180deg, #34d399 0%, #10b981 100%);
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  box-shadow: 0 3px 8px -2px rgba(16, 185, 129, 0.45);
}

/* Drop target (drag entre dias) */
#agenda-view .agenda-month-day.agenda-month-day-drop-target {
  border: 2px dashed rgba(16, 185, 129, 0.55) !important;
  background: rgba(16, 185, 129, 0.06) !important;
}

/* ---- FASE 4.2: POPOVER "Ver todos do dia" ------------------ */
#agenda-view .agenda-month-popover {
  position: fixed;
  z-index: 60;
  width: 280px;
  padding: 14px 14px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  backdrop-filter: saturate(180%) blur(22px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 18px 40px -10px rgba(40, 30, 60, 0.30),
              0 6px 14px -4px rgba(40, 30, 60, 0.18),
              inset 0 1px 0 0 rgba(255, 255, 255, 0.85);
  animation: agendaPopIn 0.18s var(--mp-ease, cubic-bezier(0.16, 1, 0.3, 1));
}
@keyframes agendaPopIn {
  from { opacity: 0; transform: translateY(-4px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
#agenda-view .agenda-month-popover-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}
#agenda-view .agenda-month-popover-title {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  text-transform: capitalize;
}
#agenda-view .agenda-month-popover-subtitle {
  font-size: 11px;
  font-weight: 600;
  color: #10b981;
}
#agenda-view .agenda-month-popover-close {
  border: 0;
  background: transparent;
  cursor: pointer;
  width: 24px; height: 24px;
  display: grid; place-items: center;
  border-radius: 8px;
  color: #64748b;
}
#agenda-view .agenda-month-popover-close:hover {
  background: rgba(15, 23, 42, 0.06);
  color: #0f172a;
}
#agenda-view .agenda-month-popover-close svg { width: 14px; height: 14px; fill: currentColor; }
#agenda-view .agenda-month-popover-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 280px;
  overflow-y: auto;
}
#agenda-view .agenda-month-popover-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s var(--mp-ease, cubic-bezier(0.16, 1, 0.3, 1));
  border: 0;
  background: transparent;
  text-align: left;
  width: 100%;
  font-family: inherit;
}
#agenda-view .agenda-month-popover-item:hover {
  background: rgba(15, 23, 42, 0.04);
}
#agenda-view .agenda-month-popover-item-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
#agenda-view .agenda-month-popover-item-time {
  font-size: 12px;
  font-weight: 700;
  color: var(--chip-color, #10b981);
  width: 44px;
  flex-shrink: 0;
}
#agenda-view .agenda-month-popover-item-name {
  font-size: 13px;
  font-weight: 500;
  color: #0f172a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

/* ---- FASE 3: TIMELINE — events Liquid Glass aprimorados ---- */
#agenda-view .agenda-event {
  --ev-color: #10b981;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--ev-color) 30%, transparent);
  background: color-mix(in srgb, var(--ev-color) 12%, rgba(255,255,255,0.85));
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: 0 6px 14px -4px rgba(40, 30, 60, 0.18),
              inset 0 1px 0 0 rgba(255, 255, 255, 0.5);
  position: absolute;
  overflow: hidden;
  padding: 8px 10px;
  color: #0f172a;
  cursor: pointer;
  transition: transform 0.15s var(--mp-ease, cubic-bezier(0.16, 1, 0.3, 1)),
              box-shadow 0.15s var(--mp-ease, cubic-bezier(0.16, 1, 0.3, 1));
}
#agenda-view .agenda-event::before {
  content: none;
}
#agenda-view .agenda-event:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px -6px rgba(40, 30, 60, 0.25),
              inset 0 1px 0 0 rgba(255, 255, 255, 0.55);
}
#agenda-view .agenda-event.agenda-event-consulta { --ev-color: #10b981; }
#agenda-view .agenda-event.agenda-event-retorno { --ev-color: #3b82f6; }
#agenda-view .agenda-event.agenda-event-bloqueio,
#agenda-view .agenda-event.agenda-event-block { --ev-color: #ef4444; }
#agenda-view .agenda-event.agenda-event-compromisso { --ev-color: #f59e0b; }
#agenda-view .agenda-event .agenda-event-time {
  color: var(--ev-color);
  font-weight: 700;
  font-size: 11.5px;
  letter-spacing: -0.005em;
}
#agenda-view .agenda-event strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* "Agora" indicator — linha vermelha + pílula */
#agenda-view .agenda-current-time {
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  background: #ef4444;
  z-index: 4;
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.15);
}
#agenda-view .agenda-current-time::before {
  content: "";
  position: absolute;
  left: -4px; top: -4px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.20);
}
#agenda-view .agenda-current-time::after {
  content: attr(data-time);
  position: absolute;
  right: 4px; top: -10px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* ============================================================
   ENERGY EXPENDITURE — LIQUID GLASS
   Espelha a receita do dashboard (mint + lavender + coral
   aurora orbs, painéis translúcidos com inset highlight,
   tipografia Apple). Tudo escopado em #energy-expenditure-view
   ou body:has(#energy-expenditure-view:not(.hidden)) para não
   afetar outras telas. Consome tokens existentes em :root
   (--glass-bg, --glass-blur, --glass-border-soft,
   --glass-highlight, --glass-shadow).
   ============================================================ */

/* --- Aurora background (mint + lavender + coral) --- */
body:has(#energy-expenditure-view:not(.hidden)) {
  position: relative;
  overflow-x: hidden;
  background: linear-gradient(180deg, #fdfcff 0%, #f5f3fa 35%, #f0f7f4 100%);
}

body:has(#energy-expenditure-view:not(.hidden))::before,
body:has(#energy-expenditure-view:not(.hidden))::after {
  content: "";
  position: fixed;
  pointer-events: none;
  z-index: 0;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
}

body:has(#energy-expenditure-view:not(.hidden))::before {
  /* Mint top-left */
  top: -12%;
  left: -8%;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, #6ee7c7 0%, transparent 70%);
}

body:has(#energy-expenditure-view:not(.hidden))::after {
  /* Lavender top-right */
  top: -8%;
  right: -10%;
  width: 580px;
  height: 580px;
  background: radial-gradient(circle, #c4b5fd 0%, transparent 70%);
}

#energy-expenditure-view .energy-aurora-orb-3 {
  /* Coral bottom (div, pois ::before/::after foram usados) */
  position: fixed;
  bottom: -22%;
  left: 28%;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.4;
  background: radial-gradient(circle, #fbcfe8 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* Conteúdo acima dos orbs */
body:has(#energy-expenditure-view:not(.hidden)) .page-shell {
  position: relative;
  z-index: 1;
}

#energy-expenditure-view {
  position: relative;
  z-index: 1;
}

/* --- Painel principal (substitui gradient sólido) --- */
#energy-expenditure-view .energy-expenditure-panel {
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border-soft);
  border-radius: 24px;
  box-shadow: var(--glass-shadow);
  position: relative;
  overflow: hidden;
}

#energy-expenditure-view .energy-expenditure-panel::before {
  /* Linha de luz no topo (signature do dashboard) */
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.85) 50%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 2;
}

/* --- Seções internas (glass + drop shadow suave que destaca do painel) --- */
#energy-expenditure-view .energy-expenditure-section {
  background: rgba(255, 255, 255, 0.55);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  backdrop-filter: saturate(140%) blur(14px);
  border: 1px solid var(--glass-border-soft);
  border-radius: 20px;
  box-shadow: inset 0 1px 0 0 var(--glass-highlight),
              0 8px 24px -6px rgba(15, 23, 42, 0.10);
}

/* Sobrescrever o `background: #fff !important` da seção de resultados */
#energy-expenditure-view .energy-expenditure-section-results {
  background: rgba(255, 255, 255, 0.55) !important;
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  backdrop-filter: saturate(140%) blur(14px);
  border: 1px solid var(--glass-border-soft);
  box-shadow: inset 0 1px 0 0 var(--glass-highlight),
              0 8px 24px -6px rgba(15, 23, 42, 0.10);
}

/* --- Cards de resultado: glass colorido sutil (tint ~10% + borda tintada) --- */
#energy-expenditure-view .energy-result-card {
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: inset 0 1px 0 0 var(--glass-highlight);
  border-radius: 16px;
}

/* TMB — mint */
#energy-expenditure-view .energy-result-card-tmb {
  background: rgba(16, 185, 129, 0.10);
  border: 1px solid rgba(16, 185, 129, 0.22);
}
#energy-expenditure-view .energy-result-card-tmb strong {
  color: #10b981;
}

/* GET — azul */
#energy-expenditure-view .energy-result-card-get {
  background: rgba(37, 99, 235, 0.10);
  border: 1px solid rgba(37, 99, 235, 0.22);
}
#energy-expenditure-view .energy-result-card-get strong {
  color: #2563eb;
}

/* GET (MET) — âmbar */
#energy-expenditure-view .energy-result-card-met {
  background: rgba(245, 158, 11, 0.10);
  border: 1px solid rgba(245, 158, 11, 0.26);
}
#energy-expenditure-view .energy-result-card-met strong {
  color: #f59e0b;
}

/* --- Linhas MET --- */
#energy-expenditure-view .energy-expenditure-grid-met {
  background: rgba(255, 255, 255, 0.45);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  backdrop-filter: saturate(140%) blur(10px);
  border: 1px solid var(--glass-border-soft);
  box-shadow: inset 0 1px 0 0 var(--glass-highlight);
}

#energy-expenditure-view .energy-met-remove-button {
  background: rgba(255, 255, 255, 0.5);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  backdrop-filter: saturate(140%) blur(10px);
  border: 1px solid var(--glass-border-soft);
  box-shadow: inset 0 1px 0 0 var(--glass-highlight);
  color: #8a929c;
}

#energy-expenditure-view .energy-met-remove-button:hover {
  background: rgba(254, 226, 226, 0.65);
  border-color: rgba(211, 92, 92, 0.3);
  color: #d35c5c;
}

/* --- Input de data --- */
#energy-expenditure-view .energy-date-field input {
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border-soft);
  box-shadow: inset 0 1px 0 0 var(--glass-highlight);
}

#energy-expenditure-view .energy-date-field input:focus {
  border-color: rgba(57, 207, 144, 0.55);
  box-shadow: inset 0 1px 0 0 var(--glass-highlight),
              0 0 0 4px rgba(57, 207, 144, 0.14);
}

/* --- Inputs e selects do formulário (glass sutil) --- */
#energy-expenditure-view .field input:not([readonly]):not(.energy-result-highlight),
#energy-expenditure-view .field select {
  background: rgba(255, 255, 255, 0.6);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  backdrop-filter: saturate(140%) blur(10px);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.6);
}

#energy-expenditure-view .field input:not([readonly]):not(.energy-result-highlight):focus,
#energy-expenditure-view .field select:focus {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(57, 207, 144, 0.5);
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.7),
              0 0 0 4px rgba(57, 207, 144, 0.14);
}

/* Formulário de antropometria — elementos desabilitados (exclusão mútua de métodos de %G) */
.anthropometry-section select:disabled,
.anthropometry-section input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}


/* ============================================================
   AUTH SCREEN — Liquid Glass Split (aurora + vidro translúcido)
   Mesma receita do dashboard/plano alimentar: orbs aurora com
   blur enorme, painéis rgba(255,255,255,.4) + backdrop-filter
   saturate(140%) blur(), borda branca suave e highlight interno.
   ============================================================ */

.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 20px;
  background: linear-gradient(180deg, #fdfcff 0%, #f5f3fa 35%, #f0f7f4 100%);
  overflow-y: auto;
  font-family: inherit;
}

/* --- Aurora background (mint + lavender + coral) --- */
.auth-aurora-canvas {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.auth-orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(80px);
  opacity: 0.55;
}

.auth-orb-1 {
  /* Mint top-left */
  width: 560px;
  height: 560px;
  top: -14%;
  left: -8%;
  background: radial-gradient(circle, #6ee7c7 0%, transparent 70%);
  animation: authOrbFloat1 22s ease-in-out infinite alternate;
}

.auth-orb-2 {
  /* Lavender top-right */
  width: 620px;
  height: 620px;
  top: -10%;
  right: -10%;
  background: radial-gradient(circle, #c4b5fd 0%, transparent 70%);
  animation: authOrbFloat2 18s ease-in-out infinite alternate;
}

.auth-orb-3 {
  /* Coral bottom */
  width: 640px;
  height: 640px;
  bottom: -24%;
  left: 26%;
  background: radial-gradient(circle, #fbcfe8 0%, transparent 70%);
  opacity: 0.4;
  filter: blur(90px);
  animation: authOrbFloat3 26s ease-in-out infinite alternate;
}

.auth-noise-overlay {
  display: none;
}

@keyframes authOrbFloat1 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(46px, 34px) scale(1.06); }
}

@keyframes authOrbFloat2 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-40px, 30px) scale(1.05); }
}

@keyframes authOrbFloat3 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(34px, -30px) scale(1.07); }
}

@keyframes authPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.18); }
}

/* --- Cartão split: vidro único com duas metades --- */
.auth-container {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1080px;
  margin: auto;
  display: grid;
  grid-template-columns: 1.06fr 1fr;
  background: rgba(255, 255, 255, 0.42);
  -webkit-backdrop-filter: saturate(140%) blur(24px);
  backdrop-filter: saturate(140%) blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 28px;
  overflow: hidden;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.65) inset,
    0 30px 60px -24px rgba(15, 23, 42, 0.22),
    0 12px 24px -12px rgba(15, 23, 42, 0.08);
}

/* ---------- Lado esquerdo: showcase em vidro verde ---------- */
.auth-showcase {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 46px 44px 36px;
  background: linear-gradient(160deg, rgba(16, 185, 129, 0.14) 0%, rgba(110, 231, 199, 0.10) 55%, rgba(255, 255, 255, 0.06) 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.5);
  overflow: hidden;
  user-select: none;
}

/* Anel decorativo sutil */
.auth-showcase::before {
  content: "";
  position: absolute;
  width: 430px;
  height: 430px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  top: -170px;
  right: -150px;
  pointer-events: none;
}

.auth-showcase > * {
  position: relative;
  z-index: 1;
}

.auth-showcase-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}

.auth-brand-logo {
  display: block;
  height: 80px;
  width: auto;
  filter: drop-shadow(0 2px 8px rgba(16, 185, 129, 0.16));
}

.auth-showcase .auth-brand-badge {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #047857;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.8);
  padding: 4px 10px;
  border-radius: 999px;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.auth-showcase-hero {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 4px;
}

.auth-pill-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #047857;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.8);
  padding: 5px 12px;
  border-radius: 999px;
  width: fit-content;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset, 0 4px 12px -6px rgba(16, 185, 129, 0.25);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.auth-pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.22);
  animation: authPulse 2.4s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.auth-showcase-title {
  margin: 0;
  font-size: 31px;
  font-weight: 800;
  line-height: 1.24;
  letter-spacing: -0.02em;
  color: #0f172a;
}

.auth-showcase-desc {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.65;
  color: #475569;
  max-width: 46ch;
}

/* Cards de features (vidro fosco, receita do dashboard) */
.auth-features-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 2px;
}

.auth-feature-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  background: rgba(255, 255, 255, 0.55);
  -webkit-backdrop-filter: saturate(140%) blur(16px);
  backdrop-filter: saturate(140%) blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 16px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset, 0 8px 20px -10px rgba(15, 23, 42, 0.10);
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.auth-feature-card:hover {
  transform: translateX(4px);
  background: rgba(255, 255, 255, 0.75);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset, 0 10px 24px -10px rgba(15, 23, 42, 0.14);
}

.auth-feature-icon-wrapper {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.auth-icon-emerald {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.20), rgba(5, 150, 105, 0.26));
  color: #047857;
}

.auth-icon-mint {
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.24), rgba(16, 185, 129, 0.22));
  color: #059669;
}

.auth-icon-teal {
  background: linear-gradient(135deg, rgba(45, 212, 191, 0.24), rgba(13, 148, 136, 0.24));
  color: #0f766e;
}

.auth-feature-info {
  display: flex;
  flex-direction: column;
}

.auth-feature-info strong {
  font-size: 13.5px;
  font-weight: 700;
  color: #0f172a;
}

.auth-feature-info span {
  font-size: 12px;
  line-height: 1.4;
  color: #64748b;
  margin-top: 1px;
}

.auth-showcase-footer {
  margin-top: auto;
  padding-top: 8px;
}

.auth-shield-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #047857;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.75);
  padding: 8px 12px;
  border-radius: 12px;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

/* ---------- Lado direito: formulário em vidro ---------- */
.auth-main-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 46px 44px;
}

.auth-card {
  position: relative;
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.auth-mobile-brand {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 2px;
}

.auth-mobile-brand .brand-logo-lg {
  height: 52px;
  max-height: 52px;
}

.auth-mobile-brand .auth-brand-badge {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #047857;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.8);
  padding: 4px 10px;
  border-radius: 999px;
}

/* Abas (controle segmentado de vidro) */
.auth-tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 13px;
  padding: 4px;
  gap: 4px;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}

.auth-tab {
  flex: 1;
  border: none;
  background: transparent;
  padding: 9px 14px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  text-align: center;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-tab:hover:not(.is-active) {
  color: #334155;
}

.auth-tab.is-active {
  background: rgba(255, 255, 255, 0.95);
  color: #065f46;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.10), 0 1px 2px rgba(15, 23, 42, 0.05);
}

/* Cabeçalho */
.auth-header-group {
  text-align: left;
}

.auth-header-group h1 {
  margin: 0 0 6px;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0f172a;
}

.auth-subtitle {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: #64748b;
}

/* Formulário */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
  text-align: left;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-field label {
  font-size: 13px;
  font-weight: 700;
  color: #334155;
  letter-spacing: -0.01em;
}

.auth-input-shell {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 13px;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.03), 0 2px 8px -4px rgba(15, 23, 42, 0.06);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.auth-input-shell:hover {
  background: rgba(255, 255, 255, 0.82);
}

.auth-input-shell:focus-within {
  border-color: rgba(16, 185, 129, 0.65);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.14), 0 2px 8px rgba(16, 185, 129, 0.08);
}

.auth-input-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  pointer-events: none;
  transition: color 0.2s ease;
}

.auth-input-shell:focus-within .auth-input-icon {
  color: #10b981;
}

.auth-input-shell input {
  width: 100%;
  border: none;
  background: transparent;
  outline: none;
  padding: 12px 44px 12px 42px;
  font-size: 14.5px;
  color: #0f172a;
  font-weight: 500;
  font-family: inherit;
}

.auth-input-shell input::placeholder {
  color: #94a3b8;
  font-weight: 400;
}

.auth-password-toggle {
  position: absolute;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

.auth-password-toggle:hover {
  color: #334155;
  background: rgba(241, 245, 249, 0.85);
}

/* Banner de erro */
.auth-error {
  margin: 0;
  background: rgba(254, 242, 242, 0.9);
  border: 1.5px solid rgba(248, 113, 113, 0.45);
  border-radius: 12px;
  padding: 10px 14px;
  color: #b91c1c;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  animation: authShake 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes authShake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-3px, 0, 0); }
  40%, 60% { transform: translate3d(3px, 0, 0); }
}

/* Botão principal */
.auth-submit {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
  background: linear-gradient(135deg, #34d399 0%, #10b981 55%, #059669 100%);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 13px;
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  padding: 13.5px 20px;
  cursor: pointer;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.4) inset,
    0 10px 22px -8px rgba(16, 185, 129, 0.55);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: inherit;
}

.auth-submit:hover {
  transform: translateY(-1.5px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.5) inset,
    0 14px 28px -8px rgba(16, 185, 129, 0.62);
  filter: brightness(1.04);
}

.auth-submit:active {
  transform: translateY(0) scale(0.99);
}

.auth-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  filter: none;
}

.auth-submit.is-loading .auth-submit-icon {
  display: none;
}

.auth-spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: authSpin 0.7s linear infinite;
  display: inline-block;
}

@keyframes authSpin {
  to { transform: rotate(360deg); }
}

/* Rodapé do card */
.auth-toggle-row {
  text-align: center;
  margin: 0;
}

.auth-toggle {
  margin: 0;
  color: #64748b;
  font-size: 13.5px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.auth-toggle-link {
  background: none;
  border: none;
  color: #047857;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  transition: color 0.15s ease;
}

.auth-toggle-link:hover {
  color: #065f46;
  text-decoration: underline;
}

.auth-card-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.6);
  padding-top: 14px;
  margin-top: -4px;
}

.auth-secure-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: #94a3b8;
}

/* ---------- Responsivo ---------- */
@media (max-width: 920px) {
  .auth-screen {
    padding: 18px 14px;
  }

  .auth-container {
    grid-template-columns: 1fr;
    max-width: 460px;
    border-radius: 24px;
  }

  .auth-showcase {
    display: none;
  }

  .auth-mobile-brand {
    display: flex;
  }

  .auth-main-panel {
    padding: 30px 24px 26px;
  }
}

@media (max-width: 400px) {
  .auth-main-panel {
    padding: 26px 18px 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-orb-1,
  .auth-orb-2,
  .auth-orb-3,
  .auth-pill-dot {
    animation: none;
  }
}

/* ============================================================
   Exam requests v2 (nx-*)
   ============================================================ */

.exam-requests-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
  min-height: 100dvh;
  padding: 34px 16px 150px;
  box-sizing: border-box;
  position: relative;
  overflow-x: clip;
}

.nx-shell {
  width: 100%;
  max-width: 1180px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* --- Painéis rápidos --- */

.nx-panels {
  background: var(--glass-bg, rgba(255, 255, 255, 0.72));
  -webkit-backdrop-filter: saturate(140%) blur(20px);
  backdrop-filter: saturate(140%) blur(20px);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 20px;
  padding: 16px 18px;
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.85), 0 14px 30px rgba(21, 43, 63, 0.06);
  display: grid;
  gap: 12px;
}

.nx-panels-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.nx-panels-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #133422;
}

.nx-panels-head div {
  display: grid;
  gap: 2px;
}

.nx-panels-head div span {
  font-size: 12px;
  color: #5c6b61;
}

.nx-panels-hint {
  font-size: 11.5px;
  font-weight: 500;
  color: #228B5A;
  background: #E7F3EC;
  border-radius: 999px;
  padding: 5px 12px;
  white-space: nowrap;
}

.nx-panels-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.nx-panel-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 8px 8px;
  border-radius: 14px;
  border: 1px solid #E0ECE4;
  background: #F7FBF8;
  color: #1e2a24;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}

.nx-panel-chip:hover {
  border-color: #A8D5BA;
  background: #F2F8F3;
}

.nx-panel-chip:active {
  transform: translateY(1px);
}

.nx-panel-chip-active {
  border-color: #228B5A;
  background: #E7F3EC;
}

.nx-panel-chip-icon {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: 10px;
  background: #228B5A;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
}

.nx-panel-chip-copy {
  display: grid;
  gap: 1px;
  text-align: left;
}

.nx-panel-chip-copy strong {
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.2;
}

.nx-panel-chip-copy small {
  font-size: 10.5px;
  color: #5c6b61;
}

.nx-panel-chip-check {
  font-size: 12px;
  font-weight: 700;
  color: #228B5A;
  min-width: 16px;
  text-align: right;
}

/* --- Split catálogo / pedido --- */

.nx-split {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.nx-column {
  background: var(--glass-bg, rgba(255, 255, 255, 0.72));
  -webkit-backdrop-filter: saturate(140%) blur(20px);
  backdrop-filter: saturate(140%) blur(20px);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 20px;
  padding: 16px 18px;
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.85), 0 14px 30px rgba(21, 43, 63, 0.06);
  display: grid;
  gap: 12px;
}

.nx-column-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.nx-column-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #133422;
}

.nx-count-badge {
  font-size: 11.5px;
  font-weight: 600;
  color: #228B5A;
  background: #E7F3EC;
  border-radius: 999px;
  padding: 4px 10px;
}

.nx-search {
  position: relative;
  display: block;
}

.nx-search svg {
  width: 16px;
  height: 16px;
  fill: #228B5A;
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

.nx-search input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #E0ECE4;
  border-radius: 12px;
  background: #F7FBF8;
  padding: 10px 12px 10px 36px;
  font-family: inherit;
  font-size: 13.5px;
  color: #1e2a24;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.nx-search input:focus {
  border-color: #228B5A;
  box-shadow: 0 0 0 3px rgba(34, 139, 90, 0.15);
}

.nx-exam-groups {
  display: grid;
  gap: 14px;
  max-height: 52vh;
  overflow-y: auto;
  padding-right: 4px;
}

.nx-exam-group {
  display: grid;
  gap: 8px;
}

.nx-exam-group-title {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #228B5A;
}

.nx-exam-group-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.nx-exam-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid #E0ECE4;
  background: #fff;
  font-family: inherit;
  font-size: 12.5px;
  color: #33443a;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.nx-exam-chip:hover {
  border-color: #A8D5BA;
  background: #F2F8F3;
}

.nx-exam-chip-selected {
  border-color: #228B5A;
  background: #E7F3EC;
  color: #133422;
  font-weight: 600;
}

.nx-exam-chip-box {
  width: 16px;
  height: 16px;
  border-radius: 5px;
  border: 1.5px solid #A8D5BA;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: transparent;
  flex-shrink: 0;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.nx-exam-chip-selected .nx-exam-chip-box {
  background: #228B5A;
  border-color: #228B5A;
}

.nx-exam-empty {
  display: grid;
  place-items: center;
  gap: 6px;
  padding: 30px 10px;
  text-align: center;
  color: #5c6b61;
  font-size: 13px;
}

.nx-exam-empty p {
  margin: 0;
}

.nx-add-custom {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 14px;
  border-radius: 14px;
  border: 1.5px dashed #A8D5BA;
  background: transparent;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.nx-add-custom:hover {
  border-color: #228B5A;
  background: #F2F8F3;
}

.nx-add-custom-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #228B5A;
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nx-add-custom-text {
  display: grid;
  gap: 1px;
}

.nx-add-custom-text strong {
  font-size: 13px;
  font-weight: 600;
  color: #133422;
}

.nx-add-custom-text small {
  font-size: 11.5px;
  color: #5c6b61;
}

/* --- Coluna do pedido --- */

.nx-clear-button {
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: #b4554d;
  background: transparent;
  border: 1px solid #f0d5d2;
  border-radius: 999px;
  padding: 5px 12px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.nx-clear-button:hover:not(:disabled) {
  background: #fdf1f0;
}

.nx-clear-button:disabled {
  opacity: 0.45;
  cursor: default;
}

.nx-order-summary {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 12.5px;
  color: #5c6b61;
}

.nx-order-count {
  font-size: 13px;
  font-weight: 700;
  color: #228B5A;
}

.nx-order-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 52vh;
  overflow-y: auto;
  padding-right: 4px;
}

.nx-order-item {
  border: 1px solid #E0ECE4;
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
  transition: border-color 0.15s ease;
}

.nx-order-item-expanded {
  border-color: #228B5A;
}

.nx-order-item-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
}

.nx-order-item-number {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  border-radius: 8px;
  background: #E7F3EC;
  color: #228B5A;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nx-order-item-copy {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 1px;
}

.nx-order-item-copy strong {
  font-size: 13px;
  font-weight: 600;
  color: #1e2a24;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nx-order-item-copy span {
  font-size: 11px;
  color: #5c6b61;
}

.nx-order-item-tools {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.nx-order-item-icon-button {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #5c6b61;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.nx-order-item-icon-button svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

.nx-order-item-icon-button:hover:not(:disabled) {
  background: #F2F8F3;
  color: #228B5A;
}

.nx-order-item-icon-button:disabled {
  opacity: 0.3;
  cursor: default;
}

.nx-order-item-remove:hover:not(:disabled) {
  background: #fdf1f0;
  color: #b4554d;
}

.nx-order-item-details {
  display: grid;
  gap: 8px;
  padding: 4px 12px 12px;
  border-top: 1px dashed #DCE8E0;
  margin-top: 2px;
}

.nx-order-item-field {
  display: grid;
  gap: 4px;
}

.nx-order-item-field span {
  font-size: 11px;
  font-weight: 600;
  color: #228B5A;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.nx-order-item-field input {
  border: 1px solid #E0ECE4;
  border-radius: 10px;
  background: #F7FBF8;
  padding: 8px 11px;
  font-family: inherit;
  font-size: 12.5px;
  color: #1e2a24;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.nx-order-item-field input:focus {
  border-color: #228B5A;
  box-shadow: 0 0 0 3px rgba(34, 139, 90, 0.15);
}

.nx-order-empty {
  list-style: none;
  display: grid;
  place-items: center;
  gap: 6px;
  padding: 34px 14px;
  text-align: center;
  border: 1.5px dashed #DCE8E0;
  border-radius: 14px;
  background: #F7FBF8;
}

.nx-order-empty-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #E7F3EC;
  color: #228B5A;
  font-size: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nx-order-empty p {
  margin: 0;
  font-size: 13.5px;
  font-weight: 600;
  color: #33443a;
}

.nx-order-empty small {
  font-size: 12px;
  color: #5c6b61;
}

/* --- Campos do pedido --- */

.nx-order-fields {
  display: grid;
  gap: 10px;
  border-top: 1px dashed #DCE8E0;
  padding-top: 12px;
}

.nx-field {
  display: grid;
  gap: 5px;
}

.nx-field span {
  font-size: 12px;
  font-weight: 600;
  color: #33443a;
}

.nx-field span small {
  font-weight: 400;
  color: #5c6b61;
}

.nx-field input,
.nx-field textarea {
  border: 1px solid #E0ECE4;
  border-radius: 12px;
  background: #F7FBF8;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 13px;
  color: #1e2a24;
  outline: none;
  resize: vertical;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.nx-field input:focus,
.nx-field textarea:focus {
  border-color: #228B5A;
  box-shadow: 0 0 0 3px rgba(34, 139, 90, 0.15);
}

/* --- Histórico (timeline compacta no modal de atendimento) --- */

.exam-history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.exam-history-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border, #e2e8f0);
  background: var(--glass-bg, rgba(255, 255, 255, 0.62));
}

.exam-history-row-latest {
  border-color: #A8D5BA;
}

.exam-history-row-date {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  color: #228B5A;
  background: #E7F3EC;
  border-radius: 999px;
  padding: 4px 10px;
  white-space: nowrap;
}

.exam-history-row-copy {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 3px;
}

.exam-history-row-copy strong {
  font-size: 13.5px;
  font-weight: 600;
  color: #22374b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.exam-history-row-names {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.exam-history-item-name {
  font-size: 11px;
  color: #5c6b61;
  background: #F2F8F3;
  border-radius: 999px;
  padding: 2px 8px;
}

.exam-history-more {
  font-size: 11px;
  font-weight: 600;
  color: #228B5A;
}

.exam-history-row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* --- Responsivo --- */

@media (max-width: 980px) {
  .nx-split {
    grid-template-columns: 1fr;
  }

  .exam-requests-page {
    padding: 24px 12px 140px;
  }
}

@media (max-width: 640px) {
  .nx-panels-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .nx-panel-chip {
    flex: 1 1 100%;
  }

  .exam-history-row {
    flex-wrap: wrap;
  }

  .exam-history-row-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

/* ============================================================
   FINANCEIRO — Liquid Glass Design System
   ============================================================ */

body:has(#financeiro-view:not(.hidden)) {
  background: linear-gradient(180deg, #fdfcff 0%, #f5f3fa 35%, #f0f7f4 100%);
  position: relative;
  overflow-x: hidden;
}

body:has(#financeiro-view:not(.hidden))::before,
body:has(#financeiro-view:not(.hidden))::after {
  content: "";
  position: fixed;
  pointer-events: none;
  z-index: 0;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
}

body:has(#financeiro-view:not(.hidden))::before {
  top: -12%;
  left: -8%;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, #6ee7c7 0%, transparent 70%);
}

body:has(#financeiro-view:not(.hidden))::after {
  top: -8%;
  right: -10%;
  width: 580px;
  height: 580px;
  background: radial-gradient(circle, #c4b5fd 0%, transparent 70%);
}

#financeiro-view .financeiro-aurora-orb-3 {
  position: fixed;
  bottom: -22%;
  left: 28%;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.4;
  background: radial-gradient(circle, #fbcfe8 0%, transparent 70%);
  pointer-events: none;
}

body:has(#financeiro-view:not(.hidden)) .page-shell {
  position: relative;
  z-index: 1;
  padding: 18px 8px 56px;
}

.financeiro-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  width: 100%;
  min-height: 100dvh;
  padding: 24px 0 80px;
  box-sizing: border-box;
  position: relative;
  z-index: 1;
}

/* --- Hero --- */
.financeiro-hero {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: 22px 28px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.65);
  -webkit-backdrop-filter: saturate(160%) blur(20px);
  backdrop-filter: saturate(160%) blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8),
              0 10px 28px -12px rgba(15, 23, 42, 0.08),
              0 2px 6px -2px rgba(15, 23, 42, 0.04);
  position: relative;
  overflow: hidden;
}

.financeiro-hero::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.9), transparent);
  pointer-events: none;
}

.financeiro-hero-title {
  display: grid;
  gap: 4px;
}

.financeiro-hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #059669;
}

.financeiro-hero-eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.financeiro-hero-month {
  margin: 0;
  font-size: 48px;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.1;
  color: #0f172a;
}

.financeiro-hero-subtitle {
  font-size: 13.5px;
  color: #64748b;
  font-weight: 500;
}

.financeiro-hero-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.financeiro-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.financeiro-nav-button {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  border-radius: 8px;
  color: #64748b;
  cursor: pointer;
  padding: 0;
  transition: all 0.18s ease;
}

.financeiro-nav-button:hover {
  background: rgba(15, 23, 42, 0.06);
  color: #0f172a;
}

.financeiro-today-pill {
  height: 32px;
  padding: 0 14px;
  border: 0;
  background: rgba(255, 255, 255, 0.95);
  color: #0f172a;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9),
              0 2px 4px -1px rgba(15, 23, 42, 0.08);
  transition: transform 0.18s ease, background 0.18s ease;
}

.financeiro-today-pill:hover {
  background: #ffffff;
  transform: translateY(-1px);
}

.financeiro-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(180deg, #34d399 0%, #10b981 100%);
  color: #fff;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: -0.005em;
  cursor: pointer;
  box-shadow: 0 6px 16px -4px rgba(16, 185, 129, 0.45),
              inset 0 1px 0 0 rgba(255, 255, 255, 0.4);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.financeiro-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px -4px rgba(16, 185, 129, 0.55),
              inset 0 1px 0 0 rgba(255, 255, 255, 0.45);
}

.financeiro-cta:active {
  transform: translateY(0);
}

/* --- Summary KPI Grid --- */
.financeiro-summary-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.financeiro-summary-card {
  background: rgba(255, 255, 255, 0.65);
  -webkit-backdrop-filter: saturate(160%) blur(20px);
  backdrop-filter: saturate(160%) blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 18px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8),
              0 10px 24px -12px rgba(15, 23, 42, 0.08),
              0 2px 6px -2px rgba(15, 23, 42, 0.04);
  position: relative;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.financeiro-summary-card:hover {
  transform: translateY(-2px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9),
              0 14px 30px -12px rgba(15, 23, 42, 0.12),
              0 4px 8px -2px rgba(15, 23, 42, 0.06);
}

.financeiro-summary-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.9), transparent);
  pointer-events: none;
}

.financeiro-summary-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.financeiro-summary-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.financeiro-icon-receita {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
}

.financeiro-icon-despesa {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}

.financeiro-icon-pendente {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
}

.financeiro-icon-neutral {
  background: rgba(100, 116, 139, 0.12);
  color: #64748b;
}

.financeiro-summary-label {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.financeiro-summary-value {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: #0f172a;
  line-height: 1.1;
  white-space: nowrap;
}

.financeiro-val-positive {
  color: #059669;
}

.financeiro-val-negative {
  color: #dc2626;
}

.financeiro-val-pendente {
  color: #b45309;
}

.financeiro-summary-foot {
  display: flex;
  align-items: center;
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
}

.financeiro-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.financeiro-badge-receita {
  background: rgba(16, 185, 129, 0.08);
  color: #059669;
}

.financeiro-badge-despesa {
  background: rgba(239, 68, 68, 0.08);
  color: #dc2626;
}

.financeiro-badge-positive {
  background: rgba(16, 185, 129, 0.1);
  color: #047857;
}

.financeiro-badge-negative {
  background: rgba(239, 68, 68, 0.1);
  color: #b91c1c;
}

.financeiro-badge-pendente {
  background: rgba(245, 158, 11, 0.08);
  color: #b45309;
}

/* --- Layout Principal --- */
.financeiro-layout {
  width: 100%;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 20px;
  align-items: stretch;
}

.financeiro-card {
  border-radius: 20px;
  padding: 22px 24px;
  display: grid;
  gap: 16px;
  background: rgba(255, 255, 255, 0.65);
  -webkit-backdrop-filter: saturate(160%) blur(20px);
  backdrop-filter: saturate(160%) blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8),
              0 10px 24px -12px rgba(15, 23, 42, 0.08),
              0 2px 6px -2px rgba(15, 23, 42, 0.04);
  position: relative;
  overflow: hidden;
}

.financeiro-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.9), transparent);
  pointer-events: none;
}

.financeiro-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.financeiro-card-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.01em;
}

.financeiro-card-head div > span {
  font-size: 12.5px;
  color: #64748b;
  font-weight: 500;
}

.financeiro-card-head-info {
  display: grid;
  gap: 2px;
}

.financeiro-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* --- Gráfico Diário --- */
.financeiro-chart {
  display: grid;
  gap: 14px;
}

.financeiro-chart-legend {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
}

.financeiro-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.financeiro-chart-legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  display: inline-block;
}

.financeiro-chart-legend-receita {
  background: #10b981;
}

.financeiro-chart-legend-despesa {
  background: #ef4444;
}

.financeiro-chart-bars-wrap {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 180px;
  overflow-x: auto;
  padding: 8px 4px 4px;
}

.financeiro-chart-day {
  flex: 1 0 20px;
  min-width: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 100%;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.financeiro-chart-day:hover {
  opacity: 0.85;
}

.financeiro-chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: calc(100% - 20px);
  width: 100%;
}

.financeiro-chart-bar {
  flex: 1;
  min-width: 5px;
  border-radius: 4px 4px 2px 2px;
  transition: transform 0.15s ease;
}

.financeiro-chart-bar-receita {
  background: linear-gradient(180deg, #34d399 0%, #10b981 100%);
}

.financeiro-chart-bar-despesa {
  background: linear-gradient(180deg, #f87171 0%, #ef4444 100%);
}

.financeiro-chart-day-label {
  font-size: 10px;
  font-weight: 600;
  color: #94a3b8;
}

.financeiro-chart-empty,
.financeiro-transactions-empty {
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 36px 16px;
  text-align: center;
  border: 1.5px dashed rgba(15, 23, 42, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.4);
  color: #64748b;
}

.financeiro-empty-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.08);
  color: #10b981;
  display: grid;
  place-items: center;
}

.financeiro-chart-empty p,
.financeiro-transactions-empty p {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #334155;
}

.financeiro-chart-empty small,
.financeiro-transactions-empty small {
  font-size: 12px;
  color: #64748b;
}

/* --- Por Categoria --- */
.financeiro-category-breakdown {
  display: grid;
  gap: 16px;
}

.financeiro-category-section {
  display: grid;
  gap: 10px;
}

.financeiro-category-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.financeiro-category-type-tag {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.financeiro-tag-receita {
  color: #059669;
}

.financeiro-tag-despesa {
  color: #dc2626;
}

.financeiro-category-type-total {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}

.financeiro-category-bar {
  display: flex;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.06);
}

.financeiro-category-bar i {
  height: 100%;
  min-width: 3px;
  transition: opacity 0.15s ease;
}

.financeiro-category-rows {
  display: grid;
  gap: 6px;
}

.financeiro-category-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  padding: 4px 6px;
  border-radius: 8px;
  transition: background 0.15s ease;
}

.financeiro-category-row:hover {
  background: rgba(15, 23, 42, 0.03);
}

.financeiro-category-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.financeiro-category-name {
  flex: 1;
  min-width: 0;
  color: #334155;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.financeiro-category-count {
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
}

.financeiro-category-total {
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
}

.financeiro-category-percent {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  min-width: 36px;
  text-align: right;
}

/* --- Extrato de Lançamentos --- */
.financeiro-transactions-card {
  width: 100%;
  box-sizing: border-box;
}

.financeiro-filters {
  display: flex;
  align-items: center;
  gap: 2px;
  background: rgba(15, 23, 42, 0.05);
  border-radius: 12px;
  padding: 3px;
}

.financeiro-filter-button {
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  padding: 6px 12px;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.financeiro-filter-button:hover {
  color: #0f172a;
}

.financeiro-filter-active {
  background: #ffffff;
  color: #059669;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}

.financeiro-list-add-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 10px;
  background: rgba(16, 185, 129, 0.06);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: #059669;
  padding: 7px 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s ease;
}

.financeiro-list-add-button:hover {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.4);
  transform: translateY(-1px);
}

.financeiro-transactions-list {
  display: grid;
  gap: 16px;
}

.financeiro-day-group {
  display: grid;
  gap: 8px;
}

.financeiro-day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 4px 6px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.financeiro-day-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  letter-spacing: 0.02em;
}

.financeiro-day-total-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
}

.financeiro-day-total-positive {
  background: rgba(16, 185, 129, 0.1);
  color: #047857;
}

.financeiro-day-total-negative {
  background: rgba(239, 68, 68, 0.1);
  color: #b91c1c;
}

.financeiro-day-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.financeiro-transaction-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.75);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  cursor: pointer;
  transition: all 0.18s ease;
}

.financeiro-transaction-item:hover {
  transform: translateY(-1px);
  border-color: rgba(16, 185, 129, 0.3);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
  background: #ffffff;
}

.financeiro-transaction-icon-shell {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.financeiro-transaction-copy {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 3px;
}

.financeiro-transaction-title {
  font-size: 13.5px;
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.financeiro-transaction-tags {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.financeiro-meta-pill {
  font-size: 11px;
  color: #64748b;
  font-weight: 500;
  background: rgba(15, 23, 42, 0.04);
  padding: 2px 7px;
  border-radius: 6px;
  white-space: nowrap;
}

.financeiro-meta-patient {
  color: #0369a1;
  background: rgba(3, 105, 161, 0.08);
  font-weight: 600;
}

.financeiro-transaction-status-cell {
  flex-shrink: 0;
}

.financeiro-transaction-status {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: 999px;
  padding: 3px 9px;
  white-space: nowrap;
}

.financeiro-transaction-status-pago {
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
}

.financeiro-transaction-status-pendente {
  background: rgba(245, 158, 11, 0.12);
  color: #b45309;
}

.financeiro-transaction-status-cancelado {
  background: rgba(100, 116, 139, 0.12);
  color: #64748b;
}

.financeiro-transaction-amount-cell {
  flex-shrink: 0;
  text-align: right;
  min-width: 100px;
}

.financeiro-transaction-amount {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.financeiro-transaction-amount-receita {
  color: #059669;
}

.financeiro-transaction-amount-despesa {
  color: #dc2626;
}

/* --- Modal de Transação --- */
.financeiro-modal-window {
  max-width: 620px;
  width: 100%;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.94);
  -webkit-backdrop-filter: saturate(160%) blur(24px);
  backdrop-filter: saturate(160%) blur(24px);
  box-shadow: 0 24px 50px -12px rgba(15, 23, 42, 0.22),
              inset 0 1px 0 rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.85);
}

.financeiro-type-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 20px;
  background: rgba(15, 23, 42, 0.04);
  padding: 4px;
  border-radius: 14px;
}

.financeiro-type-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  color: #64748b;
  cursor: pointer;
  transition: all 0.18s ease;
}

.financeiro-type-button:hover {
  color: #0f172a;
}

.financeiro-type-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.08);
  color: #64748b;
  display: grid;
  place-items: center;
  transition: all 0.18s ease;
}

.financeiro-type-button-active[data-financeiro-type="receita"] {
  border-color: rgba(16, 185, 129, 0.3);
  background: #ffffff;
  color: #047857;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.15), inset 0 1px 0 #ffffff;
}

.financeiro-type-button-active[data-financeiro-type="receita"] .financeiro-type-icon {
  background: #10b981;
  color: #ffffff;
}

.financeiro-type-button-active[data-financeiro-type="despesa"] {
  border-color: rgba(239, 68, 68, 0.3);
  background: #ffffff;
  color: #b91c1c;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.15), inset 0 1px 0 #ffffff;
}

.financeiro-type-button-active[data-financeiro-type="despesa"] .financeiro-type-icon {
  background: #ef4444;
  color: #ffffff;
}

/* Category header with micro-action */
.financeiro-category-field {
  display: grid;
  gap: 6px;
}

.financeiro-field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.financeiro-add-category-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  color: #059669;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.financeiro-add-category-button:hover {
  background: rgba(16, 185, 129, 0.1);
  color: #047857;
}

.financeiro-new-category-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  margin-top: 4px;
  border-radius: 12px;
  background: rgba(16, 185, 129, 0.05);
  border: 1px dashed rgba(16, 185, 129, 0.35);
}

.financeiro-new-category-box input {
  flex: 1;
  height: 34px !important;
  border: 1px solid rgba(15, 23, 42, 0.12) !important;
  border-radius: 8px !important;
  background: #ffffff !important;
  padding: 0 10px !important;
  font-family: inherit;
  font-size: 12.5px !important;
  color: #0f172a;
  outline: none;
}

.financeiro-new-category-box input:focus {
  border-color: #10b981 !important;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.15) !important;
}

.financeiro-new-cat-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.financeiro-add-category-confirm {
  height: 34px;
  border: none;
  border-radius: 8px;
  background: #10b981;
  color: #fff;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 0 12px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.financeiro-add-category-confirm:hover {
  background: #059669;
}

.financeiro-add-category-cancel {
  height: 34px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.8);
  color: #64748b;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 0 10px;
  cursor: pointer;
}

.financeiro-add-category-cancel:hover {
  color: #dc2626;
  border-color: rgba(239, 68, 68, 0.3);
}

/* Modal Form Fields & Inputs */
.financeiro-modal-window .form-grid {
  gap: 16px 18px;
}

.financeiro-modal-window .field {
  display: grid;
  gap: 6px;
}

.financeiro-modal-window .field span {
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.financeiro-modal-window .field span small {
  font-weight: 500;
  color: #94a3b8;
  text-transform: none;
  font-size: 11px;
}

.financeiro-modal-window .field input,
.financeiro-modal-window .field select {
  height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.85);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  color: #0f172a;
  padding: 0 14px;
  transition: all 0.15s ease;
}

.financeiro-modal-window .field textarea {
  min-height: 68px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.85);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  color: #0f172a;
  padding: 10px 14px;
  line-height: 1.45;
  resize: vertical;
  transition: all 0.15s ease;
}

.financeiro-modal-window .field input:focus,
.financeiro-modal-window .field select:focus,
.financeiro-modal-window .field textarea:focus {
  border-color: #10b981;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.financeiro-modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.financeiro-modal-actions-right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.financeiro-modal-actions button {
  height: 40px;
  padding: 0 18px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-sizing: border-box;
}

.financeiro-delete-button {
  border: 1px solid rgba(239, 68, 68, 0.22);
  border-radius: 12px;
  background: rgba(239, 68, 68, 0.08);
  color: #dc2626;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  padding: 0 18px;
  height: 40px;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.financeiro-delete-button:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: #b91c1c;
  transform: translateY(-1px);
}

.financeiro-delete-button:active {
  transform: translateY(0);
}

/* --- Responsivo --- */
@media (max-width: 1080px) {
  .financeiro-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .financeiro-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .financeiro-hero {
    flex-direction: column;
    align-items: flex-start;
    padding: 18px 20px;
  }

  .financeiro-hero-month {
    font-size: 34px;
  }

  .financeiro-hero-controls {
    width: 100%;
    justify-content: space-between;
  }

  .financeiro-summary-grid {
    grid-template-columns: 1fr;
  }

  .financeiro-card-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .financeiro-head-actions {
    width: 100%;
    justify-content: space-between;
  }

  .financeiro-filters {
    flex: 1;
    overflow-x: auto;
  }

  .financeiro-transaction-item {
    flex-wrap: wrap;
    gap: 10px;
  }

  .financeiro-transaction-amount-cell {
    width: 100%;
    text-align: left;
    margin-left: 44px;
  }
}

/* ============================================================
   ONBOARDING � Liquid Glass Wizard
   ============================================================ */

.onboarding-screen {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow-y: auto;
  background: linear-gradient(180deg, #fdfcff 0%, #f5f3fa 35%, #f0f7f4 100%);
}

.onboarding-card {
  position: relative;
  z-index: 1;
  width: min(480px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  padding: 36px 34px 30px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: saturate(180%) blur(28px);
  backdrop-filter: saturate(180%) blur(28px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset,
              0 24px 50px -20px rgba(40, 30, 60, 0.3),
              0 8px 18px -10px rgba(40, 30, 60, 0.15);
}

.onboarding-brand {
  display: flex;
}

.onboarding-form {
  width: 100%;
  display: grid;
  gap: 18px;
}

.onboarding-step {
  width: 100%;
  display: grid;
  gap: 16px;
}

.onboarding-step.hidden {
  display: none;
}

.onboarding-step h1,
.onboarding-step h2 {
  margin: 0;
  color: #0f172a;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  font-size: 26px;
  text-align: center;
}

.onboarding-step p {
  margin: 0;
  color: #64748b;
  font-size: 14px;
  line-height: 1.55;
  text-align: center;
}

.onboarding-eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #10b981;
  text-align: center;
}

.onboarding-title-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.onboarding-title-option {
  position: relative;
  cursor: pointer;
}

.onboarding-title-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.onboarding-title-option span {
  display: block;
  padding: 10px 8px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: #334155;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.6);
  transition: all 0.18s ease;
}

.onboarding-title-option:hover span {
  border-color: rgba(16, 185, 129, 0.4);
}

.onboarding-title-option input:checked + span {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(16, 185, 129, 0.5);
  color: #0f172a;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9),
              0 2px 6px -2px rgba(15, 23, 42, 0.1);
}

.onboarding-nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
}

.onboarding-nav-center {
  justify-content: center;
}

.onboarding-back {
  height: 40px;
  padding: 0 16px;
  border: 0;
  background: transparent;
  color: #64748b;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  border-radius: 12px;
  transition: background 0.18s ease, color 0.18s ease;
}

.onboarding-back:hover {
  background: rgba(15, 23, 42, 0.05);
  color: #0f172a;
}

.onboarding-next,
.onboarding-submit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(180deg, #34d399 0%, #10b981 100%);
  color: #fff;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: -0.005em;
  cursor: pointer;
  box-shadow: 0 6px 16px -4px rgba(16, 185, 129, 0.45),
              inset 0 1px 0 0 rgba(255, 255, 255, 0.4);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.onboarding-next:hover,
.onboarding-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px -4px rgba(16, 185, 129, 0.55),
              inset 0 1px 0 0 rgba(255, 255, 255, 0.45);
}

.onboarding-next svg,
.onboarding-submit svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
  stroke: none;
}

.onboarding-submit svg.auth-submit-icon {
  fill: none;
  stroke: currentColor;
}

.onboarding-submit.is-loading .auth-submit-icon {
  display: none;
}

.onboarding-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.onboarding-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.12);
  transition: background 0.2s ease, transform 0.2s ease;
}

.onboarding-dot.active {
  background: #10b981;
  transform: scale(1.2);
}

@media (max-width: 640px) {
  .onboarding-card {
    padding: 28px 22px 24px;
    border-radius: 22px;
  }
}

/* ============================================================
   LOCAIS DE ATENDIMENTO — tipo, pergunta e badges
   ============================================================ */

.location-type-field {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.location-type-label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #64748b;
  text-transform: uppercase;
}

.location-type-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 5px;
  background: rgba(15, 23, 42, 0.05);
  border-radius: 16px;
}

.location-type-option {
  position: relative;
  cursor: pointer;
  user-select: none;
}

.location-type-option input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.location-type-option span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  background: transparent;
  color: #64748b;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.location-type-option input:checked + span {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.10), 0 0 0 1px rgba(15, 23, 42, 0.05);
}

.location-type-option:hover input:not(:checked) + span {
  color: #0f172a;
}

.location-type-badge {
  display: inline-block;
  vertical-align: middle;
  margin-left: 8px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.location-question-options {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.location-question-option {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 18px 20px;
  text-align: left;
  cursor: pointer;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.location-question-option:hover {
  transform: translateY(-2px);
  border-color: rgba(16, 185, 129, 0.35);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.location-question-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(52, 211, 153, 0.16), rgba(16, 185, 129, 0.10));
  color: #059669;
}

.location-question-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.location-question-copy strong {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
}

.location-question-copy span {
  font-size: 13px;
  line-height: 1.45;
  color: #7b8794;
}

@media (max-width: 640px) {
  .location-type-options {
    grid-template-columns: 1fr;
  }
}

/* --- Onboarding: pergunta de local de atendimento --- */

.onboarding-subcopy {
  margin: -6px 0 18px;
  font-size: 13px;
  line-height: 1.55;
  color: #7b8794;
}

.onboarding-location-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.onboarding-location-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 16px;
  cursor: pointer;
  user-select: none;
  border: 1.5px solid rgba(15, 23, 42, 0.10);
  border-radius: 16px;
  background: #ffffff;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.onboarding-location-option:hover {
  transform: translateY(-1px);
  border-color: rgba(16, 185, 129, 0.45);
}

.onboarding-location-option input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.onboarding-location-option:has(input:checked) {
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.onboarding-location-option-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: linear-gradient(180deg, rgba(52, 211, 153, 0.18), rgba(16, 185, 129, 0.10));
  color: #059669;
}

.onboarding-location-option-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.onboarding-location-option-copy strong {
  font-size: 14.5px;
  font-weight: 700;
  color: #0f172a;
}

.onboarding-location-option-copy span {
  font-size: 12.5px;
  line-height: 1.45;
  color: #7b8794;
}

.onboarding-location-option-check {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid rgba(15, 23, 42, 0.18);
  color: transparent;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.onboarding-location-option:has(input:checked) .onboarding-location-option-check {
  background: #10b981;
  border-color: #10b981;
  color: #ffffff;
}

/* --- Meus Dados: forma de tratamento (Dr./Dra./nome) --- */

.profile-title-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 5px;
  background: rgba(15, 23, 42, 0.05);
  border-radius: 16px;
}

.profile-title-option {
  position: relative;
  cursor: pointer;
  user-select: none;
}

.profile-title-option input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.profile-title-option span {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 12px;
  border-radius: 12px;
  background: transparent;
  color: #64748b;
  font-size: 13.5px;
  font-weight: 700;
  text-align: center;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.profile-title-option input:checked + span {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.10), 0 0 0 1px rgba(15, 23, 42, 0.05);
}

.profile-title-option:hover input:not(:checked) + span {
  color: #0f172a;
}

@media (max-width: 640px) {
  .profile-title-options {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   PLANO ALIMENTAR — Guidelines Toolbar Button & Modal
   ============================================================ */

.mp-meals-toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.mp-guidelines-icon-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 8px;
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  flex-shrink: 0;
}

.mp-guidelines-icon-box svg {
  width: 13px;
  height: 13px;
}

.mp-toolbar-indicator {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25);
  display: inline-block;
  margin-left: 2px;
}

.mp-guidelines-modal-window {
  max-width: 580px;
}

.mp-guidelines-modal-body {
  margin-top: 10px;
}

.mp-guidelines-modal-body .field label span {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 12.5px;
  color: #0f172a;
  margin-bottom: 6px;
}

.mp-guidelines-modal-body textarea,
.mp-guidelines-modal-body input {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.85);
  padding: 10px 14px;
  font-family: inherit;
  font-size: 13px;
  color: #0f172a;
  outline: none;
  transition: all 0.15s ease;
}

.mp-guidelines-modal-body textarea:focus,
.mp-guidelines-modal-body input:focus {
  border-color: #10b981;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

/* ============================================================
   PRÉ-CONSULTA — Liquid Glass & Aurora Background (Mesmo do Financeiro)
   ============================================================ */

body:has(#pre-consulta-view:not(.hidden)),
body:has(#questionnaire-editor-view:not(.hidden)) {
  background: linear-gradient(180deg, #fdfcff 0%, #f5f3fa 35%, #f0f7f4 100%);
  position: relative;
  overflow-x: hidden;
}

body:has(#pre-consulta-view:not(.hidden))::before,
body:has(#pre-consulta-view:not(.hidden))::after,
body:has(#questionnaire-editor-view:not(.hidden))::before,
body:has(#questionnaire-editor-view:not(.hidden))::after {
  content: "";
  position: fixed;
  pointer-events: none;
  z-index: 0;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
}

body:has(#pre-consulta-view:not(.hidden))::before,
body:has(#questionnaire-editor-view:not(.hidden))::before {
  top: -12%;
  left: -8%;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, #6ee7c7 0%, transparent 70%);
}

body:has(#pre-consulta-view:not(.hidden))::after,
body:has(#questionnaire-editor-view:not(.hidden))::after {
  top: -8%;
  right: -10%;
  width: 580px;
  height: 580px;
  background: radial-gradient(circle, #c4b5fd 0%, transparent 70%);
}

#pre-consulta-view .pre-consulta-aurora-orb-3,
#questionnaire-editor-view .pre-consulta-aurora-orb-3 {
  position: fixed;
  bottom: -22%;
  left: 28%;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.4;
  background: radial-gradient(circle, #fbcfe8 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

body:has(#pre-consulta-view:not(.hidden)) .page-shell,
body:has(#questionnaire-editor-view:not(.hidden)) .page-shell {
  position: relative;
  z-index: 1;
  padding: 18px 8px 56px;
}

.pre-consulta-page {
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 100%;
  min-height: 100dvh;
  padding: 24px 0 80px;
  box-sizing: border-box;
  position: relative;
  z-index: 1;
}

/* Liquid Glass Hero Header (Formato idêntico ao Financeiro) */
.pre-consulta-header-clean {
  width: 100%;
  border-radius: 20px;
  padding: 22px 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  background: rgba(255, 255, 255, 0.65);
  -webkit-backdrop-filter: saturate(160%) blur(20px);
  backdrop-filter: saturate(160%) blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8),
              0 10px 28px -12px rgba(15, 23, 42, 0.08),
              0 2px 6px -2px rgba(15, 23, 42, 0.04);
  position: relative;
  overflow: hidden;
}

.pre-consulta-header-clean::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.9), transparent);
  pointer-events: none;
}

.pre-consulta-header-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.pre-consulta-hero-title {
  display: grid;
  gap: 4px;
}

.pre-consulta-hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #059669;
}

.pre-consulta-hero-eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.pre-consulta-heading {
  margin: 0;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: #0f172a;
}

.pre-consulta-subheading {
  margin: 0;
  font-size: 13.5px;
  color: #64748b;
  font-weight: 500;
}

.pre-consulta-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pre-consulta-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.pre-consulta-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 14px;
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: #64748b;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}

.pre-consulta-tab:hover {
  background: rgba(15, 23, 42, 0.06);
  color: #0f172a;
}

.pre-consulta-tab-active {
  background: rgba(255, 255, 255, 0.95);
  color: #0f172a;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9),
              0 2px 4px -1px rgba(15, 23, 42, 0.08);
}

.pre-consulta-badge {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
}

.pre-consulta-create-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(180deg, #34d399 0%, #10b981 100%);
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.005em;
  cursor: pointer;
  box-shadow: 0 6px 16px -4px rgba(16, 185, 129, 0.45),
              inset 0 1px 0 0 rgba(255, 255, 255, 0.4);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.pre-consulta-create-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px -4px rgba(16, 185, 129, 0.55),
              inset 0 1px 0 0 rgba(255, 255, 255, 0.45);
}

/* Toolbar */
.pre-consulta-toolbar-clean {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding-top: 16px;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
}

.pre-consulta-search-wrap {
  position: relative;
  flex: 1;
  min-width: 280px;
}

.pre-consulta-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  display: flex;
  align-items: center;
  pointer-events: none;
}

.pre-consulta-search-input {
  width: 100%;
  height: 40px;
  padding: 0 16px 0 40px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.7);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  font-family: inherit;
  font-size: 13px;
  color: #0f172a;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transition: all 0.15s ease;
}

.pre-consulta-search-input:focus {
  border-color: #10b981;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
}

.pre-consulta-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.pre-consulta-chip {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.7);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: #475569;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transition: all 0.15s ease;
}

.pre-consulta-chip:hover {
  background: #ffffff;
  color: #0f172a;
  border-color: rgba(16, 185, 129, 0.3);
}

.pre-consulta-chip-active {
  background: #0f172a;
  border-color: #0f172a;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.15);
}

/* ============================================================
   LIQUID GLASS CARDS GRID (Padrão Financeiro)
   ============================================================ */

.pre-consulta-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}

.nutrie-q-clean-card {
  border-radius: 20px;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  background: rgba(255, 255, 255, 0.65);
  -webkit-backdrop-filter: saturate(160%) blur(20px);
  backdrop-filter: saturate(160%) blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8),
              0 10px 24px -12px rgba(15, 23, 42, 0.08),
              0 2px 6px -2px rgba(15, 23, 42, 0.04);
  position: relative;
  overflow: hidden;
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.nutrie-q-clean-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.9), transparent);
  pointer-events: none;
}

.nutrie-q-clean-card:hover {
  transform: translateY(-3px);
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(16, 185, 129, 0.35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9),
              0 14px 28px -8px rgba(16, 185, 129, 0.15),
              0 4px 10px -2px rgba(15, 23, 42, 0.04);
}

.nutrie-q-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.nutrie-q-cat-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 6px;
}

.nutrie-cat-emerald { background: rgba(16, 185, 129, 0.12); color: #059669; }
.nutrie-cat-indigo  { background: rgba(99, 102, 241, 0.12); color: #4f46e5; }
.nutrie-cat-amber   { background: rgba(245, 158, 11, 0.14); color: #d97706; }
.nutrie-cat-rose    { background: rgba(244, 63, 94, 0.12);  color: #e11d48; }
.nutrie-cat-teal    { background: rgba(20, 184, 166, 0.12); color: #0d9488; }
.nutrie-cat-sky     { background: rgba(14, 165, 233, 0.12); color: #0284c7; }
.nutrie-cat-purple  { background: rgba(168, 85, 247, 0.12); color: #7c3aed; }
.nutrie-cat-slate   { background: rgba(100, 116, 139, 0.12); color: #475569; }

.nutrie-q-time-tag {
  font-size: 11.5px;
  font-weight: 600;
  color: #94a3b8;
}

.nutrie-q-card-middle {
  cursor: pointer;
  flex: 1;
}

.nutrie-q-card-heading {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.35;
  transition: color 0.15s ease;
}

.nutrie-q-clean-card:hover .nutrie-q-card-heading {
  color: #059669;
}

.nutrie-q-card-snippet {
  margin: 0;
  font-size: 12.5px;
  color: #64748b;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.nutrie-q-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid rgba(15, 23, 42, 0.05);
}

.nutrie-q-fields-chip {
  font-size: 11.5px;
  font-weight: 600;
  color: #94a3b8;
}

.nutrie-q-btns-row {
  display: flex;
  align-items: center;
  gap: 5px;
}

.nutrie-q-btn-send {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 14px;
  border-radius: 8px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #059669;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.nutrie-q-btn-send:hover {
  background: #10b981;
  color: #ffffff;
  border-color: #10b981;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

.nutrie-q-btn-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.85);
  color: #64748b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.nutrie-q-btn-icon:hover {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.18);
  color: #0f172a;
}

.nutrie-q-delete-icon:hover {
  background: #fee2e2;
  border-color: rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

.pre-consulta-footer-clean {
  padding: 14px 0 0;
  font-size: 12.5px;
  color: #94a3b8;
  font-weight: 500;
}

.pre-consulta-empty-clean {
  grid-column: 1 / -1;
  padding: 50px 24px;
  text-align: center;
  color: #94a3b8;
  font-size: 13.5px;
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(16px);
  border-radius: 18px;
  border: 1px dashed rgba(15, 23, 42, 0.12);
}

/* Responses Table */
.pre-consulta-table-card {
  background: rgba(255, 255, 255, 0.65);
  -webkit-backdrop-filter: saturate(160%) blur(20px);
  backdrop-filter: saturate(160%) blur(20px);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8),
              0 10px 24px -12px rgba(15, 23, 42, 0.08),
              0 2px 6px -2px rgba(15, 23, 42, 0.04);
  position: relative;
  overflow: hidden;
}

.pre-consulta-table-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.9), transparent);
  pointer-events: none;
}

.pre-consulta-table-header {
  display: grid;
  grid-template-columns: 2.2fr 2fr 1.3fr 1fr 1.2fr;
  gap: 12px;
  padding: 14px 22px;
  background: rgba(248, 250, 252, 0.6);
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.nutrie-resp-row {
  display: grid;
  grid-template-columns: 2.2fr 2fr 1.3fr 1fr 1.2fr;
  align-items: center;
  gap: 12px;
  padding: 14px 22px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.05);
}

.nutrie-resp-row:last-child {
  border-bottom: none;
}

.nutrie-resp-patient {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nutrie-resp-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nutrie-resp-patient strong {
  display: block;
  font-size: 13.5px;
  color: #0f172a;
}

.nutrie-resp-patient span {
  font-size: 11.5px;
  color: #64748b;
}

.nutrie-resp-form {
  font-size: 13px;
  color: #334155;
  font-weight: 600;
}

.nutrie-resp-date {
  font-size: 12px;
  color: #64748b;
}

.nutrie-status-pill {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
}

.nutrie-view-resp-btn {
  font-size: 12px;
  padding: 6px 12px;
}

/* ============================================================
   NUTRIE QUICK SHARE MODAL (Liquid Glass)
   ============================================================ */

.nutrie-share-modal-window {
  max-width: 460px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 24px;
  box-shadow: 0 20px 45px -10px rgba(15, 23, 42, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.8);
}

.nutrie-share-form-title {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  color: #0f172a;
}

.nutrie-share-modal-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 6px;
}

.nutrie-share-field-lbl {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  margin-bottom: 6px;
}

.nutrie-share-select {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.9);
  padding: 10px 14px;
  font-family: inherit;
  font-size: 13.5px;
  color: #0f172a;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.nutrie-share-select:focus {
  border-color: #10b981;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
}

.nutrie-share-contact-badge {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(248, 250, 252, 0.85);
  border-radius: 12px;
  padding: 10px 14px;
  border: 1px solid rgba(15, 23, 42, 0.06);
}

.nutrie-share-contact-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
}

.nutrie-share-contact-icon {
  font-size: 14px;
}

.nutrie-share-contact-val {
  color: #334155;
  font-weight: 600;
}

.nutrie-share-actions-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 2px;
}

.nutrie-share-action-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.nutrie-share-action-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nutrie-share-whatsapp-btn .nutrie-share-action-icon {
  background: rgba(16, 185, 129, 0.14);
  color: #10b981;
}

.nutrie-share-whatsapp-btn:hover {
  background: rgba(16, 185, 129, 0.06);
  border-color: rgba(16, 185, 129, 0.4);
  transform: translateY(-1px);
}

.nutrie-share-email-btn .nutrie-share-action-icon {
  background: rgba(59, 130, 246, 0.14);
  color: #3b82f6;
}

.nutrie-share-email-btn:hover {
  background: rgba(59, 130, 246, 0.06);
  border-color: rgba(59, 130, 246, 0.4);
  transform: translateY(-1px);
}

.nutrie-share-action-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.nutrie-share-action-text strong {
  font-size: 13.5px;
  color: #0f172a;
}

.nutrie-share-action-text span {
  font-size: 12px;
  color: #64748b;
}

.nutrie-share-link-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(248, 250, 252, 0.85);
  border-radius: 12px;
  padding: 8px 12px;
  border: 1px dashed rgba(15, 23, 42, 0.15);
  margin-top: 4px;
}

.nutrie-share-link-input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 12.5px;
  color: #64748b;
  outline: none;
}

.nutrie-share-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: #ffffff;
  color: #334155;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s ease;
}

.nutrie-share-copy-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

/* ============================================================
   FORM STUDIO (Liquid Glass Editor)
   ============================================================ */

.questionnaire-editor-page {
  position: relative;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 6px 0 40px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.q-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  background: rgba(255, 255, 255, 0.65);
  -webkit-backdrop-filter: saturate(160%) blur(20px);
  backdrop-filter: saturate(160%) blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 20px;
  padding: 16px 24px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8),
              0 10px 28px -12px rgba(15, 23, 42, 0.08),
              0 2px 6px -2px rgba(15, 23, 42, 0.04);
  position: relative;
  overflow: hidden;
}

.q-editor-header::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.9), transparent);
  pointer-events: none;
}

.q-editor-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.q-editor-back-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(15, 23, 42, 0.08);
  color: #334155;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transition: all 0.15s ease;
}

.q-editor-back-btn:hover {
  background: #ffffff;
  color: #0f172a;
  transform: translateY(-1px);
}

.q-editor-title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
}

.q-editor-subtitle {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: #64748b;
}

.q-editor-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.q-editor-save-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: #10b981;
  font-weight: 700;
}

.q-editor-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.q-editor-title-card {
  background: rgba(255, 255, 255, 0.65);
  -webkit-backdrop-filter: saturate(160%) blur(20px);
  backdrop-filter: saturate(160%) blur(20px);
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  padding: 14px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8),
              0 10px 24px -12px rgba(15, 23, 42, 0.08),
              0 2px 6px -2px rgba(15, 23, 42, 0.04);
  position: relative;
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.q-editor-title-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.9), transparent);
  pointer-events: none;
}

.q-editor-title-card:focus-within {
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
}

.q-editor-title-lbl {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.q-editor-title-input {
  width: 100%;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  outline: none;
  padding: 2px 0;
}

.q-editor-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 20px;
  align-items: start;
}

.q-editor-palette {
  background: rgba(255, 255, 255, 0.65);
  -webkit-backdrop-filter: saturate(160%) blur(20px);
  backdrop-filter: saturate(160%) blur(20px);
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.7);
padding: 18px;
  position: sticky;
  top: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8),
              0 10px 24px -12px rgba(15, 23, 42, 0.08),
              0 2px 6px -2px rgba(15, 23, 42, 0.04);
  position: relative;
  overflow: hidden;
}

.q-editor-palette::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.9), transparent);
  pointer-events: none;
}

.q-palette-heading {
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 800;
  color: #0f172a;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.q-palette-buttons {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.q-palette-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: #334155;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: all 0.12s ease;
}

.q-palette-btn:hover {
  background: rgba(16, 185, 129, 0.08);
  color: #059669;
}

.q-palette-plus {
  color: #10b981;
  font-weight: 800;
  font-size: 14px;
}

.q-editor-canvas {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.q-fields-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.q-canvas-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 2px 10px;
  margin-bottom: 2px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.q-fields-count {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}

.q-toggle-expand-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.85);
  color: #475569;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transition: all 0.12s ease;
}

.q-toggle-expand-btn:hover {
  background: #ffffff;
  color: #0f172a;
  border-color: rgba(15, 23, 42, 0.15);
}

.nutrie-field-card {
  background: rgba(255, 255, 255, 0.7);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  backdrop-filter: saturate(160%) blur(16px);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8),
              0 4px 14px -4px rgba(15, 23, 42, 0.05);
  overflow: hidden;
  position: relative;
  transition: all 0.12s ease;
}

.nutrie-field-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.85), transparent);
  pointer-events: none;
}

.nutrie-field-card-expanded {
  border-color: rgba(16, 185, 129, 0.4);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9),
              0 8px 20px -4px rgba(16, 185, 129, 0.12);
}

.nutrie-field-card-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  cursor: pointer;
  user-select: none;
}

.nutrie-field-card-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.nutrie-field-handle {
  color: #cbd5e1;
  font-size: 12px;
  cursor: grab;
}

.nutrie-field-badge-num {
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  background: #f1f5f9;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nutrie-field-bar-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #0f172a;
}

.nutrie-field-card-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nutrie-field-type-pill {
  font-size: 11px;
  color: #64748b;
  background: rgba(248, 250, 252, 0.8);
  border: 1px solid rgba(15, 23, 42, 0.06);
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 600;
}

.nutrie-field-chevron {
  font-size: 8px;
  color: #94a3b8;
}

.nutrie-field-del-btn {
  border: none;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px;
  border-radius: 5px;
}

.nutrie-field-del-btn:hover {
  background: #fee2e2;
  color: #ef4444;
}

.nutrie-field-card-content {
  padding: 14px 16px 16px;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  background: rgba(250, 250, 250, 0.7);
}

.nutrie-field-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.nutrie-field-input-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nutrie-field-input-lbl {
  font-size: 11.5px;
  font-weight: 700;
  color: #475569;
}

.nutrie-field-label-input {
  width: 100%;
  height: 38px;
  border-radius: 8px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #ffffff;
  padding: 0 12px;
  font-family: inherit;
  font-size: 13px;
  color: #0f172a;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.nutrie-field-label-input:focus {
  border-color: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.12);
}

.nutrie-field-req-row {
  display: flex;
  align-items: center;
  margin-top: 2px;
}

.nutrie-field-req-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.nutrie-field-req-input {
  width: 16px !important;
  height: 16px !important;
  min-width: 16px !important;
  max-width: 16px !important;
  min-height: 16px !important;
  max-height: 16px !important;
  margin: 0 !important;
  padding: 0 !important;
  accent-color: #10b981 !important;
  cursor: pointer;
  border-radius: 4px !important;
  box-shadow: none !important;
}

.nutrie-field-req-text {
  font-size: 12px;
  font-weight: 600;
  color: #475569;
}

.nutrie-field-options-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.nutrie-field-opt-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nutrie-field-opt-bullet {
  color: #94a3b8;
  font-size: 8px;
}

.nutrie-field-opt-input {
  flex: 1;
  height: 34px;
  border-radius: 7px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #ffffff;
  padding: 0 10px;
  font-family: inherit;
  font-size: 12.5px;
  color: #0f172a;
  outline: none;
  transition: border-color 0.12s ease;
}

.nutrie-field-opt-input:focus {
  border-color: #10b981;
}

.nutrie-field-opt-del {
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 16px;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.12s ease;
}

.nutrie-field-opt-del:hover {
  background: #fee2e2;
  color: #ef4444;
}

.nutrie-add-opt-btn {
  margin-top: 4px;
  border: none;
  background: transparent;
  color: #10b981;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 3px 0;
  width: fit-content;
}

.nutrie-add-opt-btn:hover {
  color: #059669;
  text-decoration: underline;
}

.nutrie-field-footer-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed rgba(15, 23, 42, 0.08);
}

.nutrie-order-btn {
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: #ffffff;
  color: #64748b;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s ease;
}

.nutrie-order-btn:hover:not(:disabled) {
  background: #f1f5f9;
  color: #0f172a;
}

.nutrie-order-btn:disabled {
/* Responses Modal & Public Simulator */
.q-response-modal-window {
  max-width: 580px;
}

.q-response-modal-body {
  max-height: 460px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.q-response-item {
  padding: 10px 12px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid rgba(15, 23, 42, 0.06);
}

.q-response-q {
  font-size: 12.5px;
  color: #0f172a;
  display: block;
  margin-bottom: 3px;
  font-weight: 700;
}

.q-response-a {
  margin: 0;
  font-size: 12.5px;
  color: #334155;
  white-space: pre-wrap;
}

.q-public-modal-window {
  max-width: 640px;
}

.public-q-section-title {
  margin: 18px 0 6px;
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.public-q-paragraph {
  font-size: 12.5px;
  color: #64748b;
  margin: 4px 0 10px;
}

.public-q-field {
  margin-bottom: 12px;
}

.public-q-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.public-q-opt-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #334155;
  cursor: pointer;
}

@media (max-width: 768px) {
  .pre-consulta-hero-top {
    flex-direction: column;
  }
  .pre-consulta-hero-stats {
    width: 100%;
  }
  .pre-consulta-stat-box {
    flex: 1;
  }
  .q-editor-layout {
    grid-template-columns: 1fr;
  }
  .q-editor-palette {
    position: static;
  }
.pre-consulta-table-header,
  .nutrie-q-table-row,
  .nutrie-resp-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

/* ============================================================
   RECIBOS & DECLARAÇÕES — glass (care preview)
   ============================================================ */

.doc-modal-actions {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.doc-history {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.doc-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 2px;
}

.doc-history-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #0f172a;
}

.doc-history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.doc-history-card {
  width: 100%;
  box-sizing: border-box;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.65);
  -webkit-backdrop-filter: saturate(160%) blur(20px);
  backdrop-filter: saturate(160%) blur(20px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8),
              0 4px 14px -4px rgba(15, 23, 42, 0.05);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  position: relative;
  overflow: hidden;
}

.doc-history-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.9), transparent);
  pointer-events: none;
}

.doc-history-card-main {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}

.doc-history-card-main strong {
  font-size: 13.5px;
  font-weight: 700;
  color: #0f172a;
}

.doc-history-card-main span {
  font-size: 11.5px;
  color: #64748b;
}

.doc-history-card-value {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #059669;
  white-space: nowrap;
}

.doc-history-card .anthropometry-preview-actions {
  margin: 0;
}

/* ============================================================
   PREVIEW DE RECIBOS E DECLARAÇÕES (estilo card de exames)
   ============================================================ */
.doc-preview-card {
  gap: 10px;
}

.doc-preview-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.doc-preview-kpi-row-compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.doc-preview-kpi-row .anthropometry-preview-kpi {
  padding: 7px 9px;
}

.doc-preview-kpi-row .anthropometry-preview-kpi-text strong {
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.doc-preview-value-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.22);
  color: #059669;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.doc-preview-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  color: #2563eb;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .doc-preview-kpi-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .doc-preview-kpi-row-compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
