/* ── RESET & BASE ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --cream: #FAF8F4;
  --cream-2: #F2EDE4;
  --cream-3: #E8E2D9;
  --gold: #B4A882;
  --gold-dark: #8C7E5E;
  --gold-light: #D4C9A8;
  --brown: #6B5B45;
  --brown-dark: #3D3020;
  --text-primary: #2C2416;
  --text-secondary: #7A6E62;
  --text-tertiary: #A89E94;
  --danger: #9B3A2E;
  --danger-bg: #FDF0EE;
  --warning: #8C6820;
  --warning-bg: #FDF6E8;
  --success: #2E6B4F;
  --success-bg: #EDF7F2;
  --info: #2B5FA5;
  --info-bg: #EEF4FC;
  --sidebar-w: 240px;
  --header-h: 60px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(44,36,22,0.08), 0 4px 16px rgba(44,36,22,0.06);
}
html, body { height: 100%; overflow: hidden; }
body {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--text-primary);
  background: var(--cream);
  line-height: 1.5;
}
h1,h2,h3 { font-family: 'Cormorant Garamond', serif; font-weight: 500; }
em { font-family: 'Cormorant Garamond', serif; font-style: italic; }
input, select, textarea, button {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: var(--text-primary);
}
input, select, textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--cream-3);
  border-radius: var(--radius-sm);
  background: #fff;
  outline: none;
  transition: border-color 0.15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--gold); }
textarea { resize: vertical; }
button { cursor: pointer; border: none; background: none; }
a { cursor: pointer; text-decoration: none; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ── WELCOME SCREEN ───────────────────────────────────────────────────── */
.welcome-screen {
  position: fixed; inset: 0;
  background: var(--brown-dark);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.8s ease;
}
.welcome-content {
  max-width: 440px;
  padding: 3rem 2.5rem;
  text-align: center;
  animation: slideUp 0.8s ease;
}
.welcome-logo {
  font-family: 'Cormorant Garamond', serif;
  font-size: 13px;
  letter-spacing: 0.3em;
  color: var(--gold);
  margin-bottom: 1.5rem;
}
.welcome-title {
  font-size: 3.5rem;
  font-weight: 300;
  color: var(--cream);
  line-height: 1.1;
  margin-bottom: 1.5rem;
}
.welcome-title em { color: var(--gold-light); font-size: 4rem; }
.welcome-divider {
  width: 40px; height: 1px;
  background: var(--gold);
  margin: 1.5rem auto;
}
.welcome-text {
  font-size: 14px;
  color: rgba(250,248,244,0.7);
  line-height: 1.9;
  margin-bottom: 2.5rem;
}
.welcome-text em { color: var(--gold-light); font-size: 16px; }
.welcome-btn {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--gold);
  color: var(--brown-dark);
  padding: 12px 28px;
  border-radius: 40px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: background 0.2s, transform 0.15s;
}
.welcome-btn:hover { background: var(--gold-light); transform: translateY(-1px); }
.welcome-skip {
  margin-top: 1rem;
  font-size: 12px;
  color: rgba(250,248,244,0.4);
  cursor: pointer;
  transition: color 0.15s;
}
.welcome-skip:hover { color: rgba(250,248,244,0.7); }

/* ── APP LAYOUT ───────────────────────────────────────────────────────── */
.app { display: flex; height: 100vh; overflow: hidden; }

