/* ========== RESET & BASE ========== */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scrollbar-gutter: stable; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-feature-settings: "cv11", "ss01", "ss03";
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

:root {
  --accent-h: 225;
  --accent: hsl(var(--accent-h) 65% 48%);
  --accent-soft: hsl(var(--accent-h) 65% 96%);
  --accent-hover: hsl(var(--accent-h) 65% 42%);
  --accent-ring: hsl(var(--accent-h) 70% 55% / 0.25);

  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-2: #fbfbfd;
  --border: #e7e9ee;
  --border-soft: #eef0f4;
  --text: #0e1726;
  --text-soft: #4a5468;
  --text-muted: #8b93a7;
  --text-faint: #b6bcca;

  --ok: #0d9668;
  --ok-soft: #e7f6ef;
  --warn: #c77400;

  --shadow-sm: 0 1px 2px rgba(15, 22, 40, 0.04);
  --shadow-md: 0 4px 16px rgba(15, 22, 40, 0.06), 0 1px 3px rgba(15, 22, 40, 0.04);
  --shadow-lg: 0 24px 60px rgba(15, 22, 40, 0.12), 0 4px 12px rgba(15, 22, 40, 0.06);

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
}

button { font: inherit; color: inherit; }

/* ========== HEADER ========== */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.app-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 40;
}
.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 14px 32px;
  display: grid;
  grid-template-columns: 280px 1fr 320px;
  gap: 32px;
  align-items: center;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--accent);
  color: white;
  display: grid; place-items: center;
  box-shadow: 0 4px 10px hsl(var(--accent-h) 65% 48% / 0.25);
}
.brand-name { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; }
.brand-name span { color: var(--accent); font-weight: 500; }
.brand-sub { font-size: 11px; color: var(--text-muted); letter-spacing: 0.04em; text-transform: uppercase; font-weight: 500; }

.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.search-icon {
  position: absolute; left: 14px;
  color: var(--text-muted);
  pointer-events: none;
}
.search-input {
  width: 100%;
  padding: 11px 14px 11px 40px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 10px;
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.search-input::placeholder { color: var(--text-muted); }
.search-input:focus {
  border-color: var(--accent);
  background: white;
  box-shadow: 0 0 0 4px var(--accent-ring);
}
.kbd {
  position: absolute; right: 10px;
  font: 11px/1 'SF Mono', ui-monospace, monospace;
  background: white;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 3px 6px;
  border-radius: 5px;
  letter-spacing: 0.05em;
}

.header-right { display: flex; align-items: center; gap: 16px; justify-content: flex-end; }
.icon-btn {
  width: 38px; height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-soft);
  display: grid; place-items: center;
  cursor: pointer;
  position: relative;
  transition: all .15s;
}
.icon-btn:hover { background: white; border-color: var(--text-faint); color: var(--text); }
.icon-btn .dot {
  position: absolute; top: 9px; right: 9px;
  width: 7px; height: 7px; border-radius: 50%;
  background: #e04d4d; border: 2px solid var(--surface);
  box-sizing: content-box;
}

.doctor { display: flex; align-items: center; gap: 10px; }
.doctor-avatar { flex-shrink: 0; }
.doctor-name { font-size: 13.5px; font-weight: 600; line-height: 1.3; white-space: nowrap; }
.doctor-crm { font-size: 11.5px; color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.doctor-wide .doctor-info { min-width: 0; max-width: 280px; }
.doctor-wide .doctor-name { font-size: 14px; }

.header-strip {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 32px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.date-pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12.5px; color: var(--text-soft);
  background: var(--accent-soft);
  color: var(--accent-hover);
  padding: 5px 11px;
  border-radius: 999px;
  font-weight: 500;
}
.stat-strip { display: flex; align-items: center; gap: 16px; font-size: 12.5px; color: var(--text-muted); }
.stat { display: flex; align-items: baseline; gap: 5px; }
.stat-n { font-size: 14px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.stat-sep { width: 3px; height: 3px; border-radius: 50%; background: var(--text-faint); }

/* ========== CATEGORY NAV ========== */
.cat-nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 108px; z-index: 30;
}
.cat-nav-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 12px 32px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}
.cat-nav-inner::-webkit-scrollbar { display: none; }
.cat-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 13px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-soft);
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s;
}
.cat-pill:hover { background: var(--bg); color: var(--text); }
.cat-pill.active {
  background: var(--text);
  color: white;
  border-color: var(--text);
}
.cat-count {
  font-size: 11px;
  background: rgba(0,0,0,0.06);
  padding: 1px 7px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.cat-pill.active .cat-count { background: rgba(255,255,255,0.18); }

/* ========== MAIN ========== */
.main { flex: 1; padding: 28px 0 80px; }
.main-inner { max-width: 1400px; margin: 0 auto; padding: 0 32px; }

.sec { margin-bottom: 36px; }
.sec-head {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 14px;
}
.sec-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text);
}
.sec-star { color: #e8b004; }
.sec-count {
  font-size: 11.5px;
  color: var(--text-muted);
  background: var(--bg);
  padding: 2px 8px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  border: 1px solid var(--border);
}

/* ========== CARD GRID ========== */
.card-grid { display: grid; gap: 10px; }
.card-grid.grid-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.card-grid.grid-list { grid-template-columns: 1fr; gap: 4px; }
.card-grid.grid-tile { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }

.density-compacto .card-grid.grid-grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.density-compacto .card-grid.grid-tile { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }

.card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-lg);
  cursor: pointer;
  text-align: left;
  position: relative;
  transition: all .14s ease;
  width: 100%;
  box-shadow: var(--shadow-sm);
}
.card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px hsl(var(--accent-h) 40% 40% / 0.08);
}
.card:active { transform: translateY(0); }

.card-icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.card-body { flex: 1; min-width: 0; }
.card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-sub {
  display: flex; align-items: center; gap: 8px;
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--text-muted);
}
.card-cat { font-weight: 500; }
.card-cid {
  font-variant-numeric: tabular-nums;
  font-family: 'SF Mono', ui-monospace, monospace;
  font-size: 10.5px;
  background: var(--bg);
  padding: 1px 6px;
  border-radius: 4px;
}

