/* ==========================================================================
   HISTIA HEALTHTECH V2.0 — CLINICAL ENTERPRISE DESIGN SYSTEM
   Réplica Exata da Interface de Painel Médico de Saúde
   ========================================================================== */

:root {
  /* Design System Majenta Marketing & Saúde */
  --bg-deep: #f8fafc;           /* Fundo Slate-50 */
  --border-color: #e2e8f0;       /* Slate-200 */
  --border-light: #f1f5f9;       /* Slate-100 */
  
  --color-majenta-pink: #e60067;        /* Rosa Majenta Vibrante */
  --color-majenta-purple: #7c3aed;      /* Roxo Majenta */
  --color-majenta-dark: #0f1c1a;        /* Grafite Majenta */
  --color-majenta-gradient: linear-gradient(90deg, #e60067 0%, #7c3aed 100%);
  --color-majenta-btn-grad: linear-gradient(90deg, #e60067 0%, #c90059 100%);
  
  --color-primary-blue: #e60067;        /* Usando Majenta como Primária */
  --color-primary-blue-hover: #c90059;  /* Majenta Dark Hover */
  --color-primary-blue-bg: rgba(230, 0, 103, 0.08); /* Majenta Soft Background */
  --color-primary-dark: #0f1c1a;
  
  /* Cores de status diagnóstico sóbrias */
  --color-alert-green: #10b981;         /* Estável / Emerald-500 */
  --color-alert-green-bg: #ecfdf5;      /* Emerald-50 */
  
  --color-alert-orange: #f59e0b;        /* Atenção / Amber-500 */
  --color-alert-orange-bg: #fffbeb;     /* Amber-50 */
  
  --color-alert-red: #ef4444;           /* Crítico / Red-500 */
  --color-alert-red-bg: #fef2f2;        /* Red-50 */
  
  --text-primary: #334155;              /* Slate-700 */
  --text-secondary: #64748b;            /* Slate-500 */
  --text-muted: #94a3b8;                /* Slate-400 */
  
  /* Tipografia */
  --font-family: 'Outfit', 'Inter', sans-serif;
  
  /* Transições e Efeitos */
  --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --soft-shadow: 0 1px 3px rgba(15, 23, 42, 0.03), 0 1px 2px rgba(15, 23, 42, 0.02);
  --card-shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.03), 0 2px 4px -1px rgba(15, 23, 42, 0.02);
  --deep-shadow: 0 10px 15px -3px rgba(15, 23, 42, 0.04), 0 4px 6px -4px rgba(15, 23, 42, 0.02);
}



/* Animação do Logo Heartbeat */
@keyframes HISTIAHeartbeat {
  0% {
    transform: scale(1);
    filter: drop-shadow(0 0 0px rgba(236, 0, 108, 0));
  }
  12% {
    transform: scale(1.15);
    filter: drop-shadow(0 0 8px rgba(236, 0, 108, 0.6));
  }
  24% {
    transform: scale(1);
    filter: drop-shadow(0 0 2px rgba(236, 0, 108, 0.2));
  }
  36% {
    transform: scale(1.10);
    filter: drop-shadow(0 0 6px rgba(236, 0, 108, 0.4));
  }
  60% {
    transform: scale(1);
    filter: drop-shadow(0 0 0px rgba(236, 0, 108, 0));
  }
  100% {
    transform: scale(1);
    filter: drop-shadow(0 0 0px rgba(236, 0, 108, 0));
  }
}

.logo-icon-svg {
  animation: HISTIAHeartbeat 2.8s ease-in-out infinite;
  transform-origin: center;
  flex-shrink: 0;
}

/* Estilos do Botão Alternador de Tema */
.theme-toggle-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: #ffffff;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.theme-toggle-btn:hover {
  background: var(--color-primary-blue-bg);
  border-color: var(--color-primary-blue);
  color: var(--color-primary-blue);
}

/* Reset e Configurações Globais */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--bg-deep);
  /* Textura de Fundo do Lab desfocado */
  background-image: linear-gradient(rgba(248, 250, 252, 0.98), rgba(248, 250, 252, 0.98)), url('assets/medical_lab_blur.png');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: var(--font-family);
  height: 100vh;
  overflow: hidden;
  display: flex;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* ==========================================================================
   ESTRUTURA GERAL DO LAYOUT
   ========================================================================== */

.hud-container {
  display: flex;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

/* 1. BARRA LATERAL (SIDEBAR) */
.hud-sidebar {
  width: 280px;
  height: 100vh;
  background: #ffffff;
  border-right: 1px solid var(--border-color);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-shrink: 0;
  z-index: 10;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 30px;
  max-width: 100%;
  overflow: hidden;
}

.sidebar-logo-icon {
  max-width: 175px !important;
  width: 100% !important;
  height: auto !important;
  max-height: 46px !important;
  object-fit: contain !important;
  display: block !important;
}

.logo-badge {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(236, 0, 108, 0.12) 0%, rgba(236, 0, 108, 0.04) 100%);
  border: 1px solid rgba(236, 0, 108, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary-blue);
  box-shadow: 0 4px 14px rgba(236, 0, 108, 0.15);
  transition: var(--transition-normal);
  flex-shrink: 0;
}

.logo-badge:hover {
  border-color: rgba(236, 0, 108, 0.5);
  box-shadow: 0 6px 20px rgba(236, 0, 108, 0.28);
}

.logo-text h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--color-primary-dark);
  line-height: 1.1;
}

.logo-text .sub-logo {
  font-size: 0.65rem;
  color: var(--text-secondary);
  font-weight: 500;
  letter-spacing: 0.5px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-grow: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 10px 14px;
  border-radius: 6px;
  border-left: 3px solid transparent;
  transition: var(--transition-fast);
}

.nav-icon {
  width: 18px;
  height: 18px;
  stroke: currentColor;
}

.nav-item:hover {
  color: var(--color-primary-blue);
  background: rgba(37, 99, 235, 0.04);
}

.nav-item.active {
  color: var(--color-primary-blue);
  background: rgba(37, 99, 235, 0.06);
  border-left-color: var(--color-primary-blue);
  font-weight: 600;
}

/* Card IA Clínica no rodapé da Sidebar */
.sidebar-ia-card {
  background: var(--bg-deep);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 20px;
}

.ia-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.ia-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--color-primary-dark);
}

.ia-badge-alive {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--color-alert-green);
  background: var(--color-alert-green-bg);
  padding: 2px 8px;
  border-radius: 10px;
}

.ia-dot {
  width: 5px;
  height: 5px;
  background-color: var(--color-alert-green);
  border-radius: 50%;
}

.ia-card-detail {
  font-size: 0.68rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.ia-card-confidence {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  color: var(--text-primary);
  font-weight: 600;
  margin-bottom: 8px;
}

.ia-card-confidence .conf-val {
  color: var(--color-primary-blue);
}

.ia-card-footer {
  font-size: 0.65rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.footer-dot {
  width: 5px;
  height: 5px;
  background-color: var(--color-alert-green);
  border-radius: 50%;
}

.footer-copyright {
  font-size: 0.65rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* 2. AREA PRINCIPAL (HEADER + VIEWPORT) */
.hud-main-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  padding: 20px 24px;
}

/* ==========================================================================
   HISTIA EXECUTIVE HEALTH-TECH HEADER (CX/UX REDESIGN)
   ========================================================================== */
.hud-header {
  height: 54px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 16px;
  box-shadow: 0 4px 16px -2px rgba(0, 0, 0, 0.04), 0 2px 6px -1px rgba(0, 0, 0, 0.02);
  flex-shrink: 0;
  width: 100%;
  box-sizing: border-box;
}

/* 1. Breadcrumbs */
.breadcrumbs-area {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  flex-shrink: 0;
}

.crumb-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: linear-gradient(135deg, rgba(236, 30, 130, 0.08), rgba(79, 70, 229, 0.08));
  color: #ec1e82;
  flex-shrink: 0;
}

.crumb-parent {
  color: #64748b;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.crumb-separator {
  color: #cbd5e1;
  font-weight: 400;
}

.crumb-active {
  color: #0f172a;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* 2. Barra de Busca Inteligente */
.search-box-wrapper {
  position: relative;
  flex: 0 1 160px;
  min-width: 90px;
  max-width: 180px;
}

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
  transition: color 0.2s ease;
}

.search-input {
  width: 100%;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  padding: 6px 36px 6px 30px;
  border-radius: 10px;
  outline: none;
  font-family: inherit;
  font-size: 0.78rem;
  color: #1e293b;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.search-input::placeholder {
  color: #94a3b8;
  font-size: 0.75rem;
}

.search-input:focus {
  background: #ffffff;
  border-color: #ec1e82;
  box-shadow: 0 0 0 2.5px rgba(236, 30, 130, 0.12);
}

.search-box-wrapper:focus-within .search-icon {
  color: #ec1e82;
}

.search-shortcut {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #64748b;
  border-radius: 4px;
  padding: 1px 4px;
  font-size: 0.62rem;
  font-weight: 600;
  font-family: monospace;
  pointer-events: none;
}

/* 3. Ações do Header (Direita) */
.sys-meta-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: auto;
}