/* ── SIDEBAR ──────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--brown-dark);
  display: flex;
  flex-direction: column;
  padding: 0;
  flex-shrink: 0;
  overflow-y: auto;
  overflow-x: hidden;
}
.sidebar-logo {
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid rgba(180,168,130,0.15);
  display: flex; flex-direction: column; gap: 2px;
}
.logo-abs {
  font-family: 'Cormorant Garamond', serif;
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--gold);
}
.logo-full {
  font-size: 12px;
  color: rgba(250,248,244,0.5);
  font-weight: 300;
}
.sidebar-section-label {
  font-size: 9px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(180,168,130,0.5);
  padding: 1rem 1.25rem 0.4rem;
}
.sidebar-members { padding-bottom: 0.5rem; }
.members-list { display: flex; flex-direction: column; gap: 2px; padding: 0 0.75rem; }
.member-item {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
  color: rgba(250,248,244,0.65);
  font-size: 13px;
}
.member-item:hover { background: rgba(180,168,130,0.1); }
.member-item.active {
  background: rgba(180,168,130,0.18);
  color: var(--cream);
}
.member-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(180,168,130,0.25);
  border: 1px solid rgba(180,168,130,0.3);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  font-weight: 500;
  color: var(--gold-light);
  flex-shrink: 0;
}
.member-item.active .member-avatar {
  background: var(--gold);
  color: var(--brown-dark);
  border-color: var(--gold);
}
.member-score-badge {
  margin-left: auto;
  font-size: 11px;
  color: var(--gold);
  opacity: 0.7;
}
.add-member-btn {
  display: flex; align-items: center; gap: 6px;
  margin: 0.25rem 0.75rem;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: rgba(180,168,130,0.6);
  transition: all 0.15s;
  border: 1px dashed rgba(180,168,130,0.2);
}
.add-member-btn:hover {
  color: var(--gold-light);
  border-color: rgba(180,168,130,0.4);
  background: rgba(180,168,130,0.05);
}
.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding-bottom: 0.5rem;
}
.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 1.25rem;
  font-size: 13px;
  color: rgba(250,248,244,0.55);
  transition: all 0.15s;
  border-left: 2px solid transparent;
}
.nav-item i { font-size: 16px; }
.nav-item:hover {
  color: rgba(250,248,244,0.85);
  background: rgba(180,168,130,0.08);
}
.nav-item.active {
  color: var(--cream);
  border-left-color: var(--gold);
  background: rgba(180,168,130,0.12);
}
.sidebar-urgencia {
  margin: 0.75rem;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: rgba(155,58,46,0.2);
  border: 1px solid rgba(155,58,46,0.3);
  display: flex; align-items: center; gap: 8px;
  font-size: 12px;
  color: #E8937A;
  cursor: pointer;
  transition: background 0.15s;
}
.sidebar-urgencia:hover { background: rgba(155,58,46,0.3); }

/* ── MAIN CONTENT ─────────────────────────────────────────────────────── */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--cream);
}
.top-header {
  height: var(--header-h);
  background: #fff;
  border-bottom: 1px solid var(--cream-3);
  display: flex; align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
  flex-shrink: 0;
}
.hamburger {
  font-size: 20px;
  color: var(--text-secondary);
  display: none;
}
.header-member {
  flex: 1;
  font-family: 'Cormorant Garamond', serif;
  font-size: 18px;
  color: var(--brown);
}
.header-actions { display: flex; gap: 8px; }
.icon-btn {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  color: var(--text-secondary);
  transition: all 0.15s;
}
.icon-btn:hover { background: var(--cream-2); color: var(--brown); }
.view-container {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}
.view { display: none; }
.view.active { display: block; }
.view-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.5rem;
}
.view-title {
  font-size: 1.6rem;
  color: var(--brown-dark);
  font-weight: 400;
}
.view-subtitle {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: -1rem;
  margin-bottom: 1.5rem;
}