.card-star {
  position: absolute;
  top: 10px; right: 10px;
  width: 26px; height: 26px;
  display: grid; place-items: center;
  color: var(--text-faint);
  border-radius: 6px;
  cursor: pointer;
  opacity: 0;
  transition: all .15s;
}
.card:hover .card-star { opacity: 1; }
.card-star:hover { background: var(--bg); color: #e8b004; }
.card-star.on { opacity: 1; color: #e8b004; }

/* TILE variant - bigger */
.card-tile {
  flex-direction: column;
  align-items: flex-start;
  padding: 18px;
  min-height: 130px;
}
.card-tile .card-icon { width: 40px; height: 40px; }
.card-tile .card-body { margin-top: auto; flex: 0; }
.card-tile .card-name { font-size: 15px; white-space: normal; }

/* LIST variant - compact row */
.card-list {
  padding: 10px 14px;
  border-radius: 8px;
}
.card-list .card-icon { width: 32px; height: 32px; border-radius: 7px; }
.card-list .card-icon svg { width: 16px; height: 16px; }

/* ========== CATEGORY COLORS (icon backgrounds) ========== */
.cat-bg-prescries        { background: #eff6ff; color: #1d4ed8; }
.cat-bg-encaminhamentos  { background: #ecfdf5; color: #047857; }
.cat-bg-emergncia        { background: #fef2f2; color: #b91c1c; }
.cat-bg-gestantes        { background: #fdf2f8; color: #be185d; }
.cat-bg-outros           { background: #fefce8; color: #a16207; }
.cat-bg-condutamdica     { background: #fef2f2; color: #b91c1c; }

.cat-chip {
  display: inline-flex; align-items: center;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 999px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.cat-prescries        { background: #eff6ff; color: #1d4ed8; }
.cat-encaminhamentos  { background: #ecfdf5; color: #047857; }
.cat-emergncia        { background: #fef2f2; color: #b91c1c; }
.cat-gestantes        { background: #fdf2f8; color: #be185d; }
.cat-outros           { background: #fefce8; color: #a16207; }

/* Category-tinted active pills */
.cat-pill.active.cat-pill-prescries        { background: #1d4ed8; border-color: #1d4ed8; }
.cat-pill.active.cat-pill-encaminhamentos  { background: #047857; border-color: #047857; }
.cat-pill.active.cat-pill-emergncia        { background: #b91c1c; border-color: #b91c1c; }
.cat-pill.active.cat-pill-gestantes        { background: #be185d; border-color: #be185d; }
.cat-pill.active.cat-pill-outros           { background: #a16207; border-color: #a16207; }

/* ========== DRAWER ========== */
.drawer-overlay {
  position: fixed; inset: 0;
  background: rgba(15, 22, 40, 0.28);
  backdrop-filter: blur(2px);
  z-index: 100;
  animation: fade-in .2s ease;
}
.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 560px;
  max-width: 100vw;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  z-index: 101;
  display: flex;
  flex-direction: column;
  animation: slide-in .28s cubic-bezier(0.22, 0.8, 0.3, 1);
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes slide-in { from { transform: translateX(28px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

.drawer-header {
  padding: 10px 16px 8px;
  border-bottom: 1px solid var(--border-soft);
  flex-shrink: 0;
}
.close-btn { width: 30px; height: 30px; }

.drawer-title-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.drawer-head-actions { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.drawer-title {
  font-family: 'Source Serif 4', 'Source Serif Pro', Georgia, serif;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
  margin: 0;
  color: var(--text);
}
.fav-btn {
  border: none;
  background: transparent;
  color: var(--text-faint);
  width: 36px; height: 36px;
  border-radius: 8px;
  display: grid; place-items: center;
  cursor: pointer;
  transition: all .15s;
  flex-shrink: 0;
}
.fav-btn:hover { background: var(--bg); color: #e8b004; }
.fav-btn.on { color: #e8b004; }

.drawer-meta {
  display: flex; align-items: center; gap: 8px;
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
}
.meta-item { display: inline-flex; align-items: center; gap: 5px; }
.meta-label { font-weight: 600; color: var(--text-soft); letter-spacing: 0.02em; }
.meta-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--text-faint); }

/* ========== DRAWER NAVBAR (actions bar) ========== */
.drawer-navbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 10px;
  background: var(--bg);
  border-bottom: 1px solid var(--border-soft);
  flex-shrink: 0;
  gap: 4px;
}
.dnavbar-left, .dnavbar-right { display: flex; align-items: center; gap: 2px; }
.dnavbar-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-soft);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.dnavbar-btn:hover { background: var(--bg-card); color: var(--text); }
.dnavbar-discard { color: var(--text-muted); }
.dnavbar-discard:hover { background: hsl(0 70% 96%); color: hsl(0 65% 45%); }
.dnavbar-print {
  background: hsl(168 55% 88%);
  color: hsl(168 65% 24%);
  border: 1px solid hsl(168 50% 72%);
}
.dnavbar-print:hover { background: hsl(168 55% 78%); color: hsl(168 65% 18%); border-color: hsl(168 50% 60%); }
.dnavbar-save {
  background: var(--accent);
  color: white;
  padding: 5px 14px;
  font-weight: 600;
  box-shadow: 0 1px 4px hsl(var(--accent-h) 65% 40% / 0.35);
  animation: save-pop .2s cubic-bezier(0.22, 0.8, 0.3, 1);
}
.dnavbar-save:hover { background: var(--accent-hover); color: white; box-shadow: 0 2px 6px hsl(var(--accent-h) 65% 40% / 0.45); }
@keyframes save-pop { from { opacity: 0; transform: scale(0.85); } to { opacity: 1; transform: scale(1); } }

/* In-drawer section tabs (sticky under header) */
.drawer-tabs {
  position: relative;
  display: flex;
  gap: 0;
  padding: 0 24px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-soft);
  flex-shrink: 0;
  z-index: 2;
}
.drawer-tab {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 12px 14px;
  background: transparent;
  border: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-faint);
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: color 0.18s ease;
  position: relative;
}
.drawer-tab:hover { color: var(--text-soft); }
.drawer-tab.active { color: var(--accent); }
.drawer-tab svg { opacity: 0.9; }
.drawer-tabs-indicator {
  position: absolute;
  bottom: -1px;
  left: 24px;
  width: calc((100% - 48px) / 2);
  height: 2px;
  background: var(--accent);
  border-radius: 2px 2px 0 0;
  transition: transform 0.24s cubic-bezier(.4,0,.2,1);
}
.drawer-tabs-indicator.right { transform: translateX(100%); }

.drawer-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: hsl(220 12% 80%) transparent;
  padding: 16px 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.drawer-body::-webkit-scrollbar { width: 10px; }
.drawer-body::-webkit-scrollbar-track { background: transparent; }
.drawer-body::-webkit-scrollbar-thumb {
  background: hsl(220 14% 82%);
  border-radius: 8px;
  border: 2px solid var(--surface);
}
.drawer-body::-webkit-scrollbar-thumb:hover { background: hsl(220 14% 70%); }

/* ========== RX BLOCKS (Medicamentos + Conduta) ========== */
.rx-block {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
  display: flex;
  flex-direction: column;
}
.rx-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-soft);
}
.rx-block-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.rx-block-title svg { color: var(--accent); }
.rx-block-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.rx-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: white;
  cursor: pointer;
  transition: all .15s;
  letter-spacing: 0.01em;
}
.rx-copy-btn:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 3px 8px hsl(var(--accent-h) 65% 40% / 0.35);
}
.rx-copy-btn:active { transform: translateY(0); box-shadow: none; }
.rx-print-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all .15s;
}
.rx-print-btn:hover {
  background: var(--surface);
  border-color: var(--text-muted);
  color: var(--text);
  transform: translateY(-1px);
}
.rx-print-btn:active { transform: translateY(0); }
.rx-block .editor { height: auto; }
.rx-block .editor-area {
  padding: 12px 18px;
  background: white;
  font-size: var(--rx-font-size, 12px);
  line-height: 1.55;
  min-height: 60px;
  max-height: calc(100vh - 310px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: hsl(220 12% 78%) transparent;
}
.rx-block .editor-area::-webkit-scrollbar { width: 6px; }
.rx-block .editor-area::-webkit-scrollbar-thumb {
  background: hsl(220 14% 80%);
  border-radius: 3px;
}
.rx-block .editor-area::-webkit-scrollbar-thumb:hover { background: hsl(220 14% 65%); }
.rx-block .editor-toolbar { padding: 6px 12px; }
.rx-block-conduta {
  border-color: hsl(28 80% 82%);
  background: hsl(35 100% 98.5%);
}
.rx-block-conduta .rx-block-head {
  background: hsl(35 100% 96%);
  border-bottom-color: hsl(28 80% 82%);
}
.rx-block-conduta .rx-block-title svg { color: hsl(22 85% 50%); }
.rx-block-conduta .editor-area { background: hsl(40 100% 99%); }
.rx-block-conduta .rx-copy-btn { background: hsl(22 85% 50%); border-color: hsl(22 85% 50%); }
.rx-block-conduta .rx-copy-btn:hover { background: hsl(22 85% 42%); border-color: hsl(22 85% 42%); }

/* ========== PRINT MODAL INCLUDE GRID ========== */
.print-info-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  margin-bottom: 14px;
  background: hsl(var(--accent-h) 70% 97%);
  border: 1px solid hsl(var(--accent-h) 60% 85%);
  border-radius: 8px;
  font-size: 12.5px;
  color: hsl(var(--accent-h) 50% 35%);
  font-weight: 500;
}
.print-info-row svg { color: var(--accent); flex-shrink: 0; }

.form-hint {
  font-size: 11.5px;
  color: var(--text-muted);
  margin: 0 0 10px;
  font-style: italic;
}
.form-optional {
  font-style: normal;
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.85em;
  margin-left: 4px;
}

/* TIPO TOGGLE — choose Prescrição vs Conduta Médica in new modal */
.tipo-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 4px;
  background: var(--bg-soft);
  border-radius: 12px;
  margin-bottom: 18px;
}
.tipo-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 12px;
  background: transparent;
  border: 2px solid transparent;
  border-radius: 9px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all .15s;
  text-align: center;
  line-height: 1.25;
}
.tipo-btn svg { flex-shrink: 0; }
.tipo-btn:hover { color: var(--text); background: rgba(255,255,255,0.6); }
.tipo-btn.active {
  background: white;
  border-color: var(--accent);
  color: var(--accent-hover);
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.tipo-btn.tipo-btn-red.active {
  border-color: #d04c2c;
  color: #b91c1c;
  box-shadow: 0 2px 8px rgba(208, 76, 44, 0.12);
}

/* ========== PREVIEW VIA (2-vias preview) ========== */
.preview-paper.preview-via {
  padding: 18px 20px;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 11.5px;
  line-height: 1.55;
  color: #222;
  min-height: 480px;
  display: flex;
  flex-direction: column;
}
.preview-via-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 14px 0 12px;
  font-family: Inter, sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: #666;
}
.preview-via-date {
  font-weight: 500;
  letter-spacing: 0.04em;
  color: #333;
}
.preview-paciente-line {
  border-bottom: 1px solid #333;
  padding-bottom: 3px;
  margin-bottom: 14px;
  display: flex;
  gap: 8px;
  align-items: baseline;
  min-height: 20px;
}
.pp-label {
  font-family: Inter, sans-serif;
  font-weight: 700;
  font-size: 10.5px;
}
.pp-name { flex: 1; font-size: 12px; }
.pp-empty { color: transparent; }
.preview-rx {
  font-size: 30px;
  font-weight: 700;
  color: #0050a3;
  line-height: 1;
  margin-bottom: 6px;
}
.preview-paper.preview-via .preview-content {
  font-size: 1em;
  line-height: 1.7;
  margin-bottom: 10px;
}
.preview-paper.preview-via .preview-content h3 {
  font-size: 0.82em;
  font-family: Inter, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  color: #666;
  margin: 8px 0 3px;
}
.preview-paper.preview-via .preview-content ul,
.preview-paper.preview-via .preview-content ol {
  padding-left: 18px;
  margin: 0 0 6px;
}
.preview-paper.preview-via .preview-content li { margin-bottom: 3px; }
.preview-paper.preview-via .preview-content ol.med-list {
  list-style: none;
  padding-left: 0;
  margin: 0 0 10px;
  counter-reset: medcounter;
}
.preview-paper.preview-via .preview-content ol.med-list li.med-item {
  counter-increment: medcounter;
  padding-left: 22px;
  position: relative;
  margin-bottom: 8px;
}
.preview-paper.preview-via .preview-content ol.med-list li.med-item::before {
  content: counter(medcounter) " —";
  position: absolute;
  left: 0;
  top: 0;
  font-weight: 700;
  color: #111;
}
.preview-paper.preview-via .preview-content .med-name {
  font-weight: 700;
  color: #111;
  line-height: 1.35;
}
.preview-paper.preview-via .preview-content .med-dose {
  font-style: italic;
  color: #333;
  line-height: 1.4;
  font-size: 0.96em;
  margin-top: 1px;
}
.preview-paper.preview-via .preview-content::after { display: none; }
.preview-sign {
  margin-top: auto;
  padding-top: 30px;
  text-align: center;
}
.preview-sign-line {
  width: 70%;
  margin: 0 auto 4px;
  border-top: 1px solid #333;
}
.preview-sign-caption {
  font-family: Inter, sans-serif;
  font-size: 9px;
  color: #666;
  letter-spacing: 0.05em;
}

.print-include-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}
.toggle-row.toggle-inline {
  margin-bottom: 0;
  padding: 10px 12px;
  font-size: 13px;
}
.toggle-row.toggle-inline.on {
  background: hsl(var(--accent-h) 70% 96%);
  border-color: hsl(var(--accent-h) 60% 75%);
  color: var(--accent);
}

/* ========== PREVIEW CONDUTA ========== */
.preview-conduta {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1.5px dashed hsl(28 60% 65%);
  border-radius: 6px;
  background: hsl(35 100% 98%);
  position: relative;
}
.preview-conduta::before {
  content: "CONDUTA PS";
  position: absolute;
  top: -8px;
  left: 10px;
  background: white;
  padding: 0 6px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: hsl(22 60% 45%);
}

@media (max-width: 720px) {
  .drawer-body { padding: 12px 16px 16px; gap: 10px; }
  .rx-block-head { padding: 8px 12px; }
  .rx-block .editor-area { padding: 10px 14px; font-size: var(--rx-font-size, 12px); max-height: calc(100vh - 260px); }
  .print-include-grid { grid-template-columns: 1fr; }
}

/* ========== EDITOR ========== */
.editor { display: flex; flex-direction: column; height: 100%; }
.editor-toolbar {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 8px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border-soft);
}
.tb-btn {
  border: 1px solid transparent;
  background: transparent;
  width: 30px; height: 30px;
  border-radius: 6px;
  display: grid; place-items: center;
  cursor: pointer;
  color: var(--text-soft);
  transition: all .12s;
}
.tb-btn:hover { background: var(--bg); color: var(--text); }
.tb-btn.active { background: var(--accent-soft); color: var(--accent); }
.tb-text { width: auto; padding: 0 10px; font-size: 12.5px; font-weight: 500; }
.tb-sep { width: 1px; height: 20px; background: var(--border); margin: 0 4px; }

.editor-area {
  padding: 20px 24px 40px;
  font-size: var(--rx-font-size, 12px);
  line-height: 1.6;
  color: var(--text-soft);
  outline: none;
  min-height: 100%;
}
/* Herda o tamanho da variável — anula apenas font-size inline de conteúdo colado */
.editor-area * { font-size: inherit !important; font-family: inherit !important; }
.editor-area h3 { font-size: calc(var(--rx-font-size, 12px) + 1px) !important; }
.editor-area.editable {
  background: linear-gradient(to right, var(--accent-soft) 3px, transparent 3px);
  background-size: 3px 100%;
}
.editor-area h3 {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin: 16px 0 6px;
  letter-spacing: -0.01em;
}
.editor-area h3:first-child { margin-top: 0; }
.editor-area p { margin: 0 0 10px; }
.editor-area ul, .editor-area ol { margin: 0 0 14px; padding-left: 22px; }
.editor-area li { margin-bottom: 4px; }
.editor-area b, .editor-area strong { color: var(--text); font-weight: 600; }

/* ========== MED LIST (Nome + Posologia) ========== */
.editor-area ol.med-list {
  list-style: none;
  padding-left: 0;
  margin: 0 0 14px;
  counter-reset: medcounter;
}
.editor-area ol.med-list li.med-item {
  counter-increment: medcounter;
  margin: 0 0 14px;
  padding: 0 0 0 28px;
  position: relative;
}
.editor-area ol.med-list li.med-item::before {
  content: counter(medcounter) " —";
  position: absolute;
  left: 0;
  top: 0;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.editor-area ol.med-list li.med-item:last-child { margin-bottom: 4px; }
.editor-area .med-name {
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 2px;
}
.editor-area .med-name em {
  font-style: italic;
  font-weight: 500;
  color: var(--text-muted);
  margin-right: 4px;
}
.editor-area .med-dose {
  font-style: italic;
  color: var(--text-muted);
  line-height: 1.45;
  font-weight: 400;
  font-size: 0.96em;
}

/* ========== DRAWER FOOTER ========== */
.drawer-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--border-soft);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.footer-actions-left, .footer-actions-right {
  display: flex; align-items: center; gap: 8px;
}

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 14px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all .15s;
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  box-shadow: 0 1px 2px hsl(var(--accent-h) 65% 30% / 0.2);
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-ghost {
  background: transparent;
  color: var(--text-soft);
  border-color: var(--border);
}
.btn-ghost:hover { background: white; border-color: var(--text-faint); color: var(--text); }
.btn-ghost.ok { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-soft); }

.saved-flash {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12.5px;
  color: var(--ok);
  font-weight: 500;
  animation: fade-out 1.8s ease;
}
@keyframes fade-out { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }

/* ========== EMPTY ========== */
.empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--text-muted);
}
.empty p { font-size: 14px; margin: 14px 0; }
.empty svg { color: var(--text-faint); }

/* ========== HINT BAR ========== */
.hint-bar {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 18px;
  padding: 9px 16px;
  background: rgba(14, 23, 38, 0.92);
  color: #d1d6e0;
  border-radius: 10px;
  font-size: 12px;
  z-index: 20;
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-md);
}
.hint-bar span { display: inline-flex; align-items: center; gap: 6px; }
.hint-bar .kbd {
  position: static;
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.15);
  color: #e5e9f0;
}

/* ========== MODAL (base, high specificity, loaded early) ========== */
.modal-overlay {
  position: fixed !important;
  inset: 0 !important;
  background: rgba(15, 22, 40, 0.4);
  backdrop-filter: blur(3px);
  z-index: 110 !important;
  animation: fade-in .2s ease;
}
.modal {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  width: 640px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 60px);
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  z-index: 111 !important;
  display: flex !important;
  flex-direction: column;
  animation: modal-pop .24s cubic-bezier(0.22, 0.8, 0.3, 1);
  overflow: hidden;
}
.modal.modal-wide { width: 900px; }
@keyframes modal-pop {
  from { opacity: 0; transform: translate(-50%, -48%) scale(0.97); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* ========== TOAST ========== */
.toast-stack {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px 11px 12px;
  background: #0e1726;
  color: white;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  animation: toast-in .25s cubic-bezier(0.3, 0.8, 0.3, 1.2);
  pointer-events: auto;
  min-width: 240px;
}
.toast-success { background: #0d9668; }
.toast-error { background: #c93b3b; }
.toast-info { background: #1f3a5f; }
.toast-icon {
  width: 22px; height: 22px;
  background: rgba(255,255,255,0.18);
  border-radius: 6px;
  display: grid; place-items: center;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(-10px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ========== META DIRTY ========== */
.meta-dirty { color: var(--warn); font-weight: 600; }

/* ========== PRINT MODAL ========== */
.modal-wide { width: 900px; }
.print-modal-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
}
.print-left, .print-right { min-width: 0; }

.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--accent-soft);
  border-radius: 10px;
  margin-bottom: 16px;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--accent-hover);
}
.toggle-row input { accent-color: var(--accent); width: 16px; height: 16px; }

.font-size-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.fs-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  flex-shrink: 0;
}
.fs-options {
  display: flex;
  gap: 4px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 3px;
}
.fs-option {
  padding: 6px 10px;
  border-radius: 5px;
  border: 0;
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  font-variant-numeric: tabular-nums;
  transition: background .12s, color .12s;
}
.fs-option:hover { color: var(--text); }
.fs-option.active {
  background: var(--accent);
  color: white;
}

/* ========== COMPACT PRINT MODAL ========== */
.print-info-row {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.compact-section {
  padding: 10px 12px !important;
  margin-bottom: 10px;
}
.section-head-row { margin-bottom: 8px; }
.section-title-static {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.saved-headers {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.saved-header-chip {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid var(--accent);
  border-radius: 20px;
  overflow: hidden;
  font-size: 12px;
  font-weight: 600;
  background: var(--accent-soft);
}
.shc-name {
  padding: 4px 10px 4px 11px;
  color: var(--accent);
  cursor: pointer;
  background: none;
  border: none;
  font: inherit;
  font-weight: 600;
  white-space: nowrap;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background .12s;
}
.shc-name:hover { background: hsl(var(--accent-h) 65% 90%); }
.shc-del {
  padding: 4px 8px 4px 4px;
  color: var(--accent);
  cursor: pointer;
  background: none;
  border: none;
  font-size: 14px;
  line-height: 1;
  opacity: 0.6;
  transition: opacity .12s;
}
.shc-del:hover { opacity: 1; }
.print-header-warning {
  display: flex;
  align-items: center;
  gap: 7px;
  background: #fef9c3;
  border: 1px solid #fde047;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 500;
  color: #854d0e;
  margin-bottom: 6px;
}
.section-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}
.section-toggle input { accent-color: var(--accent); width: 15px; height: 15px; }
.form-row.tight { margin-bottom: 6px; }
.form-grid.tight { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.form-row.tight .form-input,
.form-grid.tight .form-input {
  padding: 7px 10px;
  font-size: 12.5px;
  height: 32px;
}
.compact-options {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 0;
}
.opt-line {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 12px;
  font-size: 12.5px;
  color: var(--text);
  cursor: pointer;
  border-radius: 5px;
  margin: 0 4px;
}
.opt-line:hover { background: white; }
.opt-line input[type="checkbox"] {
  accent-color: var(--accent);
  width: 15px;
  height: 15px;
  margin: 0;
}
.opt-line.opt-disabled { opacity: 0.45; cursor: not-allowed; }
.opt-line.opt-fs {
  justify-content: space-between;
  cursor: default;
}
.opt-line.opt-fs:hover { background: transparent; }
.opt-fs-label { font-weight: 500; }
.fs-slider-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.fs-slider {
  width: 110px;
  cursor: pointer;
  height: 4px;
  border-radius: 2px;
}
.fs-slider-val {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  min-width: 28px;
  text-align: right;
}
.opt-line.opt-pac {
  cursor: default;
  padding: 6px 8px;
}
.opt-line.opt-pac:hover { background: transparent; }
.form-input-sm {
  width: 100%;
  padding: 7px 10px !important;
  font-size: 12.5px !important;
  height: 32px !important;
}

.form-section {
  padding: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: opacity .2s;
}
.form-section.disabled { opacity: 0.45; pointer-events: none; }
.form-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.preview-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.preview-paper {
  background: white;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 22px 20px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.04);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 12px;
  color: #333;
  min-height: 380px;
  position: sticky;
  top: 20px;
}
.rx-header-preview { margin-bottom: 14px; }
.rxh-top { display: flex; gap: 12px; align-items: center; }
.rxh-logo {
  width: 40px; height: 40px;
  border: 2px solid var(--accent);
  color: var(--accent);
  border-radius: 7px;
  display: grid; place-items: center;
  flex-shrink: 0;
  font-family: 'Inter', sans-serif;
}
.rxh-main { flex: 1; min-width: 0; }
.rxh-unidade { font-size: 15px; font-weight: 700; color: #111; margin-bottom: 2px; line-height: 1.2; }
.rxh-addr { font-size: 11px; color: #666; line-height: 1.35; }
.rxh-divider { border-top: 1.5px solid #333; margin: 8px 0 6px; }
.rxh-doctor { font-size: 11px; color: #444; display: flex; gap: 6px; flex-wrap: wrap; }

.preview-empty {
  padding: 16px;
  border: 1px dashed var(--border);
  text-align: center;
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  border-radius: 6px;
  margin-bottom: 14px;
}
.preview-paciente {
  border: 1px solid #333;
  padding: 6px 10px;
  font-size: 11px;
  margin-bottom: 12px;
  border-radius: 2px;
}
.preview-title {
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid #333;
  padding-bottom: 6px;
  margin: 10px 0 6px;
}
.preview-meta {
  font-size: 10px;
  color: #666;
  text-align: right;
  margin-bottom: 10px;
}
.preview-content {
  font-size: 11px;
  line-height: 1.45;
  color: #555;
  max-height: 150px;
  overflow: hidden;
  position: relative;
}
.preview-content::after {
  content: "";
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 40px;
  background: linear-gradient(to bottom, transparent, white);
}
.preview-content h3 { font-size: 11.5px; margin: 8px 0 3px; color: #111; }
.preview-content ul, .preview-content ol { padding-left: 16px; margin: 0 0 6px; }
.preview-content li { margin-bottom: 2px; }
.preview-content ol.med-list {
  list-style: none;
  padding-left: 0;
  counter-reset: medcounter;
}
.preview-content ol.med-list li.med-item {
  counter-increment: medcounter;
  padding-left: 18px;
  position: relative;
  margin-bottom: 4px;
}
.preview-content ol.med-list li.med-item::before {
  content: counter(medcounter) " —";
  position: absolute;
  left: 0;
  top: 0;
  font-weight: 700;
  color: #111;
  font-size: 10.5px;
}
.preview-content .med-name { font-weight: 700; color: #111; }
.preview-content .med-dose { font-style: italic; color: #444; font-size: 0.95em; }

/* ========== MODAL RESPONSIVE FIXES ========== */
.modal-editor { min-height: 220px; }
.modal-editor .editor { min-height: 220px; display: flex; flex-direction: column; }
.modal-editor .editor-area {
  min-height: 180px;
  padding: 14px 16px;
  font-size: 13.5px;
  flex: 1;
  background: white;
}
.modal-editor .editor-area.editable { background: white; }
.modal-editor .editor-toolbar {
  padding: 6px 10px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

@media (max-width: 860px) {
  .print-modal-body { grid-template-columns: 1fr; gap: 16px; }
  .preview-paper { position: static; min-height: 280px; }
  .modal-wide { width: 100vw; }
}
@media (max-height: 800px) {
  .preview-paper { position: static !important; }
  .print-modal-body { grid-template-columns: 1fr 1fr; }
}

/* ========== RESPONSIVE ========== */
.mobile-only { display: none; }
.mobile-search-bar { display: none; }

/* ========== FAB (Floating Action Button) ========== */
.fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px 14px 18px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  box-shadow: 0 8px 24px hsl(var(--accent-h) 65% 35% / 0.35), 0 2px 6px hsl(var(--accent-h) 65% 35% / 0.2);
  transition: all .18s cubic-bezier(0.3, 0.8, 0.3, 1);
}
.fab:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px hsl(var(--accent-h) 65% 35% / 0.45), 0 4px 10px hsl(var(--accent-h) 65% 35% / 0.25);
}
.fab:active { transform: translateY(0); }
.fab-label { display: inline-block; }

/* ========== NEW PRESCRIPTION MODAL ========== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15, 22, 40, 0.4);
  backdrop-filter: blur(3px);
  z-index: 110;
  animation: fade-in .2s ease;
}
.modal {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 640px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 60px);
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  z-index: 111;
  display: flex;
  flex-direction: column;
  animation: modal-pop .24s cubic-bezier(0.22, 0.8, 0.3, 1);
  overflow: hidden;
}
@keyframes modal-pop {
  from { opacity: 0; transform: translate(-50%, -48%) scale(0.97); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border-soft);
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 16px;
}
.modal-eyebrow {
  font-size: 11.5px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  margin-bottom: 4px;
}
.modal-title {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 22px;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.02em;
}
.modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}
.form-row { margin-bottom: 16px; }
.form-grid {
  display: grid;
  grid-template-columns: 1fr 160px;
  gap: 12px;
  margin-bottom: 16px;
}
.form-label, .form-label-text {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-soft);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}
.form-label em { color: #e04d4d; font-style: normal; }
.form-label > span { display: block; margin-bottom: 6px; }
.form-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text);
  font-family: inherit;
  outline: none;
  transition: all .15s;
}
.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.icon-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.icon-pick {
  width: 40px; height: 40px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 8px;
  display: grid; place-items: center;
  color: var(--text-soft);
  cursor: pointer;
  transition: all .15s;
}
.icon-pick:hover { border-color: var(--text-faint); color: var(--text); }
.icon-pick.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}
.modal-editor {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  max-height: 280px;
  display: flex;
  flex-direction: column;
}
.modal-editor .editor { max-height: 280px; }
.modal-editor .editor-toolbar { padding: 6px 10px; }
.modal-editor .editor-area { padding: 14px 16px; font-size: 13.5px; flex: 1; overflow-y: auto; }
.modal-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--border-soft);
  background: var(--surface-2);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* ========== RESPONSIVE (TABLET) ========== */
@media (max-width: 1100px) {
  .header-inner {
    grid-template-columns: auto 1fr auto;
    gap: 16px;
  }
  .brand-sub { display: none; }
  .kbd { display: none; }
  .drawer { width: min(560px, 100vw); }
}
@media (max-width: 880px) {
  .doctor-info { display: none; }
}

/* ========== RESPONSIVE (MOBILE) ========== */
@media (max-width: 720px) {
  .header-inner {
    grid-template-columns: 1fr auto;
    padding: 12px 16px;
    gap: 12px;
  }
  .brand-mark { width: 36px; height: 36px; border-radius: 9px; }
  .brand-name { font-size: 16px; }
  .brand-sub { display: none; }
  .search-wrap { display: none; }
  .header-right { gap: 8px; }
  .header-right .icon-btn { width: 40px; height: 40px; }
  .mobile-only { display: grid; }
  .doctor-info { display: none; }
  .doctor-avatar svg { width: 32px; height: 32px; }

  .mobile-search-bar {
    display: block;
    padding: 10px 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 62px;
    z-index: 35;
  }
  .mobile-search-bar .search-wrap { display: flex; }
  .mobile-search-bar .search-input { padding-right: 42px; }
  .mobile-search-close {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px; height: 32px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    border-radius: 6px;
    display: grid; place-items: center;
    cursor: pointer;
  }

  .header-strip {
    padding: 0 16px 12px;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .stat-strip { gap: 10px; font-size: 11.5px; }

  .cat-nav { position: sticky; top: 62px; }
  .cat-nav-inner { padding: 10px 16px; }

  .main { padding: 16px 0 120px; }
  .main-inner { padding: 0 16px; }

  .sec { margin-bottom: 24px; }
  .sec-head { margin-bottom: 10px; }

  /* On mobile, force a tighter 2-column grid regardless of chosen variant */
  .card-grid.grid-grid,
  .card-grid.grid-tile {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px;
  }
  .card-grid.grid-list { gap: 6px; }

  .card {
    padding: 14px 12px;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    min-height: 110px;
    border-radius: 12px;
  }
  .card-tile { flex-direction: column; }
  .card-list {
    flex-direction: row;
    align-items: center;
    min-height: 0;
    padding: 10px 12px;
  }
  .card-icon { width: 38px; height: 38px; }
  .card-name { font-size: 13.5px; white-space: normal; line-height: 1.25; }
  .card-sub { gap: 6px; font-size: 10.5px; }
  .card-star { opacity: 1; top: 6px; right: 6px; }

  /* Drawer full-screen on mobile */
  .drawer-overlay { display: none; }
  .drawer {
    width: 100vw;
    max-width: 100vw;
    inset: 0;
    animation: slide-up .25s cubic-bezier(0.22, 0.8, 0.3, 1);
  }
  @keyframes slide-up {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }
  .drawer-header { padding: 8px 12px 6px; }
  .drawer-title { font-size: 16px; }
  .drawer-navbar { padding: 3px 8px; }
  .dnavbar-btn { padding: 5px 7px; font-size: 12px; }
  .editor-toolbar { padding: 6px 12px; overflow-x: auto; scrollbar-width: none; }
  .editor-toolbar::-webkit-scrollbar { display: none; }
  .editor-area { padding: 16px; }
  .btn { padding: 10px 12px; font-size: 13px; }
  .btn span { display: inline; }

  .hint-bar { display: none; }

  /* FAB smaller + icon-only on mobile */
  .fab {
    bottom: 18px;
    right: 18px;
    padding: 0;
    width: 56px;
    height: 56px;
    justify-content: center;
  }
  .fab-label { display: none; }

  /* Modal fullscreen-ish on mobile */
  .modal {
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    max-height: 100vh;
    top: 0; left: 0;
    transform: none;
    border-radius: 0;
    animation: slide-up .25s cubic-bezier(0.22, 0.8, 0.3, 1);
  }
  .modal-header { padding: 16px; }
  .modal-title { font-size: 20px; }
  .modal-body { padding: 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .modal-footer {
    padding: 12px 16px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }
}

/* Very small phones */
@media (max-width: 380px) {
  .card-grid.grid-grid,
  .card-grid.grid-tile { grid-template-columns: 1fr !important; }
  .btn { padding: 10px; font-size: 12.5px; }
  .btn svg { width: 14px; height: 14px; }
}


/* ========== PROMINENT PATIENT FIELD ========== */
.paciente-prominent {
  background: linear-gradient(135deg, hsl(var(--accent-h) 70% 96%), hsl(var(--accent-h) 70% 92%));
  border: 1.5px solid hsl(var(--accent-h) 50% 80%);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 14px;
}
.paciente-label-big {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: hsl(var(--accent-h) 60% 35%);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}
.paciente-input-big {
  width: 100%;
  background: white;
  border: 1.5px solid hsl(var(--accent-h) 50% 75%);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.paciente-input-big:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px hsl(var(--accent-h) 70% 85% / 0.5);
}
.paciente-input-big::placeholder {
  color: var(--muted);
  font-weight: 400;
}

/* ========== ATESTADO BUTTON IN HEADER ========== */
.btn-atestado {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: white;
  border: 1.5px solid hsl(var(--accent-h) 60% 80%);
  border-radius: 10px;
  color: hsl(var(--accent-h) 60% 35%);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-atestado:hover {
  background: hsl(var(--accent-h) 70% 96%);
  border-color: var(--accent);
  transform: translateY(-1px);
}

/* ========== ATESTADO FIELDS ROW ========== */
.atest-fields-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.atest-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.atest-field-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.form-input-lg {
  padding: 10px 12px !important;
  font-size: 15px !important;
  font-weight: 500 !important;
}

/* ========== ATESTADO PREVIEW ========== */
.preview-atestado {
  font-family: Georgia, 'Times New Roman', serif;
  text-align: justify;
  line-height: 1.7;
  padding: 18px 22px !important;
}
.preview-atestado p {
  margin: 0 0 8px;
}
.atest-preview-title {
  text-align: center;
  font-size: 1.05em;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin: 0 0 14px;
}

/* ========== ATESTADO BUTTON DESKTOP/MOBILE ========== */
.desktop-only { display: inline-flex; }
@media (max-width: 720px) {
  .desktop-only { display: none; }
}


/* ========== NEW LIST CARD LAYOUT ========== */
.cards-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card.card-list {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: white;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .12s, background .15s;
  position: relative;
  width: 100%;
  font-family: inherit;
  outline: none;
}
.card.card-list:hover {
  border-color: hsl(var(--accent-h) 50% 70%);
  box-shadow: 0 4px 14px rgba(15, 22, 40, 0.06);
  transform: translateY(-1px);
}
.card.card-list:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px hsl(var(--accent-h) 70% 85% / 0.5);
}

/* favorite emphasis — inset shadow on left (respects border-radius) */
.card.card-list.card-fav {
  background: white;
  box-shadow: inset 4px 0 0 0 #e8b004;
}
.card.card-list.card-fav:hover {
  border-color: hsl(var(--accent-h) 50% 70%);
  box-shadow: inset 4px 0 0 0 #c89500, 0 4px 14px rgba(15, 22, 40, 0.06);
}

/* star button — left side, prominent */
.card.card-list .card-star {
  position: static;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--bg);
  color: var(--text-muted);
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  opacity: 1;
  transition: all .15s;
}
.card.card-list .card-star:hover {
  background: #fff7dd;
  color: #e8b004;
  transform: scale(1.08);
}
.card.card-list .card-star.on {
  background: transparent;
  color: #c89500;
  box-shadow: none;
}
.card.card-list .card-star.on svg {
  fill: #e8b004;
  stroke: #c89500;
  filter: drop-shadow(0 1px 1px rgba(200, 149, 0, 0.3));
}

.card.card-list .card-body {
  flex: 1;
  min-width: 0;
}
.card.card-list .card-name {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.01em;
  text-transform: uppercase;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card.card-list .card-sub {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--text-muted);
}
.card.card-list .card-cid {
  font-family: 'SF Mono', ui-monospace, monospace;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}
.card-cat-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* edit + delete actions on the right */
.card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.card-action {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: white;
  border: 1.5px solid var(--border);
  border-radius: 9px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all .15s;
}
.card-action:hover {
  background: var(--bg);
  color: var(--text);
  border-color: var(--text-muted);
}
.card-action-delete:hover {
  background: #ffe5e0;
  color: #d04c2c;
  border-color: #f5a896;
}

/* hide old grid + tile variants — list is now the only one */
.card-grid { display: none; }

/* ========== HERO SEARCH ========== */
.hero-search {
  position: relative;
  margin: 0 0 22px;
  animation: heroSlideIn 0.5s cubic-bezier(0.22, 0.8, 0.3, 1);
}
@keyframes heroSlideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
.hero-search-inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, white 0%, hsl(var(--accent-h) 60% 99%) 100%);
  border: 2px solid hsl(var(--accent-h) 50% 82%);
  border-radius: 16px;
  padding: 6px 18px 6px 22px;
  height: 64px;
  box-shadow:
    0 1px 3px rgba(15, 22, 40, 0.04),
    0 8px 24px hsl(var(--accent-h) 60% 50% / 0.08);
  transition: border-color .2s, box-shadow .2s, transform .15s;
}
.hero-search-inner:hover {
  transform: translateY(-1px);
  box-shadow:
    0 2px 6px rgba(15, 22, 40, 0.06),
    0 12px 32px hsl(var(--accent-h) 60% 50% / 0.12);
}
.hero-search-inner:focus-within {
  border-color: var(--accent);
  background: white;
  box-shadow:
    0 0 0 4px hsl(var(--accent-h) 70% 85% / 0.4),
    0 8px 24px hsl(var(--accent-h) 60% 50% / 0.15);
}

.hero-search-icon-wrap {
  position: relative;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: var(--accent);
}
.hero-search-icon {
  position: relative;
  z-index: 2;
  animation: heroIconBob 3.5s ease-in-out infinite;
}
@keyframes heroIconBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}
.hero-search-pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: hsl(var(--accent-h) 70% 70% / 0.35);
  animation: heroPulse 2.4s cubic-bezier(0.4, 0, 0.6, 1) infinite;
  z-index: 1;
}
@keyframes heroPulse {
  0% { transform: scale(0.6); opacity: 0.7; }
  70% { transform: scale(1.6); opacity: 0; }
  100% { transform: scale(1.6); opacity: 0; }
}
.hero-search-inner:focus-within .hero-search-pulse {
  animation-play-state: paused;
  opacity: 0;
}

.hero-search-input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-family: inherit;
  font-size: 18px;
  font-weight: 500;
  color: var(--text);
  min-width: 0;
  padding: 0;
  position: relative;
  z-index: 2;
}

.hero-search-placeholder {
  position: absolute;
  left: 76px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 18px;
  font-weight: 500;
  color: var(--text-muted);
  pointer-events: none;
  z-index: 1;
}
.hp-static { color: var(--text-muted); }
.hp-rotator {
  position: relative;
  display: inline-block;
  height: 1.4em;
  overflow: hidden;
  vertical-align: bottom;
  min-width: 180px;
}
.hp-word {
  display: block;
  height: 1.4em;
  line-height: 1.4em;
  color: hsl(var(--accent-h) 60% 45%);
  font-weight: 600;
  animation: hpRotate 9s steps(1, end) infinite;
}
.hp-word:nth-child(1) { animation-delay: 0s; }
.hp-word:nth-child(2) { animation-delay: -6.75s; }
.hp-word:nth-child(3) { animation-delay: -4.5s; }
.hp-word:nth-child(4) { animation-delay: -2.25s; }
@keyframes hpRotate {
  0%, 22% { transform: translateY(0); opacity: 1; }
  25%, 100% { transform: translateY(-100%); opacity: 0; }
}
.hp-rotator .hp-word { position: absolute; top: 0; left: 0; }
.hp-rotator .hp-word:nth-child(1) { animation: hpShow1 9s ease-in-out infinite; }
.hp-rotator .hp-word:nth-child(2) { animation: hpShow2 9s ease-in-out infinite; }
.hp-rotator .hp-word:nth-child(3) { animation: hpShow3 9s ease-in-out infinite; }
.hp-rotator .hp-word:nth-child(4) { animation: hpShow4 9s ease-in-out infinite; }
@keyframes hpShow1 {
  0%, 20% { transform: translateY(0); opacity: 1; }
  25%, 95% { transform: translateY(-100%); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}
@keyframes hpShow2 {
  0%, 20% { transform: translateY(100%); opacity: 0; }
  25%, 45% { transform: translateY(0); opacity: 1; }
  50%, 100% { transform: translateY(-100%); opacity: 0; }
}
@keyframes hpShow3 {
  0%, 45% { transform: translateY(100%); opacity: 0; }
  50%, 70% { transform: translateY(0); opacity: 1; }
  75%, 100% { transform: translateY(-100%); opacity: 0; }
}
@keyframes hpShow4 {
  0%, 70% { transform: translateY(100%); opacity: 0; }
  75%, 95% { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(-100%); opacity: 0; }
}

.hero-search-clear {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: var(--bg);
  border: none;
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all .15s;
  flex-shrink: 0;
}
.hero-search-clear:hover {
  background: #ffe5e0;
  color: #d04c2c;
}

.hero-search-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
  padding-left: 22px;
}
.kbd-hero {
  background: white;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  font-size: 11px;
  padding: 2px 7px;
}

/* ========== HEADER MINI SEARCH (replaces big one) ========== */
.header-search-mini {
  max-width: 320px !important;
}
.header-search-mini .search-input {
  font-size: 13px;
  padding: 9px 14px 9px 36px;
}

/* ========== SECTION FAV HINT ========== */
.sec-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sec-fav-hint {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  padding: 4px 10px;
  background: #fff7dd;
  border: 1px solid #f3d273;
  border-radius: 100px;
  color: #8c6800;
  font-size: 11px;
  font-weight: 600;
}
.sec-fav-hint svg { color: #e8b004; fill: #e8b004; }

/* ========== MOBILE OVERRIDES (new card-list) ========== */
@media (max-width: 720px) {
  .card.card-list {
    padding: 12px 14px;
    gap: 10px;
    flex-direction: row !important;
  }
  .card.card-list .card-star {
    width: 32px;
    height: 32px;
    border-radius: 8px;
  }
  .card.card-list .card-name {
    font-size: 13px;
    white-space: normal;
    line-height: 1.25;
  }
  .card.card-list .card-sub {
    gap: 6px;
    font-size: 10.5px;
    flex-wrap: wrap;
  }
  .card-actions { gap: 4px; }
  .card-action {
    width: 32px;
    height: 32px;
    border-radius: 8px;
  }
  .card-action svg { width: 14px; height: 14px; }
  .cards-stack { gap: 6px; }

  /* hero search adjusts on mobile */
  .hero-search-inner {
    height: 56px;
    padding: 6px 12px 6px 16px;
    gap: 10px;
  }
  .hero-search-icon-wrap { width: 32px; height: 32px; }
  .hero-search-input,
  .hero-search-placeholder { font-size: 16px; }
  .hero-search-placeholder { left: 60px; }
  .hero-search-hint { font-size: 11px; padding-left: 16px; }

  .header-search-mini { display: none !important; }
  .sec-fav-hint { font-size: 10.5px; padding: 3px 8px; }
}
@media (max-width: 380px) {
  .card.card-list .card-name { font-size: 12.5px; }
  .hero-search-inner { height: 52px; }
  .hero-search-input, .hero-search-placeholder { font-size: 15px; }
}

/* ========== STICKY HERO SEARCH ========== */
.hero-search-sticky {
  position: sticky;
  top: 0;
  z-index: 30;
  /* largura 100vw — funciona pois o elemento está direto dentro de .main (não do .main-inner) */
  width: 100%;
  margin-bottom: 22px;
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition:
    background .4s ease,
    box-shadow .4s ease,
    border-color .4s ease,
    padding .25s ease;
}
/* wrapper interno que respeita o max-width do conteúdo */
.hero-search-sticky-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 14px 32px;
  transition: padding .25s ease;
}
.hero-search-sticky::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -14px;
  height: 14px;
  background: linear-gradient(to bottom, hsl(var(--accent-h, 220) 40% 95% / 0.65), transparent);
  pointer-events: none;
  opacity: 0;
  transition: opacity .4s ease;
}
/* ── Estado fixado no topo ── */
.hero-search-sticky.is-stuck {
  background: var(--sticky-bg, hsl(var(--accent-h, 220) 38% 96%));
  box-shadow: 0 6px 28px hsl(var(--accent-h, 220) 45% 30% / 0.11);
  border-bottom-color: hsl(var(--accent-h, 220) 28% 90%);
}
.hero-search-sticky.is-stuck .hero-search-sticky-inner {
  padding-top: 10px;
  padding-bottom: 10px;
}
.hero-search-sticky.is-stuck::after { opacity: 1; }
.hero-search-sticky .hero-search { margin: 0; }

/* Input destaca em branco sobre o fundo colorido */
.hero-search-sticky.is-stuck .hero-search-inner {
  background: white;
  border-color: hsl(var(--accent-h, 220) 48% 76%);
  box-shadow:
    0 2px 6px rgba(15,22,40,.05),
    0 10px 28px hsl(var(--accent-h, 220) 60% 48% / 0.12);
  transition: border-color .4s, box-shadow .4s, background .4s;
}

/* Botões neutros ficam brancos pra contrastar */
.hero-search-sticky.is-stuck .hero-act-btn:not(.hero-act-nova) {
  background: white;
  border-color: hsl(var(--accent-h, 220) 28% 84%);
  box-shadow: 0 2px 10px hsl(var(--accent-h, 220) 40% 48% / 0.09);
  transition: background .4s, border-color .4s, box-shadow .4s, color .2s;
}

/* "Nova Prescrição" fica sólido — máximo destaque */
.hero-search-sticky.is-stuck .hero-act-nova {
  box-shadow: 0 4px 18px hsl(var(--accent-h, 220) 65% 38% / 0.32);
}

/* Inline kbd inside hero search */
.kbd-inline {
  margin-right: 12px;
  flex-shrink: 0;
  background: white;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 5px 9px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 6px;
  font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
  box-shadow: 0 1px 0 hsl(220 15% 88%);
  letter-spacing: 0.02em;
}

/* ========== FAB STACK (Atestado + Nova Prescrição) ========== */
.fab-stack {
  position: fixed;
  bottom: 28px;
  right: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 90;
  align-items: flex-end;
}
.fab-stack .fab {
  position: static;
  bottom: auto;
  right: auto;
}
.fab-atestado {
  background: white !important;
  color: var(--accent) !important;
  border: 1.5px solid var(--accent);
  box-shadow: 0 6px 16px hsl(220 15% 30% / 0.12), 0 2px 6px hsl(220 15% 30% / 0.08) !important;
  padding: 14px 22px !important;
  font-size: 14px !important;
}
.fab-atestado:hover {
  background: hsl(var(--accent-h) 70% 96%) !important;
  border-color: var(--accent-hover);
  color: var(--accent-hover) !important;
  box-shadow: 0 10px 24px hsl(var(--accent-h) 65% 35% / 0.2) !important;
}

/* Hide the now-removed header atestado button + bell + mobile-search */
.btn-atestado, .header-icon, .mobile-search-bar, .header-search-mini { display: none !important; }

@media (max-width: 720px) {
  .hero-search-sticky { margin-bottom: 14px; }
  .hero-search-sticky-inner { padding: 10px 16px 8px; }
  .fab-stack {
    bottom: 18px;
    right: 18px;
    gap: 10px;
  }
  .fab-stack .fab {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    padding: 0 !important;
    justify-content: center;
  }
  .fab-stack .fab-label { display: none; }
  .fab-atestado { font-size: 0 !important; }
}

/* Wider doctor area on desktop so name fits */
@media (min-width: 1100px) {
  .doctor-wide .doctor-info { max-width: 360px; }
  .doctor-wide .doctor-name { font-size: 14.5px; }
}


/* ========== 2-COLUMN LAYOUT ========== */
.cols-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}
.col {
  min-width: 0;
}
.col-empty {
  padding: 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  background: var(--bg);
  border-radius: 10px;
  border: 1px dashed var(--border);
}
.col-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
}
.col-dot-blue { background: hsl(var(--accent-h) 60% 55%); box-shadow: 0 0 0 3px hsl(var(--accent-h) 60% 88%); }
.col-dot-red { background: #d04c2c; box-shadow: 0 0 0 3px #ffd9d0; }

/* ========== CONDUTAS COLUMN — all red ========== */
.col-condutas .card.card-list:hover {
  border-color: #f3a896;
  box-shadow: 0 4px 14px rgba(208, 76, 44, 0.10);
}
.col-condutas .card.card-list:focus-visible {
  border-color: #d04c2c;
  box-shadow: 0 0 0 3px #ffd9d0;
}
.col-condutas .card.card-list .card-cat-tag {
  background: #fef2f2;
  color: #b91c1c;
}
.col-condutas .sec-title { color: #c0392b; }

@media (max-width: 900px) {
  .cols-2 { grid-template-columns: 1fr; gap: 18px; }
}


/* ========== HISTORY RAIL (vertical button on right edge) ========== */
.history-rail {
  position: fixed;
  bottom: 32px;
  right: 0;
  top: auto;
  transform: none;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-right: none;
  border-radius: 12px 0 0 12px;
  padding: 16px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  z-index: 95;
  box-shadow: -4px 0 12px hsl(220 25% 30% / 0.06);
  transition: all .2s;
  font-family: inherit;
}
.history-rail:hover {
  background: var(--accent-soft);
  color: var(--accent-hover);
  padding-right: 14px;
}
.history-rail.is-open {
  right: 360px;
}
.history-rail-text {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.history-rail:hover .history-rail-text { color: var(--accent-hover); }
.history-rail-badge {
  background: var(--accent);
  color: white;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
  min-width: 18px;
  text-align: center;
  line-height: 1.4;
}

/* ========== HISTORY DRAWER ========== */
.history-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 22, 40, 0.18);
  z-index: 96;
  animation: fade-in .2s ease;
}
.history-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 360px;
  max-width: 100vw;
  background: var(--surface);
  z-index: 97;
  display: flex;
  flex-direction: column;
  box-shadow: -10px 0 30px hsl(220 25% 30% / 0.12);
  animation: hist-slide .25s cubic-bezier(0.22, 0.8, 0.3, 1);
}
@keyframes hist-slide {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}
.history-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border-soft);
}
.history-eyebrow {
  font-size: 11px;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.history-title {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 18px;
  font-weight: 600;
  margin: 2px 0 0;
}
.history-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.history-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px 24px;
  text-align: center;
  color: var(--text-muted);
}
.history-empty p {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.history-empty span { font-size: 12.5px; line-height: 1.4; }

.history-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 12px 10px;
  background: var(--surface);
  transition: border-color .15s, transform .15s;
}
.history-item:hover { border-color: var(--accent); }
.history-prescricao { border-left: 3px solid var(--accent); }
.history-atestado { border-left: 3px solid #d97706; }

.history-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.history-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 6px;
}
.tag-prescricao {
  background: var(--accent-soft);
  color: var(--accent-hover);
}
.tag-atestado {
  background: #fef3e7;
  color: #b45309;
}
.tag-conduta {
  background: #fef2f2;
  color: #b91c1c;
}
.history-time {
  font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.history-paciente {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.history-paciente em {
  color: var(--text-muted);
  font-style: italic;
  font-weight: 500;
}
.history-detail {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
  line-height: 1.35;
}
.history-actions {
  display: flex;
  gap: 6px;
}
.history-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: white;
  color: var(--text);
  cursor: pointer;
  transition: all .15s;
}
.history-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-hover);
}
.history-btn-print {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  flex: 1;
  justify-content: center;
}
.history-btn-print:hover {
  background: var(--accent-hover);
  color: white;
}
.history-btn-del {
  width: 32px;
  padding: 0;
  justify-content: center;
}
.history-btn-del:hover {
  background: #ffece8;
  color: #c33b1f;
  border-color: #f3c0b8;
}
/* search bar inside history drawer */
.history-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  margin: 0 14px 10px;
}
.history-search-ico {
  position: absolute;
  left: 10px;
  color: var(--text-muted);
  pointer-events: none;
  flex-shrink: 0;
}
.history-search-inp {
  width: 100%;
  padding: 8px 32px 8px 32px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  background: var(--bg);
  color: var(--text);
  outline: none;
  transition: border-color .15s;
}
.history-search-inp:focus { border-color: var(--accent); }
.history-search-clr {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
  display: flex;
  align-items: center;
  border-radius: 4px;
}
.history-search-clr:hover { color: var(--text); }

@media (max-width: 720px) {
  .history-drawer { width: 100vw; }
  .history-rail.is-open { right: calc(100vw - 50px); }
  .history-rail { padding: 14px 8px; }
  .history-rail-text { font-size: 11px; }
}

/* ===================================================================
   NOVOS ESTILOS: Header reestruturado, botões de ação, tema pediátrico
   =================================================================== */

/* --- Header: fix layout flex + área do usuário --- */
.header-inner {
  display: flex !important;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

/* Área do usuário no header */
.user-header-area {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 6px 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: default;
}
.user-header-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  min-width: 0;
}
.user-header-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  line-height: 1.2;
}
.user-header-crm {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
  line-height: 1.2;
}
.user-session-timer {
  font-size: 10px;
  color: var(--accent);
  font-weight: 600;
  white-space: nowrap;
  line-height: 1.2;
  opacity: 0.85;
}
.user-header-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: grid;
  place-items: center;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}
.logout-header-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all .15s;
  flex-shrink: 0;
}
.logout-header-btn:hover {
  background: #fff1f0;
  border-color: #fca5a5;
  color: #dc2626;
}

