/* ==========================================================================
   PLANTÃO+ — ESTILOS DO PROTÓTIPO PREMIUM TABLET-FIRST (SAMSUNG TAB S9+)
   Direção Criativa: Ritmo do Cuidado / Turno + Mapa da Ala
   Cores: Petróleo Nobre, Jade Suave, Marfim Acolhedor, Branco Puro
   ========================================================================== */

:root {
  /* Paleta Primária & Marca */
  --teal-900: #0a2528;
  --teal-800: #10383d;
  --teal-700: #133e42; /* Tom principal de navegação e botões primários */
  --teal-600: #1a5257;
  --teal-500: #0f766e;
  --teal-400: #14b8a6;
  --teal-100: #dcece5;
  --teal-50:  #f0f7f4;

  /* Superfícies & Neutros Quentes */
  --bg-app: #f5f4ef;      /* Marfim hospitalar acolhedor */
  --bg-card: #ffffff;     /* Superfícies de conteúdo clínico */
  --bg-elevated: #ffffff;
  --bg-subtle: #eeede6;
  --border-subtle: #e2e0d8;
  --border-card: #e5e4dc;
  --border-focus: #133e42;

  /* Tipografia & Contrastes */
  --text-main: #14282b;
  --text-body: #283d40;
  --text-muted: #5e7375;
  --text-light: #889c9e;
  --text-on-teal: #ffffff;

  /* Estados Clínicos Rigorosos */
  --status-critical-bg: #fee2e2;
  --status-critical-border: #ef4444;
  --status-critical-text: #991b1b;

  --status-warning-bg: #fef3c7;
  --status-warning-border: #f59e0b;
  --status-warning-text: #92400e;

  --status-info-bg: #e0f2fe;
  --status-info-border: #38bdf8;
  --status-info-text: #075985;

  --status-unverified-bg: #f1f5f9;
  --status-unverified-border: #94a3b8;
  --status-unverified-text: #475569;

  --status-success-bg: #dcfce7;
  --status-success-border: #22c55e;
  --status-success-text: #166534;

  --badge-homonym-bg: #ede9fe;
  --badge-homonym-border: #a78bfa;
  --badge-homonym-text: #6b21a8;

  /* Touch Targets & Geometria */
  --touch-target-min: 48px;
  --touch-target-lg: 56px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-pill: 9999px;

  /* Sombras Suaves Naturais */
  --shadow-sm: 0 1px 3px rgba(19, 62, 66, 0.05);
  --shadow-card: 0 4px 16px -2px rgba(19, 62, 66, 0.06), 0 1px 3px rgba(0, 0, 0, 0.03);
  --shadow-floating: 0 12px 36px -4px rgba(19, 62, 66, 0.15), 0 4px 12px rgba(0, 0, 0, 0.04);
  --shadow-modal: 0 24px 60px -8px rgba(10, 37, 40, 0.28);

  /* Transições & Timings */
  --trans-fast: 120ms cubic-bezier(0.4, 0, 0.2, 1);
  --trans-base: 220ms cubic-bezier(0.16, 1, 0.3, 1);
  --trans-bounce: 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Reset Universal & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #1e293b; /* Fundo do simulador de moldura */
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   SIMULADOR DE DISPOSITIVO (GALAXY TAB S9+)
   ========================================================================== */
#device-simulator-wrapper {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  background: #0f172a;
  overflow: hidden;
}

/* Barra de Controle do Simulador no Topo */
.sim-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: #1e293b;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
  font-size: 13px;
  z-index: 1000;
  flex-shrink: 0;
}

.sim-controls-left, .sim-controls-center, .sim-controls-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sim-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: #38bdf8;
  letter-spacing: 0.5px;
}

.sim-brand svg {
  width: 20px;
  height: 20px;
}

.sim-btn-group {
  display: flex;
  background: #334155;
  padding: 3px;
  border-radius: var(--radius-sm);
  gap: 2px;
}

.sim-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all var(--trans-fast);
}

.sim-btn.active {
  background: var(--teal-500);
  color: #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.sim-btn:hover:not(.active) {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.05);
}

.sim-user-switch {
  display: flex;
  align-items: center;
  background: #334155;
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 4px;
}

.sim-user-switch button {
  background: transparent;
  border: none;
  color: #cbd5e1;
  padding: 4px 10px;
  font-size: 11px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: all var(--trans-fast);
}

.sim-user-switch button.active {
  background: #0284c7;
  color: #ffffff;
}

/* Área de Enquadramento do Tablet */
.sim-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  overflow: hidden;
  position: relative;
}

/* O Tablet Samsung Galaxy Tab S9+ (Moldura com borda premium e tela 16:10) */
.tablet-frame {
  background: #090d16;
  border-radius: 36px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), 0 0 0 8px #1e293b, 0 0 0 10px #334155;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition: all 400ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Modo Horizontal (1280 × 800 proporção 16:10 do Tab S9+) */