/* ── BUTTONS ──────────────────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--brown-dark);
  color: var(--cream);
  padding: 8px 16px;
  border-radius: 40px;
  font-size: 13px;
  font-weight: 400;
  transition: all 0.15s;
}
.btn-primary:hover { background: var(--brown); transform: translateY(-1px); }
.btn-secondary {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent;
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: 40px;
  font-size: 13px;
  border: 1px solid var(--cream-3);
  transition: all 0.15s;
}
.btn-secondary:hover { background: var(--cream-2); }
.btn-ghost {
  font-size: 12px;
  color: var(--text-tertiary);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
}
.btn-ghost:hover { background: var(--cream-2); color: var(--text-secondary); }

/* ── DASHBOARD ────────────────────────────────────────────────────────── */
.dashboard-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  grid-template-rows: auto auto;
  gap: 1rem;
}
.score-card {
  background: var(--brown-dark);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex; flex-direction: column; align-items: center;
  gap: 1rem;
  grid-row: span 2;
}
.score-ring-wrap {
  position: relative;
  width: 120px; height: 120px;
}
.score-ring { width: 100%; height: 100%; }
.score-ring-inner {
  position: absolute;
  inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.score-number {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2.5rem;
  font-weight: 300;
  color: var(--cream);
  line-height: 1;
}
.score-ring-label {
  font-size: 9px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  margin-top: 2px;
}
.score-info { text-align: center; width: 100%; }
.score-status {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.2rem;
  color: var(--gold-light);
  margin-bottom: 4px;
}
.score-level {
  font-size: 11px;
  color: rgba(250,248,244,0.5);
  margin-bottom: 0.75rem;
}
.score-streak {
  display: flex; align-items: center; justify-content: center; gap: 5px;
  font-size: 11px;
  color: rgba(250,248,244,0.45);
}
.score-streak strong { color: var(--gold); }
.insight-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--cream-3);
}
.insight-label {
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-dark);
  margin-bottom: 0.6rem;
}
.insight-body {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.7;
  font-style: italic;
}
.missions-card, .systems-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--cream-3);
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 0.75rem;
}
.card-label {
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 0.75rem;
}
.missions-count {
  background: var(--danger-bg);
  color: var(--danger);
  font-size: 11px;
  font-weight: 500;
  padding: 1px 8px;
  border-radius: 20px;
}
.missions-list { display: flex; flex-direction: column; gap: 8px; }
.mission-item {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  background: var(--cream);
  border-left: 3px solid transparent;
}
.mission-item.urgent { border-left-color: var(--danger); background: var(--danger-bg); }
.mission-item.medium { border-left-color: var(--warning); background: var(--warning-bg); }
.mission-item.low { border-left-color: var(--gold); background: var(--cream-2); }
.mission-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}
.mission-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.mission-desc {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.mission-tag {
  margin-left: auto;
  font-size: 10px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
}
.systems-list { display: flex; flex-direction: column; gap: 6px; }
.system-row { display: flex; align-items: center; gap: 8px; }
.system-name { font-size: 11px; color: var(--text-secondary); min-width: 148px; flex-shrink: 0; }
.system-bar-bg {
  flex: 1; height: 5px;
  background: var(--cream-2);
  border-radius: 3px;
  overflow: hidden;
}
.system-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 1.4s cubic-bezier(.4,0,.2,1);
}
.system-score {
  font-size: 11px;
  color: var(--text-tertiary);
  min-width: 24px;
  text-align: right;
}

/* ── PRONTUÁRIO ───────────────────────────────────────────────────────── */
.prontuario-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.pron-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--cream-3);
}
.pron-card.full { grid-column: span 2; }
.pron-card-title {
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-dark);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--cream-2);
}
.pron-row {
  display: flex; align-items: flex-start;
  padding: 5px 0;
  border-bottom: 1px solid var(--cream-2);
  gap: 8px;
}
.pron-row:last-child { border-bottom: none; }
.pron-label {
  font-size: 11px;
  color: var(--text-tertiary);
  min-width: 110px;
  flex-shrink: 0;
}
.pron-value {
  font-size: 12px;
  color: var(--text-primary);
  flex: 1;
}
.pron-empty {
  font-size: 12px;
  color: var(--text-tertiary);
  font-style: italic;
  padding: 0.5rem 0;
}
.pron-badge {
  font-size: 10px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 20px;
  margin: 2px;
  display: inline-block;
}
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-neutral { background: var(--cream-2); color: var(--text-secondary); }
.pron-edit-btn {
  font-size: 11px;
  color: var(--gold-dark);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--cream-3);
  transition: all 0.15s;
}
.pron-edit-btn:hover { background: var(--cream-2); }

