/* Charts OMS — preto, sem pill rosa, texto branco */
.cc-chart-card,
#clinic-sidebar .cc-chart-card {
  background: #000 !important;
  border: 1px solid rgba(255,255,255,.22) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 10px !important;
}
.cc-chart-card h4,
.cc-chart-meta,
.cc-resumo-header h3,
.cc-table th,
.cc-table td,
.cc-resumo,
#cc-resumo,
#resumo-unificado {
  color: #fff !important;
  background: #000 !important;
}
.cc-chart-canvas,
#clinic-sidebar .cc-chart-canvas {
  background: #000 !important;
}
.cc-chart-badge,
#clinic-sidebar .cc-chart-badge {
  background: #000 !important;
  color: #fff !important;
  border: 1px solid rgba(255,255,255,.25) !important;
  border-radius: 0 !important;
  padding: 6px 8px !important;
  margin-top: 8px !important;
}
.cc-badge,
#clinic-sidebar .cc-badge,
.cc-badge.normal,
.cc-badge.atencao,
.cc-badge.alerta,
#clinic-sidebar .cc-badge.normal,
#clinic-sidebar .cc-badge.atencao,
#clinic-sidebar .cc-badge.alerta {
  background: #111 !important;
  color: #fff !important;
  border: 1px solid rgba(255,255,255,.35) !important;
  border-radius: 0 !important;
  padding: 3px 8px !important;
  font-weight: 700 !important;
}
.cc-badge.normal { border-color: #34c759 !important; color: #34c759 !important; }
.cc-badge.atencao { border-color: #f5c518 !important; color: #f5c518 !important; }
.cc-badge.alerta { border-color: #ff6b6b !important; color: #ff6b6b !important; }
.cc-table {
  border-color: rgba(255,255,255,.2) !important;
  background: #000 !important;
}
.cc-table th,
.cc-table td {
  border-color: rgba(255,255,255,.15) !important;
  color: #fff !important;
}
.cc-charts-grid { gap: 10px !important; }

/* Selected options = green */
#clinic-sidebar button.snap-opt[style*="background:#6366f1"],
#clinic-sidebar button.snap-opt.is-on,
#clinic-sidebar button.findrisc-opt.is-on,
#clinic-sidebar button.fager-opt.is-on,
#clinic-sidebar button.mmrc-opt.is-on,
#clinic-sidebar button.nyha-opt.is-on,
#clinic-sidebar button.ad-opt.is-on,
#clinic-sidebar button.mchat-opt.is-on,
#clinic-sidebar button.gina-opt.is-on,
#clinic-sidebar button.cage-opt.is-on,
#clinic-sidebar button[class$="-opt"].is-on {
  background: #34c759 !important;
  border-color: #34c759 !important;
  color: #000 !important;
  font-weight: 800 !important;
}

.st-block {
  background: #000;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 10px;
  padding: 14px;
  margin: 12px 0;
}
.st-block-title, .st-pane-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff !important;
  font-size: 14px;
  font-weight: 800;
  margin: 0 0 10px;
  text-transform: uppercase;
}
.st-muted { color: rgba(255,255,255,.7) !important; font-size: 12px; line-height: 1.45; }
.st-steps { color: #fff; padding-left: 18px; margin: 0; line-height: 1.55; font-size: 13px; }
.st-input, .notes-body {
  width: 100%;
  box-sizing: border-box;
  margin: 8px 0;
  padding: 10px 12px;
  background: #000 !important;
  color: #fff !important;
  border: 1px solid rgba(255,255,255,.25) !important;
  border-radius: 8px;
  font-family: inherit;
}
.notes-body {
  min-height: min(58vh, 520px) !important;
  height: min(58vh, 520px) !important;
  resize: vertical;
  flex: 1 1 auto;
  overflow-y: auto !important;
  line-height: 1.45;
  font-size: 13px;
}
#pane-notas {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
#pane-notas .notes-salvos-wrap {
  margin-top: 14px;
  flex: 0 1 auto;
  min-height: 0;
  max-height: min(28vh, 240px);
  display: flex;
  flex-direction: column;
}
#pane-notas .notes-salvos-wrap .st-block-title {
  margin-top: 0 !important;
  flex-shrink: 0;
}
#pane-notas .notes-list {
  overflow-y: auto;
  min-height: 0;
  padding-bottom: 8px;
}
.notes-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  flex-shrink: 0;
}
.notes-list { display: flex; flex-direction: column; gap: 8px; }
.st-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 100px;
  padding: 18px;
  border: 2px dashed rgba(255,255,255,.35);
  border-radius: 10px;
  cursor: pointer;
  color: #fff;
  text-align: center;
}
.notes-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 12px;
  background: #000;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
}
.notes-empty { color: rgba(255,255,255,.55); font-size: 13px; padding: 8px 0; }