.tablet-frame.mode-landscape {
  width: 1280px;
  height: 800px;
  max-width: 98vw;
  max-height: calc(100vh - 60px);
}

/* Modo Vertical (800 × 1280) */
.tablet-frame.mode-portrait {
  width: 800px;
  height: 1240px;
  max-width: 95vw;
  max-height: calc(100vh - 60px);
}

/* Modo Tela Cheia */
.tablet-frame.mode-fullscreen {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

/* Câmera Frontal Discreta do Tablet */
.tablet-camera-notch {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 12px;
  background: #000000;
  border: 1px solid #1e293b;
  border-radius: 50%;
  z-index: 999;
}

/* Barra de Status do Sistema Operacional Android/OneUI */
.tablet-status-bar {
  height: 28px;
  background: var(--teal-900);
  color: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  user-select: none;
  flex-shrink: 0;
  z-index: 100;
}

.status-left, .status-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ==========================================================================
   ESTRUTURA PRINCIPAL DO PLANTÃO+ (APP VIEWPORT)
   ========================================================================== */
#app-viewport {
  flex: 1;
  display: flex;
  flex-direction: row;
  height: calc(100% - 28px);
  background-color: var(--bg-app);
  position: relative;
  overflow: hidden;
}

/* No modo Portrait, a barra de navegação fica na base ou retrátil */
.mode-portrait #app-viewport {
  flex-direction: column-reverse;
}

/* ==========================================================================
   BARRA LATERAL DE NAVEGAÇÃO PRINCIPAL (SIDEBAR PETRÓLEO)
   ========================================================================== */
.main-sidebar {
  width: 250px;
  background-color: var(--teal-900);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  user-select: none;
  z-index: 80;
  transition: width var(--trans-base);
}

.mode-portrait .main-sidebar {
  width: 100%;
  height: 64px;
  flex-direction: row;
  border-right: none;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  overflow-x: auto;
  padding: 0 8px;
}

/* Topo da Sidebar com Logo e Gotinha */
.sidebar-header {
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.mode-portrait .sidebar-header {
  display: none;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #0f766e, #14b8a6);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(15, 118, 110, 0.4);
}

.brand-text-block h1 {
  font-size: 17px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.3px;
  line-height: 1.1;
}

.brand-text-block span {
  font-size: 10px;
  color: var(--teal-100);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

/* ==========================================================================
   A GOTINHA SENTINELA ANIMADA (PINGO)
   ========================================================================== */
.gotinha-sentinela-badge {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  cursor: pointer;
  transition: transform var(--trans-fast), background var(--trans-fast);
}

.gotinha-sentinela-badge:hover {
  background: rgba(255, 255, 255, 0.15);
}

.gotinha-sentinela-badge:active {
  transform: scale(0.92);
}

/* Animação do Pulinho Duplo da Gotinha */
.gotinha-svg {
  width: 28px;
  height: 28px;
  transform-origin: center bottom;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.gotinha-svg.pulinho {
  animation: gotinhaBounce 900ms cubic-bezier(0.28, 0.84, 0.42, 1);
}

@keyframes gotinhaBounce {
  0% { transform: translateY(0) scale(1, 1); }
  15% { transform: translateY(-9px) scale(0.92, 1.08); }
  30% { transform: translateY(0) scale(1.08, 0.92); }
  45% { transform: translateY(-5px) scale(0.96, 1.04); }
  60% { transform: translateY(0) scale(1.03, 0.97); }
  75% { transform: translateY(-2px) scale(0.98, 1.02); }
  100% { transform: translateY(0) scale(1, 1); }
}

.gotinha-alert-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 9px;
  height: 9px;
  background: #ef4444;
  border: 2px solid var(--teal-900);
  border-radius: 50%;
  animation: dotPulse 2s infinite;
}

@keyframes dotPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.25); opacity: 0.8; }
}

/* Informações do Plantão Ativo na Sidebar */
.shift-indicator-card {
  margin: 12px 14px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
}

.mode-portrait .shift-indicator-card {
  display: none;
}