/* ── EXAMES ───────────────────────────────────────────────────────────── */
.exames-group { margin-bottom: 1.25rem; }
.exames-group-title {
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 0.5rem;
  padding-left: 4px;
}
.exame-card {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--cream-3);
  overflow: hidden;
  margin-bottom: 6px;
}
.exame-row {
  display: flex; align-items: center;
  padding: 10px 14px;
  gap: 10px;
}
.exame-name { font-size: 13px; font-weight: 500; flex: 1; }
.exame-val { font-size: 12px; color: var(--text-secondary); }
.exame-badge {
  font-size: 10px;
  font-weight: 500;
  padding: 2px 9px;
  border-radius: 20px;
}
.badge-otimo { background: var(--success-bg); color: var(--success); }
.badge-subotimo { background: var(--warning-bg); color: var(--warning); }
.badge-deficiente { background: var(--danger-bg); color: var(--danger); }
.badge-pendente { background: var(--cream-2); color: var(--text-tertiary); }
.exame-date { font-size: 11px; color: var(--text-tertiary); }
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-tertiary);
}
.empty-state i { font-size: 2rem; margin-bottom: 0.5rem; display: block; }
.empty-state p { font-size: 13px; }

/* ── CONSULTAS ────────────────────────────────────────────────────────── */
.consulta-card {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--cream-3);
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
}
.consulta-card.pendente-retorno { border-color: #F0C5C0; background: var(--danger-bg); }
.consulta-head {
  display: flex; align-items: center; gap: 9px;
  margin-bottom: 4px;
}
.consulta-title { font-size: 14px; font-weight: 500; flex: 1; }
.consulta-date { font-size: 11px; color: var(--text-tertiary); }
.consulta-date.alert { color: var(--danger); }
.consulta-desc { font-size: 12px; color: var(--text-secondary); margin-bottom: 8px; }
.consulta-actions { display: flex; gap: 7px; flex-wrap: wrap; }
.btn-action {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 20px;
  transition: all 0.15s;
}
.btn-action.primary {
  background: var(--cream-2);
  color: var(--brown);
  border: 1px solid var(--cream-3);
}
.btn-action.primary:hover { background: var(--cream-3); }
.btn-action.danger {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid #F0C5C0;
}

/* ── FAMÍLIA ──────────────────────────────────────────────────────────── */
.familia-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}
.familia-card {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--cream-3);
  padding: 1.25rem;
  cursor: pointer;
  transition: all 0.15s;
}
.familia-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.familia-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--cream-2);
  border: 2px solid var(--cream-3);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Cormorant Garamond', serif;
  font-size: 16px;
  color: var(--brown);
  margin-bottom: 0.75rem;
}
.familia-name { font-size: 14px; font-weight: 500; margin-bottom: 2px; }
.familia-score { font-size: 1.5rem; font-family: 'Cormorant Garamond', serif; font-weight: 300; margin-bottom: 2px; }
.familia-status { font-size: 11px; margin-bottom: 4px; }
.familia-sub { font-size: 10px; color: var(--text-tertiary); }

/* ── MODAL ────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(44,36,22,0.5);
  z-index: 500;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(2px);
}
.modal {
  background: #fff;
  border-radius: var(--radius);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.2s ease;
}
.modal-urgencia { max-width: 400px; }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid var(--cream-3);
}
.modal-header h3 {
  font-size: 1.1rem;
  color: var(--brown-dark);
}
.modal-header button {
  font-size: 18px;
  color: var(--text-tertiary);
  transition: color 0.15s;
}
.modal-header button:hover { color: var(--text-primary); }
.urgencia-header { background: var(--danger-bg); }
.urgencia-header h3 { color: var(--danger); }
.urgencia-header p { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.modal-body { padding: 1.25rem 1.5rem; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--cream-2);
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group.full { grid-column: span 2; }
.form-group label { font-size: 11px; color: var(--text-secondary); }
.upload-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.upload-opt {
  border: 1px solid var(--cream-3);
  border-radius: var(--radius-sm);
  padding: 1rem 0.5rem;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}
.upload-opt:hover { border-color: var(--gold); background: var(--cream-2); }
.upload-opt i { font-size: 22px; color: var(--text-secondary); }
.upload-opt span { font-size: 12px; font-weight: 500; }
.upload-opt small { font-size: 10px; color: var(--text-tertiary); }
.urg-section { margin-bottom: 1rem; }
.urg-section-title {
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 0.4rem;
}
.urg-value {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.urg-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 20px;
  margin: 2px 3px 2px 0;
}

/* ── ANIMATIONS ───────────────────────────────────────────────────────── */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

