/* ═══════════════════════════════════════════════
   EndoPed — Design System
   Linguagem visual unificada com a landing:
   teal/ink, tipografia refinada, mono para
   eyebrows, auroras translúcidas, sombras sutis.
   ═══════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

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

:root {
  /* Superfícies */
  --bg: #ffffff;
  --bg2: #f5f7fa;
  --bg3: #eef1f5;
  --card: #ffffff;
  --card-hover: #f5f7fa;
  --sidebar-bg: rgba(255, 255, 255, 0.78);

  /* Cor de marca */
  --primary: #1f8a82;
  --primary-hover: #176f68;
  --primary-soft: #e3f3f1;
  --primary-light: #e3f3f1;
  --accent: #1f8a82;
  --accent2: #40c2b8;
  --ink: #161e2b;
  --ink-foreground: #ffffff;

  /* Tipografia */
  --text: #161e2b;
  --text2: #5a6577;
  --text3: #8a93a3;

  /* Bordas */
  --border: #e3e7ec;
  --border2: #d8dde4;
  --border-soft: #eef1f5;

  /* Estado */
  --success: #1f8a82;
  --success-bg: #e3f3f1;
  --error: #c8553d;
  --error-bg: #fbe9e3;
  --warning: #b8860b;
  --warning-bg: #faf3e0;

  /* Geometria */
  --radius: 10px;
  --radius-sm: 8px;
  --radius-lg: 14px;
  --radius-full: 9999px;

  /* Sombras (alinhadas à landing) */
  --shadow-xs: 0 1px 2px 0 rgba(22, 30, 43, 0.04);
  --shadow-sm: 0 1px 3px 0 rgba(22, 30, 43, 0.06), 0 1px 2px -1px rgba(22, 30, 43, 0.04);
  --shadow-md: 0 4px 16px -4px rgba(22, 30, 43, 0.08), 0 2px 6px -2px rgba(22, 30, 43, 0.04);
  --shadow-lg: 0 12px 32px -8px rgba(22, 30, 43, 0.12), 0 4px 12px -4px rgba(22, 30, 43, 0.06);
  --shadow: var(--shadow-sm);

  /* Fontes */
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --font-heading: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

.dark {
  --bg: #0b1220;
  --bg2: #0f1828;
  --bg3: #131e30;
  --card: rgba(15, 24, 40, 0.85);
  --card-hover: #16223a;
  --sidebar-bg: rgba(11, 18, 32, 0.78);

  --primary: #40c2b8;
  --primary-hover: #5bd3ca;
  --primary-soft: rgba(64, 194, 184, 0.14);
  --primary-light: rgba(64, 194, 184, 0.14);
  --accent: #40c2b8;
  --ink: #f1f5f9;

  --text: #e6ecf2;
  --text2: #98a3b3;
  --text3: #6c7689;

  --border: #1e2a3f;
  --border2: #2a3852;
  --border-soft: #182238;

  --success-bg: rgba(64, 194, 184, 0.12);
  --error: #e07b62;
  --error-bg: rgba(224, 123, 98, 0.12);
}

html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  letter-spacing: -0.02em;
  font-weight: 700;
  color: var(--text);
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: var(--font); border: none; background: none; color: inherit; }
input, textarea, select { font-family: var(--font); }
::selection { background: rgba(31, 138, 130, 0.18); color: var(--text); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--text3); }

.mono { font-family: var(--font-mono); }
.figure { font-variant-numeric: lining-nums tabular-nums; letter-spacing: -0.025em; }