.shift-sector {
  font-size: 11px;
  font-weight: 700;
  color: var(--teal-100);
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.shift-nurse {
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.shift-meta {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 4px;
}

/* Lista de Navegação Principal */
.nav-menu {
  flex: 1;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow-y: auto;
}

.mode-portrait .nav-menu {
  flex-direction: row;
  align-items: center;
  padding: 0 4px;
  gap: 4px;
  width: 100%;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  min-height: var(--touch-target-min);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: all var(--trans-fast);
  position: relative;
}

.mode-portrait .nav-item {
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  padding: 6px 10px;
  min-height: 52px;
  font-size: 10px;
  width: auto;
  white-space: nowrap;
}

.nav-item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: 0.75;
  transition: transform var(--trans-fast), opacity var(--trans-fast);
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.nav-item:hover svg {
  opacity: 1;
  transform: translateX(2px);
}

.mode-portrait .nav-item:hover svg {
  transform: none;
}

.nav-item.active {
  background: var(--teal-700);
  color: #ffffff;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 2px 6px rgba(0, 0, 0, 0.2);
}

.nav-item.active svg {
  opacity: 1;
  color: #2dd4bf;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 4px;
  background: #2dd4bf;
  border-radius: 0 4px 4px 0;
}

.mode-portrait .nav-item.active::before {
  left: 8px;
  right: 8px;
  top: 0;
  bottom: auto;
  width: auto;
  height: 3px;
  border-radius: 0 0 3px 3px;
}

.nav-badge {
  margin-left: auto;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.15);
  font-weight: 700;
}

.nav-badge.danger {
  background: #ef4444;
  color: #ffffff;
}

.nav-badge.warning {
  background: #f59e0b;
  color: #78350f;
}

/* Rodapé da Sidebar */
.sidebar-footer {
  padding: 12px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mode-portrait .sidebar-footer {
  display: none;
}

.btn-quick-end-shift {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  justify-content: center;
  transition: all var(--trans-fast);
}

.btn-quick-end-shift:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #ffffff;
}

/* ==========================================================================
   CONTEÚDO PRINCIPAL (MAIN WORKSPACE)
   ========================================================================== */
.main-workspace {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-app);
  position: relative;
}

/* Cabeçalho Superior da Área de Trabalho */
.workspace-topbar {
  height: 60px;
  background: #ffffff;
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  z-index: 50;
}

.workspace-title-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.workspace-page-title {
  font-size: 19px;
  font-weight: 800;
  color: var(--teal-900);
  letter-spacing: -0.3px;
}

.workspace-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}

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

/* Busca Global de Pacientes / Prontuário */
.global-search-wrapper {
  position: relative;
  width: 260px;
}

.global-search-input {
  width: 100%;
  height: 38px;
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 0 14px 0 36px;
  font-size: 13px;
  color: var(--text-main);
  outline: none;
  transition: all var(--trans-fast);
}

.global-search-input:focus {
  background: #ffffff;
  border-color: var(--teal-500);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.global-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-light);
  pointer-events: none;
}

/* Botões do Topbar */
.btn-topbar-action {
  height: 38px;
  padding: 0 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  color: var(--text-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: all var(--trans-fast);
}

.btn-topbar-action:hover {
  background: var(--bg-subtle);
  border-color: #cbd5e1;
}

.btn-topbar-action.primary {
  background: var(--teal-700);
  border-color: var(--teal-800);
  color: #ffffff;
}

.btn-topbar-action.primary:hover {
  background: var(--teal-600);
}

/* Área de Rolagem das Telas (Screen Container) */
.screen-scroll-container {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  position: relative;
  -webkit-overflow-scrolling: touch;
}

.screen-view {
  display: none;
  animation: fadeIn 220ms ease;
  min-height: 100%;
}

.screen-view.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   COMPONENTES DE BOTÕES & CARDS PREMIUM
   ========================================================================== */
.btn-touch {
  min-height: var(--touch-target-min);
  padding: 0 18px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all var(--trans-fast);
  border: 1px solid transparent;
  user-select: none;
}

.btn-touch:active {
  transform: scale(0.975);
}

.btn-touch.btn-primary {
  background: var(--teal-700);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(19, 62, 66, 0.2);
}

.btn-touch.btn-primary:hover {
  background: var(--teal-600);
}

.btn-touch.btn-secondary {
  background: #ffffff;
  border-color: var(--border-card);
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}

.btn-touch.btn-secondary:hover {
  background: var(--bg-subtle);
}

.btn-touch.btn-success {
  background: #059669;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.2);
}

.btn-touch.btn-danger {
  background: #dc2626;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.2);
}

.btn-touch.btn-jade {
  background: var(--teal-100);
  color: var(--teal-900);
  border-color: #bbf7d0;
}

.btn-touch.btn-jade:hover {
  background: #bbf7d0;
}

/* Card Clínico Base */
.clinical-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-card);
  transition: transform var(--trans-fast), box-shadow var(--trans-fast), border-color var(--trans-fast);
  position: relative;
}