/* ── RESPONSIVE ───────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar {
    position: fixed; left: -100%; top: 0; bottom: 0;
    z-index: 300;
    transition: left 0.25s ease;
  }
  .sidebar.open { left: 0; }
  .hamburger { display: flex; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .score-card { grid-row: span 1; }
  .prontuario-grid { grid-template-columns: 1fr; }
  .pron-card.full { grid-column: span 1; }
}

/* ── PRONTUÁRIO EDIÇÃO ─────────────────────────────────────────────── */
.pron-card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--cream-2);
}
.pron-card-title { margin-bottom: 0; border-bottom: none; padding-bottom: 0; }
.pron-row-item { align-items: center; gap: 6px; flex-wrap: wrap; }
.pron-freq { font-size: 11px; color: var(--text-tertiary); }
.pron-delete-btn {
  width: 26px; height: 26px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  color: var(--text-tertiary);
  transition: all 0.15s;
  flex-shrink: 0;
}
.pron-delete-btn:hover { background: var(--danger-bg); color: var(--danger); }
.badge-neutral { background: var(--cream-2); color: var(--text-secondary); }

/* ── EXAME CARD HEADER ─────────────────────────────────────────────── */
.exame-card-header {
  padding: 8px 14px 6px;
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  border-bottom: 1px solid var(--cream-2);
}

/* ── AVATAR FIGURE ─────────────────────────────────────────────────── */
.avatar-figure {
  width: 80px;
  height: 180px;
  margin: 0 auto 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
@keyframes avatarFloat {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
}

/* ── RODAPÉ ÂNCORA ─────────────────────────────────────────────────── */
.footer-mantra {
  flex-shrink: 0;
  padding: 8px 1.5rem;
  background: var(--brown-dark);
  border-top: 1px solid rgba(180,168,130,0.15);
  text-align: center;
  font-family: 'Cormorant Garamond', serif;
  font-size: 13px;
  color: rgba(180,168,130,0.6);
  letter-spacing: 0.02em;
}
.footer-mantra em { font-style: italic; color: rgba(180,168,130,0.8); }

/* ── EXAMES — valores de referência ───────────────────────────────── */
.exame-refs {
  display: flex;
  gap: 8px;
  padding: 6px 14px 8px;
  background: var(--cream);
  border-top: 0.5px solid var(--cream-2);
  flex-wrap: wrap;
}
.ref-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
}
.ref-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ref-label { color: var(--text-tertiary); }
.ref-val { font-weight: 500; color: var(--text-secondary); }

/* ── ABA GENÉTICA ──────────────────────────────────────────────────── */
.genetica-header {
  background: var(--brown-dark);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  color: var(--cream);
}
.genetica-header-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  color: var(--gold-light);
  margin-bottom: 4px;
}
.genetica-header-sub { font-size: 12px; color: rgba(250,248,244,0.5); }
.genetico-card {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--cream-3);
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.genetico-impact {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 500;
  flex-shrink: 0;
  text-align: center;
  line-height: 1.2;
}
.impact-alto { background: var(--danger-bg); color: var(--danger); }
.impact-medio_alto { background: var(--warning-bg); color: var(--warning); }
.impact-medio { background: var(--info-bg); color: var(--info); }
.impact-baixo { background: var(--cream-2); color: var(--text-tertiary); }
.genetico-body { flex: 1; }
.genetico-gene { font-size: 13px; font-weight: 500; color: var(--text-primary); margin-bottom: 2px; }
.genetico-variante { font-size: 11px; color: var(--text-tertiary); margin-bottom: 4px; }
.genetico-impl { font-size: 12px; color: var(--text-secondary); line-height: 1.5; margin-bottom: 4px; }
.genetico-acao {
  font-size: 11px;
  color: var(--success);
  background: var(--success-bg);
  padding: 2px 8px;
  border-radius: 20px;
  display: inline-block;
}
.genetico-sistema {
  font-size: 10px;
  color: var(--text-tertiary);
  background: var(--cream-2);
  padding: 2px 7px;
  border-radius: 20px;
  margin-left: 6px;
}