/* ── Aurora background (igual à landing) ── */
.aurora-bg {
  position: fixed;
  inset: 0;
  z-index: -10;
  overflow: hidden;
  background: var(--bg);
  pointer-events: none;
}
.aurora-bg .aurora {
  position: absolute;
  border-radius: 9999px;
  filter: blur(90px);
  opacity: 0.45;
  mix-blend-mode: multiply;
  will-change: transform;
}
.aurora-bg .aurora-1 {
  width: 60vmax; height: 60vmax;
  top: -20%; left: -15%;
  background: radial-gradient(circle at 30% 30%, rgba(31, 138, 130, 0.55), transparent 60%);
  animation: drift1 24s ease-in-out infinite alternate;
}
.aurora-bg .aurora-2 {
  width: 55vmax; height: 55vmax;
  top: 5%; right: -20%;
  background: radial-gradient(circle at 50% 50%, rgba(58, 118, 200, 0.30), transparent 60%);
  animation: drift2 30s ease-in-out infinite alternate;
}
.aurora-bg .aurora-3 {
  width: 60vmax; height: 60vmax;
  bottom: -25%; left: 25%;
  background: radial-gradient(circle at 50% 50%, rgba(64, 194, 184, 0.40), transparent 60%);
  animation: drift3 26s ease-in-out infinite alternate;
}
.dark .aurora-bg .aurora { mix-blend-mode: screen; opacity: 0.30; }
@keyframes drift1 { 0%{transform:translate(0,0) scale(1) rotate(0)} 50%{transform:translate(12vw,8vh) scale(1.12) rotate(35deg)} 100%{transform:translate(-6vw,15vh) scale(.95) rotate(-20deg)} }
@keyframes drift2 { 0%{transform:translate(0,0) scale(1) rotate(0)} 50%{transform:translate(-15vw,10vh) scale(1.18) rotate(-25deg)} 100%{transform:translate(8vw,-8vh) scale(1.04) rotate(30deg)} }
@keyframes drift3 { 0%{transform:translate(0,0) scale(1) rotate(0)} 50%{transform:translate(18vw,-12vh) scale(1.10) rotate(20deg)} 100%{transform:translate(-12vw,-6vh) scale(1.18) rotate(-35deg)} }
@media (prefers-reduced-motion: reduce) {
  .aurora-bg .aurora { animation: none !important; }
}

/* ── Utilitários ── */
.container { max-width: 1400px; margin: 0 auto; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; } .gap-6 { gap: 24px; }
.text-center { text-align: center; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none; }
.shrink-0 { flex-shrink: 0; }
.space-y-4 > * + * { margin-top: 16px; }
.space-y-5 > * + * { margin-top: 20px; }
.space-y-6 > * + * { margin-top: 24px; }
.space-y-8 > * + * { margin-top: 32px; }

/* ── Eyebrow (numeração estilo editorial — igual landing) ── */
.eyebrow { display: inline-flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.eyebrow-num {
  font-family: var(--font-mono); font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.2em;
  color: var(--accent); font-weight: 600;
}
.eyebrow-line { height: 1px; width: 24px; background: var(--border2); }
.eyebrow-label {
  font-family: var(--font-mono); font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.2em;
  color: var(--text2); font-weight: 500;
}

/* ── Animações ── */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
.animate-fade-in-up { animation: fadeInUp .5s cubic-bezier(.22,1,.36,1) both; }
.animate-fade-in { animation: fadeIn .35s ease-out both; }

/* ── Shell ── */
.app-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
  background: transparent;
  position: relative;
  z-index: 1;
}