/* ============ APP NAVBAR ============ */
/* ══════════════════════════════════════════════
   APP NAVBAR
══════════════════════════════════════════════ */
/* ── Sidebar — desktop vertical nav ── */
.app-sidebar { display: none; }

@media (min-width: 721px) {
  .app { flex-direction: row; }

  .app-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
  }

  .app-sidebar {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    width: 68px;
    transition: width .25s cubic-bezier(.4,0,.2,1);
    overflow: hidden;
    position: sticky;
    top: 0;
    height: 100vh;
    background: var(--surface);
    border-right: 1px solid var(--border);
    z-index: 90;
  }
  .app-sidebar:hover,
  .app-sidebar.sb-forced { width: 220px; }

  .sb-nav {
    flex: 1;
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
  }
  .sb-nav::-webkit-scrollbar { display: none; }

  .sb-item {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 11px 14px;
    border-radius: 10px;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    transition: background .13s, color .13s, gap .25s;
    text-align: left;
    width: 100%;
  }
  .app-sidebar:hover .sb-item,
  .app-sidebar.sb-forced .sb-item { gap: 12px; }
  .sb-item:hover { background: var(--surface-2); color: var(--text); }
  .sb-item.sb-on { background: hsl(var(--accent-h,225) 60% 94%); color: var(--accent); }

  .sb-ico {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
  }

  .sb-lbl {
    opacity: 0;
    transition: opacity .15s .05s;
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    pointer-events: none;
  }
  .app-sidebar:hover .sb-lbl,
  .app-sidebar.sb-forced .sb-lbl { opacity: 1; }

  .sb-chevron { margin-left: auto; transition: transform .2s; flex-shrink: 0; }
  .sb-sub-open .sb-chevron { transform: rotate(180deg); }

  .sb-group { display: flex; flex-direction: column; }

  .sb-submenu {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 2px 0 4px 14px;
    overflow: hidden;
  }

  .sb-sub-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    transition: background .12s, color .12s, opacity .15s;
    text-align: left;
    width: 100%;
    opacity: 0;
  }
  .app-sidebar:hover .sb-sub-item,
  .app-sidebar.sb-forced .sb-sub-item { opacity: 1; }
  .sb-sub-item:hover { background: var(--surface-2); color: var(--text); }
  .sb-sub-item.active { color: var(--accent); font-weight: 600; }

  /* ── TopNav bar — desktop horizontal nav (topnav mode) ── */
  .app.topnav { flex-direction: column; }
  .app-topnav-bar {
    display: flex;
    align-items: stretch;
    gap: 0;
    padding: 0 8px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    scrollbar-width: none;
    position: relative;
    z-index: 100;
    flex-shrink: 0;
  }
  .app-topnav-bar::-webkit-scrollbar { display: none; }
  .topnav-item {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 0 14px;
    height: 42px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-muted);
    border: none;
    border-bottom: 2px solid transparent;
    border-top: 2px solid transparent;
    background: none;
    cursor: pointer;
    white-space: nowrap;
    transition: color .13s, border-color .13s;
  }
  .topnav-item:hover { color: var(--text); border-bottom-color: var(--border-soft); }
  .topnav-item.active { color: var(--accent); border-bottom-color: var(--accent); }
  .topnav-dropdown { position: relative; display: flex; align-items: stretch; }
  .topnav-dropdown-menu {
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,.10), 0 2px 6px rgba(0,0,0,.06);
    z-index: 101;
    min-width: 220px;
    padding: 6px;
  }
  .topnav-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    transition: background .12s, color .12s;
  }
  .topnav-dropdown-item:hover { background: var(--surface-2); }
  .topnav-dropdown-item.active { background: hsl(var(--accent-h,225) 60% 94%); color: var(--accent); font-weight: 600; }
}

/* TopNav bar: hidden on mobile, shown on desktop via media query above */
@media (max-width: 720px) { .app-topnav-bar { display: none !important; } }

/* ── Full Sidebar — admin-style with user card ── */
.app-fullsidebar { display: none; }

@media (min-width: 721px) {
  .app-fullsidebar {
    display: flex;
    flex-direction: column;
    width: 248px;
    flex-shrink: 0;
    background: var(--surface);
    border-right: 1px solid var(--border);
    height: 100vh;
    position: sticky;
    top: 0;
    overflow: hidden;
  }

  /* Brand */
  .fsbr-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 22px 20px 18px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
  }
  .fsbr-brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 13px;
    background: linear-gradient(135deg, hsl(var(--accent-h,225) 65% 52%), hsl(var(--accent-h,225) 75% 66%));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 14px hsla(var(--accent-h,225), 65%, 52%, .28);
  }
  .fsbr-brand-name {
    font-size: 14.5px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -.3px;
    line-height: 1.2;
  }
  .fsbr-brand-sub {
    font-size: 11.5px;
    color: var(--text-muted);
    line-height: 1.3;
    margin-top: 2px;
  }

  /* Nav area */
  .fsbr-nav {
    flex: 1;
    padding: 10px 10px 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
    scrollbar-width: none;
  }
  .fsbr-nav::-webkit-scrollbar { display: none; }

  .fsbr-sep {
    height: 1px;
    background: var(--border);
    margin: 6px 4px;
    border-radius: 1px;
    opacity: .6;
  }

  /* Nav items */
  .fsbr-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    width: 100%;
    text-align: left;
    transition: background .12s, color .12s;
  }
  .fsbr-item:hover { background: var(--surface-2); color: var(--text); }
  .fsbr-item.fsbr-on {
    background: hsl(var(--accent-h,225) 60% 93%);
    color: var(--accent);
  }
  .fsbr-item svg { flex-shrink: 0; }
  .fsbr-chevron { margin-left: auto; transition: transform .2s; flex-shrink: 0; }
  .fsbr-sub-open .fsbr-chevron { transform: rotate(180deg); }

  /* Sub-items */
  .fsbr-sub {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding-left: 14px;
    margin-top: 2px;
    margin-bottom: 2px;
  }
  .fsbr-sub-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    width: 100%;
    text-align: left;
    transition: background .12s, color .12s;
  }
  .fsbr-sub-item:hover { background: var(--surface-2); color: var(--text); }
  .fsbr-sub-item.active { color: var(--accent); font-weight: 600; background: hsl(var(--accent-h,225) 60% 96%); }

  /* Footer user card */
  .fsbr-foot {
    border-top: 1px solid var(--border);
    padding: 12px;
    flex-shrink: 0;
  }
  .fsbr-user-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: var(--surface-2);
    border: 1px solid var(--border);
  }
  .fsbr-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, hsl(var(--accent-h,225) 65% 52%), hsl(var(--accent-h,225) 75% 66%));
    color: white;
    font-size: 12.5px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px hsla(var(--accent-h,225), 65%, 52%, .22);
    letter-spacing: .5px;
  }
  .fsbr-user-info {
    flex: 1;
    min-width: 0;
  }
  .fsbr-user-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
  }
  .fsbr-user-crm {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .fsbr-session-timer {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: .75;
  }
  .fsbr-logout {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background .12s, color .12s;
  }
  .fsbr-logout:hover { background: #fee2e2; color: #dc2626; }

  /* Gear menu */
  .fsbr-foot { position: relative; }
  .fsbr-gear-menu {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 12px;
    right: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 -8px 30px rgba(0,0,0,.10), 0 4px 12px rgba(0,0,0,.06);
    padding: 8px;
    z-index: 300;
  }
  .fsbr-gear-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text);
    background: none;
    border: none;
    cursor: pointer;
    width: 100%;
    text-align: left;
    transition: background .12s, color .12s;
  }
  .fsbr-gear-item:hover { background: var(--surface-2); }
  .fsbr-gear-item.danger { color: #dc2626; }
  .fsbr-gear-item.danger:hover { background: #fee2e2; }
  .fsbr-gear-divider { height: 1px; background: var(--border); margin: 6px 4px; border-radius: 1px; }
  .fsbr-gear-btn {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background .12s, color .12s;
  }
  .fsbr-gear-btn:hover { background: var(--surface-2); color: var(--text); }
  .fsbr-gear-btn.open { background: hsl(var(--accent-h,225) 60% 93%); color: var(--accent); }

  /* Hide top header when full sidebar is active — sidebar already has brand + user */
  .app.fullsidebar .app-header { display: none; }
}

/* ── Prescriptions page header ── */
.rx-page-header {
  margin: 0 0 4px;
  padding: 28px 28px 26px;
  background:
    linear-gradient(135deg,
      hsla(var(--accent-h,225), 70%, 96%, 1) 0%,
      hsla(calc(var(--accent-h,225) + 20), 75%, 97%, 1) 60%,
      hsla(var(--accent-h,225), 60%, 94%, 1) 100%);
  border-bottom: 1px solid hsla(var(--accent-h,225), 50%, 88%, .6);
  position: relative;
  overflow: hidden;
}
/* decorative blobs */
.rx-page-header::before,
.rx-page-header::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.rx-page-header::before {
  width: 260px; height: 260px;
  background: hsla(var(--accent-h,225), 70%, 65%, .08);
  top: -80px; right: -40px;
}
.rx-page-header::after {
  width: 140px; height: 140px;
  background: hsla(calc(var(--accent-h,225) + 30), 75%, 65%, .1);
  bottom: -50px; right: 120px;
}
.rx-page-header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  z-index: 1;
}
.rx-page-header-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: linear-gradient(135deg, hsl(var(--accent-h,225) 65% 50%), hsl(calc(var(--accent-h,225) + 25) 70% 60%));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
  box-shadow: 0 6px 20px hsla(var(--accent-h,225), 65%, 50%, .30),
              0 2px 6px hsla(var(--accent-h,225), 65%, 50%, .20);
}
.rx-page-header-title {
  font-size: 22px;
  font-weight: 800;
  color: hsl(var(--accent-h,225) 45% 22%);
  letter-spacing: -.5px;
  line-height: 1.15;
  margin: 0;
}
.rx-page-header-sub {
  font-size: 13px;
  color: hsl(var(--accent-h,225) 30% 48%);
  margin: 4px 0 0;
  line-height: 1.3;
}
@media (max-width: 720px) {
  .rx-page-header { padding: 18px 16px 16px; }
  .rx-page-header-title { font-size: 18px; }
  .rx-page-header-icon { width: 44px; height: 44px; border-radius: 13px; }
}

/* ── Back to prescriptions button ── */
.back-to-rx-wrap {
  display: flex;
  justify-content: center;
  padding: 18px 16px 4px;
}
.back-to-rx-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 20px 10px 14px;
  border-radius: 50px;
  border: 1.5px solid hsla(var(--accent-h,225), 65%, 55%, .35);
  background: hsla(var(--accent-h,225), 65%, 55%, .1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: hsl(var(--accent-h,225) 55% 38%);
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: .1px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: background .18s, border-color .18s, color .18s, box-shadow .18s, transform .1s;
  box-shadow: 0 2px 12px hsla(var(--accent-h,225), 60%, 50%, .12);
}
.back-to-rx-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,.18) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform .55s;
}
.back-to-rx-btn:hover::before { transform: translateX(100%); }
.back-to-rx-btn:hover {
  background: hsla(var(--accent-h,225), 65%, 55%, .16);
  border-color: hsla(var(--accent-h,225), 65%, 55%, .6);
  color: hsl(var(--accent-h,225) 55% 30%);
  box-shadow: 0 4px 20px hsla(var(--accent-h,225), 60%, 50%, .22);
}
.back-to-rx-btn:active { transform: scale(.97); }
.back-rx-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: hsla(var(--accent-h,225), 65%, 55%, .15);
  flex-shrink: 0;
  transition: transform .18s, background .18s;
}
.back-to-rx-btn:hover .back-rx-arrow {
  transform: translateX(-3px);
  background: hsla(var(--accent-h,225), 65%, 55%, .25);
}

/* ── Catalog button (Medicamentos Ped. — header-right) ── */
.catalog-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color .15s, color .15s;
}
.catalog-btn:hover { border-color: var(--accent); color: var(--accent); }
@media (max-width: 720px) {
  .catalog-btn { padding: 8px; width: 40px; height: 40px; justify-content: center; border-radius: 10px; gap: 0; }
  .catalog-btn span { display: none; }
}