/* Botão Upload Exames */
.header-upload-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  background: linear-gradient(135deg, #ec1e82 0%, #d81b60 50%, #4338ca 100%);
  color: #ffffff !important;
  padding: 0 14px;
  border-radius: 18px;
  font-size: 0.76rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(236, 30, 130, 0.25);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-sizing: border-box;
}

.header-upload-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(236, 30, 130, 0.38);
}

/* Botão Acesso Médico */
.header-share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  background: #ffffff;
  color: #334155;
  border: 1.5px solid #e2e8f0;
  padding: 0 13px;
  border-radius: 18px;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  box-sizing: border-box;
}

.header-share-btn svg {
  color: #ec1e82;
  transition: transform 0.2s ease;
}

.header-share-btn:hover {
  background: #fdf2f8;
  border-color: #fbcfe8;
  color: #be185d;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(236, 72, 153, 0.12);
}

/* Botão Notificações */
.notification-bell-btn {
  position: relative;
  width: 36px;
  height: 36px;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 18px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  color: #64748b;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
  box-sizing: border-box;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.notification-bell-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a;
  transform: translateY(-1px);
}

.bell-count-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #ffffff;
  font-size: 0.60rem;
  font-weight: 800;
  min-width: 14px;
  height: 14px;
  border-radius: 7px;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 1.5px solid #ffffff;
  padding: 0 2px;
}

/* 4. Container de Perfil & Logout */
.header-auth-container {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.header-user-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  padding: 0 10px 0 4px;
  border-radius: 18px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-sizing: border-box;
}

.user-avatar-initials {
  width: 26px;
  height: 26px;
  border-radius: 13px;
  background: linear-gradient(135deg, #ec1e82 0%, #6366f1 100%);
  color: #ffffff;
  font-size: 0.70rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.user-meta-details {
  display: flex;
  align-items: center;
  gap: 5px;
  line-height: 1.2;
}

.user-name-text {
  font-size: 0.78rem;
  font-weight: 700;
  color: #0f172a;
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-chip-role {
  font-size: 0.60rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 5px;
  border-radius: 5px;
}

.user-chip-role.admin {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.user-chip-role.patient {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

/* Botão Sair (Logout) */
.header-logout-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  color: #475569;
  padding: 0 13px;
  border-radius: 18px;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
  box-sizing: border-box;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.header-logout-btn svg {
  color: #64748b;
  transition: transform 0.2s ease, color 0.2s ease;
}

.header-logout-btn:hover {
  background: #fff1f2;
  border-color: #fecdd3;
  color: #e11d48;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(225, 29, 72, 0.12);
}

.header-logout-btn:hover svg {
  color: #e11d48;
}

.doctor-profile-info {
  display: flex;
  flex-direction: column;
}

.doc-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-primary-dark);
}

.doc-role {
  font-size: 0.65rem;
  color: var(--text-secondary);
}

.chevron-down-icon {
  color: var(--text-secondary);
  margin-left: 4px;
}

/* 3. VIEWPORT DE CONTEÚDO */
.hud-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
}

.hud-content::-webkit-scrollbar {
  width: 5px;
}
.hud-content::-webkit-scrollbar-track {
  background: transparent;
}
.hud-content::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

/* ==========================================================================
   CARDS DE PAINEL CLINICO (DASHBOARD)
   ========================================================================== */

/* Paciente Header Card (Fiel ao mock) */
.patient-header-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  box-shadow: var(--soft-shadow);
}

.patient-info-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.patient-avatar-img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-color);
}

.patient-meta-text {
  display: flex;
  flex-direction: column;
}

.patient-meta-text h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-primary-dark);
}

.patient-details-sub {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Colunas de Acompanhamento no Cabeçalho */
.patient-status-cols {
  display: flex;
  gap: 40px;
}

.status-col {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.col-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.col-value-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-primary-dark);
  margin-top: 4px;
}

.col-value-badge .badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.col-value-badge .badge-dot.normal { background-color: var(--color-alert-green); }
.col-value-badge .badge-dot.critico { background-color: var(--color-alert-red); }

.col-subtext {
  font-size: 0.68rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.patient-action-right .btn-report {
  background: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
  transition: var(--transition-fast);
}

.patient-action-right .btn-report:hover {
  background: var(--border-light);
  border-color: #cbd5e1;
}

/* ==========================================================================
   DASHBOARD GRID E MONITORES INTERATIVOS
   ========================================================================== */

.dashboard-split-grid {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 20px;
  align-items: start;
}

.dashboard-split-grid > * {
  min-width: 0;
}

@media (max-width: 1024px) {
  .dashboard-split-grid {
    grid-template-columns: 1fr;
  }
}

.clinical-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 24px;
  box-shadow: var(--soft-shadow);
  position: relative;
}

.clinical-card-header {
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 12px;
  margin-bottom: 18px;
}

.clinical-card-header h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-primary-dark);
}

.clinical-card-header .card-subtitle {
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Área de Mapa Anatômico */
.anatomy-monitor-layout {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 500px;
  position: relative;
}

/* Sistemas Clínicos (Lista Esquerda) */
.systems-selector-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 170px;
  z-index: 5;
}

.system-select-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.system-select-row:hover {
  background: var(--border-light);
}

.system-select-row.active {
  background: var(--color-primary-blue-bg);
}

.system-icon-wrapper {
  width: 28px;
  height: 28px;
  background: #f1f5f9;
  border-radius: 6px;
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--text-secondary);
}

.system-select-row.active .system-icon-wrapper {
  background: #ffffff;
  color: var(--color-primary-blue);
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.1);
}

.sys-info-meta {
  display: flex;
  flex-direction: column;
}

.dashed-connector {
  flex: 1;
  height: 1px;
  background-image: linear-gradient(to right, var(--color-majenta-pink) 50%, transparent 50%);
  background-size: 8px 1px;
  background-repeat: repeat-x;
  margin-left: 10px;
  opacity: 0.3;
  animation: dashScroll 2s linear infinite;
}

.system-select-row:hover .dashed-connector,
.system-select-row.active .dashed-connector {
  opacity: 0.8;
  animation: dashScroll 1s linear infinite;
}

@keyframes dashScroll {
  to { background-position: -40px 0; }
}

.sys-name-lbl {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-primary-dark);
  display: flex;
  align-items: center;
  gap: 6px;
}

.sys-dot-indicator {
  width: 5px;
  height: 5px;
  border-radius: 50%;
}
.sys-dot-indicator.normal { background-color: var(--color-alert-green); }
.sys-dot-indicator.atencao { background-color: var(--color-alert-orange); }
.sys-dot-indicator.critico { background-color: var(--color-alert-red); }

.sys-status-lbl {
  font-size: 0.65rem;
  color: var(--text-secondary);
  margin-top: 1px;
}

/* Imagem Central Anatômica do Corpo */
.human-anatomy-wrapper {
  position: relative;
  flex: 1;
  min-height: 500px;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Círculos Concêntricos de Fundo */
.pulse-rings-wrapper {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 200px;
  height: 200px;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1;
  pointer-events: none;
}

.pulse-ring-circ {
  position: absolute;
  border: 1px solid rgba(37, 99, 235, 0.08); /* Tom azul sutil */
  border-radius: 50%;
  box-sizing: border-box;
}

.human-anatomy-bg {
  height: 290px;
  width: auto;
  opacity: 0.95;
  position: absolute;
  z-index: 1;
}

/* Linhas e Conectores de Hotspots */
.hud-line-connector {
  stroke: var(--text-muted);
  stroke-width: 1px;
  opacity: 0.35;
}
.hud-line-connector.alert {
  stroke: var(--color-alert-red);
  opacity: 0.65;
}

.hud-callout-text {
  font-family: var(--font-family);
  font-size: 0.68rem;
  font-weight: 600;
  fill: var(--text-secondary);
}
.hud-callout-text.alert {
  fill: var(--color-alert-red);
}

/* Radar Nodes */
.radar-node {
  r: 4.5px;
  stroke: #ffffff;
  stroke-width: 1.5;
  transition: var(--transition-fast);
}
.radar-node.normal { fill: var(--color-alert-green); }
.radar-node.alert {
  fill: var(--color-alert-red);
  animation: radarSoftPulse 2s infinite ease-in-out;
}

@keyframes radarSoftPulse {
  0%, 100% { r: 4px; fill-opacity: 0.7; }
  50% { r: 6.5px; fill-opacity: 1; }
}

/* Overlay Card à Direita (Análise por IA) */
.ia-insights-floating-card {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 140px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px;
  box-shadow: var(--deep-shadow);
  z-index: 5;
}

.floating-ia-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--color-primary-blue);
  margin-bottom: 6px;
}

.floating-ia-desc {
  font-size: 0.65rem;
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: 8px;
}

.floating-ia-link {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--color-primary-blue);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Barra Flutuante de Ferramentas / Camadas */
.anatomy-layers-bar {
  position: absolute;
  right: 10px;
  bottom: 50px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: var(--soft-shadow);
  z-index: 5;
}

.layer-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.layer-btn:hover {
  background: var(--border-light);
  color: var(--color-primary-blue);
}

