/* ============================================================
 * Operations — Coding & Billing views + shared claim record modal.
 * ============================================================ */

.ops-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-card, #fff);
  border: 1px solid var(--border, #e2e6ee);
  border-radius: 10px;
  margin-bottom: 12px;
}
.ops-filter { display: flex; flex-direction: column; gap: 4px; min-width: 160px; }
.ops-filter label {
  font-size: calc(9.5px * var(--ui-font-scale, 1)); text-transform: uppercase; letter-spacing: 0.4px;
  color: var(--muted, #6b7280); font-weight: 700;
}
.ops-filter select, .ops-filter input {
  padding: 7px 9px; border: 1px solid var(--border, #d5d9e0);
  border-radius: 6px; font: inherit; background: #fff;
}
.ops-toolbar .btn { height: 36px; }

.ops-hint { font-size: calc(11px * var(--ui-font-scale, 1)); color: var(--muted, #6b7280); margin: 2px 2px 10px; }

/* --- Claim list ------------------------------------------------------- */
.ops-claim-list { display: flex; flex-direction: column; gap: 8px; }
.ops-empty {
  padding: 28px 16px; text-align: center; color: var(--muted, #6b7280);
  border: 1px dashed var(--border, #d5d9e0); border-radius: 10px;
}
/* The screen has nothing to offer this user because their login carries no
   operations profile. Amber, not red: it is a setting nobody has filled in
   yet, not a failure — and emphatically not the missing upload it used to
   look like. */
.ops-hint-blocked {
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 8px;
  padding: 8px 10px;
}
.ops-empty-blocked {
  color: #92400e;
  background: #fffbeb;
  border-style: solid;
  border-color: #fcd34d;
  line-height: 1.6;
}
.ops-claim-card {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; background: var(--bg-card, #fff);
  border: 1px solid var(--border, #e2e6ee); border-radius: 10px;
}
.ops-claim-card:hover { border-color: #b7dfc6; }
.ops-claim-main { flex: 1; min-width: 0; }
.ops-claim-name { font-weight: 700; color: var(--text, #1f2937); }
.ops-claim-meta { font-size: calc(11px * var(--ui-font-scale, 1)); color: var(--muted, #6b7280); margin-top: 2px; }

.ops-pill {
  font-size: calc(10.5px * var(--ui-font-scale, 1)); font-weight: 700; padding: 3px 10px; border-radius: 999px;
  white-space: nowrap;
}
.ops-pill-good    { background: #dcfce7; color: #166534; }
.ops-pill-warn    { background: #fef3c7; color: #92400e; }
.ops-pill-neutral { background: #eef2f7; color: #475569; }

.ops-assignee {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  background: #f0faf4;
  color: #0f3d26;
  font-weight: 600;
  font-size: calc(10.5px * var(--ui-font-scale, 1));
}
.ops-list-mode {
  font-size: calc(11px * var(--ui-font-scale, 1)); font-weight: 700; color: #0f3d26;
  background: #f0faf4; border: 1px solid #b7dfc6;
  border-radius: 8px; padding: 6px 10px; margin-bottom: 8px;
}
.ops-readonly-badge {
  font-size: calc(11px * var(--ui-font-scale, 1)); font-weight: 600; color: #92400e;
  background: #fef3c7; border: 1px solid #fcd34d;
  border-radius: 8px; padding: 8px 12px; margin-bottom: 12px;
}

/* --- Shared claim record modal --------------------------------------- */
.ops-record-backdrop {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(15, 23, 42, 0.55);
  display: flex; align-items: stretch; justify-content: center;
  padding: 24px;
}
.ops-record-backdrop.hidden { display: none; }
.ops-record-frame {
  background: var(--bg, #f7f8fb);
  border-radius: 12px; width: 100%; max-width: 1680px;
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}
.ops-record-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 14px 18px; background: #fff;
  border-bottom: 1px solid var(--border, #e2e6ee);
}
.ops-record-header h2 { margin: 0; font-size: calc(16px * var(--ui-font-scale, 1)); }
.ops-record-header .meta { font-size: calc(11px * var(--ui-font-scale, 1)); color: var(--muted, #6b7280); }
.ops-record-body { padding: 16px 18px; overflow-y: auto; }

/* --- Record layout: patient record + right-hand entry panel ----------- */
.ops-record-titles { min-width: 0; }
.ops-record-tools { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.ops-record-layout {
  --ops-panel-w: 520px;
  position: relative;
  flex: 1 1 auto; min-height: 0;
  display: flex; align-items: stretch;
}
.ops-record-layout > .ops-record-body { flex: 1 1 auto; min-width: 0; }

.ops-panel {
  position: relative;
  flex: 0 0 var(--ops-panel-w); width: var(--ops-panel-w); max-width: 70%;
  display: flex; flex-direction: column; min-height: 0;
  background: var(--bg-card, #fff);
  border-left: 1px solid var(--border, #e2e6ee);
  box-shadow: -6px 0 18px rgba(15, 23, 42, 0.06);
  transition: flex-basis .18s ease, width .18s ease;
}
.ops-record-layout.panel-collapsed .ops-panel { display: none; }
.ops-resizing, .ops-resizing * { cursor: col-resize !important; user-select: none !important; }
.ops-resizing .ops-panel { transition: none; }
.ops-panel-resizer {
  position: absolute; left: -4px; top: 0; bottom: 0; width: 8px;
  cursor: col-resize; z-index: 2;
}
.ops-panel-resizer:hover { background: rgba(99, 102, 241, 0.18); }
.ops-panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 14px; border-bottom: 1px solid var(--border, #e2e6ee);
  background: #f8fafc;
}
.ops-panel-head h3 { margin: 0; font-size: calc(14px * var(--ui-font-scale, 1)); }
.ops-panel-head .meta { font-size: calc(11px * var(--ui-font-scale, 1)); color: var(--muted, #6b7280); }
.ops-panel-collapse {
  border: 1px solid var(--border, #d5d9e0); background: #fff; cursor: pointer;
  border-radius: 6px; width: 30px; height: 28px; font-size: calc(15px * var(--ui-font-scale, 1)); line-height: 1;
  color: #475569;
}
.ops-panel-collapse:hover { background: #f0faf4; color: #0f3d26; }
.ops-panel-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; }

/* Top-right toggle — the way back into a collapsed panel, and a live count
   of required fields still open. */
.ops-panel-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 10px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--border, #d5d9e0); background: #fff; color: #334155;
  font: inherit; font-size: calc(12px * var(--ui-font-scale, 1)); font-weight: 600;
}
.ops-panel-toggle:hover { border-color: #a5b4fc; }
.ops-panel-toggle.is-open { background: #f0faf4; border-color: #a5b4fc; color: #0f3d26; }
.ops-panel-count {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: #dc2626; color: #fff; font-size: calc(10.5px * var(--ui-font-scale, 1)); font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}

/* Narrow screens: the panel overlays the record as a drawer. */
@media (max-width: 960px) {
  .ops-record-backdrop { padding: 0; }
  .ops-record-frame { border-radius: 0; }
  .ops-panel {
    position: absolute; right: 0; top: 0; bottom: 0; z-index: 3;
    width: min(100%, 520px); max-width: 100%;
  }
  .ops-panel-resizer { display: none; }
}

/* --- Panel form ------------------------------------------------------- */
.ops-panel-form {
  border: 0; border-radius: 0; margin: 0; padding: 12px 14px 0;
}
.ops-panel-section { padding-bottom: 12px; margin-bottom: 12px;
  border-bottom: 1px solid #f1f5f9; display: flex; flex-direction: column; gap: 8px; }
.ops-panel-h {
  margin: 0; font-size: calc(11px * var(--ui-font-scale, 1)); text-transform: uppercase; letter-spacing: .5px;
  color: #334155; display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px;
}
.ops-panel-h-note {
  flex-basis: 100%; text-transform: none; letter-spacing: 0;
  font-size: calc(11px * var(--ui-font-scale, 1)); font-weight: 400; color: var(--muted, #6b7280);
}
.ops-field-note { font-weight: 400; color: var(--muted, #6b7280); font-size: calc(10.5px * var(--ui-font-scale, 1)); }
.ops-readonly-text { background: #f8fafc !important; color: #475569; }
.ops-stamp { font-size: calc(10.5px * var(--ui-font-scale, 1)); color: var(--muted, #6b7280); }
.ops-audit-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ops-note-block {
  font-size: calc(11.5px * var(--ui-font-scale, 1)); color: #334155; background: #f8fafc;
  border: 1px solid #eef2f7; border-radius: 6px; padding: 6px 8px; white-space: pre-wrap;
}
.ops-note-block b { display: block; font-size: calc(10px * var(--ui-font-scale, 1)); text-transform: uppercase;
  letter-spacing: .4px; color: #64748b; margin-bottom: 2px; }
.ops-panel-form .ops-grid { gap: 8px 10px; }

/* Sticky action bar at the bottom of the panel. */
.ops-panel-actions {
  position: sticky; bottom: 0; z-index: 1;
  margin: 0 -14px; padding: 10px 14px;
  background: var(--bg-card, #fff);
  border-top: 1px solid var(--border, #e2e6ee);
  box-shadow: 0 -6px 12px rgba(15, 23, 42, 0.05);
}
.ops-actions-spacer { flex: 1 1 auto; }

.ops-mods { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.ops-mods input { min-width: 0; text-transform: uppercase; text-align: center; }

/* --- MAR/TAR groups and HCPCS lines ----------------------------------- */
.ops-groups { display: flex; flex-direction: column; gap: 10px; }
.ops-group {
  border: 1px solid #b7dfc6; border-radius: 10px; background: #f8faff;
  padding: 8px; display: flex; flex-direction: column; gap: 8px;
}
.ops-group-head { display: flex; align-items: center; gap: 6px; }
.ops-group-tag {
  font-size: calc(9.5px * var(--ui-font-scale, 1)); font-weight: 800; letter-spacing: .4px; color: #0f3d26;
  background: #e8f5ee; border-radius: 4px; padding: 2px 6px; flex-shrink: 0;
}
.ops-group-head select {
  flex: 1 1 auto; min-width: 0; padding: 5px 7px; font: inherit; font-size: calc(11.5px * var(--ui-font-scale, 1));
  border: 1px solid var(--border, #d5d9e0); border-radius: 6px; background: #fff;
}
.ops-group-lines { display: flex; flex-direction: column; gap: 6px; }
.ops-line {
  background: #fff; border: 1px solid var(--border, #e2e6ee); border-radius: 8px;
  padding: 6px 8px 8px; transition: box-shadow .3s ease;
}
.ops-line-flash { box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.35); }
.ops-line-head { display: flex; align-items: center; justify-content: space-between; }
.ops-line-no { font-size: calc(10.5px * var(--ui-font-scale, 1)); color: #64748b; text-transform: uppercase; letter-spacing: .4px; }
.ops-line-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 8px;
}
.ops-lf {
  display: flex; flex-direction: column; gap: 3px; min-width: 0;
  font-size: calc(10.5px * var(--ui-font-scale, 1)); font-weight: 600; color: #475569;
}
.ops-lf-span2 { grid-column: span 2; }
.ops-lf input {
  width: 100%; min-width: 0; padding: 5px 7px; font: inherit; font-size: calc(12px * var(--ui-font-scale, 1));
  font-weight: 500; border: 1px solid var(--border, #d5d9e0); border-radius: 5px;
  background: #fff;
}
.ops-code-input { text-transform: uppercase; font-weight: 700 !important; }
.ops-code-input::placeholder { text-transform: none; font-weight: 400; }
.ops-add-hcpcs {
  align-self: flex-start; border: 1px dashed #a5b4fc; background: #fff; color: #0f3d26;
  border-radius: 6px; padding: 4px 10px; font: inherit; font-size: calc(11.5px * var(--ui-font-scale, 1)); font-weight: 600;
  cursor: pointer;
}
.ops-add-hcpcs:hover { background: #f0faf4; }
.ops-add-group { align-self: flex-start; }

/* Line item: shared details entered once, then one compact row per HCPCS. */
.ops-group-shared {
  background: #fff; border: 1px solid var(--border, #e2e6ee); border-radius: 8px;
  padding: 6px 8px 8px; display: flex; flex-direction: column; gap: 6px;
}
.ops-hcpcs { background: #fcfdff; }
.ops-days-field { gap: 5px; }
.ops-days-count { font-weight: 400; color: var(--muted, #6b7280); margin-left: 6px; }
.ops-days { display: flex; flex-wrap: wrap; gap: 4px; padding: 2px; border-radius: 6px; }
.ops-day { position: relative; cursor: pointer; }
.ops-day input { position: absolute; opacity: 0; pointer-events: none; }
.ops-day span {
  display: inline-block; padding: 2px 7px; border-radius: 999px;
  border: 1px solid var(--border, #d5d9e0); background: #fff; color: #94a3b8;
  font-size: calc(11px * var(--ui-font-scale, 1)); font-weight: 600; font-variant-numeric: tabular-nums;
}
/* Days active on the sheet are underlined whether ticked or not, so the coder
   can see the sheet's answer next to their own choice. */
.ops-day-active span { box-shadow: inset 0 -2px 0 #16a34a; }
.ops-day input:checked + span {
  background: #e8f5ee; border-color: #a5b4fc; color: #0f3d26; text-decoration: none;
}
.ops-day-added span { border-style: dashed; }
.ops-day input:focus-visible + span { outline: 2px solid #2d9960; outline-offset: 1px; }
.ops-day input:disabled + span { cursor: default; }
.ops-days-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ops-days-btn {
  border: 1px solid var(--border, #d5d9e0); background: #fff; color: #334155; border-radius: 5px;
  padding: 2px 8px; font: inherit; font-size: calc(11px * var(--ui-font-scale, 1)); cursor: pointer;
}
.ops-days-tools input { flex: 1 1 140px; max-width: 180px; }
.ops-lf-span-all { grid-column: 1 / -1; }
.ops-lf textarea {
  width: 100%; min-width: 0; padding: 5px 7px; font: inherit; font-size: calc(12px * var(--ui-font-scale, 1));
  font-weight: 500; border: 1px solid var(--border, #d5d9e0); border-radius: 5px; background: #fff; resize: vertical;
}
.ops-line-audit-text {
  font-weight: 500; color: #334155; background: #fffbeb; border: 1px solid #fde68a;
  border-radius: 5px; padding: 5px 7px; white-space: pre-wrap;
}
.ops-line-head { gap: 6px; }
.ops-line-head .ops-line-no { flex: 1 1 auto; }
.ops-line-status {
  padding: 2px 5px; font: inherit; font-size: calc(11px * var(--ui-font-scale, 1));
  border: 1px solid var(--border, #d5d9e0); border-radius: 5px; background: #fff;
}
.ops-group-head .ops-line-status { flex: 0 0 auto; }
.ops-line-query { border-color: #f59e0b; background: #fffbeb; }
.ops-line-dirty { border-color: #f87171; background: #fef2f2; }
.ops-line-dirty .ops-line-grid, .ops-line-query .ops-line-grid { opacity: .75; }
.ops-stage-qa { background: #e8f5ee; color: #0f3d26; }
.ops-stage-dirty { background: #fee2e2; color: #991b1b; }
.ops-btn-dirty { color: #b91c1c; }
.ops-days-none-note { align-self: end; font-size: calc(10.5px * var(--ui-font-scale, 1));
  color: var(--muted, #6b7280); font-weight: 400; }

/* Coding bucket — what L1 validation pushed over for this scope. */
.ops-bucket {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px;
  margin: 0 2px 10px; padding: 8px 12px; border-radius: 8px;
  background: var(--bg-card, #fff); border: 1px solid var(--border, #e2e6ee);
  font-size: calc(11.5px * var(--ui-font-scale, 1)); color: #334155;
}
.ops-bucket-label {
  font-size: calc(9.5px * var(--ui-font-scale, 1)); font-weight: 800; letter-spacing: .4px;
  text-transform: uppercase; color: #0f3d26; background: #e8f5ee; border-radius: 4px; padding: 2px 6px;
}
.ops-bucket-stat b { font-variant-numeric: tabular-nums; }
.ops-bucket-note { flex-basis: 100%; color: var(--muted, #6b7280); font-size: calc(10.5px * var(--ui-font-scale, 1)); }
.ops-invalid { border-color: #dc2626 !important; background: #fef2f2 !important;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.15); }
@media (max-width: 520px) {
  .ops-line-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* --- Coded line summary (main area) ----------------------------------- */
.ops-lines-summary {
  background: var(--bg-card, #fff); border: 1px solid var(--border, #e2e6ee);
  border-radius: 10px; padding: 12px 14px; margin-bottom: 14px;
}
.ops-summary-head { display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px; flex-wrap: wrap; }
.ops-summary-head .ops-section-title { flex: 1 1 auto; }
.ops-summary-meta { display: flex; gap: 6px 14px; flex-wrap: wrap; font-size: calc(11px * var(--ui-font-scale, 1)); color: #334155; }
.ops-summary-count {
  display: inline-block; min-width: 18px; padding: 0 6px; margin-left: 4px;
  border-radius: 999px; background: #e8f5ee; color: #0f3d26;
  font-size: calc(10.5px * var(--ui-font-scale, 1)); text-align: center; letter-spacing: 0;
}
.ops-summary-wrap { max-height: 260px; }
.ops-summary td { vertical-align: top; }
.ops-summary tr.ops-dos-start td { border-top: 1px solid #e2e8f0; }
.ops-sum-dos { white-space: nowrap; font-weight: 600; }
/* A line billed on its active days lists them under the count, wrapped, so a
   month of dates can't crowd the codes out of the table. */
.ops-sum-days { display: block; white-space: normal; max-width: 210px; font-weight: 400;
  font-size: calc(10.5px * var(--ui-font-scale, 1)); color: #475569; line-height: 1.35; }
.ops-sum-num, .ops-sum-n { text-align: right; font-variant-numeric: tabular-nums; }
.ops-sum-n { color: #94a3b8; }
.ops-sum-tx { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ops-sum-note { color: #475569; }
.ops-blank { color: #cbd5e1; }

/* "+ Code" on each MAR/TAR card, and how many HCPCS it already carries. */
#opsRecordBody .tx-card-head { grid-template-columns: 60px 140px 1fr auto auto; }
#opsRecordBody .ops-tx-coded[hidden] { display: none; }
.tx-card .ops-tx-code {
  flex-shrink: 0; align-self: start;
  border: 1px solid #a5b4fc; background: #f0faf4; color: #0f3d26;
  border-radius: 6px; padding: 3px 9px; font: inherit; font-size: calc(11px * var(--ui-font-scale, 1)); font-weight: 700;
  cursor: pointer;
}
.tx-card .ops-tx-code:hover { background: #e8f5ee; }
.ops-tx-coded {
  flex-shrink: 0; align-self: start; white-space: nowrap; font-size: calc(10.5px * var(--ui-font-scale, 1)); font-weight: 700; color: #166534;
  background: #dcfce7; border-radius: 999px; padding: 2px 8px;
}
.tx-card.ops-tx-is-coded { box-shadow: inset 3px 0 0 #22c55e; }

/* --- Mandatory-field pop-up ------------------------------------------- */
.ops-dialog-backdrop {
  position: fixed; inset: 0; z-index: 260;
  background: rgba(15, 23, 42, 0.45);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.ops-dialog-backdrop.hidden { display: none; }
.ops-dialog {
  background: #fff; border-radius: 12px; width: min(100%, 520px);
  max-height: 80vh; display: flex; flex-direction: column;
  padding: 18px 20px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  border-top: 4px solid #dc2626;
}
.ops-dialog h3 { margin: 0 0 6px; font-size: calc(15px * var(--ui-font-scale, 1)); color: #991b1b; }
.ops-dialog p { margin: 0 0 10px; font-size: calc(12.5px * var(--ui-font-scale, 1)); color: #334155; }
.ops-dialog-list { overflow-y: auto; font-size: calc(12.5px * var(--ui-font-scale, 1)); }
.ops-dialog-list ul { margin: 2px 0 8px; padding-left: 20px; }
.ops-dialog-list li { margin: 2px 0; }
.ops-dialog-group { font-weight: 700; font-size: calc(11.5px * var(--ui-font-scale, 1)); color: #475569; margin-top: 6px; }
.ops-dialog-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }

/* --- Coding / Billing form ------------------------------------------- */
.ops-section-title {
  margin: 4px 0 10px; font-size: calc(12px * var(--ui-font-scale, 1)); text-transform: uppercase;
  letter-spacing: 0.5px; color: #334155;
  border-bottom: 2px solid #e2e8f0; padding-bottom: 6px;
}
.ops-form {
  background: #fff; border: 1px solid var(--border, #e2e6ee);
  border-radius: 10px; padding: 14px 16px; margin-bottom: 16px;
}
.ops-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px;
}
@media (max-width: 720px) { .ops-grid { grid-template-columns: 1fr; } }
.ops-field { display: flex; flex-direction: column; gap: 4px; font-size: calc(11px * var(--ui-font-scale, 1));
  font-weight: 600; color: #475569; }
.ops-field.ops-col-2 { grid-column: 1 / -1; }
.ops-field input, .ops-field select, .ops-field textarea {
  padding: 7px 9px; border: 1px solid var(--border, #d5d9e0);
  border-radius: 6px; font: inherit; font-weight: 500; background: #fff;
}
.ops-field textarea { resize: vertical; }

.ops-form-actions {
  display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap;
}
.ops-move-hint { font-size: calc(11px * var(--ui-font-scale, 1)); color: var(--muted, #6b7280); }

.ops-coding-readout {
  display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: calc(11px * var(--ui-font-scale, 1));
  color: #334155; margin-bottom: 12px;
}
.ops-coding-readout b { color: #475569; }

/* --- Reused Cleansing record (read-only) ----------------------------- */
.ops-record-detail { margin-top: 8px; }
.ops-readonly-record {
  background: #fff; border: 1px solid var(--border, #e2e6ee);
  border-radius: 10px; padding: 8px 12px;
}
.ops-readonly-record input:disabled,
.ops-readonly-record select:disabled,
.ops-readonly-record textarea:disabled,
.ops-readonly-record button:disabled { opacity: 1; cursor: default; }
.ops-record-missing {
  padding: 16px; text-align: center; color: var(--muted, #6b7280);
  border: 1px dashed var(--border, #d5d9e0); border-radius: 10px;
}

/* --- Modifiers M1-M4 sit inline beside the Billing Code (UAT 4) ------- */
.ops-field-narrow { max-width: 84px; }
.ops-req { color: #b91c1c; font-weight: 700; }

/* --- Specialty tag highlights (UAT 6) --------------------------------- */
.ops-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.ops-tag {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: calc(10.5px * var(--ui-font-scale, 1)); font-weight: 700; letter-spacing: .02em;
  border: 1px solid transparent; white-space: nowrap;
}
.ops-tag-enteral { background: #e0f2fe; color: #075985; border-color: #7dd3fc; }
.ops-tag-ostomy  { background: #fef3c7; color: #92400e; border-color: #fcd34d; }
.ops-tag-urology { background: #ede9fe; color: #5b21b6; border-color: #c4b5fd; }
.ops-tag-trach   { background: #dcfce7; color: #166534; border-color: #86efac; }
.ops-tag-vaccine { background: #ffe4e6; color: #9f1239; border-color: #fda4af; }
.ops-tag-wound   { background: #ffedd5; color: #9a3412; border-color: #fdba74; }

/* --- Banners inside the record modal ---------------------------------- */
.ops-lock-badge,
.ops-missing-badge {
  padding: 8px 12px; border-radius: 8px; font-size: calc(11.5px * var(--ui-font-scale, 1));
  margin-bottom: 10px; border: 1px solid;
}
.ops-lock-badge    { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.ops-missing-badge { background: #fffbeb; color: #92400e; border-color: #fde68a; }

/* --- Physician NPI / Tax ID lookup (UAT 16) --------------------------- */
.ops-lookup-row { display: flex; gap: 8px; align-items: stretch; }
.ops-lookup-row input { flex: 1 1 auto; }

/* --- Service lines, one per DOS day (UAT 15) -------------------------- */
.ops-lines-note { font-size: calc(11px * var(--ui-font-scale, 1)); color: var(--muted, #6b7280); margin: 4px 0 8px; }
.ops-empty-lines {
  padding: 14px; text-align: center; font-size: calc(11.5px * var(--ui-font-scale, 1));
  color: var(--muted, #6b7280);
  border: 1px dashed var(--border, #d5d9e0); border-radius: 8px;
}
.ops-lines-wrap { max-height: 340px; overflow: auto; border: 1px solid var(--border, #e2e6ee); border-radius: 8px; }
.ops-lines { width: 100%; border-collapse: collapse; font-size: calc(11.5px * var(--ui-font-scale, 1)); }
.ops-lines th {
  position: sticky; top: 0; background: #f8fafc; text-align: left;
  padding: 7px 10px; font-weight: 600; border-bottom: 1px solid var(--border, #e2e6ee);
}
.ops-lines td { padding: 5px 10px; border-bottom: 1px solid #f1f5f9; }
.ops-lines input {
  width: 100%; padding: 4px 6px; font: inherit;
  border: 1px solid var(--border, #d5d9e0); border-radius: 5px;
}

/* --- Coding line items (UAT 28) --------------------------------------- */
/* The billable-item editor is the one table on the screen the coder types
   into freely, so it gets room to breathe and a visible add/remove affordance
   the read-only charge grid below it does not need. */
.ops-subsection-title {
  margin: 16px 0 6px; font-size: calc(12px * var(--ui-font-scale, 1)); font-weight: 700;
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
}
.ops-subsection-note {
  font-size: calc(11px * var(--ui-font-scale, 1)); font-weight: 400; color: var(--muted, #6b7280);
}
.ops-items { min-width: 860px; }
.ops-items th { white-space: nowrap; font-size: calc(11px * var(--ui-font-scale, 1)); }
.ops-items .ops-item-n { color: var(--muted, #6b7280); width: 26px; }
.ops-item-del {
  border: 0; background: none; cursor: pointer; padding: 2px 6px;
  color: #94a3b8; font-size: calc(12px * var(--ui-font-scale, 1)); line-height: 1; border-radius: 4px;
}
.ops-item-del:hover { color: #b91c1c; background: #fef2f2; }
[data-item-add] { margin-top: 8px; }

/* --- >30-line claim split preview (UAT 18) ---------------------------- */
.ops-split {
  margin-top: 12px; padding: 10px 14px; border-radius: 8px;
  background: #f8fafc; border: 1px solid var(--border, #e2e6ee);
}
.ops-split h4 { margin: 0 0 6px; font-size: calc(11.5px * var(--ui-font-scale, 1)); }
.ops-split ul { margin: 0; padding-left: 18px; font-size: calc(11.5px * var(--ui-font-scale, 1)); }
.ops-split code { background: #e2e8f0; padding: 0 4px; border-radius: 3px; }

/* ---- payment position on a claim card (P-01) --------------------------
   Where a claim stands on the money, once it has been matched to the
   payments that came back. Reserved status steps as a tint behind ink text,
   the same pairing the Insights screen uses — the words carry the meaning,
   the colour only makes it findable at a glance. */

.ops-pay {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: calc(10px * var(--ui-font-scale, 1));
  font-weight: 600;
  white-space: nowrap;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.ops-pay-ok   { background: #d9eed9; }
.ops-pay-part { background: #fdf0d2; }
.ops-pay-bad  { background: #f7e0e0; }
.ops-pay-open { background: var(--surface-3, var(--divider)); color: var(--text-muted); }
.ops-pay-wait {
  background: transparent;
  border: 1px dashed var(--border);
  color: var(--text-faint);
  font-style: italic;
}
[data-theme="dark"] .ops-pay-ok   { background: #1b3320; }
[data-theme="dark"] .ops-pay-part { background: #3a2f16; }
[data-theme="dark"] .ops-pay-bad  { background: #3d1f1f; }

/* Section headings sitting directly in the panel form (Billing). */
.ops-panel-form > .ops-panel-h { margin: 4px 0 8px; }

/* Coding: optional Patient ID beside "Fetch next claim". */
#codingPatientId { min-width: 0; width: 190px; max-width: 100%; }
.ops-optional { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--text-faint); }

/* "My list" tools: remove entries from this screen only (nothing deleted). */
.ops-list-tools {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 0 0 8px; font-size: calc(11.5px * var(--ui-font-scale, 1)); color: var(--text-muted);
}
.ops-list-restore {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--primary); font: inherit; text-decoration: underline;
}
.ops-claim-remove {
  width: 26px; height: 26px; flex: 0 0 auto; padding: 0; cursor: pointer;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text-muted); font-size: calc(12px * var(--ui-font-scale, 1));
}
.ops-claim-remove:hover { color: var(--error); border-color: var(--error); }

/* "Clean records only" switch — toolbars and the open record. */
.ops-clean-toggle {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer; white-space: nowrap;
  font-size: calc(12px * var(--ui-font-scale, 1)); color: var(--text);
}
.ops-clean-toggle input { margin: 0; }
.ops-clean-toggle-record { margin-right: 4px; }
.ops-clean-note {
  margin: 0 0 10px; padding: 6px 10px; border-radius: var(--radius-sm);
  background: var(--success-soft); color: var(--success);
  font-size: calc(12px * var(--ui-font-scale, 1));
}
.ops-clean-note-warn { background: var(--warning-soft); color: var(--warning); }