/* ── Calculadoras dropdown ── */
.anav-calc-wrap { position: relative; }
.anav-btn-calc { gap: 5px; }
.anav-calc-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,.13);
  min-width: 220px;
  max-height: 80vh;
  overflow-y: auto;
  z-index: 200;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  animation: fadeDown .15s ease;
}
@keyframes fadeDown { from{opacity:0;transform:translateY(-6px)} to{opacity:1;transform:none} }
.anav-calc-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 14px; font-weight: 600; color: #1e293b;
  transition: background .12s;
  font-family: inherit;
  text-align: left;
}
.anav-calc-item:hover { background: #f1f5f9; }
.anav-calc-item.active { background: hsl(var(--accent-h) 80% 94%); color: var(--accent); }
.anav-calc-ico { font-size: 18px; line-height: 1; }

/* ══════════════════════════════════════════════
   CALCULADORAS — CURB-65 e Glasgow (compartilhado)
══════════════════════════════════════════════ */
.calc-view {
  max-width: 860px;
  margin: 0 auto;
  padding: 24px 20px 80px;
}

/* Hero */
.calc-hero {
  border-radius: 18px;
  padding: 28px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  color: #fff;
}
.calc-hero-left { flex: 1; }
.calc-hero-badge {
  display: inline-block;
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 100px;
  padding: 3px 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.calc-hero-title { font-size: 26px; font-weight: 900; margin: 0 0 4px; }
.calc-hero-sub { font-size: 13px; opacity: .8; margin: 0; }

/* Big score circle */
.calc-score-big {
  width: 88px; height: 88px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.3);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  gap: 2px;
}
.calc-score-big-num { font-size: 36px; font-weight: 900; color: #fff; line-height: 1; }
.calc-score-big-den { font-size: 14px; color: rgba(255,255,255,0.6); align-self: flex-end; padding-bottom: 4px; }

/* Body */
.calc-body { display: flex; flex-direction: column; gap: 16px; }

/* Criteria (CURB-65) */
.calc-criteria { display: flex; flex-direction: column; gap: 8px; }
.calc-crit-btn {
  display: flex; align-items: center; gap: 14px;
  background: #fff;
  border: 2px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px 16px;
  cursor: pointer;
  transition: all .15s;
  text-align: left;
  font-family: inherit;
}
.calc-crit-btn:hover { border-color: #94a3b8; background: #f8fafc; transform: translateX(2px); }
.calc-crit-btn.calc-crit-on { border-color: #1d4ed8; background: #eff6ff; }
.calc-crit-letter {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 17px;
  font-weight: 900;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all .15s;
}
.calc-crit-btn.calc-crit-on .calc-crit-letter { background: #1d4ed8; color: #fff; }
.calc-crit-info { flex: 1; }
.calc-crit-label { font-size: 14px; font-weight: 700; color: #1e293b; margin-bottom: 2px; }
.calc-crit-btn.calc-crit-on .calc-crit-label { color: #1e40af; }
.calc-crit-desc { font-size: 12px; color: #64748b; }
.calc-crit-check {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid #cbd5e1;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all .15s;
}
.calc-crit-check.checked { background: #1d4ed8; border-color: #1d4ed8; }

/* Result card */
.calc-result-card {
  background: #fff;
  border-radius: 16px;
  border-left: 5px solid #e2e8f0;
  box-shadow: 0 2px 12px rgba(0,0,0,.07);
  padding: 18px 20px;
}
.calc-result-top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.calc-result-badge {
  display: inline-block;
  border-radius: 100px;
  padding: 3px 12px;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  letter-spacing: .06em;
}
.calc-result-label { font-size: 17px; font-weight: 800; }
.calc-result-mort { font-size: 13px; color: #475569; margin-bottom: 6px; }
.calc-result-rec { font-size: 14px; color: #1e293b; font-weight: 600; }
.calc-result-alert { margin-top: 10px; font-size: 13px; color: #dc2626; font-weight: 700; background: #fee2e2; border-radius: 8px; padding: 8px 12px; }

/* GCS breakdown */
.calc-gcs-breakdown {
  display: flex; gap: 6px; align-items: center;
  margin-top: 10px; font-size: 14px; font-weight: 700; color: #64748b;
}
.calc-gcs-breakdown strong { color: #1e293b; font-size: 16px; }

/* Pending */
.calc-pending {
  background: #f8fafc;
  border: 2px dashed #e2e8f0;
  border-radius: 14px;
  padding: 20px;
  text-align: center;
  font-size: 14px;
  color: #94a3b8;
}

/* Reference table */
.calc-ref-table {
  background: #fff;
  border-radius: 14px;
  border: 1.5px solid #e2e8f0;
  overflow: hidden;
}
.calc-ref-title {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  padding: 10px 16px;
  font-size: 11px;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .07em;
}
.calc-ref-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  font-size: 13px;
  color: #334155;
  border-bottom: 1px solid #f1f5f9;
}
.calc-ref-row:last-child { border-bottom: none; }
.calc-ref-score {
  min-width: 44px;
  text-align: center;
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
}

/* Note */
.calc-note {
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.6;
  background: #f8fafc;
  border-radius: 10px;
  padding: 10px 14px;
}

/* ══════════════════════════════════════════════
   GLASGOW — seções específicas
══════════════════════════════════════════════ */
.gcs-section {
  background: #fff;
  border-radius: 16px;
  border: 1.5px solid #e2e8f0;
  overflow: hidden;
}
.gcs-section-hd {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  border-left: 4px solid #e2e8f0;
}
.gcs-section-ico { font-size: 20px; }
.gcs-section-title { flex: 1; font-size: 15px; font-weight: 800; color: #1e293b; }
.gcs-section-score { font-size: 16px; font-weight: 900; }
.gcs-options { display: flex; flex-direction: column; }
.gcs-opt {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  border: none; border-bottom: 1px solid #f1f5f9;
  background: #fff;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: background .12s;
}
.gcs-opt:last-child { border-bottom: none; }
.gcs-opt:hover { background: #f8fafc; }
.gcs-opt.gcs-opt-on { background: #f0f9ff; }
.gcs-opt-score {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 15px;
  font-weight: 900;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all .12s;
}
.gcs-opt-body { flex: 1; }
.gcs-opt-label { font-size: 14px; font-weight: 700; color: #1e293b; }
.gcs-opt-ex { font-size: 12px; color: #64748b; margin-top: 1px; }
.gcs-opt-chk { flex-shrink: 0; }

@media (max-width: 600px) {
  .calc-hero { padding: 20px 18px; }
  .calc-hero-title { font-size: 22px; }
  .calc-score-big { width: 72px; height: 72px; }
  .calc-score-big-num { font-size: 30px; }
  .calc-view { padding: 16px 12px 80px; }
}

/* ══════════════════════════════════════════════
   GASOMETRIA VIEW
══════════════════════════════════════════════ */
.gaso-view {
  max-width: 900px;
  margin: 0 auto;
  padding: 28px 20px 60px;
}
.gaso-hero {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 24px;
}
.gaso-hero-ico { font-size: 44px; line-height: 1; }
.gaso-hero-title { font-size: 24px; font-weight: 800; color: #1e293b; margin: 0 0 4px; }
.gaso-hero-sub { font-size: 13px; color: #64748b; margin: 0; line-height: 1.5; }

/* Form card */
.gaso-form-card {
  background: #fff;
  border-radius: 18px;
  border: 1.5px solid #e2e8f0;
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
  padding: 22px 24px 20px;
  margin-bottom: 20px;
}
.gaso-form-title { font-size: 14px; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 16px; }
.gaso-req-row, .gaso-opt-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}
.gaso-opt-label { font-size: 11px; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 10px; border-top: 1px solid #f1f5f9; padding-top: 14px; }
.gaso-field { display: flex; flex-direction: column; gap: 4px; }
.gaso-lbl { font-size: 11px; font-weight: 700; color: #475569; text-transform: uppercase; letter-spacing: .04em; }
.gaso-req-star { color: #dc2626; }
.gaso-input {
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 14px;
  font-family: inherit;
  color: #1e293b;
  background: #f8fafc;
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
}
.gaso-input-big { font-size: 17px; font-weight: 700; padding: 11px 12px; }
.gaso-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59,130,246,.12); background: #fff; }
.gaso-ref { font-size: 10px; color: #94a3b8; }
.gaso-err { background: #fee2e2; border: 1px solid #fca5a5; border-radius: 8px; padding: 10px 14px; font-size: 13px; color: #dc2626; margin-bottom: 12px; }
.gaso-btns { display: flex; gap: 10px; margin-top: 4px; }
.gaso-btn-calc {
  background: var(--accent);
  color: #fff; border: none; border-radius: 10px;
  padding: 12px 28px; font-size: 14px; font-weight: 700;
  cursor: pointer; font-family: inherit;
  box-shadow: 0 2px 10px rgba(59,130,246,.35);
  transition: all .15s;
}
.gaso-btn-calc:hover { filter: brightness(1.08); transform: translateY(-1px); }
.gaso-btn-clear {
  background: #f1f5f9; color: #64748b; border: 1.5px solid #e2e8f0;
  border-radius: 10px; padding: 12px 20px; font-size: 14px; font-weight: 600;
  cursor: pointer; font-family: inherit; transition: all .15s;
}
.gaso-btn-clear:hover { background: #e2e8f0; color: #1e293b; }

/* Diagnóstico principal */
.gaso-diag {
  background: #fff;
  border-radius: 16px;
  border: 2.5px solid #e2e8f0;
  padding: 20px 22px;
  margin-bottom: 16px;
  display: flex; flex-direction: column; gap: 12px;
}
.gaso-diag-ph { display: flex; align-items: baseline; gap: 12px; }
.gaso-diag-ph-val { font-size: 32px; font-weight: 900; line-height: 1; }
.gaso-diag-ph-lbl { font-size: 14px; font-weight: 700; }
.gaso-diag-dist {
  color: #fff; border-radius: 10px;
  padding: 10px 16px; font-size: 17px; font-weight: 800;
  align-self: flex-start;
}
.gaso-diag-vals { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; color: #64748b; }
.gaso-diag-vals strong { color: #1e293b; }

/* Seções de resultado */
.gaso-section {
  background: #fff; border-radius: 14px;
  border: 1.5px solid #e2e8f0;
  padding: 16px 18px; margin-bottom: 14px;
}
.gaso-section-title { font-size: 12px; font-weight: 800; color: #64748b; text-transform: uppercase; letter-spacing: .07em; margin-bottom: 12px; }

/* Compensação */
.gaso-comp-row { display: flex; flex-direction: column; padding: 10px 12px; border-radius: 8px; margin-bottom: 6px; font-size: 13px; }
.gaso-comp-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.gaso-comp-ok  { background: #f0fdf4; }
.gaso-comp-bad { background: #fff1f2; }
.gaso-comp-warn{ background: #fffbeb; }
.gaso-comp-lbl { flex: 1; font-weight: 600; color: #334155; }
.gaso-comp-val { font-size: 12px; color: #64748b; font-variant-numeric: tabular-nums; }
.gaso-comp-tag { font-size: 10px; font-weight: 700; border-radius: 8px; padding: 2px 8px; white-space: nowrap; }
.gaso-comp-tag-ok  { background: #dcfce7; color: #15803d; }
.gaso-comp-tag-bad { background: #fee2e2; color: #dc2626; }
.gaso-comp-porque { margin: 6px 0 0; font-size: 12px; color: #475569; line-height: 1.55; font-style: italic; }

/* Anion Gap */
.gaso-ag-grid { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; }
.gaso-ag-item { display: flex; flex-direction: column; align-items: center; background: #f8fafc; border-radius: 10px; padding: 12px 18px; min-width: 110px; gap: 2px; }
.gaso-ag-val { font-size: 26px; font-weight: 900; line-height: 1.1; }
.gaso-ag-lbl { font-size: 11px; color: #64748b; font-weight: 600; text-align: center; }
.gaso-ag-ref { font-size: 10px; color: #94a3b8; }
.gaso-ag-badge { display: inline-block; border-radius: 20px; padding: 4px 14px; font-size: 12px; font-weight: 700; margin-bottom: 8px; }
.gaso-ag-badge-high { background: #fee2e2; color: #dc2626; }
.gaso-ag-badge-ok   { background: #dcfce7; color: #15803d; }
.gaso-ag-interp { font-size: 13px; color: #334155; background: #f1f5f9; border-radius: 8px; padding: 8px 12px; }

/* Oxigenação */
.gaso-ox-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.gaso-ox-card { background: #f8fafc; border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; gap: 3px; }
.gaso-ox-warn { background: #fffbeb; }
.gaso-ox-val { font-size: 20px; font-weight: 800; color: #1e293b; }
.gaso-ox-lbl { font-size: 11px; color: #64748b; font-weight: 600; }
.gaso-ox-status { font-size: 11px; color: #475569; }

/* Raciocínio clínico */
.gaso-passo { display: flex; gap: 12px; margin-bottom: 12px; align-items: flex-start; }
.gaso-passo-num { flex-shrink: 0; font-size: 10px; font-weight: 800; color: #fff; border-radius: 20px; padding: 3px 10px; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; margin-top: 2px; }
.gaso-passo-body { flex: 1; background: #f8fafc; border-radius: 10px; padding: 10px 14px; border-left: 3px solid #e2e8f0; }
.gaso-passo-titulo { font-size: 12px; font-weight: 700; margin-bottom: 4px; }
.gaso-passo-texto { margin: 0; font-size: 13px; color: #334155; line-height: 1.6; }

/* Causas prováveis */
.gaso-causas-intro { font-size: 13px; color: #475569; margin: 0 0 10px; }
.gaso-causas-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 5px; }
.gaso-causa-item { font-size: 13px; color: #1e293b; line-height: 1.4; }

/* Referências */
.gaso-ref-box { background: #f8fafc; border-radius: 12px; border: 1px solid #e2e8f0; padding: 14px 18px; }
.gaso-ref-title { font-size: 11px; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 10px; }
.gaso-ref-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px 16px; }
.gaso-ref-item { display: flex; justify-content: space-between; font-size: 12px; color: #475569; padding: 3px 0; border-bottom: 1px solid #e2e8f0; }
.gaso-ref-item span:first-child { font-weight: 700; color: #334155; }

@media (max-width: 700px) {
  .gaso-req-row, .gaso-opt-row { grid-template-columns: repeat(2,1fr); }
  .gaso-ox-grid { grid-template-columns: 1fr 1fr; }
  .gaso-ref-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .gaso-req-row, .gaso-opt-row { grid-template-columns: 1fr; }
  .gaso-ox-grid { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════
   IA — Assistente Médico
══════════════════════════════════════════════ */
.ia-view { max-width: 1100px; margin: 0 auto; padding: 24px 32px 80px; min-width: 0; width: 100%; overflow-x: hidden; }



/* Hero */
.ia-hero { display: flex; align-items: center; gap: 20px; background: linear-gradient(135deg, #312e81 0%, #6366f1 100%); border-radius: 16px; padding: 28px 32px; margin-bottom: 24px; position: relative; overflow: hidden; }
.ia-hero::after { content: ''; position: absolute; right: -40px; top: -40px; width: 200px; height: 200px; border-radius: 50%; background: rgba(255,255,255,.06); pointer-events: none; }
.ia-hero-ico { font-size: 40px; flex-shrink: 0; }
.ia-hero-title { font-size: 22px; font-weight: 800; color: #fff; margin: 0 0 4px; }
.ia-hero-sub { font-size: 13.5px; color: rgba(255,255,255,.8); margin: 0; line-height: 1.5; }

/* Barra de busca */
.ia-search-card { background: var(--surface); border: 1.5px solid var(--border); border-radius: 16px; padding: 20px 24px; margin-bottom: 20px; box-shadow: 0 2px 8px rgba(0,0,0,.04); }
.ia-search-row { display: flex; gap: 10px; align-items: center; }
.ia-search-input-wrap { flex: 1; position: relative; display: flex; align-items: center; }
.ia-search-ico { position: absolute; left: 14px; color: #94a3b8; pointer-events: none; flex-shrink: 0; }
.ia-search-input { width: 100%; padding: 11px 14px 11px 40px; border: 1.5px solid #e2e8f0; border-radius: 10px; font-size: 14px; outline: none; background: var(--bg); color: var(--text); transition: border-color .15s; }
.ia-search-input:focus { border-color: #6366f1; }
.ia-search-input:disabled { opacity: .6; }
.ia-search-btn { display: flex; align-items: center; gap: 7px; padding: 11px 20px; background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff; border: none; border-radius: 10px; font-size: 13.5px; font-weight: 700; cursor: pointer; white-space: nowrap; transition: opacity .15s; flex-shrink: 0; }
.ia-search-btn:hover:not(:disabled) { opacity: .88; }
.ia-search-btn:disabled { opacity: .55; cursor: default; }
.ia-spinner { width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: ia-spin .7s linear infinite; flex-shrink: 0; }
@keyframes ia-spin { to { transform: rotate(360deg); } }

/* ── IA Prompt Card ── */
.ia-prompt-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  margin-bottom: 24px;
  box-shadow: 0 4px 24px rgba(0,0,0,.07);
  overflow: hidden;
  transition: box-shadow .2s, border-color .2s;
}
.ia-prompt-card:focus-within {
  border-color: #818cf8;
  box-shadow: 0 0 0 3px rgba(99,102,241,.1), 0 4px 24px rgba(0,0,0,.07);
}
.ia-prompt-area {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 20px 22px 12px;
}
.ia-prompt-ico { flex-shrink: 0; margin-top: 3px; color: #818cf8; }
.ia-prompt-textarea {
  flex: 1;
  border: none;
  background: none;
  resize: none;
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  outline: none;
  line-height: 1.65;
  min-height: 80px;
  width: 100%;
}
.ia-prompt-textarea::placeholder { color: #94a3b8; }
.ia-prompt-textarea:disabled { opacity: .65; }

.ia-mode-row {
  display: flex;
  gap: 8px;
  padding: 4px 22px 16px;
  flex-wrap: wrap;
}
.ia-mode-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-muted);
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.ia-mode-pill:hover { border-color: #818cf8; color: #6366f1; }
.ia-mode-pill.ia-mode-active { border-color: var(--accent); background: hsl(var(--accent-h,225) 60% 94%); color: var(--accent); }
.ia-mode-pill.ia-mode-estudo.ia-mode-active { border-color: #8b5cf6; background: #f5f3ff; color: #7c3aed; }
.ia-mode-pill.ia-mode-ped.ia-mode-active { border-color: #ec4899; background: #fdf2f8; color: #be185d; }

.ia-estudo-info {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 13px 22px 15px;
  background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
  border-top: 1px solid #ddd6fe;
  font-size: 13px;
  color: #6d28d9;
  line-height: 1.6;
}
.ia-estudo-info strong { font-weight: 700; }

.ia-peso-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px 14px;
  background: #eff6ff;
  border-top: 1px solid #bfdbfe;
  font-size: 13.5px;
  color: #1e40af;
}
.ia-peso-label { font-weight: 600; }
.ia-peso-input { width: 72px; border: 1.5px solid #bfdbfe; border-radius: 8px; background: #fff; padding: 5px 8px; font-size: 14px; font-weight: 600; color: #1e40af; outline: none; font-family: inherit; }
.ia-peso-unit { font-size: 13px; color: #3b82f6; font-weight: 600; }

.ia-prompt-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 22px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  gap: 12px;
}
.ia-prompt-hint { font-size: 12px; color: var(--text-muted); flex-shrink: 0; }
.ia-prompt-hint kbd {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  font-family: inherit;
  font-size: 11px;
  color: var(--text-soft);
}
.ia-prompt-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: opacity .15s, transform .15s;
  white-space: nowrap;
}
.ia-prompt-btn:hover:not(:disabled) { opacity: .88; transform: translateY(-1px); }
.ia-prompt-btn:disabled { opacity: .5; cursor: default; transform: none; }

/* Loading screen */
.ia-loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 72px 32px;
  gap: 22px;
  text-align: center;
}
.ia-loading-orb {
  width: 76px; height: 76px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: 0 8px 32px rgba(99,102,241,.4);
  animation: iaOrbPulse 1.6s ease-in-out infinite;
}
@keyframes iaOrbPulse {
  0%,100% { transform: scale(1); box-shadow: 0 8px 32px rgba(99,102,241,.4); }
  50% { transform: scale(1.08); box-shadow: 0 14px 44px rgba(99,102,241,.65); }
}
.ia-loading-dots { display: flex; gap: 8px; }
.ia-loading-dots span {
  display: block;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  animation: iaDotBounce .75s ease-in-out infinite alternate;
}
.ia-loading-dots span:nth-child(2) { animation-delay: .17s; }
.ia-loading-dots span:nth-child(3) { animation-delay: .34s; }
@keyframes iaDotBounce {
  from { transform: translateY(0); opacity: .35; }
  to   { transform: translateY(-14px); opacity: 1; }
}
.ia-loading-text { font-size: 17px; font-weight: 700; color: var(--text); margin: 0; }
.ia-loading-sub  { font-size: 13.5px; color: var(--text-muted); margin: 0; }

/* Mobile-only bottom sheets */
.mobile-sheet-only { display: none; }
@media (max-width: 720px) { .mobile-sheet-only { display: block; } }

/* Erro */
.ia-error { display: flex; align-items: center; gap: 10px; background: #fef2f2; border: 1px solid #fecaca; border-radius: 10px; padding: 12px 16px; color: #dc2626; font-size: 13.5px; margin-bottom: 16px; }

/* Meta do resultado */
.ia-result-wrap { animation: ia-fadein .25s ease; }
@keyframes ia-fadein { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.ia-result-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.ia-cat-badge { padding: 4px 12px; border-radius: 20px; font-size: 11.5px; font-weight: 700; color: #fff; letter-spacing: .04em; text-transform: uppercase; }
.ia-modo-badge { background: #f1f5f9; color: #475569; padding: 4px 12px; border-radius: 20px; font-size: 11.5px; font-weight: 600; }
.ia-query-text { font-size: 13px; color: var(--text-muted); font-style: italic; }

/* Componente prescrição compartilhado */
.ia-presc-lista { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.ia-presc-item { display: flex; align-items: flex-start; gap: 12px; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.ia-presc-num { display: flex; align-items: center; justify-content: center; width: 24px; height: 24px; background: #6366f1; color: #fff; border-radius: 50%; font-size: 12px; font-weight: 700; flex-shrink: 0; margin-top: 1px; }
.ia-presc-med { font-size: 13.5px; font-weight: 700; color: var(--text); margin-bottom: 3px; }
.ia-presc-pos { font-size: 12.5px; color: var(--text-muted); line-height: 1.5; }
.ia-copy-btn { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 20px; background: #f8fafc; border: 1.5px solid #e2e8f0; border-radius: 8px; font-size: 13px; font-weight: 600; color: #475569; cursor: pointer; transition: all .15s; width: 100%; }
.ia-copy-btn:hover { background: #f1f5f9; border-color: #cbd5e1; }
.ia-copy-btn-ok { background: #f0fdf4 !important; border-color: #86efac !important; color: #16a34a !important; }

/* Fármaco */
.ia-result-farmaco { background: var(--surface); border: 1.5px solid var(--border); border-radius: 16px; overflow: hidden; }
.ia-farmaco-header { display: flex; align-items: center; gap: 14px; padding: 18px 20px; background: linear-gradient(135deg, #312e81 0%, #6366f1 100%); }
.ia-farmaco-icon { font-size: 28px; flex-shrink: 0; }
.ia-farmaco-title { font-size: 17px; font-weight: 800; color: #fff; margin-bottom: 2px; }
.ia-farmaco-sub { font-size: 12px; color: rgba(255,255,255,.75); }
.ia-farmaco-layout { display: flex; min-height: 320px; }
.ia-farmaco-doencas { width: 220px; flex-shrink: 0; border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 12px 0; }
.ia-doenca-card { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border: none; background: none; text-align: left; cursor: pointer; transition: background .12s; width: 100%; }
.ia-doenca-card:hover { background: #f1f5f9; }
.ia-doenca-card-on { background: #eff6ff !important; }
.ia-doenca-num { width: 22px; height: 22px; border-radius: 50%; background: #e2e8f0; color: #475569; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ia-doenca-card-on .ia-doenca-num { background: #6366f1; color: #fff; }
.ia-doenca-cid { font-size: 10px; font-weight: 700; color: #6366f1; display: block; margin-bottom: 1px; }
.ia-doenca-nome { font-size: 12px; color: var(--text); font-weight: 500; line-height: 1.3; display: block; }
.ia-farmaco-presc { flex: 1; padding: 16px; min-width: 0; display: flex; flex-direction: column; }
.ia-presc-label { font-size: 11px; font-weight: 700; color: #6366f1; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 12px; }

/* Tabs prescrição (doença / caso) */
.ia-presc-tabs-wrap { margin-top: 4px; }
.ia-presc-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.ia-presc-tab { padding: 7px 16px; border: 1.5px solid #e2e8f0; border-radius: 8px; background: var(--bg); font-size: 12.5px; font-weight: 600; color: #64748b; cursor: pointer; transition: all .15s; }
.ia-presc-tab:hover { border-color: #6366f1; color: #6366f1; }
.ia-presc-tab-on { background: #6366f1 !important; border-color: #6366f1 !important; color: #fff !important; }

/* Doença */
.ia-result-doenca, .ia-result-caso { background: var(--surface); border: 1.5px solid var(--border); border-radius: 16px; overflow: hidden; padding: 0; }
.ia-ds-header { padding: 20px 24px; background: linear-gradient(135deg, #064e3b 0%, #059669 100%); }
.ia-ds-header-caso { background: linear-gradient(135deg, #4c1d95 0%, #7c3aed 100%) !important; }
.ia-ds-header-main { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.ia-ds-icon { font-size: 28px; }
.ia-ds-title { font-size: 18px; font-weight: 800; color: #fff; margin-bottom: 3px; }
.ia-ds-cid { font-size: 12px; background: rgba(255,255,255,.2); color: #fff; padding: 2px 8px; border-radius: 20px; font-weight: 600; display: inline-block; }
.ia-ds-resumo { margin: 0; font-size: 13px; color: rgba(255,255,255,.85); line-height: 1.55; }
.ia-ds-sintomas { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 24px; border-bottom: 1px solid var(--border); }
.ia-ds-sintoma-tag { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; border-radius: 20px; font-size: 11.5px; padding: 4px 12px; font-weight: 500; }
.ia-presc-tabs-wrap { padding: 16px 24px; }

/* Caso clínico — info grid */
.ia-caso-info-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 16px 24px; border-bottom: 1px solid var(--border); }
@media (max-width: 720px) { .ia-caso-info-grid { grid-template-columns: 1fr; } }
.ia-caso-info-card { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.ia-caso-info-alarme { border-color: #fecaca; background: #fef2f2; }
.ia-caso-info-label { font-size: 11px; font-weight: 700; color: #475569; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.ia-caso-info-alarme .ia-caso-info-label { color: #dc2626; }
.ia-caso-info-list { margin: 0; padding-left: 16px; display: flex; flex-direction: column; gap: 4px; }
.ia-caso-info-list li { font-size: 12.5px; color: var(--text); line-height: 1.45; }

/* Modo Estudo — markdown */
.ia-md-content { background: var(--surface); border: 1.5px solid var(--border); border-radius: 16px; padding: 24px 28px; }
.ia-md-h2 { font-size: 16px; font-weight: 800; color: #6366f1; margin: 20px 0 8px; border-bottom: 1.5px solid #e0e7ff; padding-bottom: 6px; }
.ia-md-h2:first-child { margin-top: 0; }
.ia-md-h3 { font-size: 14px; font-weight: 700; color: var(--text); margin: 14px 0 6px; }
.ia-md-p { font-size: 13.5px; color: var(--text); line-height: 1.7; margin: 6px 0; }
.ia-md-list { font-size: 13.5px; color: var(--text); line-height: 1.65; padding-left: 20px; margin: 6px 0 10px; }
.ia-md-list li { margin-bottom: 3px; }
.ia-md-hr { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

/* Disclaimer */
.ia-disclaimer { font-size: 11.5px; color: #94a3b8; text-align: center; margin-top: 20px; line-height: 1.5; }

/* Tab bar — Pesquisar / Histórico */
.ia-tab-bar { display: flex; gap: 4px; margin: 16px 0 0; background: #f1f5f9; border-radius: 12px; padding: 4px; width: fit-content; }
.ia-tab-btn { display: flex; align-items: center; gap: 6px; padding: 7px 18px; border-radius: 9px; border: none; background: transparent; font-size: 13px; font-weight: 600; color: #64748b; cursor: pointer; transition: background .15s, color .15s; }
.ia-tab-btn:hover { color: #334155; }
.ia-tab-btn-on { background: #fff; color: #1e293b; box-shadow: 0 1px 4px rgba(0,0,0,.10); }
.ia-tab-count { background: #7c3aed; color: #fff; font-size: 10px; font-weight: 700; border-radius: 99px; padding: 1px 6px; min-width: 18px; text-align: center; }

/* Histórico — painel */
.ia-history-panel { margin-top: 20px; }
.ia-history-panel-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.ia-history-title { font-size: 13px; font-weight: 700; color: #475569; }
.ia-history-count-badge { background: #e2e8f0; color: #475569; font-size: 11px; font-weight: 700; border-radius: 99px; padding: 1px 8px; }
.ia-history-list { display: flex; flex-direction: column; gap: 6px; }
.ia-history-item { display: flex; align-items: center; gap: 10px; text-align: left; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; padding: 10px 14px; cursor: pointer; transition: background .15s, border-color .15s; min-width: 0; width: 100%; }
.ia-history-item:hover { background: #f1f5f9; border-color: #c7d2fe; }
.ia-history-item.ia-hist-open { border-radius: 10px 10px 0 0; border-bottom-color: transparent; background: #f1f5f9; border-color: #c7d2fe; }
.ia-hist-body { background: #f8fafc; border: 1px solid #c7d2fe; border-top: none; border-radius: 0 0 10px 10px; padding: 14px; }
.ia-hist-chevron { flex: none; width: 16px; height: 16px; color: #94a3b8; transition: transform .2s; }
.ia-hist-chevron-open { transform: rotate(180deg); }
.ia-hist-rerun-btn { margin-top: 14px; background: transparent; border: 1px solid #6366f1; color: #6366f1; border-radius: 8px; padding: 6px 14px; font-size: 12px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: background .15s; }
.ia-hist-rerun-btn:hover { background: #f5f3ff; }
.ia-history-cat { flex: none; font-size: 10px; font-weight: 700; color: #fff; border-radius: 6px; padding: 2px 8px; white-space: nowrap; }
.ia-history-query { flex: 1; font-size: 13px; color: #1e293b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ia-history-meta { flex: none; font-size: 11px; color: #94a3b8; white-space: nowrap; }
.ia-history-empty { text-align: center; padding: 48px 24px; color: #94a3b8; font-size: 14px; }
.ia-history-back-btn { margin-top: 16px; background: #6366f1; color: #fff; border: none; border-radius: 8px; padding: 8px 20px; font-size: 13px; font-weight: 600; cursor: pointer; }

/* Responsivo */
@media (max-width: 760px) {
  .ia-view { padding: 16px 16px 100px; }
  .ia-hero { padding: 20px 18px; }
  .ia-search-card { padding: 16px; }
  .ia-farmaco-layout { flex-direction: column; }
  .ia-farmaco-doencas { width: 100%; border-right: none; border-bottom: 1px solid var(--border); flex-direction: row; flex-wrap: wrap; padding: 8px; gap: 4px; }
  .ia-doenca-card { width: auto; flex: 1; min-width: 130px; border-radius: 8px; }
  .ia-farmaco-presc { padding: 12px; }
  .ia-caso-info-grid { grid-template-columns: 1fr; padding: 12px 14px; }
  .ia-presc-tabs-wrap { padding: 12px 14px; }
  .ia-ds-sintomas { padding: 12px 14px; }
}

/* Tema Tech */
html[data-theme="tech"] .ia-hero { background: linear-gradient(135deg, #0a0e1f 0%, #1a1040 100%); border: 1px solid rgba(99,102,241,.3); }
html[data-theme="tech"] .ia-search-card { background: rgba(10,22,40,.88); border-color: rgba(0,200,255,.14); }
html[data-theme="tech"] .ia-search-input { background: rgba(7,14,31,.9); border-color: rgba(0,200,255,.2); color: #e2e8f0; }
html[data-theme="tech"] .ia-search-input:focus { border-color: #6366f1; }
html[data-theme="tech"] .ia-result-farmaco,
html[data-theme="tech"] .ia-result-doenca,
html[data-theme="tech"] .ia-result-caso,
html[data-theme="tech"] .ia-md-content { background: rgba(10,22,40,.88); border-color: rgba(0,200,255,.14); }
html[data-theme="tech"] .ia-presc-item { background: rgba(7,14,31,.7); border-color: rgba(0,200,255,.1); }
html[data-theme="tech"] .ia-doenca-card:hover { background: rgba(99,102,241,.12); }
html[data-theme="tech"] .ia-doenca-card-on { background: rgba(99,102,241,.2) !important; }
html[data-theme="tech"] .ia-caso-info-card { background: rgba(7,14,31,.6); border-color: rgba(0,200,255,.1); }
html[data-theme="tech"] .ia-tab-bar { background: rgba(7,14,31,.8); }
html[data-theme="tech"] .ia-tab-btn-on { background: rgba(99,102,241,.25); color: #e2e8f0; box-shadow: 0 0 12px rgba(99,102,241,.3); }
html[data-theme="tech"] .ia-tab-btn { color: #475569; }
html[data-theme="tech"] .ia-history-item { background: rgba(10,22,40,.88); border-color: rgba(0,200,255,.14); }
html[data-theme="tech"] .ia-history-item:hover { background: rgba(99,102,241,.12); border-color: rgba(99,102,241,.4); }
html[data-theme="tech"] .ia-history-item.ia-hist-open { background: rgba(99,102,241,.12); border-color: rgba(99,102,241,.4); }
html[data-theme="tech"] .ia-hist-body { background: rgba(10,22,40,.7); border-color: rgba(99,102,241,.4); }
html[data-theme="tech"] .ia-hist-rerun-btn { border-color: #818cf8; color: #a5b4fc; }
html[data-theme="tech"] .ia-hist-rerun-btn:hover { background: rgba(99,102,241,.15); }
html[data-theme="tech"] .ia-history-query { color: #cbd5e1; }
html[data-theme="tech"] .ia-history-title { color: #475569; }

/* ══════════════════════════════════════════════
   RENAME 2024 — Professional
══════════════════════════════════════════════ */
.rename-view { max-width: 1280px; margin: 0 auto; padding: 24px 32px 80px; overflow-x: hidden; min-width: 0; width: 100%; }

/* Hero */
.rename-hero {
  display: flex; align-items: center; gap: 20px;
  background: linear-gradient(135deg, #1e3a5f 0%, #1d4ed8 100%);
  border-radius: 16px; padding: 28px 32px; margin-bottom: 0;
  position: relative; overflow: hidden;
}
.rename-hero::after {
  content: ''; position: absolute; right: -30px; top: -30px;
  width: 160px; height: 160px; border-radius: 50%;
  background: rgba(255,255,255,.06); pointer-events: none;
}
.rename-hero-ico { font-size: 52px; line-height: 1; flex-shrink: 0; filter: drop-shadow(0 4px 8px rgba(0,0,0,.2)); }
.rename-hero-info { flex: 1; }
.rename-hero-title { font-size: 26px; font-weight: 800; color: #fff; margin: 0 0 6px; }
.rename-hero-sub { font-size: 13.5px; color: rgba(255,255,255,.72); margin: 0; line-height: 1.5; }
.rename-hero-stat {
  flex-shrink: 0; text-align: center;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.22);
  border-radius: 12px; padding: 14px 24px;
}
.rename-hero-stat-num { font-size: 32px; font-weight: 800; color: #fff; line-height: 1; }
.rename-hero-stat-lbl { font-size: 11px; color: rgba(255,255,255,.65); margin-top: 4px; text-transform: uppercase; letter-spacing: .06em; }

/* Sticky toolbar */
.rename-toolbar-wrap {
  position: sticky; top: 0; z-index: 20;
  background: #f8fafc; margin: 0 -32px;
  padding: 14px 32px 10px; border-bottom: 1px solid #e2e8f0;
  margin-bottom: 16px;
}
.rename-toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.rename-search-wrap { flex: 1; min-width: 260px; position: relative; display: flex; align-items: center; }
.rename-search-ico { position: absolute; left: 14px; color: #94a3b8; pointer-events: none; }
.rename-search {
  width: 100%; padding: 11px 36px 11px 42px;
  border: 1.5px solid #e2e8f0; border-radius: 10px;
  font-size: 14px; outline: none; background: #fff;
  transition: border-color .15s, box-shadow .15s;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.rename-search:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,.10); }
.rename-search-clear { position: absolute; right: 12px; background: none; border: none; font-size: 18px; color: #94a3b8; cursor: pointer; line-height: 1; padding: 2px 4px; }
.rename-class-sel {
  padding: 11px 14px; border: 1.5px solid #e2e8f0; border-radius: 10px;
  font-size: 13px; background: #fff; outline: none; cursor: pointer;
  min-width: 210px; box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.rename-class-sel:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,.10); }
.rename-count { font-size: 12px; color: #94a3b8; font-weight: 500; }

/* List */
.rename-list { display: flex; flex-direction: column; gap: 6px; }
.rename-empty { text-align: center; padding: 60px 20px; color: #94a3b8; font-size: 14px; }
.rename-empty svg { display: block; margin: 0 auto 12px; }
.rename-empty p { margin: 0; }

/* Card */
.rename-card {
  background: #fff; border: 1.5px solid #e2e8f0; border-radius: 12px;
  overflow: hidden; transition: border-color .15s, box-shadow .15s;
}
.rename-card:hover { border-color: #bfdbfe; box-shadow: 0 2px 10px rgba(59,130,246,.08); }
.rename-card-open { border-color: var(--cc, #3b82f6) !important; box-shadow: 0 4px 16px rgba(0,0,0,.07) !important; }

.rename-card-hd {
  width: 100%; background: none; border: none; padding: 0; padding-right: 16px;
  display: flex; align-items: stretch; cursor: pointer; text-align: left;
  min-height: 60px;
}
.rename-card-accent { width: 5px; flex-shrink: 0; }
.rename-card-left { flex: 1; min-width: 0; padding: 13px 14px 13px 16px; }
.rename-nome { display: block; font-size: 15px; font-weight: 700; color: #1e293b; margin-bottom: 3px; }
.rename-classe { display: block; font-size: 11.5px; color: #64748b; font-weight: 500; }
.rename-card-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.rename-apres-count { font-size: 11px; color: #94a3b8; white-space: nowrap; display: none; }
.rename-vias { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.rename-chevron { color: #94a3b8; flex-shrink: 0; }
@media (min-width: 640px) { .rename-apres-count { display: inline; } }

/* Via badges */
.rename-via-badge { display: inline-block; font-size: 10px; font-weight: 700; padding: 3px 9px; border-radius: 20px; border: 1.5px solid; white-space: nowrap; letter-spacing: .02em; }

/* Expanded content */
.rename-apres-list {
  border-top: 1.5px solid #f1f5f9; padding: 14px 20px 20px;
  display: flex; flex-direction: column; gap: 12px;
}
.rename-apres { border-radius: 10px; border: 1px solid #e2e8f0; overflow: hidden; background: #fff; }
.rename-apres-hd {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 14px; background: #f8fafc; border-bottom: 1px solid #e2e8f0;
}
.rename-apres-forma { font-size: 13px; font-weight: 700; color: #1e293b; }
.rename-apres-conc { font-size: 12px; color: #475569; background: #e2e8f0; border-radius: 6px; padding: 2px 8px; font-weight: 500; }

.rename-apres-body { display: block; padding: 14px; }
.rename-apres-body-2col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; padding: 14px; }
@media (max-width: 760px) { .rename-apres-body-2col { grid-template-columns: 1fr; } }

.rename-apres-uso { }
.rename-uso-lbl { font-size: 10px; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.rename-uso-txt { margin: 0; font-size: 13px; color: #1e293b; line-height: 1.65; overflow-wrap: break-word; word-break: break-word; }

.rename-apres-dil { background: #eff6ff; border-radius: 8px; padding: 12px 14px; border-left: 3px solid #3b82f6; }
.rename-dil-lbl { font-size: 10px; font-weight: 700; color: #1d4ed8; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.rename-dil-txt { margin: 0; font-size: 12.5px; color: #1e3a5f; line-height: 1.7; overflow-wrap: break-word; word-break: break-word; }

.rename-footer {
  margin-top: 40px; padding: 16px 20px;
  background: #f8fafc; border-radius: 12px; border: 1px solid #e2e8f0;
  font-size: 12px; color: #64748b; line-height: 1.7; text-align: center;
}

@media (max-width: 720px) {
  .rename-view { padding: 20px 16px 100px; }
  .rename-toolbar-wrap { margin: 0 -16px; padding: 12px 16px 8px; }
  .rename-hero { padding: 20px; gap: 14px; flex-wrap: wrap; }
  .rename-hero-stat { display: none; }
  .rename-toolbar { flex-direction: column; }
  .rename-class-sel { width: 100%; }
}

/* ══════════════════════════════════════════════
   PLANTÕES VIEW — layout geral
══════════════════════════════════════════════ */
.pt-view {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem 3rem;
  background: #f1f5f9;
  min-height: calc(100vh - 110px);
}
/* ── Barra de mês ── */
.pt-mbar { padding: 16px 0 14px; }
.pt-mbar-in { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pt-marr {
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  width: 34px; height: 34px;
  cursor: pointer;
  font-size: 20px;
  color: #64748b;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.pt-marr:hover { border-color: var(--accent); color: var(--accent); box-shadow: 0 2px 8px rgba(0,0,0,.1); }
.pt-mlbl {
  font-size: 20px; font-weight: 800; color: #1e293b;
  min-width: 180px;
  display: flex; align-items: center; gap: 10px;
}
.pt-hoje-btn {
  font-size: 11px; font-weight: 600;
  background: hsl(var(--accent-h) 70% 95%);
  color: var(--accent);
  border: 1px solid hsl(var(--accent-h) 60% 82%);
  border-radius: 12px;
  padding: 2px 10px;
  cursor: pointer;
}
.pt-novo {
  margin-left: auto;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
  box-shadow: 0 2px 10px rgba(59,130,246,.35);
}
.pt-novo:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(59,130,246,.4); }
.pt-loading-msg { text-align: center; padding: 60px; color: #64748b; font-size: 15px; }

/* ── Grid de colunas ── */
.pt-cols {
  display: grid;
  grid-template-columns: 370px 1fr;
  gap: 16px;
  align-items: start;
}
.pt-col-left { display: flex; flex-direction: column; gap: 16px; }

/* ── Cards de resumo ── */
.pt-res-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.pt-rc {
  background: #fff;
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06), 0 0 0 1px #e9eef5;
}
.pt-rc-ico {
  font-size: 20px;
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  background: #f1f5f9;
  border-radius: 12px;
  flex-shrink: 0;
}
.pt-rc-info { flex: 1; min-width: 0; }
.pt-rc-val { font-size: 17px; font-weight: 800; line-height: 1.1; color: #1e293b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-rc-lbl { font-size: 11px; color: #64748b; margin-top: 3px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.pt-rg .pt-rc-val { color: #16a34a; }
.pt-rg .pt-rc-ico { background: #f0fdf4; }
.pt-ro .pt-rc-val { color: #d97706; }
.pt-ro .pt-rc-ico { background: #fffbeb; }

/* ── Lista de plantões (card container) ── */
.pt-lista-card {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06), 0 0 0 1px #e9eef5;
  overflow: hidden;
}
.pt-lista-hdr {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 16px 11px;
  border-bottom: 1px solid #f1f5f9;
  background: #fafbfd;
}
.pt-sec-title {
  font-size: 11px; font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .07em;
}
.pt-lista { display: flex; flex-direction: column; }

/* ── Linha compacta de plantão + acordeão ── */
.pt-row-item {
  border-bottom: 1px solid #f0f4f8;
  display: flex;
  flex-direction: column;
}
.pt-lista .pt-row-item:last-child { border-bottom: none; }
.pt-row-today .pt-row-head { background: hsl(var(--accent-h,220) 80% 98%); }
.pt-row-passado { opacity: .72; }

.pt-row-head {
  display: flex;
  align-items: center;
  min-height: 52px;
  cursor: pointer;
  user-select: none;
  transition: background .12s;
}
.pt-row-head:hover { background: #f8faff; }
.pt-row-open .pt-row-head { background: #f8faff; }

.pt-ri-bar  { width: 4px; flex-shrink: 0; align-self: stretch; }
.pt-ri-dm   { display: flex; flex-direction: column; align-items: center; min-width: 38px; padding: 0 6px; flex-shrink: 0; }
.pt-ri-d    { font-size: 15px; font-weight: 800; line-height: 1.1; }
.pt-ri-ms   { font-size: 9px; font-weight: 700; text-transform: uppercase; color: #94a3b8; }
.pt-ri-lc   {
  flex: 1; min-width: 0; padding-right: 6px;
  display: flex; align-items: center; gap: 6px;
}
.pt-ri-lc-name {
  font-size: 13px; font-weight: 600; color: #1e293b;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pt-ri-vm   { font-size: 12px; font-weight: 700; color: #16a34a; padding: 0 4px; flex-shrink: 0; white-space: nowrap; }
.pt-ri-am   { display: flex; gap: 1px; flex-shrink: 0; padding: 0 4px; }
.pt-ri-am button {
  background: none; border: none; cursor: pointer;
  font-size: 15px; padding: 5px 5px; border-radius: 6px;
  line-height: 1; color: #94a3b8; transition: background .12s, color .12s;
}
.pt-ri-am button:hover { background: #f1f5f9; color: #475569; }
.pt-row-chev {
  font-size: 14px; color: #d1d5db; padding: 0 10px 0 2px; flex-shrink: 0;
  transition: transform .2s; display: inline-block; transform: rotate(0deg);
}
.pt-row-chev.open { transform: rotate(90deg); }

/* Acordeão */
.pt-row-acc {
  border-top: 1px solid #f1f5f9;
  background: #f8faff;
  padding: 10px 12px 12px 48px;
  display: flex; flex-direction: column; gap: 7px;
}
.pt-row-acc-meta {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-size: 12px; color: #64748b;
}
.pt-row-acc-badges { display: flex; gap: 5px; flex-wrap: wrap; }
.pt-row-acc-obs { font-size: 11px; color: #94a3b8; font-style: italic; line-height: 1.4; margin: 0; }
.pt-row-acc-edit {
  align-self: flex-start;
  background: none; border: 1.5px solid #e2e8f0; border-radius: 8px;
  padding: 6px 14px; font-size: 12px; font-weight: 600; color: #334155;
  cursor: pointer; margin-top: 2px; transition: all .15s; font-family: inherit;
}
.pt-row-acc-edit:hover { background: hsl(var(--accent-h,220) 80% 97%); border-color: var(--accent); color: var(--accent); }

/* Badges comuns */
.pt-ri-sep   { color: #cbd5e1; }
.pt-ri-hoje  { background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; border-radius: 8px; padding: 1px 7px; flex-shrink: 0; }
.pt-ri-pip   { font-size: 10px; font-weight: 700; border-radius: 8px; padding: 2px 8px; white-space: nowrap; }
.pip-ok      { background: #dcfce7; color: #15803d; }
.pip-w       { background: #fef3c7; color: #92400e; }
.pip-x       { background: #f3f4f6; color: #6b7280; }
.pip-passado { background: #f1f5f9; color: #94a3b8; }
.pt-badge-pass-mini { background: #f1f5f9; color: #64748b; font-size: 10px; font-weight: 600; border-radius: 8px; padding: 1px 7px; flex-shrink: 0; white-space: nowrap; }

/* ── Estado vazio ── */
.pt-empty-state {
  text-align: center; padding: 36px 20px;
  background: #fff; border-radius: 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06), 0 0 0 1px #e9eef5;
}
.pt-empty-ico   { font-size: 40px; margin-bottom: 12px; }
.pt-empty-state p { font-size: 14px; color: #64748b; line-height: 1.5; margin: 0; }
.pt-empty-hint  { font-size: 12px !important; margin-top: 4px; }
.pt-novo-inline {
  margin-top: 16px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 10px 22px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all .15s;
  box-shadow: 0 2px 8px rgba(59,130,246,.3);
}
.pt-novo-inline:hover { filter: brightness(1.08); transform: translateY(-1px); }

/* ══════════════════════════════════════════════
   CALENDÁRIO
══════════════════════════════════════════════ */
.pt-col-right {}
.pt-cal {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,.07), 0 0 0 1px #e9eef5;
}
.pt-cal-dows {
  display: grid;
  grid-template-columns: repeat(7,1fr);
  background: #f8fafc;
  border-bottom: 2px solid #f1f5f9;
}
.pt-cal-dow {
  text-align: center;
  font-size: 11px; font-weight: 700;
  color: #94a3b8;
  padding: 11px 2px;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.pt-cal-dows > div:first-child,
.pt-cal-dows > div:last-child { color: #f59e0b; }
.pt-cal-grid {
  display: grid;
  grid-template-columns: repeat(7,1fr);
}
.pt-cc {
  border-right: 1px solid #f1f5f9;
  border-bottom: 1px solid #f1f5f9;
  min-height: 94px;
  padding: 7px 6px 5px;
  cursor: pointer;
  transition: background .12s;
  position: relative;
}
.pt-cc:hover { background: hsl(var(--accent-h,220) 80% 98%); }
.pt-cc:nth-child(7n) { border-right: none; }
.pt-cc-e { background: #fafbfc; cursor: default; pointer-events: none; }
.pt-cc-wknd { background: #fefcf5; }
.pt-cc-wknd:hover { background: hsl(38 80% 96%); }
.pt-cc-today { background: hsl(var(--accent-h) 90% 97%) !important; }
.pt-cc-today .pt-cc-num {
  background: var(--accent); color: white;
  border-radius: 50%; width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
}
.pt-cc-past .pt-cc-num { color: #cbd5e1; }
.pt-cc-top  { display: flex; align-items: center; justify-content: space-between; margin-bottom: 5px; }
.pt-cc-num  { font-size: 13px; font-weight: 500; color: #475569; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; }
.pt-cc-badge {
  font-size: 10px; font-weight: 700;
  background: var(--accent); color: white;
  border-radius: 6px; padding: 1px 5px;
  min-width: 16px; text-align: center;
}
.pt-cc-evs { display: flex; flex-direction: column; gap: 2px; }
.pt-cev {
  font-size: 9.5px; font-weight: 700;
  border-radius: 4px; padding: 2px 6px;
  color: white;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  cursor: pointer;
  transition: opacity .12s;
  box-shadow: 0 1px 2px rgba(0,0,0,.15);
}
.pt-cev:hover { opacity: .85; }
.pt-cev-x { opacity: .3 !important; }
.pt-cev-pass { opacity: .45 !important; }
.pt-cev-hora { opacity: .75; font-weight: 400; margin-right: 2px; }
.pt-cev-m { font-size: 10px; color: #94a3b8; padding-left: 3px; margin-top: 1px; }
.pt-cal-hint { font-size: 12px; color: #94a3b8; text-align: center; margin-top: 9px; font-style: italic; }

/* ══════════════════════════════════════════════
   MODAL
══════════════════════════════════════════════ */
.pt-overlay {
  position: fixed; inset: 0;
  background: rgba(15,23,42,.55);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  backdrop-filter: blur(2px);
}
@media (min-width: 560px) { .pt-overlay { align-items: center; padding: 20px; } }

.pt-mbox {
  background: #fff;
  border-radius: 22px 22px 0 0;
  width: 100%; max-width: 540px;
  max-height: 92vh;
  display: flex; flex-direction: column;
  animation: pt-slide .25s cubic-bezier(.2,.9,.3,1);
  overflow: hidden;
  box-shadow: 0 -8px 40px rgba(0,0,0,.15);
}
@media (min-width: 560px) {
  .pt-mbox { border-radius: 18px; animation: pt-zoom .2s cubic-bezier(.2,.9,.3,1); box-shadow: 0 24px 60px rgba(0,0,0,.18); }
}
@keyframes pt-slide { from{transform:translateY(100%)} to{transform:none} }
@keyframes pt-zoom  { from{opacity:0;transform:scale(.93) translateY(12px)} to{opacity:1;transform:none} }

.pt-mbox-hdr {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 16px;
  border-bottom: 2px solid #f1f5f9;
  background: linear-gradient(135deg, hsl(var(--accent-h) 80% 97%) 0%, #fff 60%);
}
.pt-mbox-title { font-size: 18px; font-weight: 800; color: #1e293b; }
.pt-mbox-sub   { font-size: 12px; color: #64748b; margin-top: 2px; }
.pt-mbox-x {
  background: #f1f5f9; border: none; font-size: 15px; cursor: pointer;
  color: #64748b; width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: all .12s; flex-shrink: 0;
}
.pt-mbox-x:hover { background: #e2e8f0; color: #1e293b; }

/* Modal body sem padding global — seções têm o próprio */
.pt-mbox-body {
  flex: 1; overflow-y: auto;
  padding: 0;
  display: flex; flex-direction: column;
}

/* Seções do formulário */
.pt-form-section {
  padding: 16px 20px;
  border-bottom: 2px solid #f8fafc;
}
.pt-form-section:last-of-type { border-bottom: none; }
.pt-form-sec-hdr {
  font-size: 11px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--accent);
  margin-bottom: 13px;
  display: flex; align-items: center; gap: 6px;
}

.pt-mbox-ftr {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 14px 20px 20px;
  border-top: 2px solid #f1f5f9;
  background: #fafbfd;
}

/* Erro */
.pt-ferr {
  background: #fee2e2; color: #dc2626;
  border: 1px solid #fca5a5;
  border-radius: 8px; padding: 9px 14px;
  font-size: 13px; margin: 12px 20px 0;
}

/* Campos */
.pt-fg  { display: flex; flex-direction: column; gap: 5px; }
.pt-row { display: flex; gap: 10px; }
.pt-row > .pt-fg { flex: 1; }
.pt-lbl {
  font-size: 11px; font-weight: 700;
  color: #64748b;
  text-transform: uppercase; letter-spacing: .05em;
}
.pt-inp {
  border: 1.5px solid #e2e8f0;
  border-radius: 9px;
  padding: 10px 13px;
  font-size: 14px;
  color: #1e293b;
  background: #fff;
  width: 100%;
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.pt-inp:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px hsl(var(--accent-h,220) 70% 52% / .12);
}

/* Toggles */
.pt-tog {
  display: flex;
  border: 1.5px solid #e2e8f0;
  border-radius: 9px;
  overflow: hidden;
  background: #f8fafc;
}
.pt-tog-btn {
  flex: 1;
  background: transparent; border: none;
  padding: 10px 6px;
  font-size: 13px; font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: all .15s;
  border-right: 1px solid #e2e8f0;
  font-family: inherit;
}
.pt-tog-btn:last-child { border-right: none; }
.pt-tog-btn.on { background: var(--accent); color: white; font-weight: 700; }
.pt-tog-btn:not(.on):hover { background: #f1f5f9; color: #1e293b; }

/* Autocomplete */
.pt-sug {
  position: absolute; top: 100%; left: 0; right: 0;
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 10px 32px rgba(0,0,0,.12);
  z-index: 10; list-style: none;
  overflow: hidden; margin-top: 4px;
}
.pt-sug li { padding: 8px 14px; font-size: 14px; cursor: pointer; transition: background .1s; }
.pt-sug li:hover { background: hsl(var(--accent-h,220) 70% 97%); }
.pt-sug-li { display: flex; align-items: center; gap: 8px; }
.pt-sug-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.pt-sug-name { flex: 1; color: #1e293b; font-weight: 500; }
.pt-sug-val { font-size: 12px; color: #64748b; font-variant-numeric: tabular-nums; flex-shrink: 0; }
.pt-lbl-cor { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-left: 7px; vertical-align: middle; position: relative; top: -1px; }

/* Checkbox estilizado */
.pt-check {
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; font-size: 14px; font-weight: 500;
  color: #1e293b;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 9px;
  padding: 11px 14px;
  user-select: none;
  transition: all .15s;
}
.pt-check input[type="checkbox"] {
  width: 18px; height: 18px;
  flex-shrink: 0; cursor: pointer;
  accent-color: var(--accent);
}
.pt-check:has(input:checked) { background: #f0fdf4; border-color: #86efac; }

/* Preview financeiro */
.pt-fin-prev {
  border-radius: 10px;
  padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between;
}
.pt-fin-pago { background: #dcfce7; border: 1px solid #bbf7d0; }
.pt-fin-pend { background: #fef9c3; border: 1px solid #fde047; }
.pt-fin-val { font-size: 18px; font-weight: 800; color: #1e293b; }
.pt-fin-st  { font-size: 13px; font-weight: 700; }
.pt-fin-pago .pt-fin-st { color: #15803d; }
.pt-fin-pend .pt-fin-st { color: #92400e; }

/* Info boxes */
.pt-info-box {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 9px;
  padding: 10px 14px;
  font-size: 13px;
  color: #1d4ed8;
  line-height: 1.55;
}
.pt-info-warn { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.pt-info-hist { background: #f0fdf4; border-color: #bbf7d0; color: #15803d; }

/* ── Blocos da coluna esquerda ── */
.pt-bloco {
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 1px 6px rgba(0,0,0,.06);
  overflow: hidden;
}
.pt-bloco-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 12px;
  border-bottom: 1.5px solid #f1f5f9;
  background: #fafbfd;
  gap: 10px;
}
.pt-bloco-hdr-left { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.pt-bloco-title { font-size: 15px; font-weight: 800; color: #1e293b; }
.pt-bloco-sub   { font-size: 11px; color: #94a3b8; font-weight: 500; margin-top: 1px; }
.pt-bloco-badge {
  font-size: 10px; font-weight: 700; letter-spacing: .04em;
  border-radius: 20px; padding: 3px 10px; white-space: nowrap; flex-shrink: 0;
}
.pt-bloco-badge-cur  { background: hsl(var(--accent-h,220) 80% 94%); color: hsl(var(--accent-h,220) 70% 38%); }
.pt-bloco-badge-past { background: #f1f5f9; color: #64748b; }
.pt-bloco-badge-fut  { background: #f0fdf4; color: #16a34a; }
.pt-bloco-total {
  font-size: 18px; font-weight: 900; color: #d97706;
  font-variant-numeric: tabular-nums; white-space: nowrap; flex-shrink: 0;
}

/* Resumo cards dentro do bloco: compactos e sem shadow próprio */
.pt-bloco-pad { padding: 12px 12px 14px; }
.pt-bloco .pt-rc {
  box-shadow: none;
  background: #f8fafc;
  border: 1px solid #eef1f6;
  padding: 10px 11px;
  gap: 8px;
  border-radius: 10px;
}
.pt-bloco .pt-rc-ico { width: 32px; height: 32px; font-size: 15px; border-radius: 8px; }
.pt-bloco .pt-rc-info { min-width: 0; }
.pt-bloco .pt-rc-val { font-size: 13px; }
.pt-bloco .pt-rc-lbl { font-size: 10px; margin-top: 2px; }

/* Seções internas do bloco */
.pt-bloco-sec { border-top: 1.5px solid #f1f5f9; }
.pt-bloco-sec:last-child { padding-bottom: 10px; }
.pt-bloco-sec:last-child .pt-lista .pt-row-item:last-child { border-bottom: none; }
.pt-bloco-sec-hdr {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 16px 7px;
  background: #fafbfd;
  border-bottom: 1px solid #f1f5f9;
}
.pt-sec-cnt { font-size: 11px; color: #94a3b8; font-weight: 500; }

/* Estado vazio dentro do bloco */
.pt-bloco-empty { text-align: center; padding: 32px 20px; }
.pt-bloco-empty .pt-empty-ico { font-size: 36px; margin-bottom: 10px; }
.pt-bloco-empty p { font-size: 13px; color: #94a3b8; margin: 0; line-height: 1.5; }
.pt-bloco-empty .pt-empty-hint { font-size: 12px; margin-top: 4px; }
.pt-bloco-empty .pt-novo-inline { margin-top: 14px; }

/* Bloco de meses anteriores (laranja) */
.pt-bloco-past { border-color: #fed7aa; }
.pt-bloco-past .pt-bloco-hdr {
  background: linear-gradient(135deg, #fffbeb, #fff7ed);
  border-bottom-color: #fde68a;
}
.pt-bloco-past .pt-bloco-title { color: #92400e; }
.pt-bloco-past .pt-bloco-sub   { color: #b45309; }

.pt-past-meses { padding: 6px 0 14px; }
.pt-past-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 16px; transition: background .12s;
}
.pt-past-row:hover { background: #fffbeb; }
.pt-past-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #f59e0b; flex-shrink: 0;
}
.pt-past-nome { font-size: 13px; font-weight: 700; color: #78350f; flex: 1; }
.pt-past-cnt  { font-size: 11px; color: #b45309; white-space: nowrap; }
.pt-past-val  { font-size: 14px; font-weight: 800; color: #d97706; min-width: 88px; text-align: right; font-variant-numeric: tabular-nums; }

/* ── Calendar chip popup ── */
.pt-cal-popup {
  background: white;
  border-radius: 18px;
  width: 330px;
  max-width: 92vw;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0,0,0,.20);
  position: relative;
}
.pt-cal-popup-bar { height: 5px; }
.pt-cal-popup-body { padding: 18px 18px 14px; position: relative; }
.pt-cal-popup-x {
  position: absolute; top: 12px; right: 14px;
  background: #f1f5f9; border: none; border-radius: 50%;
  width: 28px; height: 28px; cursor: pointer; font-size: 13px;
  color: #64748b; display: flex; align-items: center; justify-content: center;
  transition: background .12s;
}
.pt-cal-popup-x:hover { background: #e2e8f0; color: #1e293b; }
.pt-cal-popup-date { font-size: 11px; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.pt-cal-popup-local { font-size: 20px; font-weight: 900; line-height: 1.2; margin-bottom: 4px; }
.pt-cal-popup-tipo { font-size: 11px; font-weight: 600; color: #94a3b8; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 8px; }
.pt-cal-popup-meta { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #475569; margin-bottom: 10px; flex-wrap: wrap; }
.pt-cal-popup-val { font-weight: 800; color: #16a34a; }
.pt-cal-popup-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.pt-cal-popup-obs { font-size: 12px; color: #94a3b8; font-style: italic; margin-top: 10px; line-height: 1.5; }
.pt-cal-popup-acts { border-top: 1px solid #f1f5f9; }
.pt-cal-popup-act {
  width: 100%; background: none; border: none;
  padding: 13px 18px;
  font-size: 14px; font-weight: 600; color: #334155;
  cursor: pointer; text-align: left;
  display: flex; align-items: center; gap: 10px;
  transition: background .12s;
  border-top: 1px solid #f1f5f9;
  font-family: inherit;
}
.pt-cal-popup-act:first-child { border-top: none; }
.pt-cal-popup-act:hover { background: #f8fafc; }
.pt-cal-popup-del { color: #dc2626; }
.pt-cal-popup-del:hover { background: #fef2f2 !important; }

/* ── Turno selector ── */
.pt-tog-turno {
  gap: 8px;
  background: transparent;
  border: none;
  overflow: visible;
}
.pt-turno-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 12px 6px !important;
  border: 1.5px solid #e2e8f0 !important;
  border-radius: 10px !important;
  background: white !important;
}
.pt-turno-btn.on {
  border-color: var(--accent) !important;
  background: hsl(var(--accent-h,220) 80% 97%) !important;
  color: var(--accent) !important;
}
.pt-turno-ico { font-size: 22px; line-height: 1; }
.pt-turno-lbl { font-size: 13px; font-weight: 700; line-height: 1.2; }
.pt-turno-sub { font-size: 10px; color: #94a3b8; font-weight: 500; }
.pt-turno-btn.on .pt-turno-sub { color: hsl(var(--accent-h,220) 50% 60%); }

/* Botões do modal */
.pt-btn-pri {
  background: var(--accent); color: white;
  border: none; border-radius: 10px;
  padding: 11px 26px;
  font-size: 14px; font-weight: 700;
  cursor: pointer; transition: all .15s;
  box-shadow: 0 2px 10px rgba(59,130,246,.35);
  font-family: inherit;
}
.pt-btn-pri:hover:not(:disabled) { filter: brightness(1.08); box-shadow: 0 4px 16px rgba(59,130,246,.4); }
.pt-btn-pri:disabled { opacity: .55; cursor: not-allowed; }

.pt-btn-sec {
  background: #f8fafc; color: #475569;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px; padding: 11px 20px;
  font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all .15s; font-family: inherit;
}
.pt-btn-sec:hover { background: #f1f5f9; border-color: #cbd5e1; }

.pt-btn-pass {
  background: #d97706; color: white;
  border: none; border-radius: 10px;
  padding: 11px 24px;
  font-size: 14px; font-weight: 700;
  cursor: pointer; transition: all .15s;
  box-shadow: 0 2px 10px rgba(217,119,6,.3);
  font-family: inherit;
}
.pt-btn-pass:hover:not(:disabled) { filter: brightness(1.08); }
.pt-btn-pass:disabled { opacity: .55; cursor: not-allowed; }

/* ── Modal de escopo (deletar recorrente) ── */
.pt-scope-box { max-width: 390px; }
.pt-scope-body {
  padding: 16px 20px 20px;
  display: flex; flex-direction: column; gap: 10px;
}
.pt-scope-info { font-size: 14px; color: #64748b; margin: 0 0 4px; }
.pt-scope-btn {
  display: flex; align-items: center; gap: 14px;
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 16px;
  cursor: pointer;
  text-align: left;
  transition: all .15s;
  width: 100%;
  font: inherit;
}
.pt-scope-btn:hover { border-color: var(--accent); background: hsl(var(--accent-h,220) 80% 98%); transform: translateX(3px); }
.pt-scope-danger:hover { border-color: #ef4444; background: #fef2f2; transform: translateX(3px); }
.pt-scope-ico {
  width: 36px; height: 36px;
  background: #f1f5f9;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800;
  flex-shrink: 0; color: #64748b;
}
.pt-scope-ttl { font-size: 14px; font-weight: 700; color: #1e293b; line-height: 1.2; }
.pt-scope-sub { font-size: 12px; color: #64748b; margin-top: 2px; }
.pt-scope-danger .pt-scope-ttl { color: #dc2626; }
.pt-scope-danger .pt-scope-ico { background: #fee2e2; color: #dc2626; }

/* ── Passed event ── */
.pt-cev-pass { opacity: .45 !important; }

/* ── Conflict warning ── */
.pt-conflict-box {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
}
.pt-conflict-hdr {
  font-size: 13px;
  font-weight: 600;
  color: #92400e;
  margin-bottom: 6px;
}
.pt-conflict-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #44403c;
  padding: 2px 0;
}
.pt-conflict-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.pt-conflict-time {
  margin-left: auto;
  font-size: 12px;
  color: #78716c;
  font-variant-numeric: tabular-nums;
}

/* ── Painel "Valores a Receber" (pendências globais) ── */
.pt-pend-panel {
  background: linear-gradient(135deg, #fffbeb 0%, #fff7ed 100%);
  border: 1.5px solid #fed7aa;
  border-radius: 14px;
  margin-bottom: 14px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(234,88,12,.08);
}
.pt-pend-top {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
}
.pt-pend-ico {
  font-size: 26px;
  flex-shrink: 0;
  line-height: 1;
}
.pt-pend-info {
  flex: 1;
  min-width: 0;
}
.pt-pend-ttl {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #92400e;
  margin-bottom: 2px;
}
.pt-pend-val {
  font-size: 22px;
  font-weight: 900;
  color: #d97706;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.pt-pend-sub {
  font-size: 11px;
  color: #b45309;
  margin-top: 3px;
}
.pt-pend-toggle {
  background: rgba(217,119,6,.12);
  border: 1.5px solid #fbbf24;
  border-radius: 8px;
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-size: 12px;
  color: #92400e;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all .15s;
}
.pt-pend-toggle:hover {
  background: rgba(217,119,6,.22);
}
.pt-pend-meses {
  border-top: 1px solid #fed7aa;
  padding: 6px 0 4px;
}
.pt-pend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  gap: 10px;
  transition: background .12s;
}
.pt-pend-row:hover { background: rgba(255,237,213,.6); }
.pt-pend-m-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #78350f;
  flex: 1;
  min-width: 0;
}
.pt-pend-m-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f59e0b;
  flex-shrink: 0;
}
.pt-pend-overdue .pt-pend-m-dot { background: #ef4444; }
.pt-pend-overdue .pt-pend-m-name { color: #991b1b; }
.pt-pend-atrs {
  font-size: 10px;
  font-weight: 700;
  background: #fee2e2;
  color: #b91c1c;
  border-radius: 8px;
  padding: 1px 7px;
  flex-shrink: 0;
}
.pt-pend-m-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.pt-pend-m-cnt {
  font-size: 11px;
  color: #92400e;
  white-space: nowrap;
}
.pt-pend-m-val {
  font-size: 14px;
  font-weight: 800;
  color: #d97706;
  min-width: 90px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ══════════════════════════════════════════════
   RESPONSIVO
══════════════════════════════════════════════ */
@media (max-width: 960px) {
  .pt-cols { grid-template-columns: 1fr; }
  .pt-col-right { order: -1; }
  .pt-cc { min-height: 70px; }
}
@media (max-width: 580px) {
  .pt-res-grid { grid-template-columns: 1fr 1fr; }
  .pt-rc-val { font-size: 15px; }
  .pt-cc { min-height: 52px; padding: 4px 2px; }
  .pt-cev { display: none; }
  .pt-cc-has .pt-cc-num { color: var(--accent); font-weight: 800; }
  .anav-btn { padding: 10px 12px; font-size: 13px; }
  .anav-btn svg { display: none; }
  .pt-ri-vm { font-size: 11px; }
}

/* --- Hero toolbar: search + action buttons --- */
.hero-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
}
.hero-toolbar .hero-search {
  flex: 1;
  min-width: 0;
  margin: 0;
  /* alinha com o topo do ped-side-btn */
  padding-top: 0;
}
.hero-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* ── Pediatria side toggle ── */
.ped-side-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}
.ped-side-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 13px;
  height: 52px;
  border-radius: 14px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-soft);
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: all .18s;
  box-shadow: var(--shadow-sm);
}
.ped-side-btn:hover {
  border-color: hsl(330 55% 78%);
  color: hsl(330 60% 42%);
  background: hsl(330 80% 98%);
  box-shadow: 0 4px 14px hsl(330 65% 48% / 0.15);
}
.ped-side-btn.ped-on {
  background: linear-gradient(135deg, #fce7f3 0%, #f3e8ff 100%);
  border-color: #f9a8d4;
  color: #9d174d;
  box-shadow: 0 2px 10px rgba(219, 39, 119, 0.18);
}
.ped-side-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  text-align: left;
}
.ped-side-label {
  font-size: 13px;
  font-weight: 700;
  color: inherit;
}
.ped-side-status {
  font-size: 10px;
  font-weight: 500;
  opacity: 0.65;
  letter-spacing: .02em;
}
.ped-side-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
  transition: all .18s;
}
.ped-side-dot.on {
  background: #db2777;
  box-shadow: 0 0 0 3px rgba(219, 39, 119, 0.22);
}
.ped-side-meds {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 10px;
  height: 26px;
  border-radius: 8px;
  border: 1.5px solid #f9a8d4;
  background: #fce7f3;
  color: #be185d;
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s;
}
.ped-side-meds:hover {
  background: #fdf2f8;
  border-color: #db2777;
  box-shadow: 0 2px 8px rgba(219, 39, 119, 0.18);
}
@media (max-width: 720px) {
  .ped-side-text { display: none; }
  .ped-side-dot  { display: none; }
  .ped-side-btn  { padding: 0 11px; gap: 0; }
  .ped-side-meds { padding: 0 8px; font-size: 10px; gap: 4px; }
}

/* ── Opção A: ped toggle integrado na barra de busca ── */
.ped-in-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  height: 36px;
  border-radius: 9px;
  border: 1.5px solid transparent;
  background: transparent;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
  transition: all .18s;
}
.ped-in-toggle:hover {
  background: hsl(330 80% 97%);
  color: hsl(330 60% 45%);
  border-color: hsl(330 55% 85%);
}
.ped-in-toggle.on {
  background: linear-gradient(135deg, #fce7f3 0%, #f3e8ff 100%);
  color: #9d174d;
  border-color: #f9a8d4;
}
.ped-in-sep {
  display: block;
  width: 1.5px;
  align-self: stretch;
  background: var(--border);
  flex-shrink: 0;
  margin: 12px -4px;
}
.ped-in-meds {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 10px;
  height: 30px;
  border-radius: 8px;
  border: 1.5px solid #f9a8d4;
  background: #fce7f3;
  color: #be185d;
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
  transition: all .15s;
}
.ped-in-meds:hover {
  background: #fdf2f8;
  border-color: #db2777;
  box-shadow: 0 2px 8px rgba(219, 39, 119, 0.15);
}
@media (max-width: 720px) {
  .ped-in-toggle span { display: none; }
  .ped-in-meds span   { display: none; }
  .ped-in-meds { padding: 0 8px; }
}

/* ── Opção B: pill flutuante acima da barra ── */
.ped-above-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: -4px;
}
.ped-above-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 11px;
  height: 26px;
  border-radius: 100px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: all .18s;
  box-shadow: var(--shadow-sm);
}
.ped-above-pill:hover {
  border-color: hsl(330 55% 78%);
  color: hsl(330 60% 42%);
  background: hsl(330 80% 98%);
}
.ped-above-pill.on {
  background: #db2777;
  border-color: #db2777;
  color: #fff;
  box-shadow: 0 2px 10px rgba(219,39,119,.3);
}
.ped-above-x {
  font-size: 9px;
  opacity: 0.75;
  margin-left: 1px;
}
.ped-above-meds-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 11px;
  height: 26px;
  border-radius: 100px;
  border: 1.5px solid #f9a8d4;
  background: #fce7f3;
  color: #be185d;
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s;
}
.ped-above-meds-pill:hover {
  background: #fdf2f8;
  border-color: #db2777;
  box-shadow: 0 2px 8px rgba(219,39,119,.15);
}

/* ── Segmented control Adulto / Pediatria — centralizado, não sticky ── */
.ped-hero-tabs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 28px 0 18px;
}
.ped-seg {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: #e9eaee;
  border-radius: 16px;
  padding: 4px;
  box-shadow: inset 0 1px 3px rgba(0,0,0,.08);
}
.ped-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 28px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  color: #6b7280;
  background: transparent;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
  letter-spacing: .01em;
}
.ped-tab:hover {
  color: #374151;
  background: rgba(255,255,255,.6);
}
.ped-tab.active {
  color: var(--accent);
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.12), 0 0 0 1px rgba(0,0,0,.04);
}
.ped-tab-ped.active {
  color: #db2777;
  background: #fff;
}
.ped-tab-meds {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 12px;
  border: 1.5px solid #f9a8d4;
  background: #fce7f3;
  color: #be185d;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s;
  box-shadow: 0 1px 4px rgba(219,39,119,.12);
}
.ped-tab-meds:hover {
  background: #fdf2f8;
  border-color: #db2777;
  box-shadow: 0 3px 10px rgba(219,39,119,.2);
}
@media (max-width: 720px) {
  .ped-hero-tabs { padding: 18px 0 12px; }
  .ped-tab { padding: 9px 20px; font-size: 13px; }
  .ped-tab-meds { padding: 8px 14px; font-size: 12px; }
}
.hero-act-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 18px;
  height: 52px;
  border-radius: 14px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all .18s;
  box-shadow: var(--shadow-sm);
}
.hero-act-btn:hover {
  background: white;
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 4px 14px hsl(var(--accent-h) 65% 48% / 0.15);
}
.hero-act-nova {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
.hero-act-nova:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: white;
  box-shadow: 0 6px 18px hsl(var(--accent-h) 65% 40% / 0.3);
}
.hero-act-nova.ped {
  background: #db2777;
  border-color: #db2777;
}
.hero-act-nova.ped:hover {
  background: #be185d;
  border-color: #be185d;
  box-shadow: 0 6px 18px rgba(219, 39, 119, 0.3);
}
.hero-act-atestado {
  color: hsl(38 85% 38%);
  border-color: hsl(38 65% 78%);
}
.hero-act-atestado:hover {
  background: hsl(38 95% 97%);
  border-color: hsl(38 75% 55%);
  color: hsl(38 85% 30%);
  box-shadow: 0 4px 14px hsl(38 80% 50% / 0.15);
}

/* --- Tema Pediátrico --- */
.app-pediatria {
  --accent-h: 327;
}
.app-pediatria .app-header {
  background: linear-gradient(135deg, #fdf2f8 0%, #fce7f3 100%);
  border-bottom-color: #f9a8d4;
}
.app-pediatria .brand-mark {
  background: #db2777;
  box-shadow: 0 4px 10px rgba(219, 39, 119, 0.3);
}
.app-pediatria .brand-name span { color: #db2777; }
.app-pediatria .brand-sub { color: #be185d; }
.app-pediatria .date-pill {
  background: #fce7f3;
  color: #9d174d;
}
.app-pediatria .main {
  background:
    radial-gradient(ellipse at 15% 0%, rgba(252, 231, 243, 0.8) 0%, transparent 50%),
    radial-gradient(ellipse at 85% 100%, rgba(243, 232, 255, 0.6) 0%, transparent 50%),
    #f7f8fa;
}
.app-pediatria .hero-search-inner {
  border-color: #f9a8d4;
}
.app-pediatria .hero-search-inner:focus-within {
  border-color: #db2777;
  box-shadow: 0 0 0 4px rgba(219, 39, 119, 0.15);
}
.app-pediatria .mode-toggle.on {
  background: linear-gradient(135deg, #fce7f3 0%, #f3e8ff 100%);
  border-color: #f9a8d4;
  color: #9d174d;
}
.app-pediatria .user-header-avatar { background: #db2777; }

/* Ícones de fundo decorativos no modo pediatria */
.app-pediatria .main::before {
  content: "👶 🍼 ❤️";
  position: fixed;
  bottom: 24px;
  left: 24px;
  font-size: 22px;
  opacity: 0.12;
  pointer-events: none;
  letter-spacing: 8px;
  z-index: 0;
}

/* --- Ajuste responsive --- */
@media (max-width: 900px) {
  .hero-toolbar { flex-wrap: wrap; }
  .hero-actions { width: 100%; }
  .hero-act-btn { flex: 1; justify-content: center; }
}
@media (max-width: 720px) {
  /* Single-row toolbar: search + compact icon button */
  .hero-toolbar { flex-wrap: nowrap; align-items: center; gap: 8px; }
  .hero-actions { width: auto; flex-shrink: 0; }
  .hero-act-btn { flex: none; width: 42px; height: 42px; padding: 0; border-radius: 10px; justify-content: center; }
  .hero-act-btn span { display: none; }
}
@media (max-width: 600px) {
  .user-header-info { display: none; }
}

/* ========================================================
   BOTTOM NAVIGATION — mobile only
   ======================================================== */
.bottom-nav { display: none; }

@media (max-width: 720px) {
  /* ---- Bottom Nav ---- */
  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 85;
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    box-shadow: 0 -4px 20px rgba(15, 22, 40, 0.10);
  }
  .bnav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 3px;
    min-height: 58px;
    padding: 6px 4px 8px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 8.5px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: color .15s;
    -webkit-tap-highlight-color: transparent;
    letter-spacing: 0.03em;
    text-transform: uppercase;
  }
  .bnav-item.active { color: var(--accent); }
  .bnav-item.bnav-ped.active { color: #db2777; }
  .bnav-fab {
    width: 44px; height: 44px;
    background: var(--accent);
    border-radius: 50%;
    display: grid; place-items: center;
    color: white;
    box-shadow: 0 4px 14px hsl(var(--accent-h) 65% 40% / 0.45);
    margin-bottom: 2px;
    transition: transform .13s, box-shadow .13s;
  }
  .bnav-fab.bnav-fab-ped { background: #db2777; box-shadow: 0 4px 14px rgba(219,39,119,0.4); }
  .bnav-center:active .bnav-fab { transform: scale(0.91); box-shadow: none; }

  /* ---- Main gets bottom padding for nav bar ---- */
  .main { padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px)) !important; }

  /* ---- Hide desktop-only header elements ---- */
  .mode-toggle { display: none !important; }
  .history-rail { display: none !important; }
  .header-strip { display: none; }
  .kbd { display: none; }

  /* ---- Hide Nova Rx from hero toolbar (moved to bottom nav) ---- */
  .hero-act-nova { display: none !important; }

  /* ---- ExameFísico + Atestado: hidden on mobile ---- */
  .hero-act-exam, .hero-act-atestado { display: none !important; }

  /* ---- Simpler header on mobile ---- */
  .header-inner { padding: 10px 16px !important; }
  .brand-sub { display: none; }

  /* ---- Drawer on mobile: full-width, taller ---- */
  .drawer { max-width: 100vw !important; width: 100vw !important; }
  .drawer-navbar { padding: 3px 8px; }
  .dnavbar-btn span { display: none; }
  .dnavbar-btn { padding: 6px 8px; }

  /* ---- Modal: full-screen on mobile ---- */
  .modal {
    top: auto !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    transform: none !important;
    width: 100vw !important;
    max-width: 100vw !important;
    max-height: 92vh !important;
    border-radius: 20px 20px 0 0 !important;
    animation: modal-slide-up .28s cubic-bezier(0.22, 0.8, 0.3, 1) !important;
  }
  @keyframes modal-slide-up {
    from { transform: translateY(60px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
  }

  /* ---- Touch targets: ensure minimum 44px ---- */
  .card-action { width: 40px !important; height: 40px !important; }
  .card.card-list .card-star { width: 40px !important; height: 40px !important; }
  .icon-btn { width: 44px !important; height: 44px !important; }

  /* ---- Prescription drawer drag handle ---- */
  .drawer::before {
    content: '';
    display: block;
    width: 36px; height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin: 10px auto 0;
    flex-shrink: 0;
  }

  /* ---- Print modal: stack columns ---- */
  .print-modal-body { grid-template-columns: 1fr !important; }
  .print-right { display: none; }
}

/* ══════════════════════════════════════════════
   MOBILE — COMPREHENSIVE OVERHAUL
   All breakpoints consolidated here
══════════════════════════════════════════════ */

/* ── Calculadoras/Protocolos: full-width bottom sheet on mobile ── */
@media (max-width: 720px) {
  .anav-calc-menu {
    position: fixed;
    left: 0; right: 0;
    bottom: calc(58px + env(safe-area-inset-bottom, 0px)); /* above bottom nav */
    top: auto;
    max-height: 72vh;
    min-width: 100%;
    border-radius: 18px 18px 0 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
    border-top: 1.5px solid var(--border);
    padding: 8px 8px calc(16px + env(safe-area-inset-bottom, 0px));
    z-index: 300;
    animation: sheetUp .22s cubic-bezier(0.22,0.8,0.3,1);
  }
  @keyframes sheetUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  /* Add a sheet drag-handle indicator */
  .anav-calc-menu::before {
    content: '';
    display: block;
    width: 36px; height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin: 4px auto 12px;
  }
  .anav-calc-item {
    padding: 14px 16px;
    font-size: 15px;
    border-radius: 10px;
  }
  .anav-calc-ico { font-size: 20px; }

  /* ── Hero search sticky: header e navbar rolam, search fica no topo ── */
  .hero-search-sticky {
    top: 0;
  }

  /* ── Prevent iOS input zoom (font-size < 16px triggers auto-zoom) ── */
  input:not([type="checkbox"]):not([type="radio"]),
  select,
  textarea {
    font-size: 16px !important;
  }

  /* ── Pediatria side toggle — dark/surface override ── */
  .ped-side-btn {
    background: var(--surface-2);
    border-color: var(--border);
    color: var(--text-soft);
  }
  .ped-side-btn.ped-on {
    background: hsl(330 55% 18%);
    border-color: hsl(330 55% 35%);
    color: hsl(330 80% 82%);
  }
  .ped-side-dot.on { background: hsl(330 80% 65%); }
  .ped-side-meds {
    background: hsl(330 45% 18%);
    border-color: hsl(330 50% 35%);
    color: hsl(330 70% 72%);
  }

  /* ── Bottom nav: 5th tab label truncate on very small screens ── */
  .bnav-item span { font-size: 9px; }

  /* ── Calc views: tighter padding on mobile ── */
  .calc-view { padding: 14px 12px 100px; }
  .calc-body { gap: 12px; }
  .calc-hero {
    padding: 18px 16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .calc-hero-title { font-size: 20px; }
  .calc-score-big { display: none; } /* remove score circle in hero on mobile — shown in result instead */

  /* ── Drawer: smaller header + more scrollable body ── */
  .drawer-title { font-size: 15px; }
  .drawer-body { padding: 12px 14px 16px; }
  .drawer-tabs { padding: 0 14px; }
  .dnavbar-btn { min-width: 36px; }

  /* ── Plantões view: ensure full-width on mobile ── */
  .pt-view { padding: 16px 12px 100px; }
  .pt-header-toolbar { flex-wrap: wrap; gap: 8px; }
  .pt-header-actions { width: 100%; justify-content: space-between; }
  .pt-res-grid { grid-template-columns: 1fr 1fr; }

  /* ── SOFA view tabs: smaller ── */
  .sofa-tab-row { gap: 2px; }

  /* ── Profile/modal backdrop: safe area ── */
  .modal-footer { padding-bottom: max(12px, env(safe-area-inset-bottom)); }

  /* ── History drawer full-width ── */
  .history-drawer { width: 100vw !important; }
}

/* ── Very small phones (≤380px) ── */
@media (max-width: 380px) {
  .anav-btn { padding: 9px 10px; font-size: 12px; }
  .calc-hero-title { font-size: 18px; }
  .calc-view { padding: 10px 10px 100px; }
  .bnav-item span { font-size: 8.5px; }
  .anav-calc-item { padding: 12px 14px; font-size: 14px; }
}

/* ── Desktop: label e dot visíveis ── */
@media (min-width: 721px) {
  .hero-act-ped-mobile { display: none !important; }
  .ped-side-text { display: flex !important; }
  .ped-side-dot  { display: block !important; }
}

/* ── hero-search-sticky offset on desktop already set in base rule (156px) ── */

/* ── Bottom nav: ensure Calculadoras tab is accent-colored when active ── */
.bnav-item.active svg { color: var(--accent); }

/* ── Backdrop when calc sheet open — mobile only ── */
.anav-calc-backdrop {
  display: none; /* hidden on desktop; shown on mobile below */
}
@media (max-width: 720px) {
  .anav-calc-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.35);
    z-index: 299;
    animation: bkdFade .2s ease;
  }
}
@keyframes bkdFade { from { opacity: 0; } to { opacity: 1; } }

/* ══════════════════════════════════════════════════════════
   MOBILE — Correções de bugs (iOS, touch, safe area)
   ══════════════════════════════════════════════════════════ */
@media (max-width: 720px) {
  /* ── Safe area para notch/Dynamic Island no topo ── */
  .app-header {
    padding-top: env(safe-area-inset-top, 0);
  }
  .mobile-search-bar {
    top: calc(62px + env(safe-area-inset-top, 0));
  }

  /* ── Previne scroll do fundo vazando pelo drawer/modal no iOS ── */
  .drawer         { overscroll-behavior: contain; }
  .modal          { overscroll-behavior: contain; }
  .drawer-body    { overscroll-behavior: contain; }
  .modal-body     { overscroll-behavior: contain; }

  /* ── Pediatria mobile toggle: versão dark (NEON OS) ── */
  .hero-act-ped-mobile.ped-on {
    background: hsl(330 80% 95%);
    border-color: hsl(330 60% 78%);
    color: hsl(330 70% 42%);
  }

  /* ── Botão fechar no header mobile: alvo de toque 44px ── */
  .mobile-search-close { width: 44px; height: 44px; }

  /* ── Fav btn: alvo mínimo 44px ── */
  .fav-btn { width: 44px; height: 44px; }

  /* ── Bottom nav: separador do safe area mais generoso ── */
  .bottom-nav {
    padding-bottom: max(env(safe-area-inset-bottom, 0px), 8px);
  }
}

/* ── NEON OS: bottom nav mobile ── */
html[data-theme="tech"] .bottom-nav {
  background: rgba(5,11,24,.97) !important;
  border-top-color: rgba(0,200,255,.25) !important;
  backdrop-filter: blur(18px);
}
html[data-theme="tech"] .bnav-item { color: #2c5570 !important; }
html[data-theme="tech"] .bnav-item.active { color: #00c8ff !important; }
html[data-theme="tech"] .bnav-item.bnav-ped.active { color: #f472b6 !important; }
html[data-theme="tech"] .bnav-fab { background: linear-gradient(135deg, #006fa8, #00c8ff) !important; box-shadow: 0 0 20px rgba(0,200,255,.45) !important; }
html[data-theme="tech"] .bnav-fab.bnav-fab-ped { background: #9d174d !important; box-shadow: 0 0 16px rgba(236,72,153,.4) !important; }

/* ── NEON OS: mobile search bar ── */
html[data-theme="tech"] .mobile-search-bar {
  background: rgba(5,11,24,.97) !important;
  border-bottom-color: rgba(0,200,255,.2) !important;
}

/* ── NEON OS: pediatria mobile toggle ── */
html[data-theme="tech"] .hero-act-ped-mobile {
  background: rgba(10,22,40,.8) !important;
  border-color: rgba(0,200,255,.2) !important;
  color: #4a7a96 !important;
}
html[data-theme="tech"] .hero-act-ped-mobile.ped-on {
  background: rgba(157,23,77,.2) !important;
  border-color: rgba(236,72,153,.4) !important;
  color: #f472b6 !important;
}

/* ── NEON OS: calc backdrop no mobile ── */
html[data-theme="tech"] .anav-calc-backdrop { background: rgba(0,5,12,.55) !important; }

/* ── NEON OS: drag handle visual em drawer/mbox ── */
html[data-theme="tech"] .drawer::before { background: rgba(0,200,255,.25) !important; }
html[data-theme="tech"] .anav-calc-menu::before { background: rgba(0,200,255,.2) !important; }

/* ========================================================
   BULMA THEME
   ======================================================== */
html[data-theme="bulma"] {
  --accent-h: 231;
  --accent: #485fc7;
  --accent-soft: #eff1fa;
  --accent-hover: #3a52c4;
  --accent-ring: rgba(72, 95, 199, 0.25);
  --bg: #dce6ff;
  --surface-2: #e8eeff;
  --border: #b8c6f0;
  --border-soft: #cdd8f5;
}
html[data-theme="bulma"] body { background: #dce6ff; }
html[data-theme="bulma"] .app-header { background: #485fc7; }
html[data-theme="bulma"] .header-inner .search-input { background: rgba(255,255,255,0.15); border-color: rgba(255,255,255,0.3); color: #fff; }
html[data-theme="bulma"] .header-inner .search-input::placeholder { color: rgba(255,255,255,0.6); }

/* ═══════════════════════════════════════════════════════════════
   NEON OS — Tema futurista / tecnológico
   ═══════════════════════════════════════════════════════════════ */
html[data-theme="tech"] {
  --accent-h:    196;
  --accent:      #00c8ff;
  --accent-soft: rgba(0, 200, 255, 0.1);
  --accent-hover:#00aadd;
  --accent-ring: rgba(0, 200, 255, 0.22);

  --bg:          #050b18;
  --surface:     #0a1628;
  --surface-2:   #0d1c34;
  --border:      rgba(0, 200, 255, 0.2);
  --border-soft: rgba(0, 200, 255, 0.09);

  --text:        #b6d8f0;
  --text-soft:   #4a7a96;
  --text-muted:  #2c5570;
  --text-faint:  #1a3a50;

  --ok:          #00e5a0;
  --ok-soft:     rgba(0, 229, 160, 0.1);
  --warn:        #ff9100;
}

/* ── Body com grade holográfica ── */
html[data-theme="tech"] body {
  background: #050b18;
  background-image:
    linear-gradient(rgba(0,200,255,.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,200,255,.028) 1px, transparent 1px);
  background-size: 48px 48px;
  color: #b6d8f0;
}

/* ── Header ── */
html[data-theme="tech"] .app-header {
  background: rgba(5,11,24,.97);
  border-bottom: 1px solid rgba(0,200,255,.32);
  box-shadow: 0 0 28px rgba(0,200,255,.08);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
html[data-theme="tech"] .header-strip {
  background: rgba(5,11,24,.98);
  border-bottom-color: rgba(0,200,255,.2);
}
html[data-theme="tech"] .header-inner .search-input {
  background: rgba(10,22,40,.8);
  border-color: rgba(0,200,255,.22);
  color: #b6d8f0;
}
html[data-theme="tech"] .header-inner .search-input:focus {
  border-color: #00c8ff;
  box-shadow: 0 0 0 3px rgba(0,200,255,.18);
}
html[data-theme="tech"] .header-inner .search-input::placeholder { color: #2c5570; }

/* ── Superfícies / cards ── */
html[data-theme="tech"] .card,
html[data-theme="tech"] .rx-card,
html[data-theme="tech"] .presc-card,
html[data-theme="tech"] .modal-inner,
html[data-theme="tech"] .drawer-panel,
html[data-theme="tech"] .sidebar-panel {
  background: rgba(10,22,40,.9);
  border-color: rgba(0,200,255,.16);
  box-shadow: 0 0 18px rgba(0,200,255,.05), 0 3px 14px rgba(0,0,0,.7);
  backdrop-filter: blur(8px);
}

/* ── Inputs ── */
html[data-theme="tech"] input,
html[data-theme="tech"] select,
html[data-theme="tech"] textarea {
  background: rgba(10,22,40,.8) !important;
  border-color: rgba(0,200,255,.22) !important;
  color: #b6d8f0 !important;
}
html[data-theme="tech"] input:focus,
html[data-theme="tech"] select:focus,
html[data-theme="tech"] textarea:focus {
  border-color: #00c8ff !important;
  box-shadow: 0 0 0 3px rgba(0,200,255,.18) !important;
}
html[data-theme="tech"] input::placeholder,
html[data-theme="tech"] textarea::placeholder { color: #2c5570 !important; }

/* ── Botão primário ── */
html[data-theme="tech"] .btn-primary,
html[data-theme="tech"] [class*="btn-primary"] {
  background: linear-gradient(135deg, #006fa8, #00c8ff) !important;
  box-shadow: 0 0 16px rgba(0,200,255,.35) !important;
  border: none !important;
}
html[data-theme="tech"] .btn-primary:hover:not(:disabled) {
  box-shadow: 0 0 28px rgba(0,200,255,.55) !important;
}

/* ── Overlays / modais ── */
html[data-theme="tech"] .modal-backdrop,
html[data-theme="tech"] .overlay-bg { background: rgba(2,5,12,.8); }

/* ── Hero search bar ── */
html[data-theme="tech"] .hero-search-inner {
  background: rgba(10,22,40,.9) !important;
  border-color: rgba(0,200,255,.3) !important;
  box-shadow: 0 0 20px rgba(0,200,255,.08), 0 4px 20px rgba(0,0,0,.6) !important;
}
html[data-theme="tech"] .hero-search-inner:hover {
  border-color: rgba(0,200,255,.45) !important;
}
html[data-theme="tech"] .hero-search-inner:focus-within {
  background: rgba(10,22,40,.95) !important;
  border-color: #00c8ff !important;
  box-shadow: 0 0 0 3px rgba(0,200,255,.2), 0 0 30px rgba(0,200,255,.15) !important;
}
html[data-theme="tech"] .hero-search-input {
  color: #b6d8f0 !important;
  background: transparent !important;
}
html[data-theme="tech"] .hero-search-input::placeholder { color: #2c5570 !important; }

/* ── Search input (standalone) ── */
html[data-theme="tech"] .search-input:focus {
  background: rgba(10,22,40,.95) !important;
}

/* ── Prescription cards (explicit overrides for hardcoded white) ── */
html[data-theme="tech"] .card {
  background: rgba(10,22,40,.88) !important;
  border-color: rgba(0,200,255,.14) !important;
  box-shadow: 0 0 16px rgba(0,200,255,.04), 0 2px 10px rgba(0,0,0,.65) !important;
}
html[data-theme="tech"] .card:hover {
  border-color: rgba(0,200,255,.3) !important;
  box-shadow: 0 0 24px rgba(0,200,255,.09), 0 6px 20px rgba(0,0,0,.7) !important;
  transform: translateY(-1px);
}
html[data-theme="tech"] .card-fav {
  border-color: rgba(0,200,255,.35) !important;
  box-shadow: 0 0 20px rgba(0,200,255,.12) !important;
}
html[data-theme="tech"] .card-name { color: #b6d8f0 !important; }
html[data-theme="tech"] .card-cid {
  background: rgba(0,200,255,.1) !important;
  color: #00c8ff !important;
  border-color: rgba(0,200,255,.2) !important;
}
html[data-theme="tech"] .card-action {
  background: rgba(10,22,40,.7) !important;
  border-color: rgba(0,200,255,.15) !important;
  color: #4a7a96 !important;
}
html[data-theme="tech"] .card-action:hover {
  background: rgba(0,200,255,.12) !important;
  border-color: rgba(0,200,255,.35) !important;
  color: #00c8ff !important;
}

/* ── Keyboard shortcut badge ── */
html[data-theme="tech"] .kbd {
  background: rgba(10,22,40,.8) !important;
  border-color: rgba(0,200,255,.25) !important;
  color: #4a7a96 !important;
}

/* ── Icon buttons ── */
html[data-theme="tech"] .icon-btn {
  background: rgba(10,22,40,.7) !important;
  border-color: rgba(0,200,255,.15) !important;
  color: #4a7a96 !important;
}
html[data-theme="tech"] .icon-btn:hover {
  background: rgba(0,200,255,.1) !important;
  border-color: rgba(0,200,255,.3) !important;
  color: #00c8ff !important;
}

/* ── Type filter buttons ── */
html[data-theme="tech"] .tipo-btn {
  background: rgba(10,22,40,.6) !important;
  border-color: rgba(0,200,255,.12) !important;
  color: #4a7a96 !important;
}
html[data-theme="tech"] .tipo-btn:hover {
  background: rgba(0,200,255,.07) !important;
  border-color: rgba(0,200,255,.22) !important;
  color: #b6d8f0 !important;
}
html[data-theme="tech"] .tipo-btn.active {
  background: rgba(0,200,255,.15) !important;
  border-color: rgba(0,200,255,.4) !important;
  color: #00c8ff !important;
}

/* ── Ghost button ── */
html[data-theme="tech"] .btn-ghost {
  background: rgba(10,22,40,.5) !important;
  border-color: rgba(0,200,255,.15) !important;
  color: #4a7a96 !important;
}
html[data-theme="tech"] .btn-ghost:hover {
  background: rgba(0,200,255,.08) !important;
  border-color: rgba(0,200,255,.28) !important;
  color: #b6d8f0 !important;
}

/* ── Font-size / options dropdowns ── */
html[data-theme="tech"] .fs-options {
  background: rgba(10,22,40,.95) !important;
  border-color: rgba(0,200,255,.15) !important;
  box-shadow: 0 8px 32px rgba(0,0,0,.7), 0 0 20px rgba(0,200,255,.06) !important;
}
html[data-theme="tech"] .opt-line { color: #b6d8f0 !important; }
html[data-theme="tech"] .opt-line:hover {
  background: rgba(0,200,255,.06) !important;
  color: #00c8ff !important;
}

/* ── Tags / badges ── */
html[data-theme="tech"] .tag,
html[data-theme="tech"] .badge {
  background: rgba(0,200,255,.1) !important;
  color: #00c8ff !important;
  border-color: rgba(0,200,255,.2) !important;
}

/* ── Star / favorite button ── */
html[data-theme="tech"] .card-star { color: #2c5570 !important; }
html[data-theme="tech"] .card-star.active,
html[data-theme="tech"] .card-star:hover { color: #00c8ff !important; }

/* ── Hero action buttons (Atestado, Exame Físico, etc.) ── */
html[data-theme="tech"] .hero-act-btn {
  background: rgba(10,22,40,.8) !important;
  border-color: rgba(0,200,255,.2) !important;
  color: #4a7a96 !important;
  box-shadow: none !important;
}
html[data-theme="tech"] .hero-act-btn:hover {
  background: rgba(0,200,255,.1) !important;
  border-color: rgba(0,200,255,.4) !important;
  color: #00c8ff !important;
  box-shadow: 0 0 16px rgba(0,200,255,.12) !important;
}
html[data-theme="tech"] .hero-act-atestado {
  border-color: rgba(0,200,255,.2) !important;
  color: #4a7a96 !important;
}
html[data-theme="tech"] .hero-act-atestado:hover {
  background: rgba(0,200,255,.1) !important;
  border-color: rgba(0,200,255,.4) !important;
  color: #00c8ff !important;
  box-shadow: 0 0 16px rgba(0,200,255,.12) !important;
}

/* ── Modal (profile, print, all modals) ── */
html[data-theme="tech"] .modal {
  background: #0a1628 !important;
  border: 1px solid rgba(0,200,255,.2) !important;
  box-shadow: 0 0 60px rgba(0,200,255,.1), 0 24px 60px rgba(0,0,0,.9) !important;
}
html[data-theme="tech"] .modal-hdr,
html[data-theme="tech"] .modal-head {
  background: rgba(7,14,31,.98) !important;
  border-bottom-color: rgba(0,200,255,.15) !important;
  color: #b6d8f0 !important;
}
html[data-theme="tech"] .modal-body {
  background: #0a1628 !important;
  color: #8ab4cc !important;
}
html[data-theme="tech"] .modal-footer,
html[data-theme="tech"] .modal-foot {
  background: rgba(7,14,31,.98) !important;
  border-top-color: rgba(0,200,255,.12) !important;
}
html[data-theme="tech"] .modal h2,
html[data-theme="tech"] .modal h3 { color: #d6eaf8 !important; }
html[data-theme="tech"] .modal label { color: #4a7a96 !important; }
html[data-theme="tech"] .modal .form-input,
html[data-theme="tech"] .modal .form-row input,
html[data-theme="tech"] .modal .form-row select {
  background: rgba(5,11,24,.8) !important;
  border-color: rgba(0,200,255,.2) !important;
  color: #b6d8f0 !important;
}

/* Tab bar inside modal (Dados / Senha / Acessos) */
html[data-theme="tech"] .modal [style*="borderBottom"][style*="flex"] {
  background: rgba(7,14,31,.95) !important;
  border-bottom-color: rgba(0,200,255,.15) !important;
}

/* ── RENAME / Medication cards ── */
html[data-theme="tech"] .rename-toolbar-wrap {
  background: rgba(7,14,31,.97) !important;
  border-bottom-color: rgba(0,200,255,.12) !important;
}
html[data-theme="tech"] .rename-search {
  background: rgba(10,22,40,.9) !important;
  border-color: rgba(0,200,255,.2) !important;
  color: #b6d8f0 !important;
  box-shadow: none !important;
}
html[data-theme="tech"] .rename-search:focus {
  border-color: #00c8ff !important;
  box-shadow: 0 0 0 3px rgba(0,200,255,.15) !important;
}
html[data-theme="tech"] .rename-search-ico { color: #2c5570 !important; }
html[data-theme="tech"] .rename-search-clear { color: #2c5570 !important; }
html[data-theme="tech"] .rename-class-sel {
  background: rgba(10,22,40,.9) !important;
  border-color: rgba(0,200,255,.2) !important;
  color: #b6d8f0 !important;
}
html[data-theme="tech"] .rename-count { color: #2c5570 !important; }

html[data-theme="tech"] .rename-card {
  background: rgba(10,22,40,.88) !important;
  border-color: rgba(0,200,255,.14) !important;
}
html[data-theme="tech"] .rename-card:hover {
  border-color: rgba(0,200,255,.3) !important;
  box-shadow: 0 0 20px rgba(0,200,255,.08), 0 4px 16px rgba(0,0,0,.6) !important;
}
html[data-theme="tech"] .rename-card-open {
  border-color: rgba(0,200,255,.4) !important;
}
html[data-theme="tech"] .rename-nome { color: #d6eaf8 !important; }
html[data-theme="tech"] .rename-classe { color: #4a7a96 !important; }
html[data-theme="tech"] .rename-chevron { color: #2c5570 !important; }
html[data-theme="tech"] .rename-apres-count { color: #2c5570 !important; }

html[data-theme="tech"] .rename-apres-list {
  border-top-color: rgba(0,200,255,.1) !important;
}
html[data-theme="tech"] .rename-apres {
  background: rgba(5,11,24,.85) !important;
  border-color: rgba(0,200,255,.12) !important;
}
html[data-theme="tech"] .rename-apres-hd {
  background: rgba(7,14,31,.95) !important;
  border-bottom-color: rgba(0,200,255,.1) !important;
}
html[data-theme="tech"] .rename-apres-forma { color: #d6eaf8 !important; }
html[data-theme="tech"] .rename-apres-conc {
  background: rgba(0,200,255,.1) !important;
  color: #4a7a96 !important;
}
html[data-theme="tech"] .rename-uso-lbl { color: #2c5570 !important; }
html[data-theme="tech"] .rename-uso-txt { color: #8ab4cc !important; }
html[data-theme="tech"] .rename-apres-dil {
  background: rgba(0,200,255,.07) !important;
  border-left-color: #00c8ff !important;
}
html[data-theme="tech"] .rename-dil-lbl { color: #00c8ff !important; }
html[data-theme="tech"] .rename-dil-txt { color: #8ab4cc !important; }

/* ── Editor toolbar ── */
html[data-theme="tech"] .editor-toolbar {
  background: rgba(7,14,31,.98) !important;
  border-bottom-color: rgba(0,200,255,.14) !important;
}
html[data-theme="tech"] .tb-btn { color: #4a7a96 !important; background: transparent !important; }
html[data-theme="tech"] .tb-btn:hover {
  background: rgba(0,200,255,.08) !important;
  color: #b6d8f0 !important;
}
html[data-theme="tech"] .tb-btn.active {
  background: rgba(0,200,255,.14) !important;
  color: #00c8ff !important;
}
html[data-theme="tech"] .tb-sep { background: rgba(0,200,255,.15) !important; }
html[data-theme="tech"] .tb-text { color: #4a7a96 !important; }

/* ── Editor content area ── */
html[data-theme="tech"] .editor-area,
html[data-theme="tech"] .rx-block .editor-area {
  background: rgba(10,22,40,.85) !important;
  color: #8ab4cc !important;
}
html[data-theme="tech"] .editor-area.editable {
  background: linear-gradient(to right, rgba(0,200,255,.12) 3px, rgba(10,22,40,.85) 3px) !important;
}
html[data-theme="tech"] .modal-editor .editor-area.editable {
  background: rgba(10,22,40,.9) !important;
}
html[data-theme="tech"] .editor-area h3 { color: #d6eaf8 !important; }
html[data-theme="tech"] .editor-area p { color: #8ab4cc !important; }
html[data-theme="tech"] .editor-area b,
html[data-theme="tech"] .editor-area strong { color: #d6eaf8 !important; }
html[data-theme="tech"] .editor-area .med-name { color: #d6eaf8 !important; }
html[data-theme="tech"] .editor-area .med-name em { color: #4a7a96 !important; }
html[data-theme="tech"] .editor-area .med-dose { color: #5a8aaa !important; }
html[data-theme="tech"] .editor-area ol.med-list li.med-item::before { color: #00c8ff !important; }

/* ── Conduta block (warm colors → dark) ── */
html[data-theme="tech"] .rx-block-conduta {
  border-color: rgba(0,200,255,.14) !important;
  background: rgba(10,22,40,.9) !important;
}
html[data-theme="tech"] .rx-block-conduta .rx-block-head {
  background: rgba(7,14,31,.97) !important;
  border-bottom-color: rgba(0,200,255,.14) !important;
}
html[data-theme="tech"] .rx-block-conduta .editor-area {
  background: rgba(10,22,40,.85) !important;
}
html[data-theme="tech"] .rx-block-conduta .rx-block-title svg { color: #00c8ff !important; }
html[data-theme="tech"] .rx-block-conduta .rx-copy-btn {
  background: linear-gradient(135deg, #006fa8, #00c8ff) !important;
  border-color: transparent !important;
  box-shadow: 0 0 16px rgba(0,200,255,.3) !important;
}

/* ═══════════════════════════════════════════════════════
   NEON OS — full-site sweep (all remaining white elements)
   ═══════════════════════════════════════════════════════ */

/* ── Drawer / dnavbar ── */
html[data-theme="tech"] .dnavbar-discard:hover { background: rgba(255,61,106,.1) !important; color: #ff3d6a !important; }
html[data-theme="tech"] .dnavbar-print { background: rgba(0,229,160,.12) !important; color: #00e5a0 !important; border-color: rgba(0,229,160,.25) !important; }
html[data-theme="tech"] .dnavbar-print:hover { background: rgba(0,229,160,.22) !important; }

/* ── Print preview ── */
html[data-theme="tech"] .preview-paper { background: rgba(10,22,40,.88) !important; box-shadow: 0 0 24px rgba(0,200,255,.07), 0 8px 32px rgba(0,0,0,.75) !important; color: #8ab4cc !important; }
html[data-theme="tech"] .preview-content::after { background: linear-gradient(to bottom, transparent, rgba(10,22,40,.9)) !important; }
html[data-theme="tech"] .preview-conduta { background: rgba(10,22,40,.82) !important; border-color: rgba(0,200,255,.15) !important; }
html[data-theme="tech"] .preview-conduta::before { background: rgba(0,200,255,.18) !important; }
html[data-theme="tech"] .print-info-row { background: rgba(0,200,255,.06) !important; color: #4a7a96 !important; border-color: rgba(0,200,255,.1) !important; }
html[data-theme="tech"] .toggle-row { background: rgba(0,200,255,.07) !important; color: #4a7a96 !important; }
html[data-theme="tech"] .toggle-row.toggle-inline.on { background: rgba(0,200,255,.13) !important; color: #00c8ff !important; }
html[data-theme="tech"] .font-size-row { background: rgba(10,22,40,.7) !important; border-color: rgba(0,200,255,.12) !important; }

/* ── Atestado / cert buttons ── */
html[data-theme="tech"] .btn-atestado { background: rgba(10,22,40,.8) !important; border-color: rgba(0,200,255,.2) !important; color: #4a7a96 !important; }
html[data-theme="tech"] .btn-atestado:hover { background: rgba(0,200,255,.1) !important; border-color: rgba(0,200,255,.4) !important; color: #00c8ff !important; }
html[data-theme="tech"] .fab-atestado { background: rgba(10,22,40,.8) !important; border-color: rgba(0,200,255,.2) !important; color: #4a7a96 !important; }
html[data-theme="tech"] .fab-atestado:hover { background: rgba(0,200,255,.1) !important; border-color: rgba(0,200,255,.4) !important; color: #00c8ff !important; }

/* ── Card list ── */
html[data-theme="tech"] .card.card-list { background: rgba(10,22,40,.88) !important; }
html[data-theme="tech"] .card.card-list.card-fav { background: rgba(10,22,40,.95) !important; border-color: rgba(0,200,255,.3) !important; box-shadow: 0 0 20px rgba(0,200,255,.1) !important; }
html[data-theme="tech"] .card.card-list .card-star:hover { background: rgba(0,200,255,.1) !important; }
html[data-theme="tech"] .card.card-list .card-star.on { background: rgba(0,200,255,.15) !important; color: #00c8ff !important; }
html[data-theme="tech"] .card-action-delete:hover { background: rgba(255,61,106,.12) !important; color: #ff3d6a !important; }

/* ── Hero search (sticky + clear btn) ── */
html[data-theme="tech"] .hero-search-sticky.is-stuck {
  background: var(--sticky-bg, rgba(5,11,24,.97)) !important;
  box-shadow: 0 6px 28px rgba(0,200,255,.07), 0 1px 0 rgba(0,200,255,.15) !important;
  border-bottom-color: rgba(0,200,255,.2) !important;
}
html[data-theme="tech"] .hero-search-sticky.is-stuck .hero-search-inner { background: rgba(10,22,40,.97) !important; border-color: rgba(0,200,255,.3) !important; }
html[data-theme="tech"] .hero-search-sticky.is-stuck .hero-act-btn:not(.hero-act-nova) { background: rgba(10,22,40,.85) !important; }
html[data-theme="tech"] .hero-search-sticky::after { background: linear-gradient(to bottom, rgba(0,200,255,.06), transparent) !important; }
html[data-theme="tech"] .hero-search-clear:hover { background: rgba(255,61,106,.12) !important; color: #ff3d6a !important; }

/* ── KBD badges ── */
html[data-theme="tech"] .kbd-hero,
html[data-theme="tech"] .kbd-inline { background: rgba(10,22,40,.8) !important; border-color: rgba(0,200,255,.2) !important; color: #4a7a96 !important; }

/* ── Fav hint / section hint ── */
html[data-theme="tech"] .sec-fav-hint { background: rgba(0,200,255,.06) !important; border-color: rgba(0,200,255,.15) !important; color: #4a7a96 !important; }

/* ── Category tags ── */
html[data-theme="tech"] .cat-bg-emergncia,
html[data-theme="tech"] .cat-emergncia { background: rgba(255,61,106,.1) !important; }
html[data-theme="tech"] .cat-bg-gestantes,
html[data-theme="tech"] .cat-gestantes { background: rgba(236,72,153,.1) !important; }
html[data-theme="tech"] .cat-bg-outros,
html[data-theme="tech"] .cat-outros { background: rgba(255,200,0,.08) !important; }
html[data-theme="tech"] .cat-bg-condutamdica { background: rgba(255,61,106,.1) !important; }
html[data-theme="tech"] .col-condutas .card.card-list .card-cat-tag { background: rgba(255,61,106,.1) !important; }
html[data-theme="tech"] .tag-atestado { background: rgba(255,159,67,.1) !important; color: #ff9f43 !important; border-color: rgba(255,159,67,.2) !important; }
html[data-theme="tech"] .tag-conduta { background: rgba(255,61,106,.1) !important; color: #ff3d6a !important; border-color: rgba(255,61,106,.2) !important; }

/* ── History buttons ── */
html[data-theme="tech"] .history-btn { background: rgba(10,22,40,.8) !important; border-color: rgba(0,200,255,.15) !important; color: #4a7a96 !important; }
html[data-theme="tech"] .history-btn-del:hover { background: rgba(255,61,106,.1) !important; color: #ff3d6a !important; }
html[data-theme="tech"] .logout-header-btn:hover { background: rgba(255,61,106,.1) !important; color: #ff3d6a !important; }

/* ── Calculator nav dropdown ── */
html[data-theme="tech"] .anav-calc-menu { background: rgba(7,14,31,.98) !important; border-color: rgba(0,200,255,.15) !important; box-shadow: 0 8px 32px rgba(0,0,0,.75), 0 0 20px rgba(0,200,255,.06) !important; }
html[data-theme="tech"] .anav-calc-item:hover { background: rgba(0,200,255,.07) !important; color: #b6d8f0 !important; }

/* ── Calculator cards ── */
html[data-theme="tech"] .calc-crit-btn { background: rgba(10,22,40,.88) !important; border-color: rgba(0,200,255,.15) !important; color: #b6d8f0 !important; }
html[data-theme="tech"] .calc-crit-btn:hover { background: rgba(0,200,255,.08) !important; border-color: rgba(0,200,255,.28) !important; }
html[data-theme="tech"] .calc-crit-letter { background: rgba(0,200,255,.1) !important; color: #00c8ff !important; }
html[data-theme="tech"] .calc-result-card { background: rgba(10,22,40,.88) !important; border-color: rgba(0,200,255,.14) !important; }
html[data-theme="tech"] .calc-ref-table { background: rgba(10,22,40,.85) !important; border-color: rgba(0,200,255,.1) !important; }
html[data-theme="tech"] .calc-ref-title { background: rgba(7,14,31,.97) !important; color: #4a7a96 !important; border-color: rgba(0,200,255,.1) !important; }
html[data-theme="tech"] .calc-result-alert { background: rgba(255,61,106,.1) !important; border-color: rgba(255,61,106,.22) !important; color: #ff3d6a !important; }
html[data-theme="tech"] .calc-pending { background: rgba(10,22,40,.6) !important; color: #4a7a96 !important; }
html[data-theme="tech"] .calc-note { background: rgba(0,200,255,.05) !important; border-color: rgba(0,200,255,.1) !important; color: #4a7a96 !important; }

/* ── GCS calculator ── */
html[data-theme="tech"] .gcs-section { background: rgba(10,22,40,.85) !important; border-color: rgba(0,200,255,.12) !important; }
html[data-theme="tech"] .gcs-section-hd { background: rgba(7,14,31,.97) !important; color: #4a7a96 !important; border-color: rgba(0,200,255,.1) !important; }
html[data-theme="tech"] .gcs-opt { background: rgba(10,22,40,.7) !important; border-color: rgba(0,200,255,.12) !important; color: #8ab4cc !important; }
html[data-theme="tech"] .gcs-opt:hover { background: rgba(0,200,255,.07) !important; }
html[data-theme="tech"] .gcs-opt.gcs-opt-on { background: rgba(0,200,255,.15) !important; border-color: rgba(0,200,255,.4) !important; color: #00c8ff !important; }
html[data-theme="tech"] .gcs-opt-score { background: rgba(0,200,255,.1) !important; color: #00c8ff !important; }

/* ── Gasometry (ABG) calculator ── */
html[data-theme="tech"] .gaso-form-card { background: rgba(10,22,40,.85) !important; border-color: rgba(0,200,255,.12) !important; }
html[data-theme="tech"] .gaso-input { background: rgba(10,22,40,.8) !important; border-color: rgba(0,200,255,.2) !important; color: #b6d8f0 !important; }
html[data-theme="tech"] .gaso-input:focus { background: rgba(10,22,40,.97) !important; border-color: #00c8ff !important; }
html[data-theme="tech"] .gaso-diag { background: rgba(10,22,40,.88) !important; border-color: rgba(0,200,255,.15) !important; }
html[data-theme="tech"] .gaso-section { background: rgba(10,22,40,.85) !important; border-color: rgba(0,200,255,.12) !important; }
html[data-theme="tech"] .gaso-err { background: rgba(255,61,106,.1) !important; border-color: rgba(255,61,106,.2) !important; color: #ff3d6a !important; }
html[data-theme="tech"] .gaso-btn-clear { background: rgba(10,22,40,.7) !important; border-color: rgba(0,200,255,.15) !important; color: #4a7a96 !important; }
html[data-theme="tech"] .gaso-ag-item { background: rgba(10,22,40,.7) !important; border-color: rgba(0,200,255,.1) !important; }
html[data-theme="tech"] .gaso-ag-badge-high { background: rgba(255,61,106,.1) !important; color: #ff3d6a !important; }
html[data-theme="tech"] .gaso-ag-interp { background: rgba(0,200,255,.06) !important; border-color: rgba(0,200,255,.1) !important; color: #4a7a96 !important; }
html[data-theme="tech"] .gaso-ox-card { background: rgba(10,22,40,.7) !important; border-color: rgba(0,200,255,.1) !important; }
html[data-theme="tech"] .gaso-ox-warn { background: rgba(255,159,67,.08) !important; border-color: rgba(255,159,67,.18) !important; color: #ff9f43 !important; }
html[data-theme="tech"] .gaso-passo-body { background: rgba(10,22,40,.7) !important; border-color: rgba(0,200,255,.1) !important; }
html[data-theme="tech"] .gaso-ref-box { background: rgba(10,22,40,.7) !important; border-color: rgba(0,200,255,.1) !important; }

/* ── Patient input field ── */
html[data-theme="tech"] .paciente-input-big { background: rgba(10,22,40,.8) !important; border-color: rgba(0,200,255,.2) !important; color: #b6d8f0 !important; }

/* ── PT mini-view (prescriptions tracking in main app) ── */
html[data-theme="tech"] .pt-view { background: rgba(5,11,24,.8) !important; }
html[data-theme="tech"] .pt-marr { background: rgba(10,22,40,.88) !important; border-color: rgba(0,200,255,.14) !important; }
html[data-theme="tech"] .pt-rc { background: rgba(10,22,40,.7) !important; border-color: rgba(0,200,255,.12) !important; }
html[data-theme="tech"] .pt-rc-ico { background: rgba(0,200,255,.1) !important; color: #00c8ff !important; }
html[data-theme="tech"] .pt-rg .pt-rc-ico { background: rgba(0,229,160,.1) !important; color: #00e5a0 !important; }
html[data-theme="tech"] .pt-ro .pt-rc-ico { background: rgba(255,159,67,.1) !important; color: #ff9f43 !important; }
html[data-theme="tech"] .pt-lista-card { background: rgba(10,22,40,.88) !important; border-color: rgba(0,200,255,.12) !important; }
html[data-theme="tech"] .pt-lista-hdr { background: rgba(7,14,31,.97) !important; border-color: rgba(0,200,255,.1) !important; }
html[data-theme="tech"] .pt-row-head:hover { background: rgba(0,200,255,.05) !important; }
html[data-theme="tech"] .pt-row-open .pt-row-head { background: rgba(0,200,255,.06) !important; }
html[data-theme="tech"] .pt-row-today .pt-row-head { background: rgba(0,200,255,.08) !important; }
html[data-theme="tech"] .pt-row-acc { background: rgba(7,14,31,.97) !important; border-color: rgba(0,200,255,.1) !important; }
html[data-theme="tech"] .pt-row-acc-edit:hover { background: rgba(0,200,255,.08) !important; }
html[data-theme="tech"] .pt-ri-am button:hover { background: rgba(0,200,255,.08) !important; }
html[data-theme="tech"] .pt-empty-state { background: rgba(10,22,40,.6) !important; border-color: rgba(0,200,255,.1) !important; }
html[data-theme="tech"] .pip-w { background: rgba(255,159,67,.12) !important; color: #ff9f43 !important; }
html[data-theme="tech"] .pip-x,
html[data-theme="tech"] .pip-passado,
html[data-theme="tech"] .pt-badge-pass-mini { background: rgba(74,122,150,.1) !important; color: #4a7a96 !important; }
html[data-theme="tech"] .pt-hoje-btn { background: rgba(0,200,255,.1) !important; color: #00c8ff !important; border-color: rgba(0,200,255,.25) !important; }

/* PT calendar (within main app) */
html[data-theme="tech"] .pt-cal { background: rgba(10,22,40,.88) !important; border-color: rgba(0,200,255,.12) !important; }
html[data-theme="tech"] .pt-cal-dows { background: rgba(7,14,31,.97) !important; border-color: rgba(0,200,255,.1) !important; }
html[data-theme="tech"] .pt-cc:hover { background: rgba(0,200,255,.05) !important; }
html[data-theme="tech"] .pt-cc-e { background: rgba(5,11,24,.6) !important; }
html[data-theme="tech"] .pt-cc-wknd { background: rgba(5,11,24,.4) !important; }
html[data-theme="tech"] .pt-cc-wknd:hover { background: rgba(0,200,255,.04) !important; }
html[data-theme="tech"] .pt-cc-today { background: rgba(0,200,255,.1) !important; }

/* PT modal box */
html[data-theme="tech"] .pt-mbox { background: rgba(10,22,40,.97) !important; border-color: rgba(0,200,255,.2) !important; box-shadow: 0 0 50px rgba(0,200,255,.12), 0 24px 60px rgba(0,0,0,.9) !important; }
html[data-theme="tech"] .pt-mbox-hdr { background: rgba(7,14,31,.98) !important; border-color: rgba(0,200,255,.15) !important; color: #d6eaf8 !important; }
html[data-theme="tech"] .pt-mbox-x { background: rgba(0,200,255,.08) !important; color: #4a7a96 !important; }
html[data-theme="tech"] .pt-mbox-ftr { background: rgba(7,14,31,.98) !important; border-color: rgba(0,200,255,.12) !important; }
html[data-theme="tech"] .pt-ferr { background: rgba(255,61,106,.1) !important; border-color: rgba(255,61,106,.22) !important; color: #ff3d6a !important; }
html[data-theme="tech"] .pt-inp { background: rgba(10,22,40,.85) !important; border-color: rgba(0,200,255,.2) !important; color: #b6d8f0 !important; }
html[data-theme="tech"] .pt-tog { background: rgba(10,22,40,.7) !important; border-color: rgba(0,200,255,.12) !important; }
html[data-theme="tech"] .pt-tog-btn:not(.on):hover { background: rgba(0,200,255,.07) !important; }
html[data-theme="tech"] .pt-sug { background: rgba(7,14,31,.98) !important; border-color: rgba(0,200,255,.15) !important; box-shadow: 0 8px 24px rgba(0,0,0,.75) !important; }
html[data-theme="tech"] .pt-sug li:hover { background: rgba(0,200,255,.06) !important; color: #b6d8f0 !important; }
html[data-theme="tech"] .pt-check { background: rgba(10,22,40,.7) !important; border-color: rgba(0,200,255,.12) !important; }
html[data-theme="tech"] .pt-check:has(input:checked) { background: rgba(0,229,160,.08) !important; border-color: rgba(0,229,160,.25) !important; }
html[data-theme="tech"] .pt-fin-pend { background: rgba(255,159,67,.08) !important; border-color: rgba(255,159,67,.2) !important; color: #ff9f43 !important; }
html[data-theme="tech"] .pt-info-warn { background: rgba(255,159,67,.07) !important; border-color: rgba(255,159,67,.15) !important; color: #ff9f43 !important; }
html[data-theme="tech"] .pt-info-hist { background: rgba(0,229,160,.06) !important; border-color: rgba(0,229,160,.15) !important; color: #00e5a0 !important; }

/* PT bloco */
html[data-theme="tech"] .pt-bloco { background: rgba(10,22,40,.88) !important; border-color: rgba(0,200,255,.12) !important; }
html[data-theme="tech"] .pt-bloco-hdr { background: rgba(7,14,31,.97) !important; border-color: rgba(0,200,255,.1) !important; }
html[data-theme="tech"] .pt-bloco-past .pt-bloco-hdr { background: rgba(7,14,31,.9) !important; }
html[data-theme="tech"] .pt-bloco-badge-past { background: rgba(74,122,150,.1) !important; color: #4a7a96 !important; }
html[data-theme="tech"] .pt-bloco-badge-fut { background: rgba(0,229,160,.08) !important; color: #00e5a0 !important; }
html[data-theme="tech"] .pt-bloco .pt-rc { background: rgba(7,14,31,.7) !important; }
html[data-theme="tech"] .pt-bloco-sec-hdr { background: rgba(7,14,31,.97) !important; border-color: rgba(0,200,255,.08) !important; }
html[data-theme="tech"] .pt-past-row:hover { background: rgba(255,159,67,.04) !important; }

/* PT calendar popup */
html[data-theme="tech"] .pt-cal-popup { background: rgba(7,14,31,.98) !important; border-color: rgba(0,200,255,.18) !important; box-shadow: 0 8px 28px rgba(0,0,0,.75), 0 0 18px rgba(0,200,255,.07) !important; }
html[data-theme="tech"] .pt-cal-popup-x { background: rgba(0,200,255,.08) !important; color: #4a7a96 !important; }
html[data-theme="tech"] .pt-cal-popup-act:hover { background: rgba(0,200,255,.07) !important; }
html[data-theme="tech"] .pt-cal-popup-del:hover { background: rgba(255,61,106,.1) !important; color: #ff3d6a !important; }

/* PT turno / scope buttons */
html[data-theme="tech"] .pt-turno-btn { background: rgba(10,22,40,.7) !important; border-color: rgba(0,200,255,.12) !important; color: #4a7a96 !important; }
html[data-theme="tech"] .pt-turno-btn.on { background: rgba(0,200,255,.15) !important; border-color: rgba(0,200,255,.4) !important; color: #00c8ff !important; }
html[data-theme="tech"] .pt-btn-sec { background: rgba(10,22,40,.7) !important; border-color: rgba(0,200,255,.12) !important; color: #4a7a96 !important; }
html[data-theme="tech"] .pt-btn-sec:hover { background: rgba(0,200,255,.08) !important; color: #b6d8f0 !important; }
html[data-theme="tech"] .pt-scope-btn { background: rgba(10,22,40,.7) !important; border-color: rgba(0,200,255,.12) !important; }
html[data-theme="tech"] .pt-scope-btn:hover { background: rgba(0,200,255,.07) !important; }
html[data-theme="tech"] .pt-scope-danger:hover { background: rgba(255,61,106,.1) !important; }
html[data-theme="tech"] .pt-scope-ico { background: rgba(0,200,255,.1) !important; color: #4a7a96 !important; }
html[data-theme="tech"] .pt-scope-danger .pt-scope-ico { background: rgba(255,61,106,.1) !important; color: #ff3d6a !important; }
html[data-theme="tech"] .pt-conflict-box { background: rgba(255,159,67,.07) !important; border-color: rgba(255,159,67,.2) !important; color: #ff9f43 !important; }
html[data-theme="tech"] .pt-pend-panel { background: rgba(10,22,40,.9) !important; border-color: rgba(255,159,67,.2) !important; }
html[data-theme="tech"] .pt-pend-atrs { background: rgba(255,61,106,.1) !important; border-color: rgba(255,61,106,.2) !important; color: #ff3d6a !important; }

/* ── Pediatric mode (NEON OS variant: magenta instead of cyan) ── */
html[data-theme="tech"] .app-pediatria .app-header {
  background: linear-gradient(135deg, #0d0514 0%, #130720 100%) !important;
  border-bottom: 1px solid rgba(236,72,153,.5) !important;
  box-shadow: 0 0 28px rgba(236,72,153,.12), 0 1px 0 rgba(236,72,153,.18) !important;
}
html[data-theme="tech"] .app-pediatria .brand-mark { background: #9d174d !important; box-shadow: 0 4px 12px rgba(236,72,153,.35) !important; }
html[data-theme="tech"] .app-pediatria .brand-name span { color: #f472b6 !important; }
html[data-theme="tech"] .app-pediatria .brand-sub { color: #be185d !important; }
html[data-theme="tech"] .app-pediatria .date-pill { background: rgba(236,72,153,.1) !important; color: #f472b6 !important; border-color: rgba(236,72,153,.25) !important; }
html[data-theme="tech"] .app-pediatria .mode-toggle.on { background: linear-gradient(135deg, rgba(236,72,153,.14) 0%, rgba(168,85,247,.12) 100%) !important; border-color: rgba(236,72,153,.35) !important; color: #f472b6 !important; }
html[data-theme="tech"] .app-pediatria .btn-primary,
html[data-theme="tech"] .app-pediatria [class*="btn-primary"] { background: linear-gradient(135deg, #9d174d, #ec4899) !important; box-shadow: 0 0 16px rgba(236,72,153,.4) !important; }
html[data-theme="tech"] .app-pediatria .hero-act-nova { background: #db2777 !important; border-color: #db2777 !important; box-shadow: 0 0 16px rgba(219,39,119,.4) !important; }
html[data-theme="tech"] .app-pediatria .hero-act-nova:hover { background: #be185d !important; box-shadow: 0 0 28px rgba(219,39,119,.6) !important; }