#lab-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.72);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.lab-popup {
  background: #000;
  color: #fff;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 12px;
  width: min(560px, 96vw);
  max-height: 85vh;
  overflow: auto;
  padding: 16px;
}
.lab-popup-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 14px;
  text-transform: uppercase;
}
.lab-popup-x {
  margin-left: auto;
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
}
.lab-popup-body {
  white-space: pre-wrap;
  font-size: 13px;
  line-height: 1.55;
  background: #000;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 8px;
  padding: 12px;
  margin: 0 0 12px;
}
.lab-popup-actions { display: flex; gap: 8px; }

#stetho-login-gate {
  position: fixed !important;
  inset: 0 !important;
  z-index: 2147483647 !important;
  background: #000 !important;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  isolation: isolate;
}
body.stetho-locked #stetho-login-gate {
  display: flex !important;
}
/* Esconde o app inteiro no login — sem vazamento por z-index */
body.stetho-locked #stetho-app,
body.stetho-locked .stetho-top,
body.stetho-locked .stetho-top-nav,
body.stetho-locked #clinic-sidebar,
body.stetho-locked #clinic-toggle {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  opacity: 0 !important;
}
.stetho-login-card {
  width: min(400px, 100%);
  background: #0a0a0a !important;
  border: 1px solid rgba(255,255,255,.28) !important;
  border-radius: 16px;
  padding: 28px 24px;
  color: #fff !important;
  box-shadow: 0 0 0 1px rgba(255,255,255,.04);
  position: relative;
  z-index: 1;
}
.stetho-login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.stetho-login-logo {
  width: 42px !important;
  height: 42px !important;
  color: #fff !important;
}
.stetho-login-card h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.04em;
  text-align: center;
}
.stetho-login-card .st-muted {
  text-align: center;
  margin: 8px 0 4px;
  font-size: 13px;
}
.stetho-login-card label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 0 6px;
  font-size: 12px;
  font-weight: 700;
}
.stetho-login-card label .st-ico {
  width: 16px;
  height: 16px;
  color: #fff;
}
.stetho-login-card .st-input {
  width: 100%;
  background: #000 !important;
  color: #fff !important;
  border: 1px solid rgba(255,255,255,.25) !important;
  border-radius: 10px;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 15px;
}
.stetho-login-card .stetho-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
#stetho-login-err { color: #ff6b6b; min-height: 18px; font-size: 12px; margin-top: 8px; text-align: center; }

/* Logo always visible when unlocked */
.stetho-top-brand,
.stetho-top-brand span {
  color: #fff !important;
  opacity: 1 !important;
  visibility: visible !important;
}
.stetho-top-brand .st-ico,
.stetho-top-brand .st-ico svg {
  color: #fff !important;
  stroke: #fff !important;
  display: block !important;
}

/* Custom selects — no native browser chrome */
select,
#clinic-sidebar select,
.stetho-shell select {
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  background-color: #000 !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 10px center !important;
  background-size: 16px 16px !important;
  color: #fff !important;
  border: 1px solid rgba(255,255,255,.28) !important;
  border-radius: 10px !important;
  padding: 10px 36px 10px 12px !important;
  font-family: inherit !important;
  font-size: 14px !important;
  cursor: pointer !important;
  outline: none !important;
}
select:focus,
#clinic-sidebar select:focus {
  border-color: #34c759 !important;
  box-shadow: 0 0 0 1px #34c759 !important;
}
select option {
  background: #0a0a0a !important;
  color: #fff !important;
}
select option:checked,
select option:hover {
  background: #1a3d24 !important;
  color: #fff !important;
}