.layer-btn.active {
  background: var(--color-primary-blue-bg);
  color: var(--color-primary-blue);
}

.btn-rotate-hologram {
  position: absolute;
  right: 10px;
  bottom: 10px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-family: var(--font-family);
  font-size: 0.68rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: var(--soft-shadow);
  z-index: 5;
}

.btn-rotate-hologram:hover {
  background: var(--border-light);
}

/* Sinais Vitais Card */
.vitals-grid-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-top: 15px;
}

.vital-metric-block {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: var(--soft-shadow);
}

.vital-header-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.vital-icon-container {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: flex;
  justify-content: center;
  align-items: center;
}
/* Cores do ícone conforme mock */
.vital-metric-block:nth-child(1) .vital-icon-container { background: #fef2f2; color: #ef4444; }
.vital-metric-block:nth-child(2) .vital-icon-container { background: #fffbeb; color: #f59e0b; }
.vital-metric-block:nth-child(3) .vital-icon-container { background: #eff6ff; color: #2563eb; }
.vital-metric-block:nth-child(4) .vital-icon-container { background: #fff7ed; color: #ea580c; }
.vital-metric-block:nth-child(5) .vital-icon-container { background: #f0fdf4; color: #16a34a; }

.vital-lbl-name {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.vital-value-text {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  margin-top: 10px;
}

.vital-status-badge {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--color-alert-green);
  margin-top: 4px;
}
.vital-metric-block.alert .vital-status-badge {
  color: var(--color-alert-red);
}

/* ==========================================================================
   PAINEL CLÍNICO IA & BIOMARCADORES (COLUNA DIREITA)
   ========================================================================== */

.clinical-ia-summary-card {
  background: var(--color-primary-blue-bg);
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 16px;
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.summary-check-icon {
  color: var(--color-primary-blue);
  flex-shrink: 0;
}

.summary-details-txt {
  display: flex;
  flex-direction: column;
}

.summary-details-txt h4 {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--color-primary-blue);
}

.summary-details-txt p {
  font-size: 0.75rem;
  color: var(--color-primary-dark);
  line-height: 1.45;
  margin-top: 4px;
  font-weight: 400;
}

/* Trilogia de Métricas Clínicas */
.clinical-triad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.triad-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px;
  text-align: center;
}

.triad-lbl {
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

.triad-val {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  margin-top: 6px;
}
.triad-card.alert .triad-val {
  color: var(--color-alert-red);
}

/* Lista de Biomarcadores com Sparklines */
.biomarkers-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.biomarkers-header-row h3 {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-primary-dark);
}

.biomarkers-header-row .link-all {
  font-size: 0.72rem;
  color: var(--color-primary-blue);
  text-decoration: none;
  font-weight: 600;
}

.biomarkers-clinical-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.biomarker-clinical-row {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition-fast);
}

.biomarker-clinical-row:hover {
  border-color: #cbd5e1;
  background: var(--bg-deep);
}

.biomarker-info-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 140px;
}

.biomarker-icon-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.biomarker-icon-dot.normal { background-color: var(--color-alert-green); }
.biomarker-icon-dot.critico { background-color: var(--color-alert-red); }

.biomarker-meta-lbl {
  display: flex;
  flex-direction: column;
}

.biomarker-name-lbl {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-primary-dark);
}

.biomarker-ref-lbl {
  font-size: 0.65rem;
  color: var(--text-secondary);
  margin-top: 1px;
}

/* Gráfico Sparkline */
.biomarker-sparkline-cell {
  flex-grow: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  max-width: 90px;
}

.sparkline-svg {
  width: 80px;
  height: 20px;
}

.sparkline-line {
  fill: none;
  stroke: var(--color-alert-green);
  stroke-width: 1.5;
  stroke-linecap: round;
}
.sparkline-line.critico {
  stroke: var(--color-alert-red);
}

.biomarker-value-cell {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  width: 85px;
}

.biomarker-num-val {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-primary-dark);
}

.biomarker-badge-lbl {
  font-size: 0.62rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 10px;
  margin-top: 2px;
  display: inline-block;
}
.biomarker-badge-lbl.normal {
  background: var(--color-alert-green-bg);
  color: var(--color-alert-green);
}
.biomarker-badge-lbl.critico {
  background: var(--color-alert-red-bg);
  color: var(--color-alert-red);
}

.biomarker-footer-synced {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* ==========================================================================
   ELEMENTOS ADICIONAIS DO PAINEL GERAL (SEGUNDA SEÇÃO)
   ========================================================================== */

/* Grade Visão Geral de Saúde */
.systems-overview-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 15px;
}

@media (max-width: 768px) {
  .systems-overview-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.overview-system-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: var(--soft-shadow);
  transition: var(--transition-fast);
}
.overview-system-card:hover {
  border-color: #cbd5e1;
  background: var(--bg-deep);
}

.system-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.sys-icon-circle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--border-light);
  color: var(--text-secondary);
  display: flex;
  justify-content: center;
  align-items: center;
}
/* Estilo de cores dos ícones da visão geral */
.overview-system-card:nth-child(1) .sys-icon-circle { background: #eff6ff; color: #2563eb; }
.overview-system-card:nth-child(2) .sys-icon-circle { background: #fef2f2; color: #ef4444; }
.overview-system-card:nth-child(3) .sys-icon-circle { background: #f1f5f9; color: #64748b; }
.overview-system-card:nth-child(4) .sys-icon-circle { background: #eff6ff; color: #1e3a8a; }
.overview-system-card:nth-child(5) .sys-icon-circle { background: #fff7ed; color: #ea580c; }
.overview-system-card:nth-child(6) .sys-icon-circle { background: #e0f2fe; color: #0284c7; }
.overview-system-card:nth-child(7) .sys-icon-circle { background: #f0fdf4; color: #16a34a; }
.overview-system-card:nth-child(8) .sys-icon-circle { background: #faf5ff; color: #7c3aed; }

.sys-badge {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 10px;
}
.sys-badge.normal { background: var(--color-alert-green-bg); color: var(--color-alert-green); }
.sys-badge.atencao { background: var(--color-alert-orange-bg); color: var(--color-alert-orange); }
.sys-badge.critico { background: var(--color-alert-red-bg); color: var(--color-alert-red); }

.sys-title-lbl {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: 6px;
}

.sys-score-val {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  margin-top: 2px;
}

/* Gráfico circular Donut do Score */
.health-indices-layout {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-top: 15px;
}

.donut-chart-container {
  position: relative;
  width: 90px;
  height: 90px;
  flex-shrink: 0;
}

.donut-ring {
  fill: none;
  stroke: #f1f5f9;
  stroke-width: 5;
}

.donut-segment {
  fill: none;
  stroke: var(--color-primary-blue);
  stroke-width: 5;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  transition: stroke-dashoffset 0.4s ease;
}

.donut-segment.critico {
  stroke: var(--color-alert-red);
}

.donut-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.donut-text-sub {
  font-size: 0.58rem;
  color: var(--text-secondary);
  margin-top: -2px;
}

/* Barras horizontais progressivas */
.progress-list-container {
  flex-grow: 1;
}

.progress-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.progress-list-item:last-child {
  margin-bottom: 0;
}

.progress-bar-lbl {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  width: 95px;
}

.progress-bar-track {
  flex: 1;
  height: 6px;
  background: #f1f5f9;
  border-radius: 3px;
  margin: 0 16px;
  overflow: hidden;
}

.progress-bar-fill-horizontal {
  height: 100%;
  background: var(--color-alert-green);
  border-radius: 3px;
  transition: width 0.4s ease;
}

.progress-bar-val {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  width: 40px;
  text-align: right;
}

/* Linha do Tempo Clínica (Timeline) */
.timeline-container {
  position: relative;
  padding-left: 24px;
  margin-left: 10px;
  margin-top: 15px;
}

.timeline-container::before {
  content: '';
  position: absolute;
  top: 6px;
  left: 0;
  bottom: 6px;
  width: 2px;
  background: var(--border-color);
}

.timeline-item {
  position: relative;
  margin-bottom: 24px;
}
.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-marker-bubble {
  position: absolute;
  left: -33px;
  top: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid var(--color-primary-blue);
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--color-primary-blue);
  z-index: 2;
}
.timeline-marker-bubble.normal { border-color: var(--color-alert-green); color: var(--color-alert-green); }
.timeline-marker-bubble.atencao { border-color: var(--color-alert-orange); color: var(--color-alert-orange); }
.timeline-marker-bubble.critico { border-color: var(--color-alert-red); color: var(--color-alert-red); }

.timeline-marker-bubble svg {
  width: 10px;
  height: 10px;
}

.timeline-event-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--color-primary-dark);
}

.timeline-event-date {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 1px;
}

.timeline-event-desc {
  font-size: 0.72rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-top: 4px;
}

/* Alertas de Recomendações */
.recs-alert-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  margin-top: 15px;
}

.recs-alert-card.success {
  background: var(--color-alert-green-bg);
  border-color: rgba(16, 185, 129, 0.12);
  color: var(--color-alert-green);
}

.recs-alert-card.info {
  background: var(--color-primary-blue-bg);
  border-color: rgba(37, 99, 235, 0.12);
  color: var(--color-primary-blue);
}

.recs-alert-card.warning {
  background: var(--color-alert-orange-bg);
  border-color: rgba(245, 158, 11, 0.12);
  color: var(--color-alert-orange);
}

.recs-icon-cell {
  flex-shrink: 0;
  margin-top: 2px;
}

.recs-txt-cell {
  display: flex;
  flex-direction: column;
}

.recs-title-bold {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--color-primary-dark);
}

.recs-desc-light {
  font-size: 0.72rem;
  color: var(--text-primary);
  line-height: 1.4;
  margin-top: 2px;
}

/* Button Secondary Linker (Enterprise style) */
.btn-secondary-clinical {
  width: 100%;
  background: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 8px;
  border-radius: 6px;
  cursor: pointer;
  margin-top: 15px;
  text-align: center;
  transition: var(--transition-fast);
}
.btn-secondary-clinical:hover {
  background: var(--border-light);
  border-color: #cbd5e1;
}

/* ==========================================================================
   ESTILOS DE BIOMARCADORES (TERCEIRA SEÇÃO)
   ========================================================================== */

/* Abas Horizontais */
.biomarker-tabs {
  display: flex;
  gap: 20px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 16px;
  padding-bottom: 2px;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none; /* Firefox */
}
.biomarker-tabs::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.biomarker-tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 8px 4px 12px 4px;
  font-family: var(--font-family);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
}

.biomarker-tab-btn:hover {
  color: var(--color-primary-blue);
}

.biomarker-tab-btn.active {
  color: var(--color-primary-blue);
  border-bottom-color: var(--color-primary-blue);
  font-weight: 600;
}

/* Toolbar */
.biomarker-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.btn-export-clinical {
  background: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition-fast);
}
.btn-export-clinical:hover {
  background: var(--border-light);
}

/* Tabela Personalizada */
.biomarkers-main-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  background: #ffffff;
}

