/* ═══════════════════════════════════════════════════════════════════════════
   FCMS Module 12 — Operating Room. Builds on tokens.css + journey.css; colours only through their variables.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── status chips (one class per case status) ─────────────────────────────── */
.or-chip { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 4px 11px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.or-chip.st-scheduled { background: var(--pill-info-bg); color: var(--pill-info-ink); }
.or-chip.st-pre_op { background: var(--pill-warn-bg); color: var(--pill-warn-ink); }
.or-chip.st-sign_in, .or-chip.st-time_out { background: var(--sapphire-muted); color: var(--sapphire-deep); border: 1.5px solid var(--sapphire); }
.or-chip.st-in_procedure { background: var(--ruby); color: var(--white); }
.or-chip.st-sign_out { background: var(--pill-danger-bg); color: var(--pill-danger-ink); }
.or-chip.st-recovery { background: var(--emerald-muted); color: var(--emerald-dark); border: 1.5px solid var(--emerald); }
.or-chip.st-discharged { background: var(--pill-ok-bg); color: var(--pill-ok-ink); }
.or-chip.st-cancelled { background: var(--sand-deep); color: var(--ink-soft); text-decoration: line-through; }

/* ── board: timeline ───────────────────────────────────────────────────────── */
.or-tl { position: relative; overflow-x: auto; }
.or-tl-inner { min-width: 760px; }
.or-tl-head, .or-tl-row { display: grid; grid-template-columns: 150px 1fr; align-items: stretch; }
.or-tl-head .track { position: relative; height: 26px; }
.or-tl-head .hour { position: absolute; top: 4px; transform: translateX(-50%); font-size: 14px; font-weight: 600; color: var(--ink); }
.or-tl-row { border-top: 1px solid var(--border-soft); min-height: 92px; }
.or-tl-row .room { padding: 10px 8px; font-weight: 600; color: var(--ink); font-size: 16px; }
.or-tl-row .room small { display: block; font-weight: 400; color: var(--ink); font-size: 14px; }
.or-tl-row .track { position: relative; background: var(--cream-deep); }
.or-tl .gridline { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--border-soft); }
.or-tl .nowline { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--ruby); z-index: 3; }
.or-block { position: absolute; top: 6px; bottom: 6px; border-radius: 6px; padding: 6px 9px; overflow: hidden; font-size: 14px; line-height: 1.3;
  cursor: pointer; border-left: 4px solid var(--sapphire-deep); background: var(--pill-info-bg); color: var(--pill-info-ink); z-index: 2; min-width: 170px; box-shadow: 0 1px 4px rgba(0,0,0,.18); }
.or-block:hover { z-index: 4; }
.or-block b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 16px; font-weight: 600; }
.or-block span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 400; }
.or-block.st-pre_op { background: var(--pill-warn-bg); color: var(--pill-warn-ink); border-left-color: var(--color-warning); }
.or-block.st-sign_in, .or-block.st-time_out { background: var(--sapphire-muted); color: var(--sapphire-deep); border-left-color: var(--sapphire); }
.or-block.st-in_procedure { background: var(--ruby); color: var(--white); border-left-color: var(--ruby-dark); }
.or-block.st-sign_out { background: var(--pill-danger-bg); color: var(--pill-danger-ink); border-left-color: var(--ruby); }
.or-block.st-recovery { background: var(--emerald-muted); color: var(--emerald-dark); border-left-color: var(--emerald); }
.or-block.st-discharged { background: var(--pill-ok-bg); color: var(--pill-ok-ink); border-left-color: var(--emerald-dark); }
.or-block.st-cancelled { background: var(--sand-deep); color: var(--ink-soft); border-left-color: var(--border-strong); text-decoration: line-through; opacity: .7; }
.or-block.nolink { cursor: default; }