/* Badge de Identificação */
.badge-clinical {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.badge-clinical.critical {
  background: var(--status-critical-bg);
  border: 1px solid var(--status-critical-border);
  color: var(--status-critical-text);
}

.badge-clinical.warning {
  background: var(--status-warning-bg);
  border: 1px solid var(--status-warning-border);
  color: var(--status-warning-text);
}

.badge-clinical.info {
  background: var(--status-info-bg);
  border: 1px solid var(--status-info-border);
  color: var(--status-info-text);
}

.badge-clinical.unverified {
  background: var(--status-unverified-bg);
  border: 1px dashed var(--status-unverified-border);
  color: var(--status-unverified-text);
}

.badge-clinical.success {
  background: var(--status-success-bg);
  border: 1px solid var(--status-success-border);
  color: var(--status-success-text);
}

.badge-clinical.homonym {
  background: var(--badge-homonym-bg);
  border: 1px solid var(--badge-homonym-border);
  color: var(--badge-homonym-text);
}

/* ==========================================================================
   TELA 1: CENTRAL DO PLANTÃO (VISÃO OPERACIONAL & MAPA DE 41 LEITOS)
   ========================================================================== */
/* Banner Dominante de Continuidade do Cuidado */
.shift-continuity-banner {
  background: linear-gradient(135deg, #133e42, #1b5258);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 8px 24px -4px rgba(19, 62, 66, 0.25);
  margin-bottom: 22px;
}

.continuity-content h2 {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.2px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.continuity-content p {
  font-size: 13px;
  color: #cbd5e1;
  max-width: 680px;
  line-height: 1.4;
}

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

/* Barra de Métricas Operacionais Sintéticas */
.quick-kpi-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}

.kpi-tile {
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all var(--trans-fast);
}

.kpi-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

.kpi-tile.alert-kpi {
  border-left: 4px solid var(--status-critical-border);
}

.kpi-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.kpi-val {
  font-size: 22px;
  font-weight: 800;
  color: var(--teal-900);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.kpi-lbl {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

/* ==========================================================================
   NAVEGAÇÃO EM 3 ABAS PRINCIPAIS DO MAPA DE 41 LEITOS
   ISOLAMENTO (2) | FEMININO (22) | MASCULINO (17)
   ========================================================================== */
.bed-nav-tabs-wrapper {
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 8px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.bed-nav-tabs-group {
  display: flex;
  gap: 8px;
  flex: 1;
}

.bed-nav-tab {
  flex: 1;
  min-height: 54px;
  background: var(--bg-app);
  border: 1.5px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 8px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all var(--trans-fast);
  user-select: none;
}

.bed-nav-tab:hover {
  background: #ffffff;
  border-color: var(--teal-400);
  transform: translateY(-1px);
}

.bed-nav-tab.active {
  background: var(--teal-700);
  border-color: var(--teal-800);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(19, 62, 66, 0.2);
}

.bed-nav-tab-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bed-nav-tab-icon {
  font-size: 20px;
}

.bed-nav-tab-text strong {
  font-size: 14px;
  font-weight: 800;
  display: block;
  letter-spacing: -0.2px;
}

.bed-nav-tab-text span {
  font-size: 11px;
  opacity: 0.85;
  font-weight: 600;
}

.bed-nav-tab.active .bed-nav-tab-text span {
  color: var(--teal-100);
}

.bed-nav-tab-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: #ffffff;
  color: var(--teal-900);
}

.bed-nav-tab.active .bed-nav-tab-badge {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

/* Filtros Complementares do Mapa */
.map-status-filters-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.map-status-pills {
  display: flex;
  background: var(--bg-subtle);
  padding: 4px;
  border-radius: var(--radius-pill);
  gap: 4px;
}

.map-status-pill {
  background: transparent;
  border: none;
  padding: 7px 16px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--trans-fast);
}

.map-status-pill.active {
  background: #ffffff;
  color: var(--teal-900);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.map-status-pill.pill-vacant {
  color: #059669;
}

.map-status-pill.pill-vacant.active {
  background: #d1fae5;
  color: #065f46;
}

/* ==========================================================================
   AGRUPAMENTO POR ALAS (ALA A, ALA C, ALA E, ETC.)
   ========================================================================== */
.ala-group-container {
  margin-bottom: 26px;
}

.ala-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}

.ala-title-cluster {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ala-code-badge {
  font-size: 13px;
  font-weight: 800;
  background: var(--teal-700);
  color: #ffffff;
  padding: 4px 10px;
  border-radius: 6px;
  letter-spacing: 0.5px;
}

.ala-name-text {
  font-size: 15px;
  font-weight: 800;
  color: var(--teal-900);
}

.ala-stats-text {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

/* Grade de Leitos por Ala */
.ala-beds-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(285px, 1fr));
  gap: 14px;
}

/* ==========================================================================
   CARDS DE LEITOS REDESENHADOS (OCUPADO, VAGO, BLOQUEADO, NÃO CONFIRMADO)
   ========================================================================== */
.bed-card {
  background: #ffffff;
  border: 1.5px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  position: relative;
  transition: all var(--trans-fast);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 195px;
  user-select: none;
}

.bed-card:hover {
  transform: translateY(-3px);
  border-color: var(--teal-500);
  box-shadow: var(--shadow-floating);
}

.bed-card:active {
  transform: scale(0.98);
}

.bed-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 10px;
}

.bed-number-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 16px;
  font-weight: 900;
  color: var(--teal-900);
  font-variant-numeric: tabular-nums;
  background: var(--teal-50);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--teal-100);
}

/* ESTADO 1: LEITO VAGO HIGIENIZADO (EXTREMAMENTE CLARO) */
.bed-card.is-vacant-ready {
  background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 100%);
  border: 2px dashed #059669;
}