.biomarkers-main-table th {
  background: transparent;
  color: var(--text-secondary);
  font-weight: 600;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
}

.biomarkers-main-table td {
  padding: 14px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
  vertical-align: middle;
}

.biomarkers-main-table tr:hover td {
  background: var(--bg-deep);
}

/* Badges funcionais */
.cat-badge {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  display: inline-block;
}
.cat-badge.metabolicos { background: #eff6ff; color: #2563eb; }
.cat-badge.cardiovasculares { background: #fef2f2; color: #ef4444; }
.cat-badge.inflamatorios { background: #fff7ed; color: #ea580c; }
.cat-badge.renais { background: #faf5ff; color: #7c3aed; }
.cat-badge.hematologicos { background: #f1f5f9; color: #475569; }
.cat-badge.outros { background: #f0fdf4; color: #16a34a; }
.cat-badge.vitaminas { background: #e0f2fe; color: #0369a1; }

/* Variação histórica */
.variation-cell-box {
  display: flex;
  flex-direction: column;
}

.variation-pct {
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
}
.variation-pct.green { color: var(--color-alert-green); }
.variation-pct.red { color: var(--color-alert-red); }

.variation-sub {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 1px;
}

/* Coluna Direita (Resumos Quantitativos) */
.stat-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 6px;
  background: #f8fafc;
  margin-bottom: 8px;
  border-left: 3px solid transparent;
}
.stat-summary-row:last-child {
  margin-bottom: 0;
}
.stat-summary-row.normal { border-left-color: var(--color-alert-green); }
.stat-summary-row.atencao { border-left-color: var(--color-alert-orange); }
.stat-summary-row.critico { border-left-color: var(--color-alert-red); }

.stat-lbl-box {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text-primary);
}

.stat-icon {
  width: 14px;
  height: 14px;
}
.stat-icon.normal { color: var(--color-alert-green); }
.stat-icon.atencao { color: var(--color-alert-orange); }
.stat-icon.critico { color: var(--color-alert-red); }

.stat-num-box {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--color-primary-dark);
}

.stat-pct-box {
  font-size: 0.65rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-left: 8px;
}

/* LIMS Synced */
.sync-card-status {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--soft-shadow);
  margin-top: 20px;
}

.sync-icon-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-alert-green-bg);
  color: var(--color-alert-green);
  display: flex;
  justify-content: center;
  align-items: center;
}

/* ==========================================================================
   ESTILOS DE ANÁLISES DE IA (QUINTA SEÇÃO)
   ========================================================================== */

/* Abas de IA */
.ia-tab-bar {
  display: flex;
  gap: 20px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 20px;
  padding-bottom: 2px;
}

.ia-tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 8px 4px 12px 4px;
  font-family: var(--font-family);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition-fast);
}

.ia-tab-btn:hover {
  color: var(--color-primary-blue);
}

.ia-tab-btn.active {
  color: var(--color-primary-blue);
  border-bottom-color: var(--color-primary-blue);
  font-weight: 600;
}

/* Resumo Executivo Layout */
.ia-exec-summary-layout {
  display: flex;
  gap: 32px;
  align-items: flex-start;
  margin-top: 15px;
}

@media (max-width: 768px) {
  .ia-exec-summary-layout {
    flex-direction: column;
  }
}

/* Conclusões */
.conclusions-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.conclusion-item-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.75rem;
  color: var(--text-primary);
}

.conclusion-icon-circle {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
}
.conclusion-icon-circle.success { background: var(--color-alert-green-bg); color: var(--color-alert-green); }
.conclusion-icon-circle.warning { background: var(--color-alert-orange-bg); color: var(--color-alert-orange); }
.conclusion-icon-circle.danger { background: var(--color-alert-red-bg); color: var(--color-alert-red); }

/* Grids preditivos */
.predictive-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 15px;
}

@media (max-width: 768px) {
  .predictive-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.predictive-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 14px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: var(--soft-shadow);
  transition: var(--transition-fast);
}
.predictive-card:hover {
  border-color: #cbd5e1;
}

.predictive-icon-box {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--border-light);
  color: var(--text-secondary);
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 10px;
}
.predictive-card:nth-child(1) .predictive-icon-box { background: #fef2f2; color: #ef4444; }
.predictive-card:nth-child(2) .predictive-icon-box { background: #eff6ff; color: #2563eb; }
.predictive-card:nth-child(3) .predictive-icon-box { background: #faf5ff; color: #7c3aed; }
.predictive-card:nth-child(4) .predictive-icon-box { background: #fff7ed; color: #ea580c; }

.predictive-lbl {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.predictive-status {
  font-size: 0.78rem;
  font-weight: 700;
  margin-top: 4px;
}
.predictive-status.normal { color: var(--color-alert-green); }
.predictive-status.atencao { color: var(--color-alert-orange); }
.predictive-status.critico { color: var(--color-alert-red); }

.predictive-prob {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 6px;
}

/* Insights Automáticos */
.insights-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 15px;
}

.insight-item-row {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--soft-shadow);
  transition: var(--transition-fast);
  cursor: pointer;
}
.insight-item-row:hover {
  border-color: #cbd5e1;
  background: var(--bg-deep);
}

.insight-icon-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
}
.insight-item-row:nth-child(1) .insight-icon-circle { background: #fef2f2; color: #ef4444; }
.insight-item-row:nth-child(2) .insight-icon-circle { background: #f0fdf4; color: #16a34a; }
.insight-item-row:nth-child(3) .insight-icon-circle { background: #faf5ff; color: #7c3aed; }

.insight-txt-box {
  display: flex;
  flex-direction: column;
}

.insight-title-bold {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-primary-dark);
}

.insight-desc-light {
  font-size: 0.68rem;
  color: var(--text-secondary);
  line-height: 1.35;
  margin-top: 1px;
}

/* Recomendações da IA */
.recommendations-ia-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 15px;
}

.rec-item-row {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--soft-shadow);
  transition: var(--transition-fast);
}
.rec-item-row:hover {
  border-color: #cbd5e1;
  background: var(--bg-deep);
}

.rec-left-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.rec-icon-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--border-light);
  color: var(--text-secondary);
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
}

.rec-meta-box {
  display: flex;
  flex-direction: column;
}

.rec-title-txt {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  display: flex;
  align-items: center;
  gap: 6px;
}

.rec-badge {
  font-size: 0.58rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
}
.rec-badge.manter { background: #ecfdf5; color: #10b981; }
.rec-badge.sugestao { background: #eff6ff; color: #2563eb; }
.rec-badge.atencao { background: #fffbeb; color: #f59e0b; }

.rec-desc-txt {
  font-size: 0.68rem;
  color: var(--text-secondary);
  margin-top: 2px;
  line-height: 1.35;
}

/* ==========================================================================
   ESTILOS DE RELATÓRIOS (SÉTIMA SEÇÃO - MOCKUP 7)
   ========================================================================== */

.reports-page-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.reports-title-lbl h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary-dark);
}

.reports-title-lbl p {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.reports-action-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
}

.btn-filter-clinical {
  background: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition-fast);
}
.btn-filter-clinical:hover {
  background: var(--border-light);
}