/* ── Sidebar ── */
.sidebar {
  display: flex;
  flex-direction: column;
  width: 64px;
  height: 100vh;
  border-right: 1px solid var(--border);
  background: var(--sidebar-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: width .28s cubic-bezier(.22,1,.36,1);
  overflow: hidden;
  flex-shrink: 0;
}
.sidebar:hover { width: 240px; }
.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  height: 64px; padding: 0 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.sidebar-brand i,
.sidebar-brand svg {
  color: var(--accent);
  width: 24px; height: 24px;
  flex-shrink: 0;
  stroke: currentColor;
}
.sidebar-brand > span {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  opacity: 0;
  transition: opacity .2s;
}
.sidebar:hover .sidebar-brand > span { opacity: 1; }
.brand-endo { color: #1e3a5f; }
.brand-ped  { color: #3b82f6; }
.dark .brand-endo { color: #cfe1ff; }
.dark .brand-ped  { color: #60a5fa; }
.sidebar-nav { flex: 1; padding: 14px 10px; }
.sidebar-nav ul { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.sidebar-footer { border-top: 1px solid var(--border); padding: 12px 10px; }
.sidebar-footer ul { list-style: none; display: flex; flex-direction: column; gap: 2px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text2);
  transition: background .15s, color .15s;
  white-space: nowrap;
  position: relative;
}
.nav-item i,
.nav-item svg {
  width: 18px; height: 18px;
  flex-shrink: 0;
  stroke: currentColor;
}
.nav-item span { opacity: 0; transition: opacity .2s; }
.sidebar:hover .nav-item span { opacity: 1; }
.nav-item:hover { background: var(--bg2); color: var(--text); }
.nav-item.active {
  background: var(--primary-soft);
  color: var(--accent);
  border-left: none;
}
.nav-item.active::before {
  content: "";
  position: absolute;
  left: -10px; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 18px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}
.nav-item.danger:hover { background: var(--error-bg); color: var(--error); }

.nav-item-form { margin: 0; padding: 0; }
button.nav-item {
  width: 100%;
  background: transparent;
  border: 0;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

/* ── Área principal ── */
.main-area { display: flex; flex-direction: column; flex: 1; overflow: hidden; }
.top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 28px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  position: relative;
  z-index: 5;
}
.dark .top-header { background: rgba(11, 18, 32, 0.72); }

.main-area > #app {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#app > .endo-pacientes,
#app > .endo-profile,
#app > .endo-paciente-detalhe {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.main-content { flex: 1; min-height: 0; overflow-y: auto; padding: 32px 28px; }

/* ── Theme toggle ── */
.theme-toggle {
  width: 36px; height: 36px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text2);
  transition: background .15s, color .15s;
}
.theme-toggle:hover { background: var(--bg2); color: var(--text); }

/* ── Avatar ── */
.avatar {
  width: 34px; height: 34px;
  border-radius: var(--radius-full);
  background: var(--ink);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600;
  flex-shrink: 0;
  letter-spacing: -0.01em;
}
.avatar-lg { width: 48px; height: 48px; font-size: 17px; }
.avatar-img {
  object-fit: cover;
  background: var(--bg2);
  padding: 0;
  border: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(22, 30, 43, 0.06);
  transition: transform .25s, box-shadow .25s;
}
.avatar-img:hover {
  transform: scale(1.06);
  box-shadow: 0 4px 12px -2px rgba(22, 30, 43, 0.18);
}

/* ── Cards ── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-xs);
  transition: box-shadow .25s, transform .25s, border-color .25s;
}
.card-compact { padding: 20px; }
.card:hover { box-shadow: var(--shadow-sm); }

/* ── Stat card (dashboard) ── */
.stat-card {
  display: flex;
  align-items: center;
  gap: 18px;
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: "";
  position: absolute;
  right: -20px; top: -20px;
  width: 120px; height: 120px;
  background: radial-gradient(circle, rgba(31, 138, 130, 0.08), transparent 65%);
  border-radius: 50%;
  pointer-events: none;
}
.stat-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-icon i { width: 22px; height: 22px; }
.stat-label {
  font-size: 11px;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}
.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: lining-nums tabular-nums;
  letter-spacing: -0.035em;
  margin-top: 4px;
  line-height: 1;
}

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
}
.badge-success { background: rgba(31, 138, 130, 0.10); color: var(--accent); border-color: rgba(31, 138, 130, 0.18); }
.badge-error { background: rgba(200, 85, 61, 0.10); color: var(--error); border-color: rgba(200, 85, 61, 0.18); }
.badge-blue { background: rgba(58, 118, 200, 0.10); color: #2e63ad; border-color: rgba(58, 118, 200, 0.18); }
.badge-pink { background: rgba(190, 24, 93, 0.08); color: #be185d; border-color: rgba(190, 24, 93, 0.16); }
.badge-neutral { background: var(--bg2); color: var(--text2); border-color: var(--border); }
.badge-yellow { background: rgba(184, 134, 11, 0.10); color: #92660b; border-color: rgba(184, 134, 11, 0.18); }
.badge-green { background: rgba(31, 138, 130, 0.10); color: var(--accent); border-color: rgba(31, 138, 130, 0.18); }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
  transition: background .18s, color .18s, border-color .18s, box-shadow .18s, transform .18s;
  border: 1px solid transparent;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow-xs);
}
.btn-primary:hover { background: rgba(22, 30, 43, 0.92); box-shadow: var(--shadow-sm); }
.dark .btn-primary { background: var(--accent); color: #0b1220; }
.dark .btn-primary:hover { background: var(--primary-hover); }

.btn-outline {
  border-color: var(--border);
  color: var(--text);
  background: var(--bg);
}
.btn-outline:hover { background: var(--bg2); border-color: var(--border2); }
.btn-block { width: 100%; }
.btn-lg { height: 46px; font-size: 14px; padding: 0 20px; }
.btn-sm { height: 32px; font-size: 12.5px; padding: 0 12px; }
.btn i { width: 15px; height: 15px; }
.btn-icon {
  width: 34px; height: 34px;
  padding: 0;
  border-radius: 8px;
  color: var(--text2);
  background: transparent;
  border-color: transparent;
}
.btn-icon:hover { background: var(--bg2); color: var(--text); }
.btn-icon.danger:hover { background: var(--error-bg); color: var(--error); }

/* Loading */
.btn.btn-is-loading { pointer-events: none; opacity: 0.95; }
.btn .btn-spinner {
  width: 16px; height: 16px;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: btnSpinnerRotate .65s linear infinite;
}
.btn-outline .btn-spinner,
.btn.btn-outline .btn-spinner {
  border-color: rgba(22, 30, 43, 0.18);
  border-top-color: var(--text);
}
.btn .btn-loading-label { font-size: 13.5px; font-weight: 600; }
@keyframes btnSpinnerRotate { to { transform: rotate(360deg); } }

/* ── Inputs ── */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.005em;
}
.form-input {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: border-color .18s, box-shadow .18s, background .18s;
  font-feature-settings: "cv11";
}
.form-input::placeholder { color: var(--text3); }
.form-input:hover { border-color: var(--border2); }
.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(31, 138, 130, 0.14);
  background: var(--bg);
}
.form-input-icon { padding-left: 44px; }
.form-textarea { height: auto; padding: 12px 14px; resize: vertical; min-height: 96px; }
.input-wrapper { position: relative; }
.input-icon {
  position: absolute; left: 14px; top: 50%;
  transform: translateY(-50%);
  color: var(--text3);
  pointer-events: none;
}
.input-icon i { width: 17px; height: 17px; }

/* ── Tabelas ── */
.table-wrapper { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}
thead tr {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
}
th {
  padding: 12px 14px;
  text-align: left;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text2);
  white-space: nowrap;
  font-family: var(--font-mono);
}
td {
  padding: 12px 14px;
  font-size: 13.5px;
  color: var(--text2);
  white-space: nowrap;
  border-bottom: 1px solid var(--border-soft);
}
tbody tr { transition: background .14s; }
tbody tr:hover { background: var(--bg2); }
tbody tr:last-child td { border-bottom: none; }
.td-primary { color: var(--text); font-weight: 500; }

/* ── Section header ── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
}
.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.015em;
}
.section-title i { width: 18px; height: 18px; color: var(--accent); }

/* ── Patient row (dashboard) ── */
.patient-row {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-soft);
  transition: background .14s;
}
.patient-row:hover { background: var(--bg2); }
.patient-row .avatar { background: var(--primary-soft); color: var(--accent); }
.patient-info { flex: 1; min-width: 0; }
.patient-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}
.patient-meta { font-size: 12.5px; color: var(--text2); margin-top: 3px; }
.patient-meta .dot { margin: 0 6px; color: var(--border2); }

