/* Estilos específicos do Passômetro Médico — HSH */

/* ===== NAV BAR (5 columnas) ===== */
#navbar {
  position: sticky; top: 0; z-index: 1000;
  background: var(--bg-navy); color: #fff;
  padding: 6px 12px;
  display: flex; flex-wrap: wrap;
  align-items: stretch; gap: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

#navbar .nav-col {
  display: flex; flex-direction: column;
  justify-content: center; gap: 2px;
  min-width: 0;
}

/* Col 1: Brand */
#navbar .nav-col-brand {
  white-space: nowrap; flex-shrink: 0;
  line-height: 1.15; gap: 1px;
}
#navbar .nav-col-brand .nav-hosp { font-size: 10pt; font-weight: bold; color: #fff; }
#navbar .nav-col-brand .nav-net  { font-size: 7.5pt; color: var(--blue-light); font-weight: normal; }
#navbar .nav-col-brand .nav-app  { font-size: 8pt; color: var(--teal-light); font-weight: bold; }

/* Col 2: Andar */
#navbar .nav-col-andar { justify-content: center; flex-shrink: 0; }

/* Col 3: Postos (rejilla de leitos) */
#navbar .nav-col-postos { gap: 2px; flex-shrink: 1; min-width: 0; }
#navbar .nav-group { display: flex; flex-wrap: wrap; gap: 3px; align-items: center; }
#navbar .nav-group:empty { display: none; }
#navbar .nav-group-label {
  font-size: 7pt; color: var(--blue-light); font-weight: bold;
  width: 22px; flex-shrink: 0; text-align: left;
}

/* Col 4: Configuração (empujada a la derecha) */
#navbar .nav-col-config {
  gap: 3px; margin-left: auto; flex-shrink: 0;
  align-items: flex-start;
}

/* Col 5: Usuário */
#navbar .nav-col-user {
  gap: 3px; flex-shrink: 0; align-items: stretch;
}

/* Filas horizontales dentro de las columnas */
#navbar .nav-row-h {
  display: flex; align-items: center; gap: 6px;
  flex-wrap: wrap;
}

/* Separadores verticales full-height */
#navbar .nav-sep {
  width: 1px; align-self: stretch;
  background: rgba(255,255,255,0.18);
  margin: 0;
}

/* Inputs y labels en el navbar */
#navbar .nav-label {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 7pt; color: var(--text-muted); white-space: nowrap;
  text-transform: uppercase; letter-spacing: 0.4px;
}
#navbar input[type="date"],
#navbar input[type="text"] {
  font-size: 7.5pt; padding: 0 6px; height: 22px; box-sizing: border-box;
  border: 1px solid var(--border); border-radius: 4px;
  background: var(--bg-mid); color: #fff; outline: none;
}
#navbar input[type="date"]:hover, #navbar input[type="text"]:hover { border-color: var(--border-hover); }
#navbar input[type="text"]::placeholder { color: #8ab; }
#navbar .plantao-box {
  display: inline-flex; gap: 2px; align-items: center;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.06);
  border-radius: 4px; padding: 2px 4px; height: 22px; box-sizing: border-box;
}
#navbar .plantao-box label {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 7pt; color: var(--text-primary); cursor: pointer;
  padding: 0 4px;
}
#navbar .plantao-box input[type="checkbox"] { accent-color: var(--teal-light); margin: 0; }

/* User card (badge + logout píldora unificada) */
.user-card {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg-mid); border: 1px solid var(--border);
  border-radius: 6px; padding: 0 3px 0 8px;
  height: 24px; box-sizing: border-box; white-space: nowrap;
  transition: border-color 0.15s;
}
.user-card:hover { border-color: var(--border-hover); }
.user-card .user-avatar { color: var(--blue-light); }
.user-card .user-name {
  font-size: 8pt; color: var(--text-white); font-weight: 600;
  max-width: 140px; overflow: hidden; text-overflow: ellipsis;
}
.user-card .user-logout-btn {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--red-dark); border: 1px solid var(--red);
  color: #fff; padding: 0 5px; height: 18px; border-radius: 4px;
  cursor: pointer; margin-left: 2px;
  transition: background 0.15s;
}
.user-card .user-logout-btn:hover { background: var(--red); }

/* Botón Admin */
#navbar .nav-admin-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  background: var(--accent-warn); color: #1a1a1a; font-weight: bold;
  font-size: 7.5pt; border: none; padding: 0 10px; height: 22px; border-radius: 4px;
  cursor: pointer; white-space: nowrap; box-sizing: border-box;
}
#navbar .nav-admin-btn:hover { filter: brightness(0.92); }

/* Andar badge (clickable) + dropdown */
#navbar .andar-badge-wrap { position: relative; }
#navbar .andar-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--bg-mid); color: var(--teal-light);
  border: 1px solid var(--border); border-radius: 5px;
  padding: 4px 10px; font-size: 9pt; font-weight: bold;
  cursor: pointer; white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}
#navbar .andar-badge:hover { background: var(--bg-deeper); border-color: var(--teal-light); }
#navbar .andar-badge .andar-chevron { transition: transform 0.15s; color: var(--blue-light); }
#navbar .andar-badge.open .andar-chevron { transform: rotate(180deg); }
.andar-menu {
  position: absolute; top: calc(100% + var(--space-2)); left: 0;
  min-width: 170px;
  background: var(--bg-navy); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: var(--space-2);
  box-shadow: var(--shadow-md);
  z-index: 1100;
  display: flex; flex-direction: column; gap: var(--space-1);
}
.andar-menu.hidden { display: none; }
.andar-menu button {
  display: flex; align-items: center; gap: var(--space-3);
  background: none; border: none; color: var(--text-primary);
  font-size: var(--fs-md); padding: var(--space-3) var(--space-4);
  text-align: left; cursor: pointer;
  border-radius: var(--radius-sm); white-space: nowrap;
  font-family: inherit; font-weight: 500;
  transition: background var(--t-fast), color var(--t-fast);
}
.andar-menu button:hover { background: var(--bg-mid); color: var(--teal-light); }
.andar-menu button.active { background: var(--blue-dark); color: var(--blue-light); font-weight: 700; }
.andar-menu button.active::before { content: '●'; color: var(--teal-light); margin-right: 2px; }

/* Bed buttons (alineados como rejilla) */
.bed-btn {
  position: relative;
  font-size: 7pt; font-weight: bold;
  padding: 3px 0;
  min-width: 32px; text-align: center;
  border-radius: 3px; border: 1px solid var(--border);
  background: #4a5568; color: #e2e8f0; cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
  box-sizing: border-box;
}
.bed-btn:hover { background: var(--border-hover); }
/* Status base: livre (default) → cinza */
.bed-btn.free     { background: #4a5568; color: #e2e8f0; border-color: #4a5568; }
/* Ocupado → verde (teal) */
.bed-btn.occupied { background: #16a34a; color: #fff; border-color: #16a34a; }
/* Bloqueado → laranja (manutenção / limpeza / reserva) */
.bed-btn.blocked  { background: #ea580c; color: #fff; border-color: #ea580c; }
/* Leito selecionado: contorno claro para destacar sem perder a cor de status */
.bed-btn.active   { outline: 2px solid #fff; outline-offset: 1px; box-shadow: 0 0 0 1px rgba(0,0,0,0.4); }
.bed-btn .dot {
  position: absolute; top: -3px; right: -3px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green-light); border: 1px solid var(--bg-navy); display: none;
}
.bed-btn.occupied .dot { display: block; }
.bed-btn.blocked  .dot { display: block; background: #fde68a; }

/* Botão Bloquear no header do leito */
.block-bed-btn {
  font-size: 7pt; padding: 3px 8px; border-radius: 4px; cursor: pointer;
  background: rgba(234,88,12,0.15); color: #ea580c; border: 1px solid rgba(234,88,12,0.5);
  display: inline-flex; align-items: center; gap: 3px;
  transition: all 0.15s;
}
.block-bed-btn:hover { background: rgba(234,88,12,0.3); color: #fff; }
.block-bed-btn.active { background: #ea580c; color: #fff; border-color: #ea580c; }

#save-status-container {
  display: flex;
  padding-right: 2px;
  margin-top: -2px;
}

#save-status {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 6.5pt;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 800;
  letter-spacing: 0.3px;
  white-space: nowrap;
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.4);
  transition: all 0.3s;
}

#save-status.saving { 
  background: #dd6b20; 
  color: #fff;
  box-shadow: 0 0 8px rgba(221, 107, 32, 0.4);
}

#save-status.saved { 
  background: var(--green); 
  color: #fff;
}

#save-status.error { 
  background: var(--red); 
  color: #fff;
}

