/* ─── Patient Header ────────────────────────────────────────── */
.v1-patient-header {
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border);
  padding: 10px 24px;
  flex-shrink: 0;
  min-height: 56px;
}
.v1-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #2563eb;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.v1-patient-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
  line-height: 1.2;
}
.v1-age-badge {
  font-size: 11px;
  font-weight: 600;
  background: #1e3a5f;
  color: #93c5fd;
  border: 1px solid #1e4a7a;
  padding: 1px 8px;
  border-radius: 20px;
}
.v1-patient-meta {
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-top: 2px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}
.v1-meta-sep { color: var(--border); }

/* ─── Scrollable body ───────────────────────────────────────── */
.v1-body {
  overflow-y: auto;
  background: var(--bg-main);
}
.v1-body::-webkit-scrollbar { width: 5px; }
.v1-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ─── SOAP tags ─────────────────────────────────────────────── */
.soap-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 800;
  flex-shrink: 0;
  letter-spacing: 0;
}
.soap-o { background: #1e3a5f; color: #60a5fa; border: 1px solid #1e4a7a; }
.soap-a { background: #2d1b69; color: #a78bfa; border: 1px solid #3d2b8a; }
.soap-p { background: #14402a; color: #4ade80; border: 1px solid #1a5235; }
.soap-s { background: #2d2410; color: #fbbf24; border: 1px solid #3d320a; }

/* ─── Safety strip ──────────────────────────────────────────── */
.v1-safety-strip {
  background: #1c0a0a;
  border-bottom: 1px solid #5a1a1a;
  border-top: 1px solid #5a1a1a;
  padding: 10px 24px;
  min-height: 44px;
  flex-shrink: 0;
}
.safety-icon {
  color: #ef4444;
  font-size: 18px;
  flex-shrink: 0;
}
.safety-label {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: #ef4444;
  white-space: nowrap;
  flex-shrink: 0;
}
.safety-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.safety-badge.critical {
  background: #7f1d1d;
  color: var(--text-primary)var(--text-primary)var(--text-primary);
  border: 1px solid #991b1b;
}
.safety-badge.mild {
  background: #1c2c14;
  color: var(--text-primary)var(--text-primary);
  border: 1px solid #166534;
}
.safety-conflict-flag {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-primary);
  background: #2c1500;
  border: 1px solid #7c2d12;
  padding: 3px 10px;
  border-radius: 5px;
  white-space: nowrap;
}
.safety-view-all {
  font-size: 11.5px;
  color: #ef4444;
  white-space: nowrap;
}
.safety-view-all:hover { color: #fca5a5; }

/* ─── Section headers ───────────────────────────────────────── */
.v1-section-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.v1-section-sub {
  font-size: 11px;
  color: var(--text-callado);
}
.v1-view-all {
  font-size: 11.5px;
  color: var(--text-secondary);
}
.v1-view-all:hover { color: var(--accent); }

/* ─── Vitals stat grid ──────────────────────────────────────── */
.vitals-stat-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.vs-card {
  border-radius: 10px;
  border: 1px solid var(--border);
  border-top-width: 3px;
  padding: 14px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--bg-card);
  position: relative;
}

/* status border colors */
.vs-critical { border-top-color: #ef4444; background: #160808; }
.vs-high     { border-top-color: #f97316; background: #120900; }
.vs-low      { border-top-color: #eab308; background: #12110a; }
.vs-neutral  { border-top-color: var(--border); }

.vs-name {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-secondary);
}

.vs-status-badge {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.07em;
  padding: 1px 7px;
  border-radius: 4px;
}
.vs-badge-critical { background: #7f1d1d; color: #fca5a5; }
.vs-badge-high     { background: #7c2d12; color: #fdba74; }
.vs-badge-low      { background: #713f12; color: #fde68a; }

.vs-value-row {
  display: flex;
  align-items: baseline;
  gap: 2px;
  margin-top: 6px;
  line-height: 1;
}
.vs-num {
  font-size: 42px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -1px;
}
.vs-num-sm { font-size: 32px; }
.vs-num-neutral { color: var(--text-primary); }
.vs-slash {
  font-size: 28px;
  color: var(--text-callado);
  margin: 0 2px;
  font-weight: 300;
}

/* value colors by status */
.vs-critical .vs-num { color: #ef4444; }
.vs-critical .vs-slash { color: #ef444480; }
.vs-high .vs-num     { color: #f97316; }
.vs-low .vs-num      { color: #eab308; }

.vs-unit-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}
.vs-unit {
  font-size: 12px;
  color: var(--text-secondary);
}
.vs-trend-up {
  font-size: 11px;
  font-weight: 600;
  color: #f97316;
}
.vs-critical .vs-trend-up { color: #ef4444; }
.vs-trend-down {
  font-size: 11px;
  font-weight: 600;
  color: #eab308;
}
.vs-range {
  font-size: 10.5px;
  color: var(--text-callado);
  margin-top: 6px;
  border-top: 1px solid var(--border);
  padding-top: 6px;
}

/* ─── Lower 2-column grid ───────────────────────────────────── */
.v1-lower-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  padding-bottom: 4px;
}
.v1-col { min-width: 0; }

/* ─── Cards ─────────────────────────────────────────────────── */
.v1-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
}
.v1-card-header { }
.v1-card-title {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-secondary);
}
.v1-count-badge {
  font-size: 10px;
  font-weight: 700;
  background: var(--bg-active);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  padding: 1px 7px;
  border-radius: 20px;
}
.v1-empty-state {
  font-size: 12.5px;
  color: var(--text-callado);
  padding: 8px 0;
}

/* ─── Lab table ─────────────────────────────────────────────── */
.lab-table { display: flex; flex-direction: column; gap: 0; }
.lab-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: center;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
}
.lab-row:last-child { border-bottom: none; }
.lab-row-abnormal { background: #120808; margin: 0 -16px; padding: 7px 16px; }
.lab-name  { color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lab-val   { color: var(--text-primary); font-weight: 600; white-space: nowrap; }
.lab-unit  { font-size: 10.5px; font-weight: 400; color: var(--text-callado); }
.lab-ref   { font-size: 10.5px; font-weight: 600; color: var(--text-callado); white-space: nowrap; }
.lab-ok    { color: #22c55e; }
.lab-abnormal { color: #ef4444; }
.lab-date  { font-size: 10.5px; color: var(--text-callado); white-space: nowrap; }

/* ─── Medications ───────────────────────────────────────────── */
.med-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
}
.med-row:last-child { border-bottom: none; }
.med-conflict {
  background: #160808;
  margin: 0 -16px;
  padding: 10px 16px;
  border-bottom-color: #5a1a1a;
  position: relative;
  overflow: hidden;
  border-radius: 6px 6px 0 0;
}
.med-conflict-bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: #ef4444;
  border-radius: 3px 0 0 3px;
}
.med-icon { font-size: 13px; color: var(--text-callado); flex-shrink: 0; }
.med-name { font-size: 13px; font-weight: 500; color: var(--text-primary); }
.med-conflict .med-name { color: #fca5a5; }
.med-dose { font-size: 11px; color: var(--text-callado); }
.med-divider { height: 1px; background: var(--border); margin: 4px 0; }
.med-flag-badge {
  font-size: 10.5px;
  font-weight: 700;
  background: #7f1d1d;
  color: #fca5a5;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ─── Patient Info Accordion ────────────────────────────────── */
.v1-info-accordion {
  border-top: 1px solid var(--border);
}
.v1-accordion-toggle {
  background: none;
  border: none;
  padding: 12px 0;
  cursor: pointer;
  text-align: left;
  width: 100%;
}
.v1-accordion-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-secondary);
}
.v1-acc-chevron {
  font-size: 13px;
  color: var(--text-callado);
  transition: transform 0.2s ease;
}
.v1-accordion-toggle.open .v1-acc-chevron { transform: rotate(180deg); }

.v1-accordion-body { display: none; }
.v1-accordion-body.open { display: block; }

.v1-info-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding-bottom: 8px;
}
.v1-info-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
}
.v1-info-block-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-callado);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.v1-info-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  padding: 4px 0;
  font-size: 12px;
}
.v1-info-row > span:first-child { color: var(--text-secondary); white-space: nowrap; }
.v1-info-row > span:last-child  { color: var(--text-primary); text-align: right; font-size: 12px; }