.btn-new-report {
  background: var(--color-primary-blue);
  border: 1px solid var(--color-primary-blue);
  color: #ffffff;
  font-family: var(--font-family);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition-fast);
}
.btn-new-report:hover {
  background: var(--color-primary-blue-hover);
}

/* Abas */
.reports-tab-bar {
  display: flex;
  gap: 20px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 16px;
  padding-bottom: 2px;
}

.reports-tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 8px 4px 12px 4px;
  font-family: var(--font-family);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
}
.reports-tab-btn:hover {
  color: var(--color-primary-blue);
}
.reports-tab-btn.active {
  color: var(--color-primary-blue);
  border-bottom-color: var(--color-primary-blue);
  font-weight: 600;
}

/* Tabela */
.reports-main-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  background: #ffffff;
}

.reports-main-table th {
  background: transparent;
  color: var(--text-secondary);
  font-weight: 600;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
}

.reports-main-table td {
  padding: 14px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
  vertical-align: middle;
}

.reports-main-table tr {
  cursor: pointer;
  transition: var(--transition-fast);
}

.reports-main-table tr:hover td {
  background: var(--bg-deep);
}

.reports-main-table tr.active td {
  background: var(--color-primary-blue-bg);
}

.report-icon-wrapper {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
}
.report-icon-wrapper.blue { background: #eff6ff; color: #2563eb; }
.report-icon-wrapper.purple { background: #faf5ff; color: #7c3aed; }
.report-icon-wrapper.red { background: #fef2f2; color: #ef4444; }
.report-icon-wrapper.teal { background: #e0f2fe; color: #0d9488; }
.report-icon-wrapper.green { background: #f0fdf4; color: #16a34a; }

.cat-badge.sumario { background: #eff6ff; color: #2563eb; }
.cat-badge.laboratorial { background: #f0fdf4; color: #16a34a; }
.cat-badge.especializado { background: #faf5ff; color: #7c3aed; }
.cat-badge.ia { background: #e0f2fe; color: #0284c7; }
.cat-badge.imagem { background: #fff7ed; color: #ea580c; }
.cat-badge.clinico { background: #f1f5f9; color: #475569; }

.status-badge.recense { background: #d1fae5; color: #065f46; font-weight: 700; }
.status-badge.concluido { background: #ecfdf5; color: #10b981; }

.btn-action-icon {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 4px;
  border-radius: 4px;
  transition: var(--transition-fast);
}
.btn-action-icon:hover {
  background: var(--border-light);
  color: var(--color-primary-blue);
}

/* Paginação */
.pagination-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.pagination-list {
  display: flex;
  gap: 6px;
  align-items: center;
}

.page-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 0.72rem;
  font-weight: 500;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: var(--transition-fast);
}
.page-btn:hover {
  background: var(--border-light);
  border-color: var(--border-color);
}
.page-btn.active {
  background: var(--color-primary-blue);
  color: #ffffff;
  border-color: var(--color-primary-blue);
  font-weight: 700;
}

/* Document Sheet Preview */
.document-preview-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--soft-shadow);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.doc-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.doc-preview-meta {
  display: flex;
  flex-direction: column;
}
.doc-preview-meta h3 {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--color-primary-dark);
}
.doc-preview-meta span {
  font-size: 0.65rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.btn-close-preview {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  transition: var(--transition-fast);
}
.btn-close-preview:hover {
  color: var(--color-alert-red);
}

/* Folha A4 */
.a4-paper-sheet {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 24px;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.06);
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 350px;
  position: relative;
  overflow: hidden;
}
.a4-paper-sheet::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--color-primary-blue);
}

.paper-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  font-size: 0.58rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 8px;
}

.paper-logo {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
  color: var(--color-primary-dark);
}

.paper-title-centered {
  text-align: center;
  margin-top: 24px;
}
.paper-title-centered h4 {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--color-primary-dark);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.paper-patient-info {
  margin-top: 20px;
  background: var(--bg-deep);
  border-radius: 6px;
  padding: 12px;
  border-left: 3px solid var(--color-primary-blue);
}

.paper-patient-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 0.68rem;
}
.paper-patient-row:last-child {
  margin-bottom: 0;
}

.paper-lbl {
  font-weight: 600;
  color: var(--text-secondary);
}
.paper-val {
  font-weight: 700;
  color: var(--color-primary-dark);
}

.paper-signature-box {
  align-self: flex-end;
  text-align: right;
  margin-top: 30px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.signature-svg {
  width: 80px;
  height: 30px;
  margin-bottom: 4px;
}

.doc-sign-name {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--color-primary-dark);
}
.doc-sign-lbl {
  font-size: 0.58rem;
  color: var(--text-secondary);
}

.preview-footer-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.btn-view-full-doc {
  background: var(--color-primary-blue);
  border: 1px solid var(--color-primary-blue);
  color: #ffffff;
  font-family: var(--font-family);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 8px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: var(--transition-fast);
}
.btn-view-full-doc:hover {
  background: var(--color-primary-blue-hover);
}

.preview-sub-buttons {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 8px;
}

/* ==========================================================================
   MOTOR DE UPLOAD (DRAG AND DROP)
   ========================================================================== */

.upload-zone-placeholder {
  border: 2px dashed #cbd5e1;
  background: #ffffff;
  border-radius: 12px;
  padding: 50px 30px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition-normal);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-top: 20px;
  box-shadow: var(--soft-shadow);
}

.upload-zone-placeholder.dragover {
  background: var(--color-primary-blue-bg);
  border-color: var(--color-primary-blue);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.05);
}

.upload-zone-placeholder:hover {
  border-color: var(--color-primary-blue);
}

.upload-icon {
  width: 44px;
  height: 44px;
  fill: none;
  stroke: var(--color-primary-blue);
  stroke-width: 2;
  transition: var(--transition-fast);
}

/* Barra de Progresso Clássica */
.progress-bar-container {
  width: 100%;
  background: #cbd5e1;
  border-radius: 6px;
  height: 14px;
  margin-top: 20px;
  overflow: hidden;
  position: relative;
  display: none;
}

.progress-bar-fill {
  height: 100%;
  background: var(--color-primary-blue);
  width: 0%;
  transition: width 0.1s linear;
}

.progress-percent {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.65rem;
  color: #ffffff;
  font-weight: 700;
}

/* Alertas de Feedback */
.hud-alert {
  padding: 12px 18px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  margin-top: 15px;
  display: none;
}
.hud-alert.error {
  background: var(--color-alert-red-bg);
  color: var(--color-alert-red);
  border: 1px solid rgba(220, 38, 38, 0.15);
}
.hud-alert.success {
  background: var(--color-alert-green-bg);
  color: var(--color-alert-green);
  border: 1px solid rgba(5, 150, 105, 0.15);
}

/* ==========================================================================
   TABELAS E HISTÓRICO
   ========================================================================== */

.history-table-wrapper {
  overflow-x: auto;
  margin-top: 20px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

.cyber-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.82rem;
  background: #ffffff;
}

.cyber-table th {
  background: #f8fafc;
  color: var(--text-secondary);
  padding: 12px 18px;
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
}

.cyber-table td {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
}

.cyber-table tr:hover td {
  background: var(--border-light);
}

/* ==========================================================================
   ANIMAÇÕES PREMUM E TRANSIÇÕES DE DADOS (DAR VIDA)
   ========================================================================== */

.view-container {
  animation: fadeSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
}

@keyframes fadeSlideUp {
  0% {
    opacity: 0;
    transform: translateY(8px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Efeito Cascata em Itens de Listas */
.stagger-in {
  opacity: 0;
  animation: fadeSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.stagger-in:nth-child(1) { animation-delay: 0.05s; }
.stagger-in:nth-child(2) { animation-delay: 0.1s; }
.stagger-in:nth-child(3) { animation-delay: 0.15s; }
.stagger-in:nth-child(4) { animation-delay: 0.2s; }
.stagger-in:nth-child(5) { animation-delay: 0.25s; }
.stagger-in:nth-child(6) { animation-delay: 0.3s; }

/* Barras de Progresso Horizontais — estado inicial gerenciado por JS */
.progress-bar-fill-horizontal {
  height: 100%;
  border-radius: 3px;
}

/* Donuts SVG — estado inicial (fechado) gerenciado por JS via rAF */
/* .donut-segment initial state set by animateNumbersAndDonuts() */

/* Sparklines SVG — estado inicial gerenciado por JS */
/* .sparkline-line initial state set by animateNumbersAndDonuts() */


/* Pulso Cardíaco/Alerta Suave nos Nós Anatomicos */
@keyframes heartbeatPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.35); opacity: 0.7; }
}
.radar-node {
  transform-origin: center;
  transform-box: fill-box;
}
.radar-node.alert {
  animation: heartbeatPulse 1.8s infinite ease-in-out;
}

.radar-node.normal {
  animation: heartbeatPulse 3.5s infinite ease-in-out;
}

/* Levitamento On Hover */
.clinical-card, .vital-metric-block, .overview-system-card, .insight-item-row, .rec-item-row, .pacs-series-item {
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, border-color 0.2s ease;
}
.clinical-card:hover, .vital-metric-block:hover, .overview-system-card:hover, .insight-item-row:hover, .rec-item-row:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px -5px rgba(15, 23, 42, 0.04), 0 4px 6px -4px rgba(15, 23, 42, 0.02);
}

/* ==========================================================================
   ESTILOS DO VISUALIZADOR PACS DE IMAGENS MÉDICAS
   ========================================================================== */

.pacs-viewer-layout {
  display: grid;
  grid-template-columns: 240px 1.4fr 1.1fr;
  gap: 20px;
  height: calc(100vh - 170px);
  min-height: 520px;
  align-items: stretch;
}

@media (max-width: 1100px) {
  .pacs-viewer-layout {
    grid-template-columns: 1fr;
    height: auto;
  }
}

.pacs-series-sidebar {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
}

.pacs-series-item {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px;
  cursor: pointer;
  background: #ffffff;
}
.pacs-series-item:hover {
  border-color: var(--color-primary-blue);
  background: var(--color-primary-blue-bg);
  transform: translateY(-1px);
}
.pacs-series-item.active {
  border-color: var(--color-primary-blue);
  background: var(--color-primary-blue-bg);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.06);
}

.pacs-series-thumb {
  width: 100%;
  height: 85px;
  background: #090d16;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 8px;
  border: 1px solid #1e293b;
  position: relative;
}

.pacs-series-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pacs-series-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--color-primary-dark);
}
.pacs-series-desc {
  font-size: 0.62rem;
  color: var(--text-secondary);
}

/* Visor PACS */
.pacs-dark-viewer {
  background: #090d16;
  border: 1px solid #1e293b;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: stretch;
  position: relative;
  overflow: hidden;
  box-shadow: var(--deep-shadow);
}

.pacs-top-watermark {
  display: flex;
  justify-content: space-between;
  color: #475569;
  font-size: 0.58rem;
  font-family: monospace;
  border-bottom: 1px solid rgba(71, 85, 105, 0.2);
  padding-bottom: 6px;
  z-index: 5;
}

.pacs-canvas-area {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  min-height: 280px;
}

.pacs-svg-content {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.pacs-viewer-controls {
  position: absolute;
  left: 16px;
  bottom: 16px;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(71, 85, 105, 0.4);
  border-radius: 20px;
  padding: 4px;
  display: flex;
  gap: 4px;
  z-index: 5;
}

.pacs-control-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: #94a3b8;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: var(--transition-fast);
}
.pacs-control-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.pacs-calibration-scale {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 20px;
  color: #475569;
  font-size: 0.55rem;
  font-family: monospace;
  z-index: 5;
}
.pacs-scale-line {
  width: 8px;
  height: 1px;
  background: #475569;
}

.pacs-bottom-watermark {
  display: flex;
  justify-content: space-between;
  color: #475569;
  font-size: 0.58rem;
  font-family: monospace;
  border-top: 1px solid rgba(71, 85, 105, 0.2);
  padding-top: 6px;
  z-index: 5;
}

/* AI Bounding Box */
.pacs-ai-bounding-box {
  position: absolute;
  border: 1.5px dashed var(--color-alert-red);
  background: rgba(239, 68, 68, 0.05);
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: flex-start;
  padding: 2px 4px;
  box-sizing: border-box;
}
.pacs-ai-bounding-box::after {
  content: attr(data-label);
  font-size: 0.52rem;
  font-weight: 700;
  color: #ffffff;
  background: var(--color-alert-red);
  padding: 1px 3px;
  border-radius: 2px;
  position: absolute;
  top: -12px;
  left: -1px;
  white-space: nowrap;
}
.pacs-ai-bounding-box.green {
  border-color: var(--color-alert-green);
  background: rgba(16, 185, 129, 0.05);
}
.pacs-ai-bounding-box.green::after {
  background: var(--color-alert-green);
}

.pacs-ai-bounding-box.orange {
  border-color: var(--color-alert-orange);
  background: rgba(245, 158, 11, 0.05);
}
.pacs-ai-bounding-box.orange::after {
  background: var(--color-alert-orange);
}

/* Painel de Laudo */
.pacs-laudo-panel {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow-y: auto;
  box-shadow: var(--soft-shadow);
}

.modality-desc-card {
  background: var(--bg-deep);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 16px;
}
.modality-desc-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  margin-bottom: 4px;
}
.modality-desc-text {
  font-size: 0.68rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.pacs-laudo-body h4 {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  margin-bottom: 8px;
}

.pacs-laudo-text {
  font-size: 0.72rem;
  color: var(--text-primary);
  line-height: 1.5;
  margin-bottom: 16px;
}

.pacs-measurements-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
  border-top: 1px dashed var(--border-color);
  padding-top: 12px;
}