.bed-card.is-vacant-ready:hover {
  border-color: #047857;
  border-style: solid;
}

.vacant-prominent-badge {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.5px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-transform: uppercase;
}

.vacant-prominent-badge.ready {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}

.vacant-prominent-badge.cleaning {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #7dd3fc;
}

/* ESTADO 2: LEITO VAGO EM HIGIENIZAÇÃO */
.bed-card.is-vacant-cleaning {
  background: linear-gradient(180deg, #f0f9ff 0%, #ffffff 100%);
  border: 2px dashed #0284c7;
}

/* ESTADO 3: BLOQUEADO (MANUTENÇÃO) */
.bed-card.is-blocked {
  background: #fef2f2;
  border: 2px solid #ef4444;
}

/* ESTADO 4: SITUAÇÃO NÃO CONFIRMADA */
.bed-card.is-unconfirmed {
  background: #faf5ff;
  border: 2px dashed #a855f7;
}

.bed-patient-info {
  margin-bottom: 12px;
}

.patient-name-text {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.25;
  margin-bottom: 3px;
}

.patient-meta-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.bed-diag-text {
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  background: var(--bg-subtle);
  padding: 5px 8px;
  border-radius: 6px;
  margin-top: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bed-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid #f1f5f9;
  margin-top: auto;
}


.tech-tag-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #334155;
}

.tech-avatar-mini {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.bed-pending-count {
  font-size: 11px;
  font-weight: 700;
  color: var(--teal-700);
  background: var(--teal-100);
  padding: 3px 8px;
  border-radius: var(--radius-pill);
}

/* ==========================================================================
   DRAWER LATERAL DE DETALHES DO PACIENTE (SEM PERDER O CONTEXTO)
   ========================================================================== */
.patient-context-drawer {
  position: fixed;
  top: 0;
  right: -520px;
  width: 500px;
  max-width: 90vw;
  height: 100%;
  background: #ffffff;
  box-shadow: -8px 0 32px rgba(10, 37, 40, 0.2);
  z-index: 200;
  display: flex;
  flex-direction: column;
  transition: right 320ms cubic-bezier(0.16, 1, 0.3, 1);
}

.patient-context-drawer.open {
  right: 0;
}

.drawer-header {
  padding: 20px 24px;
  background: var(--teal-900);
  color: #ffffff;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-shrink: 0;
}

.drawer-header h3 {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 4px;
}

.drawer-header p {
  font-size: 12px;
  color: var(--teal-100);
}

.btn-close-drawer {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--trans-fast);
}

.btn-close-drawer:hover {
  background: rgba(255, 255, 255, 0.2);
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
}

.drawer-section-title {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.6px;
  margin: 18px 0 10px 0;
}

.drawer-ssvv-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.drawer-ssvv-tile {
  background: var(--bg-app);
  padding: 10px;
  border-radius: var(--radius-md);
  text-align: center;
}

.drawer-ssvv-tile .val {
  font-size: 18px;
  font-weight: 800;
  color: var(--teal-900);
  font-variant-numeric: tabular-nums;
}