/* ── board: room columns ──────────────────────────────────────────────────── */
.or-rooms { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.or-rooms .card + .card { margin-top: 0; }
.or-case { border: 1px solid var(--border-soft); border-radius: 6px; padding: 10px 12px; margin-top: 10px; background: var(--white); display: block; color: var(--ink-body); }
.or-case:hover { border-color: var(--sapphire); }
.or-case .t { font-weight: 700; font-size: 15px; color: var(--ink); }
.or-case .line { font-size: 14px; margin-top: 3px; }
.or-case .flags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.or-legend { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

/* ── case page ────────────────────────────────────────────────────────────── */
.or-steps { display: flex; gap: 4px; flex-wrap: wrap; margin: 0 0 14px; }
.or-steps .step { flex: 1; min-width: 92px; text-align: center; padding: 8px 6px; border-radius: 6px; font-size: 13px; font-weight: 700;
  background: var(--sand); color: var(--ink-soft); border: 1.5px solid transparent; }
.or-steps .step.done { background: var(--pill-ok-bg); color: var(--pill-ok-ink); }
.or-steps .step.cur { background: var(--dept-deep); color: var(--white); }
.or-steps .step small { display: block; font-weight: 500; font-size: 11.5px; opacity: .9; }
.or-flags { border-left: 4px solid var(--ruby); background: var(--pill-danger-bg); color: var(--pill-danger-ink); }
.or-flags div { font-weight: 700; }
.or-allergy { display: inline-flex; gap: 6px; align-items: center; border-radius: 999px; padding: 4px 12px; font-weight: 700; font-size: 13.5px;
  background: var(--pill-danger-bg); color: var(--pill-danger-ink); }
.or-flags:not(.card) { padding: 8px 12px; border-radius: 6px; font-weight: 700; font-size: 14px; }
.or-allergy-hint { display: inline-block; margin-top: 4px; border-radius: 6px; padding: 2px 10px; font-weight: 700; font-size: 13px;
  background: var(--pill-danger-bg); color: var(--pill-danger-ink); }
.or-sent { margin-top: 10px; border: 1px solid var(--border-soft); border-radius: 6px; padding: 8px 12px; background: var(--cream-deep); }
.or-sent summary { cursor: pointer; font-weight: 700; font-size: 13.5px; color: var(--ink-soft); }
.or-sent .or-pre { font-size: 14px; margin-top: 6px; }

/* checklist */
.or-item { display: grid; grid-template-columns: 40px 1fr; gap: 10px; padding: 10px 0; border-top: 1px solid var(--border-soft); align-items: start; }
.or-item:first-of-type { border-top: 0; }
.or-tick { width: 34px; height: 34px; border-radius: 8px; border: 2px solid var(--border-strong); background: var(--white); cursor: pointer; font-size: 19px;
  font-weight: 700; color: var(--white); display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.or-tick.on { background: var(--emerald); border-color: var(--emerald); }
.or-tick.bad { background: var(--ruby); border-color: var(--ruby); }
.or-tick:disabled { cursor: not-allowed; opacity: .55; }
.or-item.na { opacity: .55; }
.or-item .lbl { font-weight: 600; font-size: 15px; color: var(--ink-body); }
.or-item .who { font-size: 12.5px; color: var(--ink-soft); margin-top: 3px; }
.or-item .opts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.or-opt { border: 1.5px solid var(--border-strong); background: var(--white); border-radius: 999px; padding: 6px 13px; font-weight: 700; font-size: 13.5px;
  cursor: pointer; color: var(--dept-deep); }
.or-opt.on { background: var(--dept-deep); border-color: var(--dept-deep); color: var(--white); }
.or-opt:disabled { cursor: not-allowed; opacity: .55; }
.or-item .note { margin-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; }
.or-item .note .input { flex: 1; min-width: 160px; width: auto; padding: 7px 10px; }
.or-phase-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.or-phase-head h2 { margin: 0 !important; }

/* vitals / tables */
.or-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.or-form label.f { min-width: 90px; flex: 1; }
.or-form label.f input, .or-form label.f select { width: 100%; }
.or-form .btn { flex: 0 0 auto; }
tr.void td { color: var(--ink-soft); text-decoration: line-through; }
tr.void td:last-child, .or-void, .or-void * { text-decoration: none; }
.or-void { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; white-space: normal; }
.or-ok { color: var(--emerald-dark); font-weight: 700; }
.or-no { color: var(--ruby-dark); font-weight: 700; }
.or-req { list-style: none; padding: 0; margin: 0; }
.or-req li { padding: 7px 0; border-top: 1px solid var(--border-soft); display: flex; gap: 10px; align-items: center; font-size: 15px; }
.or-req li:first-child { border-top: 0; }
.or-mark { width: 26px; height: 26px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: var(--white); flex: 0 0 26px; }
.or-mark.ok { background: var(--emerald); }
.or-mark.no { background: var(--ruby); }
.or-pick { border: 1px solid var(--border-soft); border-radius: 6px; max-height: 240px; overflow: auto; background: var(--white); margin-top: 6px; }
.or-pick div { padding: 8px 10px; cursor: pointer; border-top: 1px solid var(--border-soft); font-size: 14.5px; }
.or-pick div:first-child { border-top: 0; }
.or-pick div:hover { background: var(--gray-50); }
.or-pre { white-space: pre-wrap; font-size: 15px; }
.or-checks { display: flex; gap: 6px 14px; flex-wrap: wrap; }
.or-checks label { display: inline-flex; gap: 6px; align-items: center; font-weight: 600; font-size: 14px; margin: 0; color: var(--ink-body); }
textarea.input { width: 100%; }
.modal .grid label.f input, .modal .grid label.f select, .modal .grid label.f textarea { width: 100%; }

/* titled checkbox groups (not <label>: labels must not nest) */
.f-group { display: flex; flex-direction: column; gap: 5px; font-size: 13.5px; color: var(--ink); font-weight: 700; margin-top: 8px; }
.or-scroll { overflow-x: auto; }
.or-tl-head .hour.first { transform: none; }
.or-tl-head .hour.last { transform: translateX(-100%); }
table.t .pill, table.t .tag, table.t .btn, .topbar .btn, .topbar .tag { white-space: nowrap; }

/* tablet (10-inch) and small laptops */
@media (max-width: 1100px) {
  .or-tl-head, .or-tl-row { grid-template-columns: 110px 1fr; }
  .or-steps .step { min-width: 76px; font-size: 12px; }
}

/* the case's consents (signed on paper): one block per consent, actions wrap under it (fits the narrow pre-op column) */
.or-consent { padding: 10px 0; border-bottom: 1px solid var(--border-soft); }
.or-consent:last-child { border-bottom: 0; }

/* Set OR / Set ART (or-book.js): one-click choice rows, the cycle line, and the team notices */
.or-pick-row { display: flex; flex-wrap: wrap; gap: 8px; }
.or-pick-row .btn { min-height: 40px; }
.or-cyc-line { margin: 4px 0 10px; font-size: 15px; }
.or-notices h2 { display: flex; align-items: center; gap: 8px; }
.or-notice { border-left: 4px solid var(--ruby); background: var(--ruby-muted); border-radius: 6px; padding: 10px 12px; margin-top: 8px; }
.or-notice.read { border-left-color: var(--border-color); background: var(--white); }
.or-notice-t { font-size: 14.5px; }
.or-notice-b { font-size: 15.5px; font-weight: 600; margin: 4px 0 2px; color: var(--ink); }

/* hover / focus detail card for a timeline block: shown at once, big enough to read (Dr. Pat, 29 Nov 2026) */
.or-tip { position: fixed; z-index: 1000; width: 380px; pointer-events: none; background: var(--white); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.28); border: 2px solid var(--sapphire-deep); }
.or-tip .or-case { margin-top: 0; border: 0; font-size: 16px; }