.pacs-measure-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
}
.pacs-measure-lbl {
  color: var(--text-secondary);
}
.pacs-measure-val {
  font-weight: 700;
  color: var(--color-primary-dark);
}
.pacs-measure-row.alert .pacs-measure-val {
  color: var(--color-alert-red);
}

/* ------------------------------------------------------------- */
/* ONBOARDING / LOGIN MODE */
/* ------------------------------------------------------------- */
body.login-mode {
  background: var(--bg-deep) !important;
}
body.login-mode .hud-sidebar,
body.login-mode .hud-header {
  display: none !important;
}
body.login-mode .hud-container,
body.login-mode .hud-main-container,
body.login-mode .hud-content,
body.login-mode #app-viewport {
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
  height: 100vh !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  background: var(--bg-deep) !important;
}

/* LOGIN BOX */
/* ==========================================================================
   HISTIA DESIGN SYSTEM - NOVA TELA DE LOGIN & CADASTRO (52/48 SPLIT)
   ========================================================================== */

.login-split-layout {
  display: flex;
  height: 100vh;
  max-height: 100vh;
  width: 100vw;
  background-color: #FBF6F5;
  font-family: 'Inter', sans-serif;
  overflow: hidden;
  box-sizing: border-box;
}

/* ─────────────────────────────────────────────────────────────
   LADO ESQUERDO: ÁREA ILUSTRADA (FUNDO VINHO, PERSONAGEM & PAINEL)
   ───────────────────────────────────────────────────────────── */
.login-left-panel {
  flex: 1.08; /* 52% da tela */
  position: relative;
  display: none; /* Oculto em telas mobile */
  background: #2E0818;
  overflow: hidden;
  box-sizing: border-box;
}

@media (min-width: 900px) {
  .login-left-panel {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }
}

.login-hero-bg-wrapper {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 1;
  background: #2E0818;
}

.login-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 22% 16%;
  display: block;
}

.login-hero-gradient-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(46, 8, 24, 0) 0%,
    rgba(46, 8, 24, 0.1) 40%,
    rgba(36, 5, 18, 0.75) 72%,
    rgba(28, 4, 14, 0.98) 100%
  );
  pointer-events: none;
}

.login-left-overlay-content {
  position: relative;
  z-index: 5;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 28px 32px 24px 32px;
  box-sizing: border-box;
}

/* PAINEL FLUTUANTE DISCRETO: "Exames organizados" */
.organized-exams-card {
  align-self: flex-end;
  margin-top: 24px;
  margin-right: 12px;
  width: 240px;
  background: rgba(72, 14, 25, 0.42);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 20px;
  padding: 14px 14px 12px 14px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
}

.organized-exams-title {
  color: #FFFFFF;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 10px;
  font-family: 'Inter', sans-serif;
  letter-spacing: -0.01em;
}

.organized-exams-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.organized-exam-item {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 10px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background-color 0.2s, border-color 0.2s;
}

.organized-exam-item:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.22);
}

.exam-item-left {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #FFFFFF;
  font-size: 0.78rem;
  font-weight: 400;
}

.exam-icon {
  width: 14px;
  height: 14px;
  color: rgba(255, 255, 255, 0.9);
  flex-shrink: 0;
}

.exam-chevron-svg {
  color: rgba(255, 255, 255, 0.6);
  flex-shrink: 0;
}

/* TEXTO DE APRESENTAÇÃO NO RODAPÉ ESQUERDO */
.login-left-presentation {
  margin-top: auto;
  max-width: 500px;
}

.presentation-title {
  font-family: 'Inter', sans-serif;
  font-size: 1.65rem;
  font-weight: 700;
  color: #FFFFFF;
  line-height: 1.24;
  letter-spacing: -0.025em;
  margin: 0 0 6px 0;
}

.presentation-subtitle {
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.42;
  margin: 0;
  font-weight: 400;
}

/* ─────────────────────────────────────────────────────────────
   LADO DIREITO: FUNDO OFF-WHITE & CARTÃO BRANCO DE LOGIN
   ───────────────────────────────────────────────────────────── */
.login-right-panel {
  flex: 0.92; /* 48% da tela */
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #FBF6F5;
  padding: 20px 24px;
  position: relative;
  overflow-y: auto;
  box-sizing: border-box;
}

.login-form-card {
  width: 100%;
  max-width: 410px;
  background: #FFFFFF;
  border-radius: 22px;
  padding: 28px 32px 24px 32px;
  box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.07), 0 4px 15px -2px rgba(0, 0, 0, 0.03);
  box-sizing: border-box;
  border: 1px solid rgba(0, 0, 0, 0.03);
  margin: auto 0;
}