/* ── Search ── */
.search-bar { position: relative; }
.search-bar input {
  height: 40px;
  padding: 0 16px 0 40px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  font-size: 13.5px;
  color: var(--text);
  outline: none;
  width: 320px;
  transition: border-color .18s, box-shadow .18s;
}
.search-bar input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(31, 138, 130, 0.14);
}
.search-bar i {
  position: absolute; left: 14px; top: 50%;
  transform: translateY(-50%);
  color: var(--text3);
  width: 17px; height: 17px;
}

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(22, 30, 43, 0.42);
  backdrop-filter: blur(6px) saturate(140%);
  -webkit-backdrop-filter: blur(6px) saturate(140%);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  animation: fadeIn .2s ease;
}
.modal-overlay.hidden { display: none !important; }
.modal {
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(227, 231, 236, 0.85);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 50px -12px rgba(22, 30, 43, 0.22), 0 4px 12px -4px rgba(22, 30, 43, 0.10);
  animation: fadeInUp .25s cubic-bezier(.22,1,.36,1);
}
.dark .modal {
  background: rgba(15, 24, 40, 0.88);
  border-color: rgba(255, 255, 255, 0.08);
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.015em;
}
.modal-body { padding: 24px; }

/* Modal: novo paciente */
#add-patient-modal .modal-close {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  border-radius: 8px;
  color: var(--text2);
}
#add-patient-modal .modal-close:hover { background: var(--bg2); color: var(--text); }
#add-patient-modal .modal-close-icon { width: 18px; height: 18px; stroke: currentColor; }
#add-patient-modal select.form-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235a6577' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}
#add-patient-modal .form-label-hint { font-weight: 400; color: var(--text3); }
#add-patient-modal .modal { max-height: none; overflow: visible; }
#add-patient-modal .modal-header { padding: 16px 20px; }
#add-patient-modal .modal-body { padding: 18px 22px 20px; }
#add-patient-modal #add-patient-form {
  display: flex; flex-direction: column; gap: 12px;
}
#add-patient-modal #add-patient-form .form-textarea { min-height: 0; }
@media (max-height: 640px) {
  #add-patient-modal .modal { max-height: min(92vh, 900px); overflow-y: auto; }
}