/* ── ALERGIA TIPOS ──────────────────────────────────────────────────── */
.badge-genetico { background: #EEEDFE; color: #3C3489; }

/* ── REVISÃO DE LAUDO ──────────────────────────────────────────────── */
.modal-wide { max-width: 780px; }
.revisao-table-header {
  display: grid;
  grid-template-columns: 2fr 1.5fr 1.2fr 1.2fr 1.2fr 28px;
  gap: 6px;
  padding: 6px 4px;
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  border-bottom: 1px solid var(--cream-2);
  margin-bottom: 4px;
}
.revisao-row {
  display: grid;
  grid-template-columns: 2fr 1.5fr 1.2fr 1.2fr 1.2fr 28px;
  gap: 6px;
  padding: 5px 4px;
  border-bottom: 0.5px solid var(--cream-2);
  align-items: center;
}
.revisao-row input, .revisao-row select {
  padding: 4px 8px;
  font-size: 12px;
  border-radius: 6px;
  width: 100%;
}
.revisao-vals { display: flex; gap: 4px; }
.revisao-vals input { flex: 1; }

/* ── TOAST ─────────────────────────────────────────────────────────── */
#abs-toast { pointer-events: none; }

/* ── SPIN ──────────────────────────────────────────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }
.ti-spin { animation: spin 1s linear infinite; display: inline-block; }

/* ── EXAME DETALHE ─────────────────────────────────────────────────── */
.exame-detail {
  padding: 8px 14px 10px;
  background: var(--cream);
  border-top: 0.5px solid var(--cream-2);
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}
.exame-ref-box {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.exame-ref-label {
  font-size: 9px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
}
.exame-ref-value {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
}
.exame-ref-value.sens { color: var(--gold-dark); }
.exame-ref-value.atual { color: var(--text-primary); }

/* ── ITEM ACTIONS (editar + apagar) ───────────────────────────────── */
.item-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  margin-left: auto;
}
.pron-action-btn {
  width: 26px; height: 26px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  color: var(--text-tertiary);
  transition: all 0.15s;
}
.pron-action-btn.edit:hover  { background: var(--info-bg);   color: var(--info);   }
.pron-action-btn.delete:hover{ background: var(--danger-bg); color: var(--danger); }

/* ── REVISÃO GENÉTICA ──────────────────────────────────────────────── */
.revisao-gen-card {
  background: var(--cream);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 8px;
  border: 0.5px solid var(--cream-3);
}
.revisao-gen-card .form-group label {
  font-size: 10px;
  color: var(--text-tertiary);
}

/* ── HEADER MEMBRO ─────────────────────────────────────────────────── */
.header-member-display {
  display: flex; align-items: center; gap: 10px; flex: 1;
}
.header-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--gold); color: var(--brown-dark);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 500; flex-shrink: 0;
}
.header-member-name {
  font-size: 14px; font-weight: 500; color: var(--text-primary); line-height: 1.2;
}
.header-view-name {
  font-size: 11px; color: var(--text-tertiary);
}

