/* nes-omron-cardio.css — Monitoramento Cardiometabólico NES v1.0 */

/* ── Bloco de PA dentro da aba cardiológica ─────────────────────── */
.nco-bloco {
  margin-top: 24px;
  border: 1.5px solid #e5e7eb;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}

.nco-bloco-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 18px;
  background: linear-gradient(135deg, #0b4b5a 0%, #0F6E56 100%);
  color: #fff;
}

.nco-bloco-header h3 {
  margin: 0;
  font-size: .95rem;
  font-weight: 700;
  color: #fff;
}

.nco-bloco-acoes {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.nco-btn-novo {
  padding: 6px 14px;
  border-radius: 7px;
  border: none;
  background: #fff;
  color: #0b4b5a;
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, transform .1s;
}
.nco-btn-novo:hover { background: #e0fdf4; transform: translateY(-1px); }

.nco-btn-ble {
  padding: 6px 14px;
  border-radius: 7px;
  border: 2px solid rgba(255,255,255,.5);
  background: transparent;
  color: #fff;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.nco-btn-ble:hover { background: rgba(255,255,255,.12); }

.nco-historico-host {
  padding: 16px 18px;
}

/* ── Loading / vazio ────────────────────────────────────────────── */
.nco-loading {
  color: #9ca3af;
  font-style: italic;
  font-size: .85rem;
  text-align: center;
  padding: 24px;
}
.nco-vazio {
  color: #9ca3af;
  font-style: italic;
  font-size: .85rem;
  text-align: center;
  padding: 24px;
}

/* ── Alerta banner (última aferição) ────────────────────────────── */
.nco-alerta-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: .86rem;
  margin-bottom: 14px;
  line-height: 1.5;
}
.nco-alerta-banner--verde   { background: #d1fae5; color: #065f46; border-left: 4px solid #22c55e; }
.nco-alerta-banner--amarelo { background: #fef3c7; color: #92400e; border-left: 4px solid #f59e0b; }
.nco-alerta-banner--vermelho { background: #fee2e2; color: #991b1b; border-left: 4px solid #ef4444; }
.nco-alerta-banner--cinza   { background: #f3f4f6; color: #6b7280; border-left: 4px solid #9ca3af; }

/* ── Alerta inline no modal ─────────────────────────────────────── */
.nco-alerta-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 7px;
  font-size: .83rem;
  margin: 4px 0 8px;
  line-height: 1.4;
}
.nco-alerta-inline--verde   { background: #d1fae5; color: #065f46; }
.nco-alerta-inline--amarelo { background: #fef3c7; color: #92400e; }
.nco-alerta-inline--vermelho { background: #fee2e2; color: #991b1b; }
.nco-alerta-inline--cinza   { background: #f3f4f6; color: #6b7280; }

.nco-alerta-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: currentColor;
}

/* ── Aviso medicamentos ─────────────────────────────────────────── */
.nco-aviso-meds,
.nco-aviso-info {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 14px;
  border-radius: 8px;
  background: #fffbeb;
  border-left: 4px solid #f59e0b;
  font-size: .83rem;
  margin-bottom: 14px;
  line-height: 1.5;
}
.nco-aviso-info {
  background: #eff6ff;
  border-left-color: #3b82f6;
  color: #1e3a8a;
}
.nco-aviso-meds > span { font-size: 1.1rem; flex-shrink: 0; }

.nco-tag-med {
  display: inline-block;
  background: #fef3c7;
  color: #92400e;
  border-radius: 5px;
  padding: 1px 7px;
  font-size: .78rem;
  font-weight: 600;
  margin: 2px 3px 2px 0;
}

.nco-educativo-texto {
  color: #6b7280;
  font-size: .78rem;
  margin: 6px 0 0;
  font-style: italic;
}

/* ── Gráficos ───────────────────────────────────────────────────── */
.nco-graficos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.nco-grafico-card {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 14px;
  background: #fafafa;
}

.nco-grafico-card h4 {
  font-size: .82rem;
  font-weight: 700;
  color: #374151;
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.nco-grafico-svg {
  width: 100%;
  height: auto;
  display: block;
}

.nco-grafico-vazio {
  color: #9ca3af;
  font-size: .82rem;
  font-style: italic;
  text-align: center;
  padding: 18px;
}

/* ── Tabela de histórico ────────────────────────────────────────── */
.nco-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .83rem;
  margin-bottom: 14px;
  overflow-x: auto;
}
.nco-table th {
  background: #f9fafb;
  color: #374151;
  font-weight: 700;
  padding: 7px 10px;
  text-align: left;
  border-bottom: 2px solid #e5e7eb;
  white-space: nowrap;
}
.nco-table td {
  padding: 7px 10px;
  border-bottom: 1px solid #f3f4f6;
  color: #1f2937;
  vertical-align: middle;
}
.nco-table tr:last-child td { border-bottom: none; }
.nco-table tr:hover td { background: #f9fafb; }

/* ── Badges de alerta ───────────────────────────────────────────── */
.nco-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: .75rem;
  font-weight: 600;
  white-space: nowrap;
}
.nco-badge--verde    { background: #d1fae5; color: #065f46; }
.nco-badge--amarelo  { background: #fef3c7; color: #92400e; }
.nco-badge--vermelho { background: #fee2e2; color: #991b1b; }
.nco-badge--cinza    { background: #f3f4f6; color: #6b7280; }

/* ── Ações na tabela ────────────────────────────────────────────── */
.nco-table-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.nco-btn-link {
  font-size: .78rem;
  color: #0F6E56;
  text-decoration: underline;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}
.nco-btn-ciencia {
  font-size: .75rem;
  padding: 3px 8px;
  border-radius: 5px;
  border: 1px solid #22c55e;
  background: #d1fae5;
  color: #065f46;
  cursor: pointer;
  font-weight: 600;
}
.nco-btn-ciencia:hover { background: #a7f3d0; }
.nco-btn-excluir {
  font-size: .8rem;
  padding: 3px 7px;
  border-radius: 5px;
  border: 1px solid #fca5a5;
  background: #fee2e2;
  color: #991b1b;
  cursor: pointer;
}
.nco-btn-excluir:hover { background: #fecaca; }

/* ── Rodapé de ações ────────────────────────────────────────────── */
.nco-acoes-footer {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 8px;
}
.nco-btn-imprimir {
  padding: 7px 16px;
  border-radius: 7px;
  border: 1.5px solid #0F6E56;
  background: #fff;
  color: #0F6E56;
  font-size: .83rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.nco-btn-imprimir:hover { background: #f0fdf4; }

/* ── Modal backdrop ─────────────────────────────────────────────── */
.nco-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  transition: opacity .2s ease;
}
.nco-modal-backdrop--visivel { opacity: 1; }

/* ── Modal ──────────────────────────────────────────────────────── */
.nco-modal {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.nco-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
}
.nco-modal-header h3 {
  margin: 0;
  font-size: .95rem;
  font-weight: 700;
  color: #0b4b5a;
}
.nco-modal-fechar {
  background: none;
  border: none;
  font-size: 1.4rem;
  color: #6b7280;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  border-radius: 4px;
}
.nco-modal-fechar:hover { background: #f3f4f6; color: #111; }

.nco-modal-body {
  padding: 20px;
  flex: 1;
}
.nco-modal-footer {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 20px;
  border-top: 1px solid #e5e7eb;
  flex-shrink: 0;
}

/* ── Formulário ─────────────────────────────────────────────────── */
.nco-form-row {
  margin-bottom: 14px;
}
.nco-form-3col {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}
.nco-label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 4px;
}
.nco-input {
  width: 100%;
  padding: 8px 10px;
  border: 1.5px solid #d1d5db;
  border-radius: 7px;
  font-size: .88rem;
  color: #111;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
  font-family: inherit;
  box-sizing: border-box;
}
.nco-input:focus {
  outline: none;
  border-color: #0F6E56;
  box-shadow: 0 0 0 3px rgba(15,110,86,.12);
}
.nco-input-hint {
  display: block;
  font-size: .75rem;
  color: #9ca3af;
  margin-top: 3px;
}
textarea.nco-input { resize: vertical; min-height: 72px; }

/* ── Botões do modal ────────────────────────────────────────────── */
.nco-btn-salvar {
  padding: 9px 20px;
  border-radius: 8px;
  border: none;
  background: #0F6E56;
  color: #fff;
  font-size: .88rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, transform .1s;
}
.nco-btn-salvar:hover { background: #0a5740; transform: translateY(-1px); }
.nco-btn-salvar:disabled { opacity: .6; cursor: not-allowed; transform: none; }

.nco-btn-cancelar {
  padding: 9px 16px;
  border-radius: 8px;
  border: 1.5px solid #d1d5db;
  background: #fff;
  color: #374151;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.nco-btn-cancelar:hover { background: #f9fafb; }

/* ── Texto educativo no modal ───────────────────────────────────── */
.nco-educativo {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  background: #eff6ff;
  border-left: 3px solid #3b82f6;
  border-radius: 0 7px 7px 0;
  padding: 10px 12px;
  margin: 14px 0 0;
  font-size: .79rem;
  color: #1e40af;
  line-height: 1.5;
}
.nco-educativo > span { flex-shrink: 0; }
.nco-educativo p { margin: 0; }

/* ── Status no modal ────────────────────────────────────────────── */
.nco-status {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 7px;
  font-size: .83rem;
  margin-top: 10px;
}
.nco-status--info { background: #eff6ff; color: #1e3a8a; }
.nco-status--ok   { background: #d1fae5; color: #065f46; }
.nco-status--erro { background: #fee2e2; color: #991b1b; }

/* ── BLE banner ─────────────────────────────────────────────────── */
.nco-ble-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: .83rem;
  margin: 10px 16px;
  line-height: 1.4;
  border: 1.5px solid transparent;
}
.nco-ble-banner--ok    { background: #d1fae5; border-color: #6ee7b7; color: #065f46; }
.nco-ble-banner--info  { background: #eff6ff; border-color: #93c5fd; color: #1e3a8a; }
.nco-ble-banner--erro  { background: #fee2e2; border-color: #fca5a5; color: #991b1b; }
.nco-ble-banner--aviso { background: #fef3c7; border-color: #fcd34d; color: #92400e; }

.nco-ble-banner-icone { font-size: 1rem; flex-shrink: 0; }
.nco-ble-banner-texto { flex: 1; }
.nco-ble-banner-manual {
  padding: 5px 12px;
  border-radius: 6px;
  border: 1.5px solid currentColor;
  background: transparent;
  color: inherit;
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  opacity: .85;
  transition: opacity .15s;
}
.nco-ble-banner-manual:hover { opacity: 1; }

/* ── Painel de diagnóstico BLE ──────────────────────────────────── */
.nco-ble-banner--diag {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1e3a8a;
}

/* ── Botões secundários no header (Importar / Diagnóstico BT) ──── */
.nco-btn-importar,
.nco-btn-diag {
  padding: 6px 12px;
  border-radius: 7px;
  border: 1.5px solid rgba(255,255,255,.4);
  background: rgba(255,255,255,.08);
  color: #fff;
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
  white-space: nowrap;
}
.nco-btn-importar:hover,
.nco-btn-diag:hover { background: rgba(255,255,255,.18); }

/* ── Aviso BLEsmart (faixa informativa no bloco) ────────────────── */
.nco-aviso-blesmart {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 16px;
  background: #fefce8;
  border-bottom: 1px solid #fde68a;
  font-size: .80rem;
  color: #78350f;
  line-height: 1.5;
}
.nco-aviso-blesmart-icone {
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: 1px;
}
.nco-aviso-blesmart-texto strong { color: #92400e; }

/* ── Responsivo ─────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .nco-form-3col { grid-template-columns: 1fr 1fr; }
  .nco-graficos-grid { grid-template-columns: 1fr; }
  .nco-modal { border-radius: 10px 10px 0 0; }
  .nco-modal-backdrop { align-items: flex-end; padding: 0; }
  .nco-table { font-size: .75rem; }
  .nco-table th, .nco-table td { padding: 5px 7px; }
}

/* FC não aferida — a ausência é informação clínica, não erro (Fase 1 PA) */
.nco-na {
  color: #6b7280;
  font-style: italic;
  font-size: .82em;
}

/* Filtro de período do relatório (G-ETAPA2) */
.nco-acoes-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.nco-periodo-label { font-size: .8rem; color: #4b5563; }
.nco-periodo { min-height: 44px; min-width: 190px; }
.nco-periodo-data { min-height: 44px; }