/* Modal: confirmação excluir */
#delete-patient-modal { z-index: 110; }
#delete-patient-modal .modal-close {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 8px; color: var(--text2);
}
#delete-patient-modal .modal-close:hover { background: var(--bg2); color: var(--text); }
#delete-patient-modal .modal-close-icon { width: 18px; height: 18px; stroke: currentColor; }
.modal--confirm-delete { max-width: 440px; }
.modal-delete-lead {
  font-size: 14.5px;
  color: var(--text);
  line-height: 1.55;
  margin: 0 0 10px;
}
.modal-delete-lead strong { color: var(--text); font-weight: 700; }
.modal-delete-hint { font-size: 13.5px; color: var(--text2); line-height: 1.55; margin: 0; }
.modal-footer {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}
.modal-footer--end { justify-content: flex-end; }
.btn-danger-solid {
  background: var(--error);
  color: #fff;
  border: 1px solid var(--error);
}
.btn-danger-solid:hover { background: #b04832; border-color: #b04832; color: #fff; }

/* ── Auth pages ── */
.auth-layout { display: flex; min-height: 100vh; }
.auth-left {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 48px 24px;
  background: var(--bg);
}
.auth-right {
  width: 42%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: var(--ink);
  position: relative;
  overflow: hidden;
}
.auth-right::before {
  content: "";
  position: absolute;
  top: -10%; right: -10%;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(31, 138, 130, 0.30), transparent 60%);
  filter: blur(80px);
  pointer-events: none;
}
.auth-right-content {
  position: relative; z-index: 10;
  max-width: 380px; padding: 0 40px; text-align: center;
}
.auth-right h2 {
  font-size: 30px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  letter-spacing: -0.025em;
}
.auth-right p {
  margin-top: 16px;
  font-size: 16px;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.65;
}
.feature-pill {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  backdrop-filter: blur(4px);
}
.feature-pill i { width: 18px; height: 18px; color: rgba(255, 255, 255, 0.85); flex-shrink: 0; }
.feature-pill span { font-size: 13.5px; font-weight: 500; color: rgba(255, 255, 255, 0.88); }
.floating-icon { position: absolute; color: rgba(255, 255, 255, 0.06); }
.dot-pattern { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ── Grids ── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-detail { display: grid; grid-template-columns: 45% 1fr; gap: 24px; }

/* ── Responsive ── */
@media (max-width: 1024px) {
  .auth-right { display: none; }
  .auth-left { width: 100%; }
  .grid-detail { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .search-bar input { width: 100%; }
  .main-content { padding: 24px 20px; }
}