/* ── NAV LABEL MEMBRO ──────────────────────────────────────────────── */
.nav-divider {
  height: 0.5px; background: rgba(180,168,130,0.15);
  margin: 0.5rem 1.25rem;
}
.sidebar-bottom {
  padding: 0.5rem 0.75rem 0.75rem;
  display: flex; flex-direction: column; gap: 4px;
}
.sidebar-sync {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: rgba(250,248,244,0.5);
  cursor: pointer;
  transition: all 0.15s;
}
.sidebar-sync:hover { background: rgba(180,168,130,0.1); color: var(--gold-light); }

/* ── FAMÍLIA — TIME DE SAÚDE ───────────────────────────────────────── */
.team-score-geral {
  background: var(--brown-dark);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  display: flex; align-items: center; gap: 1.5rem;
}
.team-score-num {
  font-family: 'Cormorant Garamond', serif;
  font-size: 3rem; font-weight: 300;
  color: #fff; line-height: 1;
}
.team-score-info { flex: 1; }
.team-score-label {
  font-size: 9px; letter-spacing: 0.15em;
  text-transform: uppercase; color: var(--gold); margin-bottom: 4px;
}
.team-score-status {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem; color: var(--gold-light); margin-bottom: 4px;
}
.team-score-sub { font-size: 11px; color: rgba(250,248,244,0.4); }
.team-avatares {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
}
.team-member-card {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--cream-3);
  padding: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
}
.team-member-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.team-avatar-wrap {
  width: 70px; height: 140px;
  margin-bottom: 0.75rem;
}
.team-member-nome { font-size: 13px; font-weight: 500; margin-bottom: 3px; }
.team-member-score {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2rem; font-weight: 300; line-height: 1; margin-bottom: 3px;
}
.team-member-status { font-size: 11px; margin-bottom: 6px; }
.team-member-missoes {
  font-size: 10px; color: var(--text-tertiary);
  background: var(--cream-2); padding: 2px 8px; border-radius: 20px;
}

/* ── CHAT ──────────────────────────────────────────────────────────── */
.chat-container {
  display: flex; flex-direction: column;
  height: calc(100vh - 200px);
  background: #fff; border-radius: var(--radius);
  border: 1px solid var(--cream-3); overflow: hidden;
}
.chat-mensagens {
  flex: 1; overflow-y: auto;
  padding: 1.25rem; display: flex; flex-direction: column; gap: 10px;
}
.chat-empty {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; color: var(--text-tertiary);
  font-size: 13px; padding: 2rem;
}
.chat-sugestoes {
  display: flex; flex-wrap: wrap; gap: 6px; justify-content: center;
  margin-top: 1rem;
}
.chat-sugestoes button {
  background: var(--cream-2); border: 0.5px solid var(--cream-3);
  border-radius: 20px; padding: 5px 12px; font-size: 12px;
  color: var(--text-secondary); cursor: pointer; transition: all 0.15s;
}
.chat-sugestoes button:hover { background: var(--cream-3); color: var(--text-primary); }
.chat-msg {
  max-width: 80%; padding: 10px 14px;
  border-radius: var(--radius); font-size: 13px; line-height: 1.6;
}
.chat-msg-user {
  background: var(--brown-dark); color: var(--cream);
  align-self: flex-end; border-radius: var(--radius) var(--radius) 4px var(--radius);
}
.chat-msg-assistant {
  background: var(--cream-2); color: var(--text-primary);
  align-self: flex-start; border-radius: var(--radius) var(--radius) var(--radius) 4px;
}
.chat-typing {
  padding: 0.75rem 1.25rem; display: flex; gap: 4px; align-items: center;
}
.chat-typing span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--text-tertiary); animation: chatBounce 1.2s infinite;
}
.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes chatBounce { 0%,80%,100% { transform: translateY(0); } 40% { transform: translateY(-6px); } }
.chat-input-wrap {
  display: flex; gap: 8px; padding: 0.75rem 1rem;
  border-top: 1px solid var(--cream-2);
}
.chat-input-wrap input { flex: 1; border-radius: 40px; padding: 8px 16px; }

