/* vitals — Vitals tab (list + Add/Edit Vitals editor + Monitor Import). All classes prefixed .vit- */

/* ---------- list ---------- */
.vit-tab { flex: 1; min-height: 0; display: flex; flex-direction: column; background: #fff; }
.vit-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 16px 30px; border-bottom: 1px solid var(--line); flex: none; gap: 16px; }
.vit-total { font-size: 20px; color: #2d3e50; }
.vit-total b { font-weight: 700; }
.vit-seg { display: inline-flex; border: 1px solid var(--green); border-radius: 3px; overflow: hidden; }
.vit-seg button { min-width: 130px; height: 44px; background: #fff; border: 0; border-left: 1px solid var(--green); font-size: 16px; font-weight: 600; color: #2d3e50; cursor: pointer; }
.vit-seg button:first-child { border-left: 0; }
.vit-seg button:hover:not(.on) { background: #f1fbf5; }
.vit-seg button.on { background: var(--green); color: #fff; }

.vit-table { width: 100%; border-collapse: collapse; }
.vit-table th { position: sticky; top: 0; z-index: 1; background: #eef1f3; text-align: left; font-size: 13px; font-weight: 700; color: #5d6d7c; padding: 12px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.vit-table td { padding: 16px 12px; border-bottom: 1px solid var(--line); font-size: 17px; color: #2d3e50; white-space: nowrap; }
.vit-table th:first-child, .vit-table td:first-child { padding-left: 30px; }
.vit-tr { cursor: pointer; }
.vit-tr:hover td { background: #f5fafd; }
.vit-time { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.vit-pta { background: #0b98de; color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .5px; padding: 2px 6px; border-radius: 2px; }
.vit-notes { display: inline-block; max-width: 360px; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
.vit-del-col { width: 70px; text-align: right; padding-right: 24px !important; }
.vit-del { width: 38px; height: 38px; background: var(--red); color: #fff; border: 0; border-radius: 2px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.vit-del:hover { background: #d84333; }
.vit-del .ico { width: 22px; height: 22px; }
.vit-foot { flex: none; border-top: 1px solid var(--line); background: #fff; padding: 16px; display: flex; justify-content: center; gap: 18px; }
.vit-foot .btn { min-width: 250px; height: 50px; font-size: 17px; }

/* ---------- editor modal ---------- */
.modal-backdrop.vit-backdrop { z-index: 85; padding: 14px; } /* below .shelf-backdrop (90) so list pickers open on top */
.vit-modal.modal-full { max-width: 1680px; height: calc(100vh - 28px); max-height: calc(100vh - 28px); margin: 0 auto; }
.vit-modal .modal-body { padding: 0; flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }

.vit-top { flex: none; display: flex; align-items: stretch; background: #eef1f3; border-bottom: 1px solid var(--line); min-height: 86px; padding: 0 12px; overflow-x: auto; }
.vit-cell { display: flex; flex-direction: column; justify-content: center; padding: 10px 18px; border-right: 1px solid #dde3e7; min-width: 0; flex: none; }
.vit-cell-pill { flex-direction: row; align-items: center; }
.vit-cell-pill .pill { min-width: 110px; height: 46px; }
.vit-cell-label { font-size: 12px; font-weight: 700; color: #5d6d7c; letter-spacing: .6px; text-transform: uppercase; margin-bottom: 4px; }
.vit-cell-ctl { display: flex; align-items: center; gap: 6px; }
.vit-top-input { border: 0; border-bottom: 1px solid #b9c3cb; background: transparent; font: inherit; font-size: 20px; color: #2d3e50; padding: 2px 0; outline: none; }
.vit-top-input:focus { border-bottom: 2px solid var(--green); }
.vit-time-in { width: 112px; font-variant-numeric: tabular-nums; }
.vit-top-input[type=date] { width: 170px; }
.vit-top-input::-webkit-calendar-picker-indicator { display: none; }
.vit-icon-btn { background: none; border: 0; cursor: pointer; color: #0b98de; padding: 4px; display: inline-flex; }
.vit-ico-sm { width: 26px !important; height: 26px !important; }
.vit-drop { background: none; border-top: 0; border-bottom: 0; border-left: 0; cursor: pointer; text-align: left; min-width: 150px; }
.vit-drop:hover:not(:disabled) { background: #e5eaee; }
.vit-drop:disabled { cursor: default; }
.vit-cell-val { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 20px; color: #2d3e50; white-space: nowrap; }
.vit-cell-val.placeholder { color: #a8b3bc; }
.vit-caret { width: 20px !important; height: 20px !important; color: #0b98de; }
.vit-top-spacer { flex: 1; min-width: 10px; }
.vit-top-actions { display: flex; align-items: center; gap: 12px; padding: 0 12px; flex: none; }
.vit-top-actions .btn { min-width: 120px; height: 50px; font-size: 17px; }
/* Narrow desktops (< ~1500px): tighten the cells and keep Cancel / OK pinned in view while the bar scrolls. */
.vit-top-actions { position: sticky; right: -12px; background: inherit; }
@media (max-width: 1500px) {
  .vit-cell { padding: 10px 12px; }
  .vit-drop { min-width: 118px; }
  .vit-cell-pill .pill { min-width: 92px; }
  .vit-top-actions .btn { min-width: 96px; }
}

.vit-main { flex: 1; min-height: 0; display: grid; grid-template-columns: 310px 1fr; }
.vit-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 20px; align-content: start; border-right: 1px solid var(--line); overflow-y: auto; }
.vit-tile { position: relative; aspect-ratio: 1 / 1; border: 1px solid #cfd7dd; border-radius: 2px; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 8px; font-size: 12px; font-weight: 700; letter-spacing: 1px; color: #2d3e50; cursor: pointer; text-transform: uppercase; text-align: center; line-height: 1.3; }
.vit-tile:hover:not(.on) { background: #f4f7f9; }
.vit-tile .vit-ico { width: 48px; height: 48px; color: #0b98de; }
.vit-tile.on { background: var(--green); border-color: var(--green); color: #fff; }
.vit-tile.on .vit-ico { color: #fff; }
.vit-tile.has::after { content: ''; position: absolute; top: 0; right: 0; border-style: solid; border-width: 0 18px 18px 0; border-color: transparent var(--green) transparent transparent; }
.vit-tile.on.has::after { border-color: transparent #fff transparent transparent; }

.vit-panel { overflow-y: auto; padding: 26px 44px 40px; min-width: 0; }
.vit-panel-title { font-size: 26px; font-weight: 300; letter-spacing: 6px; text-transform: uppercase; color: #2d3e50; margin-bottom: 28px; }
.vit-panel-body { display: flex; gap: 56px; align-items: flex-start; flex-wrap: wrap; }
.vit-fields { flex: 1 1 460px; min-width: 0; max-width: 760px; }
.vit-fields.vit-wide { max-width: none; }
.vit-kp { flex: none; padding-top: 6px; }
.vit-kp .keypad { gap: 14px 22px; }

.vit-f { margin-bottom: 28px; min-width: 0; }
.vit-label { display: block; font-size: 15px; color: #5c6b77; margin-bottom: 6px; letter-spacing: .3px; transition: color .1s; }
.vit-f:focus-within > .vit-label { color: var(--green); }
.vit-ctl { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid #b9c3cb; min-height: 48px; }
.vit-ctl:focus-within { border-bottom: 2px solid var(--green); }
.vit-input { border: 0; outline: none; background: transparent; font: inherit; font-size: 22px; color: #2d3e50; padding: 8px 0; width: 100%; min-width: 0; }
.vit-input:disabled { -webkit-text-fill-color: #2d3e50; }
.vit-unit { color: #5d6d7c; font-size: 16px; white-space: nowrap; }
.vit-ro { font-size: 22px; min-height: 48px; padding: 8px 0; border-bottom: 2px dashed #c4ccd3; color: #2d3e50; }
.vit-ro.placeholder { color: #a8b3bc; }
.vit-row { display: flex; gap: 30px; align-items: flex-end; flex-wrap: wrap; }
.vit-row > .vit-f { flex: 1 1 160px; }
.vit-row > .vit-f-pills { flex: 0 0 auto; }
.vit-slash { font-size: 34px; color: #9aa7b2; padding-bottom: 32px; font-weight: 300; }
.vit-subhead { font-size: 13px; font-weight: 700; color: #2d3e50; letter-spacing: 1.5px; text-transform: uppercase; margin: 4px 0 10px; }
.vit-select { cursor: pointer; justify-content: space-between; }
.vit-select:focus { outline: none; border-bottom: 2px solid var(--green); }
.vit-select-val { font-size: 20px; padding: 8px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #2d3e50; }
.vit-select-val.placeholder { color: #a8b3bc; }
.vit-sel-ico { width: 26px !important; height: 26px !important; color: #0b98de; }
.vit-textarea { width: 100%; border: 1px solid #c4ccd3; border-radius: 3px; padding: 10px 12px; font: inherit; font-size: 18px; color: #2d3e50; min-height: 90px; resize: vertical; outline: none; }
.vit-textarea:focus { border-color: var(--green); }
.vit-muted { color: #8996a1; font-size: 15px; margin: 8px 0 16px; }

/* scoring */
.vit-subtabs { display: flex; gap: 36px; border-bottom: 1px solid var(--line); margin-bottom: 28px; flex-wrap: wrap; }
.vit-subtab { position: relative; background: none; border: 0; color: #0a8fd6; font-size: 14px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; padding: 12px 0 16px; cursor: pointer; }
.vit-subtab:hover { text-decoration: underline; }
.vit-subtab.on { color: #2d3e50; text-decoration: none; }
.vit-subtab.on::after { content: ''; position: absolute; left: 50%; bottom: -1px; transform: translateX(-50%); border: 9px solid transparent; border-bottom-color: #2d3e50; }
.vit-score-wrap { display: flex; gap: 44px; align-items: flex-start; flex-wrap: wrap; }
.vit-score-fields { flex: 1 1 440px; min-width: 0; max-width: 760px; }
.vit-card { flex: none; width: 280px; border: 1px solid var(--line); background: #f6f8f9; padding: 28px 20px; text-align: center; }
.vit-circle { width: 150px; height: 150px; border-radius: 50%; border: 6px solid #c9d2d9; background: #fff; margin: 0 auto 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #2d3e50; }
.vit-circle.set { border-color: #0b98de; }
.vit-circle span { font-size: 13px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: #5d6d7c; }
.vit-circle b { font-size: 54px; font-weight: 300; line-height: 1.1; }
.vit-card-sub { color: #5d6d7c; font-size: 14px; margin-bottom: 14px; }
.vit-card-pills { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.vit-card-pills .pill { min-width: 190px; }

.vit-acts { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; max-width: 1000px; }
.vit-act, .vit-pts-opt, .vit-flacc-opt { background: #eceff1; border: 1px solid #d7dde2; border-radius: 2px; cursor: pointer; text-align: left; color: #2d3e50; display: flex; flex-direction: column; gap: 4px; }
.vit-act { padding: 16px 18px; min-height: 86px; }
.vit-act b { font-size: 19px; }
.vit-act span, .vit-pts-opt span, .vit-flacc-opt span { font-size: 14px; color: #5d6d7c; }
.vit-act:hover:not(.on):not(:disabled), .vit-pts-opt:hover:not(.on):not(:disabled), .vit-flacc-opt:hover:not(.on):not(:disabled) { background: #e2e7eb; }
.vit-act.on, .vit-pts-opt.on, .vit-flacc-opt.on { background: #0b98de; border-color: #0b98de; color: #fff; }
.vit-act.on span, .vit-pts-opt.on span, .vit-flacc-opt.on span { color: #e6f5fd; }
.vit-act:disabled, .vit-pts-opt:disabled, .vit-flacc-opt:disabled { cursor: default; }

.vit-rts { width: 100%; border-collapse: collapse; margin-bottom: 12px; }
.vit-rts th { background: #eef1f3; text-align: left; font-size: 13px; color: #5d6d7c; padding: 10px 14px; }
.vit-rts td { padding: 16px 14px; border-bottom: 1px solid var(--line); font-size: 19px; color: #2d3e50; }
.vit-coded { font-weight: 700; color: #0b98de !important; }

.vit-pts-row { display: grid; grid-template-columns: 150px 1fr; gap: 16px; align-items: center; padding: 10px 0; border-bottom: 1px solid #edf0f2; }
.vit-pts-label { font-size: 16px; font-weight: 600; color: #2d3e50; }
.vit-pts-opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.vit-pts-opt { padding: 8px 12px; min-height: 58px; justify-content: center; }
.vit-pts-opt b { font-size: 18px; }

/* pain */
.vit-pain-fields { max-width: 1000px; }
.vit-bars { display: flex; align-items: flex-end; gap: 10px; flex-wrap: nowrap; overflow-x: auto; padding: 10px 0 6px; }
.vit-bar-col { background: none; border: 0; padding: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; width: 64px; flex: none; cursor: pointer; color: #2d3e50; }
.vit-bar-col:disabled { cursor: default; }
.vit-bar { width: 46px; border-radius: 3px 3px 0 0; opacity: .82; transition: opacity .1s, transform .1s; }
.vit-bar-col:hover:not(:disabled) .vit-bar { opacity: 1; }
.vit-bar-col.on .vit-bar { opacity: 1; box-shadow: 0 0 0 3px #2d3e50; }
.vit-radio { width: 26px; height: 26px; border: 1.5px solid #9aa7b2; border-radius: 50%; background: #fff; position: relative; }
.vit-bar-col.on .vit-radio { border-color: #0b98de; }
.vit-bar-col.on .vit-radio::after { content: ''; position: absolute; inset: 5px; border-radius: 50%; background: #0b98de; }
.vit-bar-num { font-size: 28px; font-weight: 400; }
.vit-bar-cap { font-size: 12px; font-weight: 700; color: #5d6d7c; min-height: 16px; white-space: nowrap; }
.vit-faces { display: flex; gap: 16px; flex-wrap: wrap; }
.vit-face { width: 128px; background: #fff; border: 2px solid transparent; border-radius: 6px; padding: 12px 6px; display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; color: #2d3e50; }
.vit-face:hover:not(:disabled) { background: #f4f7f9; }
.vit-face:disabled { cursor: default; }
.vit-face.on { border-color: #0b98de; background: #e8f5fc; }
.vit-face-svg { width: 84px; height: 84px; display: block; }
.vit-face-svg svg { width: 100%; height: 100%; }
.vit-face b { font-size: 26px; font-weight: 400; }
.vit-face span { font-size: 13px; text-align: center; color: #5d6d7c; }
.vit-flacc { max-width: 1100px; }
.vit-flacc-row { display: grid; grid-template-columns: 150px 1fr; gap: 16px; align-items: center; padding: 10px 0; border-bottom: 1px solid #edf0f2; }
.vit-flacc-cat { font-size: 16px; font-weight: 700; color: #2d3e50; letter-spacing: .5px; }
.vit-flacc-opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.vit-flacc-opt { flex-direction: row; align-items: center; gap: 12px; padding: 10px 12px; min-height: 60px; }
.vit-flacc-opt b { font-size: 22px; min-width: 18px; }

/* time keypad */
.vit-time-modal .modal-body { display: flex; flex-direction: column; align-items: center; gap: 20px; }
.vit-time-disp { font-size: 44px; font-weight: 300; letter-spacing: 4px; color: #2d3e50; font-variant-numeric: tabular-nums; border-bottom: 2px solid var(--green); padding: 0 12px 4px; }
.vit-now { min-width: 140px; }

/* monitor import */
.vit-mon-dev { display: flex; align-items: center; gap: 22px; background: #eef1f3; border: 1px solid var(--line); padding: 16px 20px; margin-bottom: 14px; }
.vit-mon-screen { width: 150px; height: 74px; background: #1b2631; border: 4px solid #3b4b5a; border-radius: 6px; color: #2ecc71; display: flex; flex-direction: column; justify-content: center; padding: 4px 8px; flex: none; }
.vit-mon-label { font-size: 10px; font-weight: 700; color: #f2c200; letter-spacing: .5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vit-mon-trace { width: 100% !important; height: 34px !important; }
.vit-mon-info { display: flex; flex-direction: column; gap: 3px; color: #2d3e50; font-size: 14px; }
.vit-mon-info b { font-size: 19px; }
.vit-mon-ok { color: var(--green-dark); font-weight: 600; }
.vit-mon-table { width: 100%; border-collapse: collapse; }
.vit-mon-table th { background: #eef1f3; text-align: left; font-size: 13px; color: #5d6d7c; padding: 10px; white-space: nowrap; }
.vit-mon-table td { padding: 12px 10px; border-bottom: 1px solid var(--line); font-size: 16px; color: #2d3e50; cursor: pointer; white-space: nowrap; }
.vit-mon-table tr.on td { background: #f1fbf5; }
.vit-mon-time { font-weight: 600; }
.vit-mon-dup { display: block; font-size: 11px; font-weight: 600; color: #b07d00; }
.vit-mon-rhythm { white-space: normal !important; font-size: 14px !important; }
.vit-cb { width: 22px; height: 22px; accent-color: var(--green); cursor: pointer; }

@media (max-width: 1100px) {
  .vit-main { grid-template-columns: 220px 1fr; }
  .vit-tiles { padding: 12px; gap: 8px; }
  .vit-tile .vit-ico { width: 34px; height: 34px; }
  .vit-tile { font-size: 10px; }
  .vit-panel { padding: 20px 22px; }
  .vit-head { grid-template-columns: 1fr; justify-items: center; }
}

/* keep selected choice buttons blue under hover (app.css hover rule would otherwise win) */
.vit-panel .choice.on, .vit-panel .choice.on:hover:not(:disabled) { background: #0b98de; border-color: #0b98de; color: #fff; }