/* Selection / active feedback in green */
::selection {
  background: #34c759;
  color: #000;
}
.proto-item-btn:focus,
.proto-item-btn:active,
.notes-item:focus,
.notes-item.active,
.lc-card:focus,
.stetho-btn.primary:active {
  outline: none;
  border-color: #34c759 !important;
  box-shadow: 0 0 0 1px #34c759 !important;
}
#clinic-sidebar .prev-check:has(input:checked),
#clinic-sidebar label:has(> input[type="checkbox"]:checked) {
  border-color: #34c759 !important;
  background: #0d1f12 !important;
}

#stetho-user-chip {
  display: none;
  align-items: center;
  gap: 8px;
  color: #fff !important;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#stetho-user-chip .st-ico { width: 16px; height: 16px; flex-shrink: 0; }
.stetho-user-name { overflow: hidden; text-overflow: ellipsis; }
.stetho-top-nav {
  display: none;
  width: auto;
  margin: 0;
  padding: 0;
}
.stetho-top-nav.visible { display: block; }
#stetho-back-home {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #000;
  color: #fff;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 700;
}

.notes-item-row {
  display: flex;
  align-items: stretch;
  gap: 6px;
}
.notes-item-row .notes-item {
  flex: 1;
  border-radius: 8px;
}
.notes-item-row.active .notes-item {
  border-color: #34c759 !important;
}
.notes-item-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.notes-item-title {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notes-item-date {
  font-size: 11px;
  color: rgba(255,255,255,.55);
  font-weight: 500;
}
.notes-del {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  background: #000;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
}
.notes-del:hover { border-color: #ff6b6b; color: #ff6b6b; }

.stetho-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483646;
  background: rgba(0,0,0,.75);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.stetho-confirm-card {
  width: min(380px, 100%);
  background: #0a0a0a;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 14px;
  padding: 20px;
  color: #fff;
}
.stetho-confirm-card p {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.45;
}
.stetho-confirm-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.stetho-confirm-actions .stetho-btn {
  flex: 1;
  justify-content: center;
}

/* hide lançamento rápido leftovers */
#pueri-isf-section,
#adl-isf-section,
.isf-grid,
[id$="-isf-section"] {
  display: none !important;
}

/* Card OMS oculto (vence display:flex !important do sidebar.css) */
.cc-chart-card.cc-card-hidden,
#clinic-sidebar .cc-chart-card.cc-card-hidden {
  display: none !important;
}
.cc-no-data {
  display: block !important;
  color: #fff !important;
  text-align: center !important;
  padding: 28px 12px !important;
  font-size: 12px !important;
  line-height: 1.45 !important;
  border: 1px dashed rgba(255,255,255,.35) !important;
  min-height: 120px !important;
  box-sizing: border-box !important;
}

@media print {
  @page { margin: 10mm; }
  html, body {
    background: #000 !important;
    color: #fff !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  body * { visibility: hidden !important; }
  #stetho-print-root,
  #stetho-print-root * {
    visibility: visible !important;
  }
  #stetho-print-root {
    display: block !important;
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    background: #000 !important;
    color: #fff !important;
    padding: 12px !important;
    font-family: Montserrat, system-ui, sans-serif !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  #stetho-print-root h1 {
    font-size: 18px !important;
    margin: 0 0 10px !important;
    color: #fff !important;
  }
  #stetho-print-root h3 {
    font-size: 13px !important;
    margin: 0 0 4px !important;
    color: #fff !important;
  }
  #stetho-print-root .cc-resumo,
  #stetho-print-root .cc-table,
  #stetho-print-root .cc-table th,
  #stetho-print-root .cc-table td,
  #stetho-print-root .cc-badge,
  #stetho-print-root .cc-resumo-header h3 {
    background: #000 !important;
    color: #fff !important;
    border-color: rgba(255,255,255,.35) !important;
  }
  .stetho-print-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 12px !important;
    margin-top: 12px !important;
  }
  .stetho-print-card {
    background: #000 !important;
    border: 1px solid rgba(255,255,255,.4) !important;
    color: #fff !important;
    padding: 10px !important;
    break-inside: avoid !important;
    page-break-inside: avoid !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  .stetho-print-card img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    display: block !important;
    background: #000 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  .stetho-print-meta,
  .stetho-print-badge,
  .stetho-print-empty {
    font-size: 11px !important;
    color: #fff !important;
    margin: 4px 0 !important;
  }
  .stetho-print-empty {
    min-height: 120px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: 1px dashed rgba(255,255,255,.4) !important;
    padding: 12px !important;
    text-align: center !important;
    background: #000 !important;
    color: #fff !important;
  }
}