/* ── SELOS ──────────────────────────────────────────────────────────── */
.selos-card, .evolucao-card {
  background: #fff; border-radius: var(--radius);
  border: 1px solid var(--cream-3); padding: 1.25rem 1.5rem;
  grid-column: span 2;
}
.selo-item {
  display: flex; flex-direction: column; align-items: center;
  gap: 4px; padding: 8px 10px;
  border-radius: var(--border-radius-md, 8px);
  min-width: 72px; position: relative;
}
.selo-item.conquistado { background: #fff; border: 1px solid var(--cream-3); }
.selo-item.bloqueado { opacity: 0.28; background: var(--cream-2); border: 1px solid var(--cream-2); }
.selo-icon { font-size: 20px; position: relative; }
.selo-nome { font-size: 10px; color: var(--text-secondary); text-align: center; line-height: 1.3; }
.selo-data { font-size: 9px; color: var(--text-tertiary); }
.selo-vencendo {
  position: absolute; top: -4px; right: -4px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--danger); color: white;
  font-size: 8px; font-weight: bold;
  display: flex; align-items: center; justify-content: center;
}

/* ── BIOIMPEDÂNCIA ──────────────────────────────────────────────────── */
.bio-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1rem;
}
.bio-title {
  font-size: 9px; font-weight: 500; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--gold-dark);
}
.bio-chart { margin-bottom: 1rem; background: var(--cream); border-radius: var(--radius-sm); padding: 0.5rem; }
.bio-atual { margin-bottom: 1rem; }
.bio-atual-label { font-size: 10px; color: var(--text-tertiary); margin-bottom: 8px; }
.bio-vals-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.bio-val-box {
  background: var(--cream-2); border-radius: var(--radius-sm);
  padding: 10px 12px; display: flex; flex-direction: column; gap: 2px;
}
.bio-val-label { font-size: 10px; color: var(--text-tertiary); }
.bio-val-num { font-family: 'Cormorant Garamond', serif; font-size: 1.5rem; font-weight: 300; color: var(--text-primary); }
.bio-val-unit { font-size: 10px; color: var(--text-tertiary); }
.bio-hist-label { font-size: 10px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-tertiary); margin-bottom: 6px; }
.bio-hist-table { border: 1px solid var(--cream-3); border-radius: var(--radius-sm); overflow: hidden; }
.bio-hist-header {
  display: grid; grid-template-columns: 1fr 1fr 1fr 1fr 1fr 32px;
  background: var(--cream-2); padding: 6px 10px;
  font-size: 10px; font-weight: 500; color: var(--text-tertiary);
}
.bio-hist-row {
  display: grid; grid-template-columns: 1fr 1fr 1fr 1fr 1fr 32px;
  padding: 7px 10px; font-size: 12px; color: var(--text-secondary);
  border-top: 0.5px solid var(--cream-2); align-items: center;
}

/* ── GESTAÇÃO ───────────────────────────────────────────────────────── */
.gest-header {
  background: linear-gradient(135deg, var(--brown-dark), #5A3D28);
  border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: 1rem;
}
.gest-title { font-family: 'Cormorant Garamond', serif; font-size: 1.1rem; color: var(--gold-light); margin-bottom: 3px; }
.gest-sub { font-size: 11px; color: rgba(250,248,244,0.5); }
.gest-section { background: #fff; border-radius: var(--radius); border: 1px solid var(--cream-3); padding: 1rem 1.25rem; margin-bottom: 0.75rem; }
.gest-section-title { font-size: 9px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.1em; color: var(--gold-dark); }

/* ── GOOGLE LOGIN ───────────────────────────────────────────────────── */
.google-login-btn {
  display: inline-flex; align-items: center;
  background: white; color: #3c4043;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 40px; padding: 10px 20px;
  font-size: 14px; font-weight: 500;
  cursor: pointer; transition: all 0.15s;
}
.google-login-btn:hover { background: #f8f9fa; transform: translateY(-1px); }
.google-logged {
  display: flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 40px; padding: 6px 14px;
  font-size: 12px; color: rgba(250,248,244,0.7);
}
.btn-sm { padding: 6px 12px; font-size: 12px; }