.login-brand-header {
  margin-bottom: 14px;
  text-align: left;
}

.login-brand-logo {
  height: 38px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  display: block;
}

.form-title {
  font-family: 'Inter', sans-serif;
  font-size: 1.45rem;
  font-weight: 700;
  color: #0F172A;
  margin: 0 0 2px 0;
  letter-spacing: -0.025em;
}

.form-subtitle {
  color: #64748B;
  font-size: 0.84rem;
  font-weight: 400;
  margin: 0 0 16px 0;
}

/* CAMPOS DO FORMULÁRIO */
.HISTIA-form {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.HISTIA-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.HISTIA-form label {
  font-size: 0.80rem;
  font-weight: 500;
  color: #334155;
  font-family: 'Inter', sans-serif;
}

.HISTIA-form input[type="text"],
.HISTIA-form input[type="email"],
.HISTIA-form input[type="password"] {
  background: #FFFFFF;
  border: 1.5px solid #E2E8F0;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.88rem;
  color: #0F172A;
  outline: none;
  font-family: inherit;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-shadow: none;
}

.HISTIA-form input::placeholder {
  color: #94A3B8;
}

.HISTIA-form input:hover {
  border-color: #CBD5E1;
}

.HISTIA-form input:focus {
  border-color: #891942;
  box-shadow: 0 0 0 3px rgba(137, 25, 66, 0.12);
}

.password-wrapper {
  position: relative;
  width: 100%;
}

.password-wrapper input {
  padding-right: 40px !important;
}

.btn-toggle-pass {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: #94A3B8;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.btn-toggle-pass:hover {
  color: #475569;
}

.form-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  margin-top: 1px;
}

.remember-me {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #475569;
  cursor: pointer;
  font-weight: 400;
  font-size: 0.82rem;
  user-select: none;
}

.remember-me input {
  accent-color: #891942;
  cursor: pointer;
  width: 15px;
  height: 15px;
  border-radius: 4px;
  border: 1.5px solid #CBD5E1;
}

.forgot-pass {
  color: #891942;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.82rem;
  transition: color 0.2s;
}

.forgot-pass:hover {
  text-decoration: underline;
  color: #701033;
}

/* BOTÃO PRINCIPAL ENTRAR (#891942) */
.btn-HISTIA-submit {
  background: #891942;
  color: #FFFFFF;
  border: none;
  border-radius: 10px;
  padding: 11px;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
  box-shadow: none;
  margin-top: 4px;
  width: 100%;
}

.btn-HISTIA-submit:hover {
  background: #771438;
}

.btn-HISTIA-submit:active {
  transform: scale(0.99);
}

/* DIVISOR DISCRETO "ou" */
.login-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 12px 0 10px 0;
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid #E2E8F0;
}

.login-divider span {
  padding: 0 10px;
  font-size: 0.78rem;
  font-weight: 500;
  color: #94A3B8;
}

/* BOTÃO GOOGLE */
.btn-google-login {
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1.5px solid #E2E8F0;
  background: #FFFFFF;
  font-weight: 600;
  font-size: 0.88rem;
  color: #1E293B;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background-color 0.2s, border-color 0.2s;
}

.btn-google-login:hover {
  background-color: #F8FAFC;
  border-color: #CBD5E1;
}

/* RODAPÉ DO LOGIN */
.login-footer {
  text-align: center;
  font-size: 0.84rem;
  color: #64748B;
  margin-top: 14px;
}

.login-footer a {
  color: #891942;
  font-weight: 700;
  text-decoration: none;
  transition: color 0.2s;
}

.login-footer a:hover {
  text-decoration: underline;
  color: #701033;
}

/* RESPONSIVIDADE PARA CELULAR E TELAS MENORES */
@media (max-width: 899px) {
  .login-split-layout {
    flex-direction: column;
    background: #FBF6F5;
  }
  .login-left-panel {
    display: none !important;
  }
  .login-right-panel {
    width: 100%;
    height: 100%;
    padding: 24px 16px;
  }
  .login-form-card {
    max-width: 400px;
    padding: 30px 24px;
    border-radius: 20px;
  }
}

@media (max-height: 720px) and (min-width: 900px) {
  .login-left-overlay-content {
    padding: 26px 32px;
  }
  .presentation-title {
    font-size: 1.6rem;
  }
  .login-form-card {
    padding: 24px 28px;
  }
  .HISTIA-form {
    gap: 10px;
  }
  .organized-exams-card {
    margin-top: 18px;
  }
}

/* SPINNER LOGIN */
.login-spinner {
  display: none;
  margin: 20px auto 0;
  width: 24px;
  height: 24px;
  border: 3px solid rgba(37, 99, 235, 0.2);
  border-top-color: var(--color-primary-blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Botão Upload Header */
.header-upload-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--color-primary-blue), #3b82f6);
  color: #fff;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  animation: pulse-soft 2.5s infinite;
  margin-right: 12px;
}

.header-upload-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  color: #fff;
}

@keyframes pulse-soft {
  0% { box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25); }
  50% { box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.15), 0 4px 12px rgba(37, 99, 235, 0.35); }
  100% { box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25); }
}



/* ==========================================
   ANIMAÇÕES REFINADAS DE ENTRADA (FADE IN UP)
   ========================================== */