.drawer-ssvv-tile .lbl {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.drawer-footer {
  padding: 16px 24px;
  background: #f8fafc;
  border-top: 1px solid var(--border-card);
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

/* ==========================================================================
   TELA 2: ABERTURA DO PLANTÃO & IMPORTAÇÃO DE IA (WIZARD FLUÍDO)
   ========================================================================== */
.wizard-steps-track {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 16px 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.wizard-step-node {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity var(--trans-fast);
}

.wizard-step-node.active {
  opacity: 1;
}

.wizard-step-node.completed {
  opacity: 0.85;
}

.step-bubble {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
}

.wizard-step-node.active .step-bubble {
  background: var(--teal-700);
  color: #ffffff;
  box-shadow: 0 0 0 4px var(--teal-100);
}

.wizard-step-node.completed .step-bubble {
  background: #059669;
  color: #ffffff;
}

.step-label-box .title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}

.step-label-box .desc {
  font-size: 11px;
  color: var(--text-muted);
}

.wizard-line {
  flex: 1;
  height: 2px;
  background: #e2e8f0;
  margin: 0 16px;
}

/* Tela Dividida de Conferência Assistida (Split View Lado a Lado) */
.split-conferencia-wrapper {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 20px;
  height: calc(100vh - 230px);
  min-height: 520px;
}

.mode-portrait .split-conferencia-wrapper {
  grid-template-columns: 1fr;
  height: auto;
}

/* Painel Esquerdo: Visualizador de Documento Original */
.doc-viewer-panel {
  background: #1e293b;
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-card);
}

.doc-viewer-header {
  padding: 12px 16px;
  background: #0f172a;
  color: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.doc-viewer-canvas {
  flex: 1;
  overflow: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #334155;
  position: relative;
}

/* Simulação da Prescrição Médica Hospitalar Escaneada */
.scanned-prescription-mock {
  width: 100%;
  max-width: 440px;
  background: #ffffff;
  border-radius: 4px;
  padding: 24px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  font-family: 'Courier New', Courier, monospace;
  font-size: 12px;
  line-height: 1.5;
  color: #111827;
  position: relative;
}

.scanned-prescription-mock .hospital-header {
  border-bottom: 2px solid #000;
  padding-bottom: 10px;
  margin-bottom: 14px;
  text-align: center;
  font-weight: bold;
}

.ocr-highlight {
  background: rgba(45, 212, 191, 0.25);
  border-left: 3px solid #0f766e;
  padding: 2px 4px;
  border-radius: 2px;
  position: relative;
}

.ocr-highlight.critical-found {
  background: rgba(239, 68, 68, 0.25);
  border-left: 3px solid #dc2626;
}

/* Painel Direito: Conferência e Correção Estruturada */
.conferencia-form-panel {
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.conferencia-form-header {
  padding: 16px 20px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-card);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.conferencia-form-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.conferencia-form-footer {
  padding: 16px 20px;
  background: #f8fafc;
  border-top: 1px solid var(--border-card);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ==========================================================================
   TELA 3: SEGURANÇA MEDICAMENTOSA & ANÁLISE DE INTERAÇÕES
   ========================================================================== */
.safety-alert-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border-card);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
  position: relative;
  transition: all var(--trans-fast);
}

.safety-alert-card.critico {
  border-color: var(--status-critical-border);
  border-left-width: 6px;
}

.safety-alert-card.atencao {
  border-color: var(--status-warning-border);
  border-left-width: 6px;
}

.safety-alert-card.nao_verificado {
  border-color: var(--status-unverified-border);
  border-style: dashed;
  border-left-width: 6px;
  background: #f8fafc;
}

.safety-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.safety-decision-box {
  background: var(--bg-app);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ==========================================================================
   TELA 4: LEITOS & DIMENSIONAMENTO INTEGRADO
   ========================================================================== */
.allocation-interactive-deck {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.mode-portrait .allocation-interactive-deck {
  grid-template-columns: 1fr;
}

/* Seletor de Técnicos (Touch) */
.tech-picker-column {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tech-selectable-card {
  background: #ffffff;
  border: 2px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all var(--trans-fast);
  user-select: none;
}

.tech-selectable-card:hover {
  border-color: #94a3b8;
  transform: translateX(4px);
}

.tech-selectable-card.selected {
  border-color: var(--teal-500);
  background: var(--teal-50);
  box-shadow: 0 4px 12px rgba(15, 118, 110, 0.15);
}

.tech-card-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tech-avatar-box {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  background: #e2e8f0;
}

.tech-card-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
}

.tech-card-coren {
  font-size: 11px;
  color: var(--text-muted);
}

.tech-card-count {
  font-size: 13px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: #e2e8f0;
  color: #334155;
}

.tech-selectable-card.selected .tech-card-count {
  background: var(--teal-700);
  color: #ffffff;
}

/* Grade de Atribuição Rápida de Leitos */
.beds-allocation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
}

.bed-alloc-tile {
  background: #ffffff;
  border: 2px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 14px 12px;
  text-align: center;
  cursor: pointer;
  transition: all var(--trans-fast);
  user-select: none;
  min-height: 90px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.bed-alloc-tile:hover {
  transform: translateY(-2px);
  border-color: var(--teal-500);
}

.bed-alloc-tile:active {
  transform: scale(0.95);
}

.bed-alloc-number {
  font-size: 16px;
  font-weight: 800;
  color: var(--teal-900);
}

.bed-alloc-tech {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 6px;
  border-radius: 6px;
  margin-top: 4px;
}

/* ==========================================================================
   TELA 5: APRAZAMENTO & PRÉ-VISUALIZAÇÃO DE ETIQUETAS
   ========================================================================== */
.labels-workspace-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.mode-portrait .labels-workspace-layout {
  grid-template-columns: 1fr;
}

/* Régua de Aprazamento Touch */
.aprazamento-timeline-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 0;
  margin: 12px 0;
}

.hour-pill-btn {
  min-width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: var(--bg-app);
  border: 1.5px solid var(--border-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  transition: all var(--trans-fast);
}

.hour-pill-btn.selected {
  background: var(--teal-700);
  border-color: var(--teal-800);
  color: #ffffff;
}

/* Prévia Realista da Etiqueta de Medicação (8,5 x 2,5 cm) */
.label-preview-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 24px;
  background: #334155;
  border-radius: var(--radius-lg);
}

.label-medication-physical {
  width: 360px; /* Proporção 8.5 x 2.5 cm */
  height: 106px;
  background: #ffffff;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  padding: 8px 10px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #000000;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  user-select: none;
}

.label-top-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid #000;
  padding-bottom: 3px;
}

.lbl-bed {
  font-size: 14px;
  font-weight: 900;
}

.lbl-patient-name {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.lbl-pront {
  font-size: 9px;
  font-weight: 600;
}

.lbl-drug-bold {
  font-size: 12px;
  font-weight: 900;
  margin: 3px 0;
  line-height: 1.2;
}

.lbl-bottom-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 9px;
  font-weight: 700;
  border-top: 1px dashed #64748b;
  padding-top: 2px;
}

/* Prévia Realista da Etiqueta de Soro (100 x 100 mm - Quadrada) */
.label-soro-physical {
  width: 280px;
  height: 280px;
  background: #ffffff;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  padding: 12px;
  color: #000000;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  user-select: none;
}

.label-soro-physical .soro-header {
  border-bottom: 2px solid #000;
  padding-bottom: 6px;
  text-align: center;
}

.label-soro-physical .soro-title {
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.label-soro-grid {
  font-size: 10px;
  line-height: 1.5;
  margin: 6px 0;
}

.label-soro-grid strong {
  font-weight: 800;
}

/* ==========================================================================
   TELA 6: RONDA CLÍNICA GUIADA POR ETAPAS (UMA AVALIAÇÃO POR VEZ)
   Experiência Tablet-First com Próximo Paciente Automático
   ========================================================================== */
.ronda-wizard-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 1100px;
  margin: 0 auto;
}

/* Card Dominante de Identificação do Paciente & Fila Contínua */
.ronda-patient-banner {
  background: linear-gradient(135deg, #133e42, #184e54);
  border-radius: var(--radius-lg);
  padding: 18px 24px;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-card);
}

.ronda-patient-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.ronda-bed-badge {
  font-size: 20px;
  font-weight: 900;
  background: rgba(255, 255, 255, 0.15);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.25);
  letter-spacing: 0.5px;
}

.ronda-patient-details h3 {
  font-size: 19px;
  font-weight: 800;
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: 10px;
}

.ronda-patient-details p {
  font-size: 13px;
  color: #cbd5e1;
  margin-top: 3px;
}

.ronda-queue-status {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.ronda-queue-pill {
  background: var(--teal-100);
  color: var(--teal-900);
  font-size: 12px;
  font-weight: 800;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ronda-queue-meta {
  font-size: 11px;
  color: #cbd5e1;
}

/* Stepper Horizontal de 10 Etapas Clínicas */
.ronda-stepper-card {
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 14px 20px;
  box-shadow: var(--shadow-sm);
}

.ronda-stepper-track {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  overflow-x: auto;
  gap: 6px;
  padding: 4px 0;
}

.ronda-step-bubble-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  transition: all var(--trans-fast);
  min-width: 74px;
}

.ronda-step-bubble-btn:hover {
  background: var(--bg-subtle);
}

.ronda-bubble-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  transition: all var(--trans-fast);
}

.ronda-step-bubble-btn.active .ronda-bubble-circle {
  background: var(--teal-700);
  color: #ffffff;
  box-shadow: 0 0 0 4px var(--teal-100);
  transform: scale(1.08);
}

.ronda-step-bubble-btn.completed .ronda-bubble-circle {
  background: #059669;
  color: #ffffff;
}

.ronda-bubble-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
}