/* Botão genérico de controles del navbar (Equipe, Imprimir) */
.ctrl-btn {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 7.5pt; padding: 3px 10px; height: 22px; box-sizing: border-box;
  border-radius: 4px; border: 1px solid var(--border);
  background: var(--bg-mid); color: #fff; cursor: pointer; font-weight: bold;
  white-space: nowrap;
}
.ctrl-btn:hover { background: #3a6080; border-color: var(--border-hover); }
.ctrl-btn .chev { margin-left: 2px; opacity: 0.7; }

.print-dd { position: relative; }
/* Legado: mantengo .equipe-btn y .print-dd-btn como aliases */
.equipe-btn, .print-dd-btn {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 7.5pt; padding: 3px 10px; height: 22px; box-sizing: border-box;
  border-radius: 4px; border: 1px solid var(--border);
  background: var(--bg-mid); color: #fff; cursor: pointer; font-weight: bold;
  white-space: nowrap;
}
.equipe-btn:hover, .print-dd-btn:hover { background: #3a6080; }
.print-dd-menu {
  display: none; position: absolute;
  top: calc(100% + var(--space-2)); right: 0; min-width: 170px;
  background: var(--bg-navy); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: var(--space-2);
  z-index: 9999; box-shadow: var(--shadow-md);
  flex-direction: column; gap: var(--space-1);
}
.print-dd-menu.open { display: flex; }
.print-dd-menu button {
  display: flex; align-items: center; gap: var(--space-3);
  width: 100%; text-align: left;
  padding: var(--space-3) var(--space-4); font-size: var(--fs-md);
  color: var(--text-primary); background: none; border: none;
  border-radius: var(--radius-sm); cursor: pointer;
  font-family: inherit; font-weight: 500;
  transition: background var(--t-fast), color var(--t-fast);
}
.print-dd-menu button:hover { background: var(--bg-mid); color: #fff; }

/* ===== MAIN CONTENT ===== */
#app-form-wrapper { padding: 10px; }
.bed-section { display: none; }
.bed-section.visible {
  display: flex; flex-direction: column;
  /* Llenar todo el alto disponible entre navbar y footer */
  min-height: calc(100vh - 130px); /* 70 navbar + 25 footer + 30 padding */
}
.bed-section.visible > .bed-upper {
  flex: 1; min-height: 0;
}
.bed-section.visible > .bed-upper > .bed-table-wrap {
  display: flex; flex-direction: column;
}
.bed-section.visible > .bed-upper > .bed-table-wrap > table.bed-table {
  flex: 1;
  height: 100%;
}
/* Navbar más alto cuando los leitos caen a fila propia (≤1300px) */
@media (max-width: 1300px) {
  .bed-section.visible { min-height: calc(100vh - 140px); }
}

/* ===== BED TABLE ===== */
.bed-table-wrap {
  min-width: 0; /* permite ao flex pai comprimir */
  margin-bottom: 0;
}
table.bed-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 7pt;
  font-family: inherit;
}
table.bed-table th, table.bed-table td {
  border: 1px solid #b0c4d8;
  vertical-align: top;
  padding: 4px 6px;
}
table.bed-table th { border-color: var(--blue-dark); }
/* Column widths */
table.bed-table { width: 100%; table-layout: fixed; }
table.bed-table .col-leito   { width: 11%; }
table.bed-table .col-diag    { width: 12%; }
table.bed-table .col-comor   { width: 11%; }
table.bed-table .col-exames  { width: 20%; }
table.bed-table .col-par     { width: 12%; }
table.bed-table .col-acessos { width: 7%; }
table.bed-table .col-atb     { width: 16%; }
table.bed-table .col-cond    { width: 11%; }

/* BH / Labs row */
.bh-labs-row td { background: var(--bg-light); border-top: 2px solid var(--blue) !important; padding: 6px 10px !important; }
.bh-labs-wrap { display: flex; gap: 0; align-items: stretch; }
.bh-block { flex: 1; padding-right: 16px; border-right: 1px solid #d0d8e0; margin-right: 16px; }
.bh-block:last-child { border-right: none; margin-right: 0; padding-right: 0; }
.bh-block-title { font-weight: bold; font-size: 7pt; color: var(--bg-navy); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.bh-grid { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.bh-field { display: flex; align-items: center; gap: 4px; font-size: 7pt; }
.bh-field b { color: var(--bg-navy); white-space: nowrap; }

/* Lab "Outros" — múltiplas linhas, nome + valor editáveis */
.lab-outros-list { display: flex; flex-direction: column; gap: 3px; }
.lab-outros-row { display: flex; align-items: center; gap: 4px; font-size: 7pt; }
.lab-outros-row .lab-outros-sep { color: var(--bg-navy); font-weight: bold; }
.lab-outros-row .lab-outros-name,
.lab-outros-row .lab-outros-val {
  border: none; border-bottom: 1px solid #aaa; background: transparent;
  font-size: 7pt; padding: 1px 2px; outline: none;
}
.lab-outros-row .lab-outros-name { flex: 0 0 90px; font-weight: bold; color: var(--bg-navy); }
.lab-outros-row .lab-outros-val  { flex: 1; min-width: 0; }
.lab-outros-row .lab-outros-name:focus,
.lab-outros-row .lab-outros-val:focus {
  border-bottom-color: #1a6b8a; background: rgba(255,255,150,0.3);
}
.lab-group-lbl { font-size: 5.5pt; font-weight: bold; color: var(--border-hover); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 3px; border-bottom: 1px solid #e2e8f0; padding-bottom: 1px; }

/* Sinais Vitais */
.sv-section-title { font-size: 6pt; font-weight: bold; color: var(--bg-navy); text-transform: uppercase;
  letter-spacing: 0.5px; margin: 7px 0 4px; border-top: 1px solid #d0d8e0; padding-top: 5px; }
.sv-grid { display: flex; flex-direction: column; gap: 4px; }
.sv-row { display: flex; align-items: center; gap: 4px; font-size: 7pt; flex-wrap: nowrap; }
.sv-lbl { font-weight: bold; color: var(--bg-navy); min-width: 28px; white-space: nowrap; }
.sv-val-inp { width: 38px !important; border: none !important; border-bottom: 1px solid #aaa !important;
  background: transparent; font-size: 7pt; padding: 1px 2px; }
.sv-chips { display: flex; gap: 2px; flex-wrap: nowrap; }
.sv-chip { font-size: 5.5pt; padding: 1px 5px; border: 1px solid #bbb; border-radius: 10px;
  background: var(--bg-light); cursor: pointer; white-space: nowrap; color: #666; line-height: 1.5; }
.sv-chip:hover { border-color: #888; }
.sv-chip.sv-active { color: #fff; border-color: transparent; font-weight: bold; }
.sv-chip[data-danger="ok"].sv-active  { background: #27ae60; }
.sv-chip[data-danger="warn"].sv-active { background: #e74c3c; }
.sv-chip[data-danger="caution"].sv-active { background: #e67e22; }

/* Febre / Glicemia min–max */
.bh-range { display: flex; align-items: center; gap: 2px; }
.bh-range input { width: 36px !important; }
.bh-range .sep { color: #999; font-size: 7pt; }
.bh-field input { width: 55px; border: none; border-bottom: 1px solid #aaa; background: transparent;
  font-size: 7pt; font-family: inherit; outline: none; padding: 1px 2px; }
.bh-field input:focus { border-bottom-color: #1a6b8a; background: rgba(255,255,150,0.3); }

/* PARECERES slots */
.par-slot { margin-bottom: 7px; padding-bottom: 6px; border-bottom: 1px solid #e8e8e8; }
.par-slot:last-child { border-bottom: none; margin-bottom: 0; }
.par-header { display: flex; gap: 4px; align-items: center; margin-bottom: 3px; }
.par-spec { flex: 1; font-weight: bold; font-size: 7pt !important; }
.par-date { width: 50px !important; font-size: 6.5pt !important; color: #555; }
.par-resp-area { min-height: 28px; max-height: 70px; overflow-y: auto;
  font-size: 6.5pt; outline: none; color: #333;
  border: 1px dashed #ccc; border-radius: 2px; padding: 2px 3px; width: 100%;
  font-family: inherit; word-break: break-word; }
.par-resp-area:focus { border-color: #1a6b8a; background: rgba(255,255,150,0.2); outline: none; }
.par-resp-area:empty::before { content: attr(data-ph); color: #bbb; pointer-events: none; font-style: italic; }

/* Laudo de exames: cresce com o conteúdo, sem scroll */
.col-exames .par-resp-area { max-height: none; overflow-y: visible; }

/* ACESSOS rows */
.acesso-row { display:flex; flex-direction:column; margin-bottom:4px; font-size:6.5pt; }
.acesso-top { display:flex; align-items:baseline; gap:3px; }
.acesso-lbl { font-weight:bold; white-space:nowrap; min-width:34px; }
.acesso-date-row { display:flex; align-items:baseline; gap:2px; margin-top:1px; padding-left:36px; color:#555; flex-wrap:wrap; }
.date-lbl { font-size:6pt; color:#555; white-space:nowrap; }
.date-inp { width:42px !important; font-size:6pt !important; }
.d-badge { display:inline-block; background:#27ae60; color:#fff; font-size:5.5pt;
  border-radius:var(--radius-sm); padding:0 3px; margin-left:3px; vertical-align:middle; font-weight:bold; }

/* Native <input type="date"> usado fora do widget compacto (ADM, DN, g-data, etc.) */
input[type="date"].lf-inp { width: 110px !important; padding: 1px 2px; font-size: 7pt; }
input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer; padding: 0; margin-left: 1px;
  opacity: 0.55; filter: invert(0.2);
}
input[type="date"]::-webkit-calendar-picker-indicator:hover { opacity: 1; }
input[type="date"]::-webkit-inner-spin-button,
input[type="date"]::-webkit-clear-button { display: none; }

/* ===== Widget de data compacto (mostra dd/mm, oculta ano corrente) =====
   O <input type="date"> fica invisível por cima do .cdate-text — o usuário vê o texto,
   mas clica direto no input nativo (que abre o picker sozinho, sem precisar de JS). */
.cdate {
  display: inline-block; position: relative;
  line-height: 1.1; vertical-align: middle;
  font-family: 'JetBrains Mono', monospace; font-size: 6.5pt;
}
.cdate-text {
  display: inline-block;
  padding: 2px 5px;
  border: 1px solid transparent;
  border-bottom: 1px dashed #aaa;
  background: transparent;
  min-width: 32px; text-align: center;
  color: #1a2530;
  user-select: none;
  border-radius: 2px;
  white-space: nowrap;
  pointer-events: none;       /* não bloqueia clicks no input */
}
.cdate:hover .cdate-text {
  border-color: var(--blue);
  background: rgba(37,99,235,0.05);
  color: var(--blue);
}
.cdate input.cdate-input[type="date"] {
  position: absolute !important; left: 0 !important; top: 0 !important;
  width: 100% !important; height: 100% !important;
  opacity: 0 !important;
  border: 0 !important; padding: 0 !important; margin: 0 !important;
  font-size: 0 !important;
  cursor: pointer;            /* input invisível mas clicável */
}

/* Floating calendar picker */
#floatcal { position:fixed; z-index:9999; background:#fff; border:1px solid #aaa;
  border-radius:var(--radius-lg); box-shadow:var(--shadow-md); padding:8px; width:210px;
  font-size:9pt; user-select:none; display:none; }
#floatcal.open { display:block; }
#floatcal .cal-header { display:flex; align-items:center; justify-content:space-between;
  margin-bottom:6px; font-weight:bold; color:var(--bg-navy); }
#floatcal .cal-nav { background:none; border:none; cursor:pointer; font-size:13pt;
  color:var(--bg-navy); padding:0 4px; line-height:1; }
#floatcal .cal-nav:hover { color:#e74c3c; }
#floatcal .cal-grid { display:grid; grid-template-columns:repeat(7,1fr); gap:2px; }
#floatcal .cal-dow { text-align:center; font-size:7pt; color:#888; font-weight:bold; }
#floatcal .cal-day { text-align:center; border-radius:var(--radius-md); padding:3px 1px; cursor:pointer;
  font-size:8.5pt; }
#floatcal .cal-day:hover { background:#d4e9f7; }
#floatcal .cal-day.today { font-weight:bold; color:#e74c3c; }
#floatcal .cal-day.selected { background:var(--bg-navy); color:#fff !important; border-radius:var(--radius-md); }
#floatcal .cal-day.other-month { color:#ccc; }
#floatcal .cal-footer { display:flex; justify-content:flex-end; margin-top:6px; gap:6px; }
#floatcal .cal-btn { background:none; border:1px solid #aaa; border-radius:var(--radius-md);
  font-size:7.5pt; cursor:pointer; padding:2px 7px; }
#floatcal .cal-btn:hover { background:#eee; }

/* Equipe modal */
#equipe-modal-overlay {
  position: fixed; inset: 0; background: rgba(15, 33, 51, 0.55);
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
  z-index: 8000; display: none; align-items: center; justify-content: center;
  padding: var(--space-6);
}
#equipe-modal-overlay.open { display: flex; }
#equipe-modal {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: var(--space-7) var(--space-7) var(--space-6);
  min-width: 340px; max-width: 460px; width: 100%;
  box-shadow: var(--shadow-lg);
}
#equipe-modal h3 {
  margin: 0 0 var(--space-6);
  color: var(--bg-navy); font-size: var(--fs-lg);
  display: flex; align-items: center; gap: var(--space-3);
  border-bottom: 2px solid var(--blue); padding-bottom: var(--space-3);
}
.eq-posto {
  margin-bottom: var(--space-5);
  border-bottom: 1px solid #e0e0e0;
  padding-bottom: var(--space-5);
}
.eq-posto:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.eq-posto h4 {
  margin: 0 0 var(--space-3);
  font-size: var(--fs-sm); font-weight: 700;
  color: var(--blue-dark);
  text-transform: uppercase; letter-spacing: .5px;
}
.eq-posto label {
  font-size: var(--fs-md); color: #555;
  display: flex; align-items: center; gap: var(--space-3);
  margin-bottom: var(--space-3);
}
.eq-posto input {
  flex: 1;
  height: var(--ctrl-h-md); padding: 0 var(--space-3);
  border: 1px solid #ccc; border-radius: var(--radius-md);
  font-size: var(--fs-md); font-family: inherit;
  outline: none; transition: border-color var(--t-fast);
}
.eq-posto input:focus { border-color: var(--blue); }
#equipe-modal .modal-close-btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: var(--ctrl-h-md); padding: 0 var(--space-6);
  background: var(--bg-navy); color: #fff; border: none;
  border-radius: var(--radius-md);
  font-size: var(--fs-md); font-weight: 600; font-family: inherit;
  cursor: pointer; margin-top: var(--space-5); float: right;
  transition: background var(--t-fast);
}
#equipe-modal .modal-close-btn:hover { background: var(--bg-deeper); }

/* ===== PHOTOS / PDF MODAL ===== */
#photos-overlay { position:fixed; inset:0; background:rgba(0,0,0,.5); z-index:8500;
  display:none; align-items:center; justify-content:center; padding:12px; }
#photos-overlay.open { display:flex; }
#photos-modal { background:#fff; border-radius:var(--radius-lg); width:min(820px,96vw); max-height:90vh;
  display:flex; flex-direction:column; box-shadow:0 8px 32px rgba(0,0,0,.35); overflow:hidden; }
.photos-header { display:flex; align-items:center; justify-content:space-between;
  padding:12px 16px; background:var(--bg-navy); color:#fff; }
.photos-header h3 { font-size:11pt; margin:0; }
.photos-header-close { background:none; border:none; color:#fff; font-size:16pt;
  cursor:pointer; line-height:1; padding:0 4px; }
.photos-upload-area { padding:10px 16px; background:#f0f5fa; border-bottom:1px solid #d0d8e0; }
.photos-meta-row { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.photos-meta-row select, .photos-meta-row input[type="text"] {
  border:1px solid #ccc; border-radius:var(--radius-md); padding:5px 8px; font-size:8.5pt; }
.photos-meta-row select { width:130px; }
.photos-meta-row input[type="text"] { flex:1; min-width:160px; }
.photo-file-btn { display:inline-flex; align-items:center; gap:5px;
  background:var(--bg-navy); color:#fff; border:none; border-radius:var(--radius-md);
  padding:5px 12px; font-size:8.5pt; cursor:pointer; white-space:nowrap; }
.photo-file-btn:hover { background:var(--blue-dark); }
.photo-grid { flex:1; overflow-y:auto; padding:12px 16px;
  display:grid; grid-template-columns:repeat(auto-fill,minmax(160px,1fr)); gap:10px; }
.photo-empty, .photo-loading { grid-column:1/-1; text-align:center;
  color:#888; font-size:9pt; padding:30px; }
.photo-thumb { position:relative; border:1px solid #d0d8e0; border-radius:var(--radius-md);
  overflow:hidden; background:#f8fafc; display:flex; flex-direction:column; }
.photo-thumb img { width:100%; height:110px; object-fit:cover; cursor:zoom-in; }
.photo-thumb-pdf { height:110px; display:flex; flex-direction:column; align-items:center;
  justify-content:center; gap:6px; cursor:pointer; background:#fff3f0; color:#c0392b; font-size:9pt; }
.photo-thumb-pdf span { font-size:26pt; }
.photo-thumb-info { padding:5px 7px; font-size:7pt; }
.photo-type-badge { display:inline-block; background:var(--bg-navy); color:#fff;
  border-radius:var(--radius-sm); padding:1px 5px; font-size:6pt; font-weight:bold; margin-bottom:2px; }
.photo-label { display:block; font-size:7.5pt; color:#222; white-space:nowrap;
  overflow:hidden; text-overflow:ellipsis; }
.photo-date { display:block; font-size:6.5pt; color:#888; }
.photo-delete-btn { position:absolute; top:4px; right:4px; background:rgba(0,0,0,.5);
  color:#fff; border:none; border-radius:50%; width:20px; height:20px; cursor:pointer;
  font-size:9pt; line-height:1; display:flex; align-items:center; justify-content:center; }
.photo-delete-btn:hover { background:#e74c3c; }
.photos-footer { padding:10px 16px; text-align:right; border-top:1px solid #eee; }
.photos-close-btn { background:var(--bg-navy); color:#fff; border:none; border-radius:var(--radius-md);
  padding:6px 18px; font-size:9pt; cursor:pointer; }

/* Lightbox */
#lightbox-overlay { position:fixed; inset:0; background:rgba(0,0,0,.88); z-index:9500;
  display:none; align-items:center; justify-content:center; }
#lightbox-overlay.open { display:flex; }
#lightbox-img { max-width:92vw; max-height:90vh; border-radius:var(--radius-md);
  box-shadow:0 4px 24px rgba(0,0,0,.5); cursor:zoom-out; }
#lightbox-pdf { width:min(860px,92vw); height:88vh; border:none; border-radius:var(--radius-md); }
#lightbox-close { position:fixed; top:14px; right:18px; background:rgba(255,255,255,.15);
  border:none; color:#fff; font-size:20pt; cursor:pointer; border-radius:50%;
  width:36px; height:36px; display:flex; align-items:center; justify-content:center; }

/* Photo btn in bed header */
.photo-btn { font-size:6pt; padding:2px 7px; border-radius:var(--radius-sm); border:1px solid #4a9a8b;
  background:#1a7a6a; color:#fff; cursor:pointer; font-weight:bold; white-space:nowrap; }
.photo-btn:hover { background:#15665a; }

/* ATB rows */
.atb-row { display:flex; align-items:baseline; gap:3px; margin-bottom:3px; flex-wrap:wrap; }
.atb-name-inp { flex:1; min-width:50px; }
.atb-date-inp { width:44px !important; font-size:6pt !important; }

/* Prévio: nome + data início + → + data término. Se nome não couber, quebra para
   nome em cima e datas embaixo (usa container queries — suportado nos navegadores
   modernos). */
.atb-section[data-rows="atb_prev"] { container-type: inline-size; }
.atb-prev-row { flex-wrap: nowrap; align-items: center; }
.atb-prev-row .atb-name-inp { min-width: 40px; flex: 1 1 auto; }
.atb-prev-row input[type="date"].atb-date-inp { width: 80px !important; padding: 1px 2px; font-size: 6pt !important; }
.atb-prev-row .atb-arrow { font-size: 7pt; color: #94a3b8; padding: 0 1px; }
@container (max-width: 200px) {
  .atb-prev-row { flex-wrap: wrap; }
  .atb-prev-row .atb-name-inp { flex: 1 1 100%; }
}

/* Campo DN: o select de ano fica escondido por padrão e aparece quando o usuário
   passa o mouse na linha ou foca em qualquer campo dela (para não poluir a coluna). */
.dn-row { gap: 3px; }
.dn-row .dn-date { flex: 1 1 auto; min-width: 0; }
.dn-row .dn-year-quick {
  display: none;
  font-size: 6.5pt; padding: 1px 2px; border: 1px solid var(--blue);
  border-radius: 3px; background: #fff; color: var(--bg-navy);
  cursor: pointer; max-width: 60px;
}
.dn-row:hover .dn-year-quick,
.dn-row:focus-within .dn-year-quick { display: inline-block; }

/* Acessos: chips toggle multi-select + sub-divs ocultas até ativar */
.acesso-widget { display:flex; flex-direction:column; gap:4px; }
.chip-row.acesso-chips { gap:3px; flex-wrap:wrap; margin-bottom:3px; }
.acesso-chip {
  font-size: 7pt; padding: 3px 7px; border-radius: 4px;
  background: #f1f5f9; color: #64748b; border: 1px solid #cbd5e1;
  cursor: pointer; transition: all 0.15s; font-weight: 600;
}
.acesso-chip:hover { background: #e2e8f0; color: #1a2530; }
.acesso-chip.active {
  background: #16a34a; color: #fff; border-color: #15803d;
  box-shadow: 0 1px 2px rgba(22,163,74,0.3);
}
.acesso-subs { display:flex; flex-direction:column; gap:2px; }
.acesso-sub { display: none; padding: 3px 0 4px; border-top: 1px dotted #e2e8f0; }
.acesso-sub.open { display: block; }
.acesso-sub:first-of-type.open { border-top: none; padding-top: 0; }

/* Botão "+ adicionar" dentro das seções de ATB e culturas */
.add-row-btn {
  background: transparent; border: 1px dashed #94a3b8; color: #64748b;
  font-size: 7pt; padding: 2px 8px; border-radius: 4px; cursor: pointer;
  margin-top: 3px; display: inline-flex; align-items: center; gap: 3px;
  transition: all 0.15s;
}
.add-row-btn:hover { border-color: var(--blue); color: var(--blue); background: rgba(37,99,235,0.05); }
.add-row-btn .mi { font-size: 9pt; }

/* Cultura: linha com nome+data + linha com resultado (sem badge D+) */
.cult-row { display:flex; flex-direction:column; gap:2px; margin-bottom:5px;
  padding-bottom:4px; border-bottom:1px dotted #e2e8f0; }
.cult-row:last-child { border-bottom:none; }
.cult-top  { display:flex; align-items:baseline; gap:4px; flex-wrap:wrap; }
.cult-name-inp { flex: 0 1 auto; min-width:60px; max-width: calc(100% - 50px); font-size:6.5pt !important; }
.cult-date-inp { font-size:6pt !important; }
input[type="date"].cult-date-inp { width:100px !important; padding:1px 2px; font-size:6.5pt !important; }
.cult-resp-inp { width:100%; font-size:6.5pt !important; color:#555;
  border:none !important; border-bottom:1px solid #d1d5db !important;
  background:transparent; padding:1px 2px; outline:none; }
.cult-resp-inp:focus { border-bottom-color:#1a6b8a !important; background:rgba(255,255,150,0.25); }

/* PARECERES column */
.par-row { display:flex; flex-direction:column; margin-bottom:5px; font-size:6.5pt; }
.par-name-inp { font-size:6.5pt; font-weight:bold; }
.par-bottom { display:flex; align-items:baseline; gap:3px; margin-top:1px; flex-wrap:wrap; }
.par-date-inp { width:44px !important; font-size:6pt !important; }
.par-resp { font-size:6pt; color:#555; white-space:nowrap; }

/* Header row */
.bed-table thead th {
  background: linear-gradient(180deg, var(--bg-navy) 0%, var(--blue-dark) 100%);
  color: var(--blue-light); font-size: 7.5pt; font-weight: bold;
  text-align: center; padding: 5px 3px; letter-spacing: 0.3px;
  text-transform: uppercase; border-bottom: 2px solid var(--blue);
}

/* ===== LEITO column — redesigned ===== */
.col-leito-cell {
  background: #fff !important;
  padding: 0 !important;
  vertical-align: top;
}
/* Dark header: bed number + patient name */
.leito-head {
  background: var(--bg-navy);
  padding: var(--space-4) var(--space-4) var(--space-3);
  border-bottom: 3px solid var(--blue);
  display: flex; flex-direction: column; gap: var(--space-3);
}
td.prec-bg-contato   .leito-head { background: #b45309; }
td.prec-bg-goticular .leito-head { background: #c2410c; }
td.prec-bg-aerossol  .leito-head { background: #b91c1c; }
.leito-num {
  display: inline-flex; align-items: center;
  background: var(--blue);
  color: #fff;
  font-size: var(--fs-xl);
  font-weight: 700;
  border-radius: var(--radius-md);
  padding: 2px var(--space-4);
  line-height: 1.2;
  letter-spacing: 0.5px;
}
.leito-num-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
}
.clear-bed-btn {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 5.5pt; padding: 2px 6px; border-radius: 3px;
  border: 1px solid rgba(252, 129, 129, 0.35);
  background: rgba(229, 62, 62, 0.12);
  color: #fc8181;
  white-space: nowrap; font-weight: bold;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.clear-bed-btn:hover {
  background: rgba(229, 62, 62, 0.55);
  color: #fff;
  border-color: #fc8181;
}
.leito-pac-name {
  font-size: 8.5pt;
  font-weight: bold;
  color: #fff;
  min-height: 15px;
  width: 100%;
  outline: none;
  word-break: break-word;
  border-bottom: 1px solid rgba(255,255,255,0.25);
  padding-bottom: 2px;
  cursor: text;
}
.leito-pac-name:focus { background: rgba(255,255,255,0.08); border-radius: 2px; outline: none; }
.leito-pac-name:empty::before {
  content: 'Nome do paciente';
  color: rgba(255,255,255,0.35);
  font-style: italic; font-weight: normal; font-size: 7.5pt;
  pointer-events: none;
}
/* Body: fields on white */
.leito-body { padding: 6px 7px 5px; }
.lf-row {
  display: grid;
  grid-template-columns: 50px 1fr;
  align-items: center;
  gap: 0 4px;
  margin-bottom: 4px;
  min-height: 15px;
}
.lf-lbl {
  font-size: 6pt;
  font-weight: bold;
  color: var(--border-hover);
  text-transform: uppercase;
  letter-spacing: 0.2px;
  white-space: nowrap;
}
.lf-inp {
  font-size: 7pt;
  border: none;
  border-bottom: 1px solid #dde8f0;
  background: transparent;
  outline: none;
  width: 100%;
  padding: 1px 2px;
  font-family: inherit;
  color: #111;
  transition: border-color 0.15s;
}
.lf-inp:focus { border-bottom-color: #1a6b8a; background: rgba(255,255,150,0.25); }

/* Precaução inside leito body */
.prec-section {
  margin-top: 5px;
  padding-top: 4px;
  border-top: 1px solid #edf2f7;
}
.prec-section-lbl {
  font-size: 5.5pt; font-weight: bold; color: var(--border-hover);
  text-transform: uppercase; letter-spacing: 0.3px; margin-bottom: 3px;
}
.prec-chips { display: flex; flex-wrap: wrap; gap: 2px; }
.prec-chip {
  font-size: 5.5pt; padding: 2px 4px; border-radius: 3px; cursor: pointer;
  border: 1px solid transparent; font-weight: bold;
  white-space: nowrap; user-select: none; transition: opacity 0.1s, outline 0.1s;
}
.prec-chip:hover { opacity: 0.75; }
.prec-chip[data-type="PADRÃO"]    { background: #e2e8f0; border-color: #a0aec0; color: #2d3748; }
.prec-chip[data-type="CONTATO"]   { background: #fef3c7; border-color: #d97706; color: #78350f; }
.prec-chip[data-type="GOTÍCULAS"] { background: #ffedd5; border-color: #ea580c; color: #7c2d12; }
.prec-chip[data-type="AEROSSOL"]  { background: #fee2e2; border-color: #dc2626; color: #7f1d1d; }
.prec-chip.selected { outline: 2px solid #1a6b8a; outline-offset: 1px; }

.prec-bg-padrao    { /* default — leito-head stays var(--bg-navy) */ }
.prec-bg-contato   { background: #fef3c7 !important; }
.prec-bg-goticular { background: #ffedd5 !important; }
.prec-bg-aerossol  { background: #fee2e2 !important; }

/* contenteditable */
[contenteditable="true"] {
  outline: none; min-height: 18px; width: 100%;
  padding: 0; cursor: text;
}
[contenteditable="true"]:hover { background: rgba(255,255,200,0.4); border-radius: 2px; }
[contenteditable="true"]:focus { outline: 1px solid #1a6b8a; border-radius: 2px; background: rgba(200,240,255,0.2); }

/* Input fields inline */
.inline-input {
  border: none; background: transparent; font-size: 7pt; font-family: inherit;
  outline: none; width: 100%; color: #111;
}
.inline-input:hover { background: rgba(255,255,200,0.4); border-radius: 2px; }
.inline-input:focus { outline: 1px solid #1a6b8a; border-radius: 2px; }

/* ATB section */
.atb-section { margin-bottom: 5px; }
.atb-label { font-size: 7.5pt; font-weight: bold; color: var(--bg-navy); margin-bottom: 2px; display: block; }

/* Condutas section */
.cond-row { display: flex; align-items: center; gap: 4px; margin-bottom: 4px; flex-wrap: wrap; }
.cond-label { font-weight: bold; font-size: 7pt; white-space: nowrap; min-width: 58px; color: var(--bg-navy); }
.cond-input { flex: 1; font-size: 7pt; border: none; background: transparent; outline: none; font-family: inherit; min-width: 60px; }
.cond-input:hover { background: rgba(255,255,200,0.4); border-radius: 2px; }
.cond-input:focus { outline: 1px solid #1a6b8a; border-radius: 2px; }

/* Quick-select chips */
.chip-row { display: flex; flex-wrap: wrap; gap: 2px; margin-top: 1px; margin-bottom: 3px; }
.chip {
  font-size: 5.5pt; padding: 1px 4px; border-radius: 8px; cursor: pointer;
  border: none; background: #dde8f0; color: var(--bg-navy); font-weight: bold;
  white-space: nowrap; user-select: none; font-family: inherit;
  transition: background 0.1s;
}
.chip:hover { background: #b8d4e8; }
.chip.active { background: var(--bg-navy); color: #fff; }

/* DVA inline infusion rows */
.dva-btn {
  font-size: 6pt; padding: 1px 4px; border-radius: 3px; border: 1px solid var(--teal);
  background: #e6f4f1; cursor: pointer; color: var(--bg-navy); white-space: nowrap;
}
.dva-btn:hover { background: var(--teal); color: #fff; }
.dva-inline-row {
  display: flex; align-items: center; gap: 2px; margin-bottom: 3px; flex-wrap: wrap;
}
.dva-row-top { display: flex; align-items: center; gap: 2px; flex: 0 0 100%; }
.dva-drug-name {
  width: 54px; font-size: 6.5pt; padding: 1px 3px; border: 1px solid #c0d0dd;
  border-radius: 3px; background: #f8fbfd; color: #111; font-family: inherit;
}
.dva-mlh {
  width: 30px; font-size: 6.5pt; padding: 1px 3px; border: 1px solid #c0d0dd;
  border-radius: 3px; background: #f8fbfd; color: #111; font-family: inherit;
}
.dva-unit { font-size: 5.5pt; color: #666; white-space: nowrap; }
.dva-conc-sel {
  font-size: 5.5pt; padding: 1px 2px; border: 1px solid #c0d0dd; border-radius: 3px;
  background: #f8fbfd; color: var(--bg-navy); width: 100%; flex: 0 0 100%; cursor: pointer;
}
.dva-calc-result {
  font-size: 6pt; font-weight: bold; color: var(--teal); white-space: nowrap;
  background: #e6f4f1; border-radius: 3px; padding: 1px 3px; min-width: 28px;
}

/* CrCl widget */
.crcl-box { margin-top: 6px; border-top: 1px dashed #c0d0dd; padding-top: 5px; }
.crcl-title { font-size: 5.5pt; font-weight: bold; color: var(--border-hover); text-transform: uppercase;
  letter-spacing: .4px; display: block; margin-bottom: 3px; }
.crcl-sex-row { display: flex; gap: 3px; margin-bottom: 3px; }
.crcl-sex-btn { font-size: 6pt; padding: 1px 6px; border: 1px solid #bbb; border-radius: 10px;
  background: var(--bg-light); cursor: pointer; color: #555; }
.crcl-sex-btn.active { background: var(--bg-navy); color: #fff; border-color: transparent; }
.crcl-result { font-size: 7pt; font-weight: bold; padding: 3px 6px; border-radius: 4px;
  text-align: center; margin-top: 1px; }
.crcl-ok      { background: #d4edda; color: #155724; }
.crcl-warn    { background: #fff3cd; color: #856404; }
.crcl-danger  { background: #f8d7da; color: #721c24; }
.crcl-neutral { background: #e9ecef; color: #555; }

/* Bed upper layout: tabla principal + sidebar derecho (Condutas + Pendências) */
.bed-upper {
  display: flex;
  gap: 0;
  align-items: stretch;
}
.bed-upper > .bed-table-wrap {
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
}

/* Sidebar derecho: stack vertical de Condutas + Pendências */
.bed-side {
  flex-shrink: 0;
  width: 200px;
  display: flex; flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
}
.bed-side .cond-full-block {
  flex: 1;
  min-height: 0;
  display: flex; flex-direction: column; gap: var(--space-1);
  background: #f5f8fb;
  padding: var(--space-2) var(--space-3) var(--space-3);
  border-radius: 0 !important;
  border: 1px solid #d0d8e0;
}
.bed-side .cond-full-lbl {
  font-size: 5.5pt; font-weight: bold; color: var(--bg-navy);
  text-transform: uppercase; letter-spacing: .5px;
  display: inline-flex; align-items: center; gap: 3px;
}
.bed-side .cond-area {
  flex: 1;
  min-height: 60px;
  max-height: 100%;
  overflow-y: auto;
  font-size: var(--fs-base);
  border: 1px solid #c8d8e8; border-radius: 0 !important;
  background: #fff;
  padding: var(--space-2) var(--space-3);
  font-family: inherit;
}

/* Responsive: pantallas estrechas — sidebar baja debajo de la tabla */
@media (max-width: 1100px) {
  .bed-upper { flex-direction: column; }
  .bed-side { width: 100%; }
  .bed-side .cond-full-block { min-height: 80px; }
}

/* Print: sidebar baja debajo para mantener orden de papel */
@media print {
  .bed-upper { flex-direction: column; gap: 4px; }
  .bed-side { width: 100%; gap: 4px; }
  .bed-side .cond-full-block { min-height: auto; border: none; padding: 4px 6px; background: transparent; }
  .bed-side .cond-area { max-height: none; overflow: visible; }
}

/* ===== DVA MODAL ===== */
#dva-modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.55); z-index: 9000;
  align-items: center; justify-content: center;
}
#dva-modal-overlay.open { display: flex; }
#dva-modal {
  background: #fff; border-radius: 8px; padding: 20px; min-width: 360px; max-width: 420px;
  box-shadow:var(--shadow-lg);
}

/* ===== Modal Colar em Lote ===== */
#paste-modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.6); z-index: 9100;
  align-items: center; justify-content: center; padding: 20px;
}
#paste-modal-overlay.open { display: flex; }
#paste-modal {
  background: #fff; border-radius: 10px; padding: 22px 24px;
  width: 540px; max-width: 96vw; max-height: 92vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}
#paste-modal h3 {
  margin: 0 0 8px; color: var(--bg-navy); font-size: 13pt;
  display: flex; align-items: center; gap: 8px;
}
#paste-modal .paste-help {
  font-size: 8pt; color: #64748b; line-height: 1.4; margin: 0 0 14px;
  padding: 8px 10px; background: #f1f5f9; border-radius: 6px; border-left: 3px solid var(--blue);
}
#paste-modal .paste-help code {
  background: #e2e8f0; padding: 1px 5px; border-radius: 3px;
  font-family: 'JetBrains Mono', monospace; font-size: 7.5pt; color: var(--bg-navy);
}
.paste-section { margin-bottom: 12px; }
.paste-section label {
  display: block; font-size: 8.5pt; font-weight: 700; color: var(--bg-navy);
  margin-bottom: 4px;
}
.paste-section .paste-hint {
  font-weight: 400; color: #94a3b8; font-size: 7.5pt; margin-left: 4px;
}
.paste-section textarea {
  width: 100%; box-sizing: border-box;
  padding: 8px 10px; border-radius: 6px; border: 1px solid #cbd5e1;
  font-family: 'JetBrains Mono', monospace; font-size: 8.5pt; line-height: 1.4;
  background: #fafbfc; color: #1a2530;
  resize: vertical; min-height: 40px; outline: none;
}
.paste-section textarea:focus {
  border-color: var(--blue); background: #fff;
  box-shadow: 0 0 0 2px rgba(37,99,235,0.15);
}
.paste-buttons {
  display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px;
  padding-top: 14px; border-top: 1px solid #e2e8f0;
}
.paste-btn-cancel, .paste-btn-apply {
  padding: 8px 16px; border-radius: 6px; font-size: 9pt; font-weight: 600;
  cursor: pointer; display: inline-flex; align-items: center; gap: 5px;
  transition: all 0.15s;
}
.paste-btn-cancel { background: transparent; color: #64748b; border: 1px solid #cbd5e1; }
.paste-btn-cancel:hover { background: #f1f5f9; color: #334155; }
.paste-btn-apply  { background: var(--blue); color: #fff; border: 1px solid var(--blue); }
.paste-btn-apply:hover { background: var(--blue-hover); border-color: var(--blue-hover); }

.paste-section-title { color: var(--blue); font-weight: 700; }

#paste-modal textarea {
  width: 100%; box-sizing: border-box;
  padding: 10px 12px; border-radius: 6px; border: 1px solid #cbd5e1;
  font-family: 'JetBrains Mono', monospace; font-size: 8.5pt; line-height: 1.5;
  background: #fafbfc; color: #1a2530;
  resize: vertical; min-height: 160px; outline: none;
}
#paste-modal textarea:focus {
  border-color: var(--blue); background: #fff;
  box-shadow: 0 0 0 2px rgba(37,99,235,0.15);
}

/* Títulos/labels clicáveis para abrir o modal de paste */
.pasteable-th, .pasteable-label {
  cursor: pointer; user-select: none;
  transition: background 0.15s, color 0.15s;
}
.pasteable-th:hover { background: rgba(37,99,235,0.08); color: var(--blue); }
.pasteable-label:hover { color: var(--blue); }
.paste-icon {
  opacity: 0.45; vertical-align: middle; margin-left: 3px;
  transition: opacity 0.15s, transform 0.15s;
}
.pasteable-th:hover .paste-icon,
.pasteable-label:hover .paste-icon { opacity: 1; transform: scale(1.1); }

/* ===== PRINT STYLES ===== */
@media print {
  #navbar, #save-status, .dva-btn, .chip, .chip-row, .prec-chips, .print-dd { display: none !important; }
  body { background: #fff; font-size: 7pt; }
  .bed-section { display: block !important; }
  table.bed-table { min-width: unset; width: 100%; }
}

/* Flags (VIP, Cuidados Paliativos) — píldoras toggleables */
.flag-btn {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 5.5pt; font-weight: 700;
  padding: 2px var(--space-3);
  border-radius: var(--radius-pill);
  border: 1.5px solid transparent;
  cursor: pointer; user-select: none;
  opacity: 0.4;
  font-family: inherit;
  transition: opacity var(--t-fast), background var(--t-fast);
}
.flag-btn:hover { opacity: 0.7; }
.flag-btn.active { opacity: 1; }
.flag-btn[data-flag="vip"]  { background: #fef9c3; border-color: #ca8a04; color: #713f12; }
.flag-btn[data-flag="cp"]   { background: #f3e8ff; border-color: #9333ea; color: #581c87; }

/* === VISTA ADMINISTRATIVA (FULL PAGE DASHBOARD) === */
#admin-view {
  position: fixed; inset: 0; z-index: 10005;
  background: var(--bg-dark);
  display: flex; /* Sidebar + Main Content */
  font-family: 'Inter', sans-serif;
  color: #fff;
}

/* Sidebar Admin */
.admin-nav {
  width: 240px; background: var(--bg-navy);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
}
.admin-nav-brand {
  padding: 30px 20px; font-weight: bold; font-size: 14pt;
  display: flex; align-items: center; gap: 10px; color: var(--blue-light);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.admin-nav-links { flex: 1; padding: 20px 0; }
.admin-nav-btn {
  width: 100%; padding: 12px 20px; background: none; border: none;
  color: var(--text-muted); display: flex; align-items: center; gap: 12px;
  cursor: pointer; text-align: left; font-size: 9pt; transition: all 0.2s;
}
.admin-nav-btn:hover { background: rgba(255,255,255,0.05); color: #fff; }
.admin-nav-btn.active { 
  background: var(--bg-mid); color: #fff; 
  border-left: 4px solid var(--blue-light); 
}
.admin-nav-footer { padding: 20px; border-top: 1px solid rgba(255,255,255,0.05); }

/* Main Content Area */
.admin-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; background: #f0f4f8; }
.admin-header {
  padding: 20px 30px; background: #fff; color: var(--bg-navy);
  display: flex; justify-content: space-between; align-items: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.admin-header h2 { margin: 0; font-size: 14pt; font-weight: 700; }

.admin-tab-content { flex: 1; overflow-y: auto; padding: 30px; display: none; }
.admin-tab-content.active { display: block; }

/* Dashboard Cards */
.admin-card { background: #fff; border-radius: 8px; box-shadow: 0 2px 12px rgba(0,0,0,0.08); padding: 20px; }

/* Dashboard Tables */
.admin-table-container { margin-top: 10px; border: 1px solid #e2e8f0; border-radius: 6px; overflow: hidden; }
.admin-table { width: 100%; border-collapse: collapse; background: #fff; color: #333; font-size: 9pt; }
.admin-table th { background: #f8fafc; padding: 12px 15px; text-align: left; color: var(--bg-navy); font-weight: 700; border-bottom: 2px solid #e2e8f0; }
.admin-table td { padding: 12px 15px; border-bottom: 1px solid #edf2f7; }
.admin-table tr:hover { background: #f1f5f9; }

/* Search Box */
.search-box { 
  display: flex; align-items: center; gap: 8px; background: #f1f5f9; 
  padding: 0 12px; border-radius: 6px; border: 1px solid #cbd5e1; flex: 1;
}
.search-box input { 
  border: none; background: transparent; padding: 10px 0; outline: none; width: 100%; font-size: 9pt; 
}
.search-box .mi { color: #64748b; }

/* Mini Buttons & Pills */
.admin-mini-btn { 
  padding: 4px 10px; border-radius: 4px; border: 1px solid #cbd5e1; 
  background: #fff; color: var(--bg-navy); cursor: pointer; font-size: 7.5pt; font-weight: 600;
}
.admin-mini-btn.btn-danger { color: var(--red); border-color: #fecaca; }
.admin-pill { padding: 3px 10px; border-radius: 12px; font-size: 7pt; font-weight: bold; text-transform: uppercase; }
.status-active { background: #dcfce7; color: #166534; }
.status-inactive { background: #fee2e2; color: #991b1b; }

/* Logs View */
.admin-logs-scroll { max-height: 70vh; overflow-y: auto; background: #fff; border-radius: 6px; }
.logs-filters { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.logs-filters input, .logs-filters select { 
  padding: 8px 12px; border-radius: 6px; border: 1px solid #cbd5e1; font-size: 9pt;
}

.admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 20px; }
.admin-floor-card { background: #fff; padding: 25px; border-radius: 8px; border: 1px solid #e2e8f0; box-shadow: var(--shadow-md); }

.floor-card-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; border-bottom: 1px solid #f1f5f9; padding-bottom: 15px; }
.floor-title-box { flex: 1; }
.floor-title-box label { display: block; font-size: 7pt; color: #64748b; text-transform: uppercase; font-weight: bold; margin-bottom: 4px; }
.floor-title-box input { font-size: 13pt; color: var(--bg-navy); border: none; border-bottom: 2px solid var(--blue-light); width: 90%; font-weight: 700; outline: none; background: transparent; }
.floor-title-box input:focus { border-bottom-color: var(--blue); }

/* Dynamic Constructor (Floors/Postos) */
.dynamic-constructor { border-left: 5px solid var(--blue); }
.floor-name-main { font-size: 16pt !important; border-bottom: 3px solid var(--blue-light) !important; color: var(--bg-navy) !important; }

.postos-container { display: flex; flex-direction: column; gap: 15px; margin: 20px 0; }
.posto-config-item { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 6px; padding: 12px; transition: transform 0.2s; }
.posto-config-item:hover { border-color: var(--blue-light); background: #fff; }

.posto-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.posto-name-inp { border: none !important; background: transparent !important; font-weight: 700; color: var(--blue-dark); font-size: 10pt; width: 80%; }
.posto-name-inp:focus { border-bottom: 1px solid var(--blue) !important; }
.posto-del-btn { background: none; border: none; color: #cbd5e1; font-size: 14pt; cursor: pointer; line-height: 1; }
.posto-del-btn:hover { color: var(--red); }

.posto-beds-inp { width: 100%; padding: 8px; border: 1px solid #cbd5e1; border-radius: 4px; font-size: 9pt; font-family: 'JetBrains Mono', monospace; }

.add-posto-btn { 
  width: 100%; padding: 10px; border: 2px dashed #cbd5e1; border-radius: 6px; 
  background: none; color: #64748b; font-weight: 600; cursor: pointer; 
  display: flex; align-items: center; justify-content: center; gap: 8px; transition: all 0.2s;
}
.add-posto-btn:hover { border-color: var(--blue); color: var(--blue); background: #f0f7ff; }

.floor-footer-info { display: flex; justify-content: space-between; font-size: 7.5pt; color: #94a3b8; border-top: 1px solid #f1f5f9; padding-top: 10px; }
.admin-config-modal {
  width: 500px; max-width: 95%;
  background: var(--bg-deeper);
  border: 1px solid var(--border);
  overflow: hidden;
}
.admin-config-body { padding: var(--space-6); }
.admin-floor-item {
  background: rgba(255,255,255,0.03); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: var(--space-5);
  margin-bottom: var(--space-5);
}
.admin-floor-item h4 { color: var(--teal-light); margin-bottom: var(--space-4); font-size: var(--fs-md); }
.admin-posto-item { margin-bottom: var(--space-5); padding-left: var(--space-5); border-left: 2px solid var(--border); }
.admin-posto-item label { display: block; font-size: var(--fs-sm); margin-bottom: var(--space-2); color: var(--blue-light); }
.admin-posto-item input {
  width: 100%; background: var(--bg-dark); border: 1px solid var(--border);
  color: var(--text-primary); height: var(--ctrl-h-md); padding: 0 var(--space-3);
  border-radius: var(--radius-md); font-size: var(--fs-md);
  font-family: inherit; outline: none;
  transition: border-color var(--t-fast);
}
.admin-posto-item input:focus { border-color: var(--teal-light); }
.admin-actions {
  display: flex; gap: var(--space-4); margin-top: var(--space-6);
  border-top: 1px solid var(--border); padding-top: var(--space-5);
}
.admin-save-btn, .admin-seed-btn {
  flex: 1; height: var(--ctrl-h-lg);
  border: none; border-radius: var(--radius-md); cursor: pointer;
  font-size: var(--fs-md); font-weight: bold;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-3);
  font-family: inherit;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.admin-save-btn { background: var(--blue); color: #fff; }
.admin-save-btn:hover { background: var(--blue-hover); }
.admin-seed-btn { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.admin-seed-btn:hover { color: #fff; border-color: var(--text-muted); }

/* ===== MODAL OVERLAYS — patrón único ===== */
#move-modal-overlay,
#admin-config-overlay,
#logs-overlay,
#admin-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 9998;
  background: rgba(15, 33, 51, 0.85);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  align-items: center; justify-content: center;
  padding: var(--space-6);
}
#move-modal-overlay.open,
#admin-config-overlay.open,
#logs-overlay.open,
#admin-overlay.open {
  display: flex;
}
#move-modal,
.admin-config-modal,
#logs-modal {
  background: var(--bg-navy);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6) var(--space-7);
  max-width: 560px; width: 100%;
  max-height: 85vh; overflow-y: auto;
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
}
#logs-modal { max-width: 720px; display: flex; flex-direction: column; }

/* Aumentar fuentes en resoluciones grandes (e.g. 1600px+) */
@media (min-width: 1600px) {
  /* Título leito */
  .leito-pac-name { font-size: 9.5pt; }
  .leito-num { font-size: 15pt; }
  
  /* Celdas tabla principal */
  table.bed-table, .inline-input, .cond-input, .lf-inp, .bh-field input, .sv-val-inp, .par-resp-area {
    font-size: 8pt;
  }
  
  /* Sub-elementos de la tabla */
  .acesso-row, .par-row, .vent-num, .dieta-num, .dva-mlh, .dva-drug-name {
    font-size: 7.5pt;
  }
  
  /* Fechas y labels pequeños */
  .atb-date-inp, .par-date-inp, .date-inp, .sv-lbl, .lf-lbl {
    font-size: 7pt !important;
  }
  
  /* Chips y tags */
  .prec-chip, .chip, .dva-btn, .sv-chip {
    font-size: 6.5pt;
  }
  
  /* Títulos de sección */
  .bh-block-title, .sv-section-title, .crcl-title, .bed-side .cond-full-lbl, .lab-group-lbl {
    font-size: 7.5pt;
  }
  
  /* Sidebar de condutas */
  .bed-side .cond-area {
    font-size: 8.5pt;
  }
}
  .bed-side .cond-area {
    font-size: 8.5pt;
  }
}


;
  }
}




/* PASSOMETRO HSH - Legacy CSS migrated from monolithic original.
   Selectors not present in css/passometro.css or css/shared.css. */

.atb-content { position: relative; }

.dva-mlh::-webkit-inner-spin-button, .dva-mlh::-webkit-outer-spin-button { -webkit-appearance: none; }

.cond-area { min-height: 36px; font-size: 7pt; border: 1px solid #ddd; border-radius: 0; padding: 2px 4px; }

.cond-area-sm { min-height: 22px; }

#dva-modal h3 {
  font-size: var(--fs-lg); color: var(--blue-light);
  margin-bottom: var(--space-6); padding-bottom: var(--space-3);
  border-bottom: 2px solid var(--blue);
  display: flex; align-items: center; gap: var(--space-3);
}

#dva-modal label {
  font-size: var(--fs-md); font-weight: 700;
  color: var(--blue-light); display: block;
  margin-top: var(--space-5); margin-bottom: var(--space-2);
}

#dva-modal select, #dva-modal input[type="number"], #dva-modal input[type="text"] {
  width: 100%;
  height: var(--ctrl-h-md); padding: 0 var(--space-3);
  font-size: var(--fs-md); font-family: inherit;
  border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--bg-dark); color: #fff; outline: none;
  transition: border-color var(--t-fast);
}

#dva-modal select:focus, #dva-modal input:focus { border-color: var(--teal-light); }

#dva-result {
  margin-top: var(--space-6);
  padding: var(--space-5) var(--space-6);
  background: var(--bg-deeper);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  font-size: var(--fs-lg); font-weight: 700;
  color: var(--text-white); min-height: 40px;
  display: flex; align-items: center;
  justify-content: center;
  text-align: center;
}

.dva-modal-btns {
  display: flex; gap: var(--space-4);
  margin-top: var(--space-6);
  justify-content: flex-end;
}

.dva-modal-btns button {
  display: inline-flex; align-items: center; justify-content: center;
  height: var(--ctrl-h-md); padding: 0 var(--space-6);
  font-size: var(--fs-md); font-weight: 700; font-family: inherit;
  border-radius: var(--radius-md); border: none;
  cursor: pointer;
  transition: background var(--t-fast);
}

#dva-apply-btn { background: var(--teal); color: #fff; }
#dva-apply-btn:hover { background: #1e6b61; }
#dva-cancel-btn { background: #e2e8f0; color: #444; }
#dva-cancel-btn:hover { background: #c0ccd8; }

#multi-print-area { display: none; }

.print-header {
  display: none; /* visível apenas em print (regra abaixo) */
  align-items: center; justify-content: space-between;
  margin-bottom: 8px; padding: 7px 12px;
  background: linear-gradient(135deg, #1b3a52 0%, #264d6b 100%);
  border-radius: 6px; border-bottom: 3px solid #729fcf;
}
@media print {
  .print-header { display: flex; }
}

.ph-left { display: flex; flex-direction: column; gap: 1px; }

.ph-hosp { font-size: 11pt; font-weight: bold; color: #fff; letter-spacing: 0.3px; }

.ph-subnet { font-size: 7.5pt; color: #a8d8f0; }

.ph-title { font-size: 11pt; font-weight: bold; color: #68d3c3; letter-spacing: 0.5px; text-align: center; }

.ph-meta { font-size: 7pt; color: #a8d8f0; text-align: right; min-width: 120px; }

.bullet-lines {
  min-height: 30px;
  max-height: 160px;
  overflow-y: auto;
  padding: var(--space-2) var(--space-3);
  border: 1px dashed transparent;
  border-radius: var(--radius-sm);
  white-space: pre-wrap;
  word-break: break-word;
  cursor: text;
  transition: background var(--t-fast), border-color var(--t-fast);
}

/* Diagnósticos: mostra tudo sem scroll, cresce com o conteúdo, em negrito */
.col-diag .bullet-lines {
  max-height: none;
  overflow-y: visible;
  font-weight: 700;
}
.bullet-lines:hover:not(:focus) {
  background: rgba(45, 80, 112, 0.05);
  border-color: rgba(45, 80, 112, 0.12);
}
.bullet-lines:focus {
  outline: none;
  background: rgba(104, 211, 195, 0.08);
  border-color: var(--teal);
  border-style: solid;
}
.bullet-lines:empty::before {
  content: attr(data-ph);
  color: #94a3b8;
  font-style: italic;
  font-size: var(--fs-sm);
  pointer-events: none;
}

.leito-flags { display: flex; gap: var(--space-2); flex-wrap: wrap; }

.flag-btn[data-flag="vip"].active  { background: #fef08a; border-color: #ca8a04; }

.flag-btn[data-flag="cp"].active   { background: #e9d5ff; border-color: #7c3aed; }

.leito-head-peso {
  font-size: 6pt; color: rgba(255,255,255,0.65); font-weight: normal;
  margin-left: 4px; vertical-align: middle;
}

.leito-head-peso:not(:empty)::before { content: '· '; }

.prec-head-label {
  display: inline-block; font-size: 5.5pt; font-weight: bold; letter-spacing: 0.3px;
  padding: 1px 5px; border-radius: 3px; margin-top: 3px;
  background: rgba(255,255,255,0.18); color: #fff;
}

.prec-head-label.prec-contato   { background: rgba(255,255,255,0.25); color: #fef3c7; }

.prec-head-label.prec-goticular { background: rgba(255,255,255,0.25); color: #fed7aa; }

.prec-head-label.prec-aerossol  { background: rgba(255,255,255,0.25); color: #fecaca; }

::-webkit-scrollbar { width: 6px; height: 6px; }

::-webkit-scrollbar-track { background: #f0f4f8; }

::-webkit-scrollbar-thumb { background: #4a7a9b; border-radius: 3px; }

.vent-num, .dieta-num {
  width: 34px !important;
  border: none !important;
  border-bottom: 1px solid #aaa !important;
  background: transparent;
  font-size: 6.5pt;
  font-family: inherit;
  padding: 1px 2px;
  outline: none;
  -moz-appearance: textfield;
  color: #111;
}

.vent-num::-webkit-inner-spin-button, .vent-num::-webkit-outer-spin-button,
.dieta-num::-webkit-inner-spin-button, .dieta-num::-webkit-outer-spin-button { -webkit-appearance: none; }

.vent-num:focus, .dieta-num:focus { border-bottom-color: #1a6b8a !important; background: rgba(255,255,150,0.3); }

.vent-widget { margin-bottom: 4px; }

.vent-sub {
  display: none;
  margin-top: 3px;
  padding: 3px 5px;
  background: #eaf4fb;
  border-left: 2px solid #2b7a9e;
  border-radius: 0 3px 3px 0;
  font-size: 6.5pt;
  color: #111;
}

.vent-sub-lbl {
  font-size: 6pt; font-weight: bold; color: #1b3a52;
  margin-right: 2px; white-space: nowrap;
}

.vent-params {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 2px 6px; margin-top: 3px;
}

.vent-param-row {
  display: flex; align-items: center; gap: 2px; font-size: 6pt;
}

.vent-param-row span {
  font-weight: bold; color: #1b3a52; white-space: nowrap; min-width: 28px;
}

.vent-inline-row {
  display: flex; align-items: center; gap: 2px; flex-wrap: nowrap; font-size: 6.5pt;
}

.vent-unit { font-size: 5.5pt; color: #666; white-space: nowrap; margin-left: 1px; }

.dieta-widget { margin-top: 4px; }

.dieta-sub {
  display: none;
  margin-top: 3px;
  padding: 3px 5px;
  background: #fff8ee;
  border-left: 2px solid #dd8800;
  border-radius: 0 3px 3px 0;
  font-size: 6.5pt;
  color: #111;
}

.dieta-sub-row { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; font-size: 6.5pt; }

.dieta-sub-lbl { font-size: 6pt; font-weight: bold; color: #7a4400; white-space: nowrap; margin-right: 2px; }

.dieta-unit { font-size: 5.5pt; color: #888; white-space: nowrap; margin-left: 1px; }

.move-bed-btn {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 5.5pt; padding: 2px 6px; border-radius: 3px; cursor: pointer;
  border: 1px solid rgba(100,180,255,0.35); background: rgba(37,99,235,0.12);
  color: #93c5fd; white-space: nowrap; font-weight: bold;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.move-bed-btn:hover { background: rgba(37,99,235,0.55); color: #fff; border-color: #60a5fa; }

.leito-action-row { display: flex; gap: var(--space-2); flex-wrap: wrap; }

#move-modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.6); z-index: 9100;
  align-items: center; justify-content: center;
}

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

#move-modal {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: var(--space-7);
  min-width: 340px; max-width: 440px; width: 92vw;
  box-shadow: var(--shadow-lg);
}

#move-modal h3 {
  font-size: var(--fs-lg); color: var(--bg-navy);
  margin-bottom: var(--space-5); padding-bottom: var(--space-3);
  border-bottom: 2px solid var(--blue);
  display: flex; align-items: center; gap: var(--space-3);
}

#move-source-info {
  font-size: var(--fs-md); color: #555;
  margin-bottom: var(--space-6);
  background: #f0f4f8;
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--blue);
}

#move-modal label {
  font-size: var(--fs-md); font-weight: 700; color: var(--bg-navy);
  display: block; margin-top: var(--space-5); margin-bottom: var(--space-3);
}

.move-uti-row { display: flex; gap: var(--space-4); }

.move-uti-btn {
  flex: 1;
  height: var(--ctrl-h-lg); padding: 0 var(--space-4);
  font-size: var(--fs-md); font-weight: 700; font-family: inherit;
  border: 2px solid #c0d0dd; border-radius: var(--radius-md);
  background: #f0f4f8; color: #555;
  cursor: pointer; text-align: center;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  transition: all var(--t-fast);
}
.move-uti-btn.active { border-color: var(--bg-navy); background: var(--bg-navy); color: #fff; }
.move-uti-btn:hover:not(.active) { border-color: var(--blue); color: var(--bg-navy); }

#move-dest-bed {
  width: 100%;
  height: var(--ctrl-h-md); padding: 0 var(--space-3);
  font-size: var(--fs-md); font-family: inherit;
  border: 1px solid #c0d0dd; border-radius: var(--radius-md);
  background: #f8fbfd; color: #111; outline: none;
  margin-top: var(--space-1);
  transition: border-color var(--t-fast);
}
#move-dest-bed:focus { border-color: var(--blue); }

#move-warning {
  margin-top: var(--space-5); padding: var(--space-4) var(--space-5);
  background: #fef9c3; border-radius: var(--radius-md);
  font-size: var(--fs-base); color: #854d0e;
  border-left: 3px solid #ca8a04;
}

.move-modal-btns {
  display: flex; gap: var(--space-4);
  margin-top: var(--space-6); justify-content: flex-end;
}

.move-modal-btns button {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  height: var(--ctrl-h-md); padding: 0 var(--space-6);
  border-radius: var(--radius-md); border: none;
  font-size: var(--fs-md); font-weight: 700; font-family: inherit;
  cursor: pointer;
  transition: background var(--t-fast);
}

#move-cancel-btn { background: #e2e8f0; color: #444; }
#move-cancel-btn:hover { background: #c0ccd8; }

#move-confirm-btn { background: var(--bg-navy); color: #fff; }
#move-confirm-btn:hover { background: var(--blue-dark); }

#page-footer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  text-align: center;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 7.5pt;
  letter-spacing: 0.3px;
  padding: 6px 16px;
  background: rgba(15, 33, 51, 0.92);
  border-top: 1px solid #1b3a52;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #cde;
}
#page-footer .footer-credit { color: #8a9daa; }
#page-footer .footer-sep { color: #4a7a9b; }
#page-footer .footer-brand { color: #68d3c3; }
#page-footer .brand-bracket { color: #729fcf; }

/* Padding-bottom = altura exata do #page-footer (border 1 + padding 6+6 + texto ~12 = ~25px)
   para que o gap visual table↔footer coincida com o gap table↔navbar (#app-form-wrapper padding). */
body { padding-bottom: 25px; }

@media print {
  #page-footer { display: none; }
  body { padding-bottom: 0; }
}

/* Navbar 5-cols — responsive */
@media (max-width: 1300px) {
  /* Leitos caen a fila propia debajo del andar */
  #navbar .nav-col-postos {
    flex-basis: 100%; order: 10;
    border-top: 1px solid rgba(255,255,255,0.08);
    padding-top: 4px; margin-top: 2px;
  }
  #navbar .nav-sep-postos { display: none; }
}

@media (max-width: 1100px) {
  /* Brand y andar compactan tipografía */
  #navbar { padding: 5px 10px; gap: 6px; }
  #navbar .nav-col-brand .nav-hosp { font-size: 9pt; }
  #navbar .nav-col-brand .nav-net  { font-size: 7pt; }
  #navbar .nav-col-brand .nav-app  { font-size: 7.5pt; }
  #navbar .andar-badge { padding: 3px 8px; font-size: 8.5pt; }
}

@media (max-width: 900px) {
  html { font-size: 13px; }
  /* Config y user pasan a la fila siguiente */
  #navbar .nav-col-config { margin-left: 0; flex-basis: 100%; order: 11; align-items: stretch; }
  #navbar .nav-col-user { flex-basis: 100%; order: 12; }
  #navbar .nav-sep { display: none; }
  .bed-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

@media (max-width: 600px) {
  html { font-size: 11px; }
  #navbar { flex-wrap: wrap; gap: 4px; }
  .print-dd-menu { right: auto; left: 0; }
  #equipe-modal { min-width: unset; width: 92vw; }
  #dva-modal { min-width: unset; width: 92vw; max-width: 92vw; }
}

#login-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: #0f2133;
  display: flex; align-items: center; justify-content: center;
}

#login-overlay.hidden { display: none; }

.login-box .login-subtitle { font-size: 8pt; color: #7ab; text-align: center; margin-bottom: 20px; }

.login-box input[type="text"],
.login-box input[type="password"] {
  width: 100%; padding: 7px 10px; border-radius: 5px;
  border: 1px solid #4a7a9b; background: #0f2133; color: #fff;
  font-size: 9pt; outline: none;
}

#logs-overlay {
  display: none; position: fixed; inset: 0; z-index: 9998;
  background: rgba(0,0,0,0.7); align-items: flex-start; justify-content: center;
  padding-top: 40px;
}

#logs-overlay.open { display: flex; }

#logs-modal h3 {
  padding: var(--space-5) var(--space-6) var(--space-4);
  font-size: var(--fs-lg); color: var(--blue-light);
  border-bottom: 1px solid var(--bg-mid);
  display: flex; align-items: center; gap: var(--space-3);
}

.logs-filters {
  display: flex; gap: var(--space-4);
  padding: var(--space-4) var(--space-6);
  flex-wrap: wrap;
  border-bottom: 1px solid var(--bg-mid);
}

.logs-filters select, .logs-filters input {
  height: var(--ctrl-h-sm); padding: 0 var(--space-3);
  font-size: var(--fs-md); font-family: inherit;
  border-radius: var(--radius-md);
  border: 1px solid var(--border); background: var(--bg-dark); color: #fff;
  outline: none; transition: border-color var(--t-fast);
}
.logs-filters select:focus, .logs-filters input:focus { border-color: var(--teal-light); }

#logs-list {
  overflow-y: auto; flex: 1;
  padding: var(--space-4) var(--space-6);
}

.log-entry {
  display: flex; gap: var(--space-5);
  padding: var(--space-3) 0;
  border-bottom: 1px solid #243f55;
  font-size: var(--fs-base); align-items: flex-start;
}
.log-entry:last-child { border-bottom: none; }
.log-ts { color: var(--text-muted); white-space: nowrap; min-width: 130px; font-family: 'JetBrains Mono', monospace; font-size: var(--fs-sm); }
.log-user { color: var(--teal-light); min-width: 160px; font-weight: 600; }
.log-action { font-weight: 700; min-width: 55px; text-transform: uppercase; letter-spacing: 0.3px; font-size: var(--fs-sm); }
.log-action.save  { color: var(--green-light); }
.log-action.clear { color: var(--accent-err); }
.log-action.move  { color: var(--accent-warn); }
.log-details { color: var(--text-primary); flex: 1; }

/* Modal-close button compartido (Equipe, Logs) */
.modal-close-btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: var(--ctrl-h-md); padding: 0 var(--space-6);
  background: var(--bg-navy); color: #fff;
  border: none; border-radius: var(--radius-md);
  font-size: var(--fs-md); font-weight: 600; font-family: inherit;
  cursor: pointer;
  transition: background var(--t-fast);
}
.modal-close-btn:hover { background: var(--blue-dark); }

#logs-modal .modal-close-btn {
  margin: var(--space-4) var(--space-6) var(--space-5) auto;
  display: flex;
}