@keyframes histiaFadeInUp {
  0% {
    opacity: 0;
    transform: translateY(15px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

#app-viewport > div {
  animation: histiaFadeInUp 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.hud-card {
  animation: histiaFadeInUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
  animation-delay: 0.1s;
}

/* ==========================================================================
   ONBOARDING — Tela de Perfil de Saúde (3 etapas)
   ========================================================================== */

#onboarding-view {
  width: 100%;
  min-height: 100vh;
  background: #f4f6fb;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.onb-page {
  width: 100%;
  max-width: 920px;
  padding: 40px 20px 60px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* ---------- STEPPER ---------- */
.onb-stepper {
  display: flex;
  align-items: center;
  gap: 0;
}

.onb-step {
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0.4;
  transition: opacity 0.3s;
}

.onb-step--active {
  opacity: 1;
}

.onb-step__circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e5e7eb;
  color: #6b7280;
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  flex-shrink: 0;
}

.onb-step--active .onb-step__circle {
  background: linear-gradient(135deg, #EC1E82, #8B5CF6);
  color: #fff;
  box-shadow: 0 4px 14px rgba(236, 30, 130, 0.35);
}

.onb-step__label {
  font-size: 0.88rem;
  font-weight: 600;
  color: #374151;
  white-space: nowrap;
}

.onb-step--active .onb-step__label {
  color: #111827;
}

.onb-step__line {
  flex: 1;
  height: 2px;
  background: linear-gradient(to right, #EC1E82, #c4b5fd);
  margin: 0 16px;
  border-radius: 2px;
  opacity: 0.25;
}

/* ---------- CARD PRINCIPAL ---------- */
.onb-card {
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 4px 40px rgba(0,0,0,0.08);
  display: flex;
  overflow: hidden;
  min-height: 540px;
}

/* Lado esquerdo */
.onb-card__left {
  width: 290px;
  flex-shrink: 0;
  background: linear-gradient(160deg, #f8f0ff 0%, #e8f0ff 100%);
  padding: 36px 28px 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.onb-card__copy {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.onb-card__headline {
  font-family: 'Outfit', sans-serif;
  font-size: 1.65rem;
  font-weight: 700;
  color: #111827;
  line-height: 1.25;
  margin: 0;
}

.onb-card__desc {
  font-size: 0.87rem;
  color: #6b7280;
  line-height: 1.6;
  margin: 0;
}

.onb-card__time-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: #6b7280;
  background: rgba(255,255,255,0.7);
  border: 1px solid rgba(0,0,0,0.07);
  border-radius: 20px;
  padding: 5px 12px;
  width: fit-content;
}

.onb-card__illustration {
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-top: 20px;
}

.onb-card__illustration img {
  width: 100%;
  max-width: 240px;
  object-fit: contain;
  display: block;
}

/* Lado Direito */
.onb-card__right {
  flex: 1;
  padding: 36px 40px 32px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.onb-card__form-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.onb-form__title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: #111827;
  margin: 0 0 4px;
}

.onb-form__subtitle {
  font-size: 0.84rem;
  color: #6b7280;
  margin: 0;
}

.onb-badge--secure {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  color: #4b5563;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  padding: 5px 11px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ---------- FORM FIELDS ---------- */
#onboarding-form {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.onb-step-content {
  display: flex;
  flex-direction: column;
  gap: 18px;
  flex: 1;
}

.onb-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.onb-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.onb-field--full {
  grid-column: 1 / -1;
}

.onb-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #374151;
}

.onb-label-hint {
  font-weight: 400;
  color: #9ca3af;
}

.onb-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.onb-input-icon {
  position: absolute;
  left: 14px;
  color: #9ca3af;
  pointer-events: none;
  flex-shrink: 0;
}

.onb-input {
  width: 100%;
  padding: 11px 14px 11px 40px;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  font-size: 0.9rem;
  color: #111827;
  background: #f9fafb;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  box-sizing: border-box;
  -webkit-appearance: none;
}

.onb-input:focus {
  outline: none;
  border-color: #EC1E82;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(236, 30, 130, 0.1);
}

.onb-input::placeholder {
  color: #d1d5db;
}

/* Select customizado */
.onb-input-wrap--select {
  position: relative;
}

.onb-select {
  padding-right: 36px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.onb-select-chevron {
  position: absolute;
  right: 12px;
  color: #9ca3af;
  pointer-events: none;
}

/* Inputs com sufixo (kg, cm) */
.onb-input-wrap--suffix .onb-input {
  padding-right: 44px;
}

.onb-input-suffix {
  position: absolute;
  right: 14px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #9ca3af;
  pointer-events: none;
}

/* ---------- FOOTER ---------- */
.onb-form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid #f3f4f6;
}

.onb-footer-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: #9ca3af;
  flex: 1;
  text-align: center;
  justify-content: center;
}

.onb-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  white-space: nowrap;
}

.onb-btn--ghost {
  background: #fff;
  color: #374151;
  border: 1.5px solid #e5e7eb;
}

.onb-btn--ghost:hover {
  background: #f9fafb;
  border-color: #d1d5db;
}

.onb-btn--primary {
  background: linear-gradient(135deg, #EC1E82, #8B5CF6);
  color: #fff;
  box-shadow: 0 4px 16px rgba(236, 30, 130, 0.3);
}

.onb-btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(236, 30, 130, 0.4);
}

.onb-btn--primary:active {
  transform: translateY(0);
}

/* Feedback de erro */
.onb-feedback {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: #b91c1c;
  font-size: 0.84rem;
  padding: 10px 14px;
  margin-top: 8px;
}

/* Responsive */
@media (max-width: 700px) {
  .onb-card {
    flex-direction: column;
  }
  .onb-card__left {
    width: 100%;
    padding: 28px 24px;
    min-height: unset;
  }
  .onb-card__illustration {
    display: none;
  }
  .onb-card__right {
    padding: 24px;
  }
  .onb-field-row {
    grid-template-columns: 1fr;
  }
  .onb-form-footer {
    flex-direction: column-reverse;
    gap: 12px;
  }
  .onb-btn {
    width: 100%;
    justify-content: center;
  }
}

/* ---------- TAG INPUT (Medicamentos / Alergias) ---------- */
.onb-tag-input {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  background: #f9fafb;
  cursor: text;
  min-height: 46px;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.onb-tag-input:focus-within {
  outline: none;
  border-color: #EC1E82;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(236, 30, 130, 0.1);
}

.onb-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.onb-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(135deg, rgba(236,30,130,0.1), rgba(139,92,246,0.1));
  border: 1px solid rgba(236,30,130,0.2);
  border-radius: 20px;
  padding: 4px 10px 4px 12px;
  font-size: 0.8rem;
  font-weight: 500;
  color: #6b21a8;
  max-width: 100%;
  word-break: break-word;
  animation: tagPop 0.15s ease;
}

@keyframes tagPop {
  from { transform: scale(0.8); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

.onb-tag__remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: #9333ea;
  cursor: pointer;
  padding: 0;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
  font-size: 12px;
  line-height: 1;
}

.onb-tag__remove:hover {
  background: rgba(236,30,130,0.2);
  color: #EC1E82;
}

.onb-tag-text-input {
  flex: 1;
  min-width: 160px;
  border: none;
  outline: none;
  background: transparent;
  font-size: 0.88rem;
  color: #111827;
  padding: 2px 4px;
}

.onb-tag-text-input::placeholder {
  color: #d1d5db;
}

/* Medicamento tag tem cor ligeiramente diferente para distinguir */
#onb-medicamentos-list .onb-tag {
  background: linear-gradient(135deg, rgba(59,130,246,0.1), rgba(139,92,246,0.1));
  border-color: rgba(59,130,246,0.2);
  color: #1e40af;
}

#onb-medicamentos-list .onb-tag__remove {
  color: #3b82f6;
}

#onb-medicamentos-list .onb-tag__remove:hover {
  background: rgba(59,130,246,0.2);
  color: #1d4ed8;
}

/* ==========================================
   ESTILOS OFICIAIS: MAPA DE SAÚDE (3 COLUNAS)
   ========================================== */
.mapa-sistema-row {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.mapa-sistema-row:hover {
  background-color: #F8FAFC !important;
  border-color: #CBD5E1 !important;
  transform: translateX(2px);
}

.mapa-sistema-row.active {
  background-color: #F0FDFA !important;
  border-color: #99F6E4 !important;
  border-left: 4px solid #0D9488 !important;
}

.btn-add-exame-teal:hover {
  background-color: #0F766E !important;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(13, 148, 136, 0.35) !important;
}

/* ==========================================================================
   MODAL DE ESCANEAMENTO E PROCESSAMENTO IA HISTIA (OCR INTELIGENTE)
   ========================================================================== */
.histia-scan-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  overflow-y: auto;
  animation: fadeInModal 0.25s ease-out;
}

.histia-scan-card {
  width: 100%;
  max-width: 460px;
  max-height: calc(100vh - 32px);
  background: #FFFFFF;
  border-radius: 20px;
  padding: 20px 24px;
  box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(236, 0, 108, 0.12);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  overflow-y: auto;
  box-sizing: border-box;
}

.histia-scan-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #0D9488, #EC1E82, #3B82F6, #0D9488);
  background-size: 300% 100%;
  animation: gradientFlow 3s ease infinite;
}

@keyframes gradientFlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes fadeInModal {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

/* Área de Escaneamento com Documento e Laser */
.scan-visual-wrapper {
  position: relative;
  width: 120px;
  height: 85px;
  margin: 10px 0 10px 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scan-doc-icon {
  width: 68px;
  height: 80px;
  background: #F8FAFC;
  border: 1.5px solid #E2E8F0;
  border-radius: 10px;
  position: relative;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  padding: 9px 7px;
  gap: 4px;
  overflow: hidden;
}

.scan-doc-line {
  height: 3px;
  background: #E2E8F0;
  border-radius: 3px;
  width: 100%;
}

.scan-doc-line.short {
  width: 60%;
}

.scan-doc-line.highlight {
  background: #99F6E4;
}

.scan-laser-beam {
  position: absolute;
  left: 6px;
  right: 6px;
  height: 2.5px;
  background: linear-gradient(90deg, transparent, #EC1E82, #0D9488, transparent);
  box-shadow: 0 0 12px 2px rgba(236, 30, 130, 0.6), 0 0 16px 4px rgba(13, 148, 136, 0.4);
  border-radius: 50%;
  animation: scanLaserAnim 2s ease-in-out infinite;
  z-index: 10;
}

@keyframes scanLaserAnim {
  0% { top: 8px; opacity: 0.2; }
  15% { opacity: 1; }
  50% { top: 72px; opacity: 1; }
  85% { opacity: 1; }
  100% { top: 8px; opacity: 0.2; }
}

/* Avatar Histia Pulsante */
.scan-avatar-container {
  position: relative;
  margin-bottom: 4px;
}

.scan-avatar-img {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #FFFFFF;
  box-shadow: 0 6px 18px rgba(236, 0, 108, 0.22);
  z-index: 2;
  position: relative;
}

.scan-avatar-pulse {
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border-radius: 50%;
  border: 2px solid #EC1E82;
  animation: pulseScanRing 2s infinite cubic-bezier(0.215, 0.61, 0.355, 1);
  z-index: 1;
}

@keyframes pulseScanRing {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 0.2; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

/* Timeline de Etapas */
.scan-steps-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 10px;
  text-align: left;
}

.scan-step-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  border-radius: 10px;
  background: #F8FAFC;
  border: 1px solid #F1F5F9;
  font-size: 0.78rem;
  color: #64748B;
  transition: all 0.3s ease;
}

.scan-step-item.active {
  background: #F0FDFA;
  border-color: #99F6E4;
  color: #0F766E;
  font-weight: 700;
  box-shadow: 0 3px 10px rgba(13, 148, 136, 0.08);
}

.scan-step-item.done {
  background: #F0FDF4;
  border-color: #BBF7D0;
  color: #15803D;
  font-weight: 600;
}

.scan-step-item.error {
  background: #FEF2F2;
  border-color: #FECACA;
  color: #DC2626;
  font-weight: 600;
}

.scan-step-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  flex-shrink: 0;
  background: #E2E8F0;
  color: #64748B;
}

.scan-step-item.active .scan-step-icon {
  background: #0D9488;
  color: #FFFFFF;
  animation: spinIcon 1.5s linear infinite;
}

.scan-step-item.done .scan-step-icon {
  background: #16A34A;
  color: #FFFFFF;
}

.scan-step-item.error .scan-step-icon {
  background: #EF4444;
  color: #FFFFFF;
}

@keyframes spinIcon {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.scan-progress-bar-wrap {
  width: 100%;
  height: 6px;
  background: #E2E8F0;
  border-radius: 6px;
  margin-top: 10px;
  overflow: hidden;
  position: relative;
}

.scan-progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #0D9488, #EC1E82);
  border-radius: 6px;
  transition: width 0.25s ease-out;
}