.ronda-step-bubble-btn.active .ronda-bubble-label {
  color: var(--teal-900);
  font-weight: 800;
}

/* Palco Central: A Avaliação Atual em Destaque */
.ronda-stage-card {
  background: #ffffff;
  border: 1.5px solid var(--border-card);
  border-radius: var(--radius-xl);
  padding: 30px;
  box-shadow: var(--shadow-card);
  min-height: 420px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
}

.ronda-question-header {
  margin-bottom: 24px;
}

.ronda-step-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--teal-700);
  background: var(--teal-50);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  margin-bottom: 8px;
}

.ronda-question-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--teal-900);
  line-height: 1.3;
  margin-bottom: 6px;
}

.ronda-question-hint {
  font-size: 13px;
  color: var(--text-muted);
}

/* Grade de Botões Grandes de Resposta Rápida (Touch-First 60-78px) */
.ronda-answers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.ronda-touch-button {
  min-height: 68px;
  background: var(--bg-app);
  border: 2px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  text-align: left;
  transition: all var(--trans-fast);
  user-select: none;
}

.ronda-touch-button:hover {
  background: #ffffff;
  border-color: var(--teal-400);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.ronda-touch-button:active {
  transform: scale(0.975);
}

.ronda-touch-button.selected {
  background: var(--teal-50);
  border-color: var(--teal-700);
  box-shadow: 0 4px 16px rgba(19, 62, 66, 0.15);
}

.ronda-touch-icon {
  font-size: 24px;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.ronda-touch-button.selected .ronda-touch-icon {
  background: var(--teal-700);
  color: #ffffff;
}

.ronda-touch-text-wrap {
  flex: 1;
}

.ronda-touch-main-label {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.25;
}

.ronda-touch-sub-desc {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
  line-height: 1.3;
}

.ronda-touch-button.neutro-nao-avaliado {
  border-style: dashed;
  background: #f8fafc;
}

.ronda-touch-button.neutro-nao-avaliado.selected {
  border-style: solid;
  border-color: #475569;
  background: #f1f5f9;
}

/* Componente Especial da Escala de Dor (EVA 0–10) */
.ronda-eva-container {
  background: var(--bg-app);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
}

.ronda-eva-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.ronda-eva-emoji {
  font-size: 42px;
}

.ronda-eva-slider {
  width: 100%;
  height: 12px;
  accent-color: var(--teal-700);
  cursor: pointer;
  margin: 10px 0;
}

/* Área Expansível de Observações Complementares */
.ronda-obs-expandable {
  margin-top: 14px;
}

.ronda-obs-toggle-btn {
  background: transparent;
  border: none;
  color: var(--teal-700);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
}

.ronda-obs-textarea {
  width: 100%;
  height: 70px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-card);
  padding: 10px 14px;
  font-family: inherit;
  font-size: 13px;
  margin-top: 8px;
  outline: none;
  resize: none;
}

.ronda-obs-textarea:focus {
  border-color: var(--teal-700);
  box-shadow: 0 0 0 3px rgba(19, 62, 66, 0.1);
}

/* Barra Inferior de Navegação Estável */
.ronda-stage-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
  margin-top: auto;
}

/* Etapa 10: Resumo e Confirmação da Evolução */
.ronda-summary-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.ronda-summary-card {
  background: var(--bg-app);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 16px;
}

.ronda-summary-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  font-size: 13px;
}

.ronda-summary-item strong {
  color: var(--teal-900);
}

/* Tela de Celebração Quando Todas as Rondas Forem Concluídas */
.ronda-all-completed-screen {
  text-align: center;
  padding: 40px 20px;
  background: #ffffff;
  border: 1.5px solid var(--border-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
}

.ronda-celebration-badge {
  font-size: 64px;
  margin-bottom: 16px;
  animation: gotinhaBounce 1.5s infinite;
}

.ronda-all-completed-screen h2 {
  font-size: 24px;
  font-weight: 800;
  color: var(--teal-900);
  margin-bottom: 8px;
}

.ronda-all-completed-screen p {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 580px;
  margin: 0 auto 24px auto;
  line-height: 1.6;
}


/* ==========================================================================
   TELA 7: MEDICAÇÕES & ADMINISTRAÇÃO CONSCIENTE
   ========================================================================== */
.meds-timeline-table {
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.med-row-item {
  display: grid;
  grid-template-columns: 90px 100px 1.5fr 1fr 120px 140px;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--trans-fast);
}

.med-row-item:hover {
  background: #f8fafc;
}

.med-row-item.atrasado {
  background: #fff8f8;
  border-left: 4px solid var(--status-critical-border);
}

.med-time-box {
  font-size: 15px;
  font-weight: 800;
  color: var(--teal-900);
  font-variant-numeric: tabular-nums;
}

/* Modal dos 9 Certos da Enfermagem */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(10, 37, 40, 0.6);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.open {
  display: flex;
}

.modal-content-box {
  background: #ffffff;
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 620px;
  box-shadow: var(--shadow-modal);
  overflow: hidden;
  animation: modalScale 240ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScale {
  from { opacity: 0; transform: scale(0.94); }
  to { opacity: 1; transform: scale(1); }
}

.nine-rights-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 16px 0;
}

.nine-right-item {
  background: var(--bg-app);
  border: 1px solid var(--border-card);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ==========================================================================
   TOASTS & NOTIFICAÇÕES FLUTUANTES
   ========================================================================== */
#toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast-msg {
  background: var(--teal-900);
  color: #ffffff;
  padding: 12px 20px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
  animation: toastPop 300ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes toastPop {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsividade Adaptável */
@media (max-width: 1024px) {
  .quick-kpi-row {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .quick-kpi-row {
    grid-template-columns: 1fr 1fr;
  }
  .beds-grid {
    grid-template-columns: 1fr;
  }
}
