/*
 * billing-parity.css - RehabDox's small sizes on IMEHR's Billing page and billing dialogs.
 * Goal (CTO, 2026-11-13): nobody can tell whether a biller is in RehabDox or IMEHR.
 *
 * WHY A CLASS AND NOT btn-sm: the project bans the btn-sm class in markup (CLAUDE.md). Billing
 * screens that mirror RehabDox get their small buttons from this scoped class instead.
 *
 * WHAT RehabDox's btn-sm REALLY COMPUTES TO. Both apps load Bootstrap 5.3.2 and then the same
 * styles.css, whose own .btn rule sets padding / font-size directly (8px 16px, 13px). So
 * Bootstrap's btn-sm variables (--bs-btn-padding-y etc.) never reach the button; what wins is
 * styles.css's two later .btn-sm rules:
 *     .btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 8px; gap: 5px; }   (Button Sizes)
 *     .btn-sm i, .btn-sm .bi { font-size: 11px; }
 *     .btn-sm { font-size: 0.75rem; padding: 0.2rem 0.5rem; }                          (font reduction)
 * With html at 14px that is font 10.5px, padding 2.8px 7px, radius 8px, line-height 1.4 from
 * .btn: the 10.5px / 2.8px 7px / 21.9px tall / 8px measured in RehabDox on 2026-11-13.
 *
 * NAME: bp-sm-btn, not bp-btn-sm, so the text "btn-sm" never appears in billing markup and the
 * existing "no btn-sm" source-contract checks (plain substring and \bbtn-sm\b) stay meaningful.
 *
 * ONE DEFINITION, ALIASES. .bp-sm-btn is the real class. Three older IMEHR classes did the same
 * job and are aliases in the same rule, so they can never drift apart:
 *   .billing-compact-btn  claims and charges filter bars (Clear, Print, Apply, clear links, split toggle)
 *   .claims-action-btn    the claims list Open Claim button
 *   .ee-small-btn         EOB / ERA tab and EOB posting screen. It used Bootstrap's btn-sm
 *                         variables, which styles.css's .btn overrides, so it had no effect at all
 *                         (the PM measured 13px / 8px 16px there). This rule fixes it.
 * .claim-compact .btn (styles.css) gives the claim dialog the same metrics for every button in it
 * and stays in styles.css because the claim dialog also opens from the patient profile.
 *
 * SPECIFICITY: one class, loaded after styles.css. That reproduces RehabDox's cascade, where the
 * last .btn-sm rule beats every earlier one-class rule on the same button (for example
 * .schedule-filter-clear-btn). p-0 on btn-link buttons is an !important utility and still wins.
 *
 * NOT NEEDED (measured equal in both apps, and explained by the cascade): form-control-sm and
 * form-select-sm lose padding, font-size and radius to styles.css's .form-control / .form-select;
 * the only surviving declaration is a min-height that never binds. table-sm and pagination-sm are
 * plain Bootstrap classes that IMEHR already carries in billing markup (only btn-sm is banned).
 *
 * LOADING: linked from Views/Billing/Index.cshtml. Billing dialogs that open from other pages
 * (claim insurance picker) need this file in _Layout.cshtml as well; the class names are unique
 * to billing markup, so loading it globally changes nothing else.
 */

.bp-sm-btn,
.billing-compact-btn,
.claims-action-btn,
.ee-small-btn {
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 8px;
    gap: 5px;
}

.bp-sm-btn i,
.bp-sm-btn .bi,
.billing-compact-btn i,
.billing-compact-btn .bi,
.claims-action-btn i,
.claims-action-btn .bi,
.ee-small-btn i,
.ee-small-btn .bi {
    font-size: 11px;
}

/*
 * Office Ally responses panel (spec 2026-11-17, approved mockup version 2,
 * Docs/mockups/2026-11-14_office-ally-responses-panel.html). Same classes and colours as the
 * mockup and as RehabDox. Everything is scoped under .oa-resp so the mockup's short class names
 * (.summary, .stage, .pill, .files) cannot collide with Bootstrap or the rest of the claim screen.
 * The claims-list reason line (.why-line) is at the end.
 * Spec Change 1 (as RehabDox): .stage.closed (grey, like skip and waiting), .stage .note and
 * .summary .detail; the Closed summary tone is grey.
 */
.oa-resp {
    --oa-ink: #1f2937; --oa-muted: #6b7280; --oa-line: #e5e7eb;
    --oa-red: #dc2626; --oa-red-bg: #fef2f2; --oa-red-line: #fecaca;
    --oa-green: #059669; --oa-green-bg: #ecfdf5; --oa-green-line: #a7f3d0;
    --oa-amber: #b45309; --oa-amber-bg: #fffbeb; --oa-amber-line: #fde68a;
    --oa-grey: #9ca3af; --oa-grey-bg: #f3f4f6; --oa-brand: #4f46e5;
    background: #fff; border: 1px solid var(--oa-line); border-radius: 12px; overflow: hidden;
    color: var(--oa-ink); font-size: 13px; line-height: 1.5;
}
.oa-resp .card-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px;
                      border-bottom: 1px solid var(--oa-line); background: #fafafa; }
.oa-resp .card-head .t { font-weight: 600; display: flex; gap: 8px; align-items: center; }
.oa-resp .oa-empty { padding: 10px 14px; color: var(--oa-muted); }
.oa-resp .pill { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 100px; }
.oa-resp .pill.live, .oa-resp .pill.rej { background: var(--oa-red-bg); color: var(--oa-red); }
.oa-resp .pill.ok { background: var(--oa-green-bg); color: var(--oa-green); }
.oa-resp .pill.owes { background: var(--oa-amber-bg); color: var(--oa-amber); }
.oa-resp .pill.grey { background: var(--oa-grey-bg); color: var(--oa-muted); }

/* 1. The answer first, from the rule table */
.oa-resp .summary { margin: 14px; border: 1px solid var(--oa-red-line); background: var(--oa-red-bg); border-radius: 10px; padding: 14px 16px; }
.oa-resp .summary .status { font-size: 15px; font-weight: 700; color: var(--oa-red); }
.oa-resp .summary.paid { border-color: var(--oa-green-line); background: var(--oa-green-bg); }
.oa-resp .summary.paid .status { color: var(--oa-green); }
.oa-resp .summary.owes { border-color: var(--oa-amber-line); background: var(--oa-amber-bg); }
.oa-resp .summary.owes .status { color: var(--oa-amber); }
.oa-resp .summary.waiting, .oa-resp .summary.none, .oa-resp .summary.closed { border-color: var(--oa-line); background: var(--oa-grey-bg); }
.oa-resp .summary.waiting .status, .oa-resp .summary.none .status, .oa-resp .summary.closed .status { color: var(--oa-muted); }
.oa-resp .summary .when { color: var(--oa-muted); font-size: 12px; margin: 2px 0 10px; }
/* Spec Change 1 C7: the Closed line ("Written off") under the status */
.oa-resp .summary .detail { font-weight: 600; margin-top: 2px; }
.oa-resp .summary dl { display: grid; grid-template-columns: 120px 1fr; gap: 6px 12px; margin: 0; }
.oa-resp .summary dt { font-weight: 600; color: var(--oa-muted); font-size: 12px; }
.oa-resp .summary dd { margin: 0; }
.oa-resp .summary .todo { font-weight: 600; }
.oa-resp .payer-says { background: #fff; border: 1px solid var(--oa-red-line); border-radius: 8px; padding: 6px 10px; font-size: 12px; }
.oa-resp .src { font-size: 11px; color: var(--oa-muted); margin-top: 8px; }

/* 2. Package-tracking stepper per submission */
.oa-resp .sub-block { margin: 0 14px 14px; border: 1px solid var(--oa-line); border-radius: 10px; }
.oa-resp .sub-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap;
                     padding: 9px 12px; background: #fafafa; border-bottom: 1px solid var(--oa-line); border-radius: 10px 10px 0 0; }
.oa-resp .sub-head .name { font-weight: 600; }
.oa-resp .sub-head .meta { color: var(--oa-muted); font-size: 12px; }
.oa-resp .tracker { display: grid; grid-template-columns: repeat(4, 1fr); padding: 16px 12px 10px; position: relative; }
.oa-resp .stage { text-align: center; position: relative; padding: 0 4px; }
.oa-resp .stage::before { content: ""; position: absolute; top: 13px; left: -50%; width: 100%; height: 3px; background: var(--oa-line); z-index: 0; }
.oa-resp .stage:first-child::before { display: none; }
.oa-resp .stage.done::before, .oa-resp .stage.fail::before, .oa-resp .stage.warn::before { background: var(--oa-green); }
.oa-resp .dot { width: 28px; height: 28px; border-radius: 50%; margin: 0 auto 6px; display: grid; place-items: center;
                font-weight: 700; font-size: 14px; position: relative; z-index: 1; border: 3px solid #fff; }
.oa-resp .stage.done .dot { background: var(--oa-green); color: #fff; }
.oa-resp .stage.fail .dot { background: var(--oa-red); color: #fff; }
.oa-resp .stage.warn .dot { background: var(--oa-amber); color: #fff; }
.oa-resp .stage.skip .dot, .oa-resp .stage.waiting .dot, .oa-resp .stage.closed .dot { background: var(--oa-grey-bg); color: var(--oa-grey); }
.oa-resp .stage .label { font-weight: 600; font-size: 12px; }
.oa-resp .stage.skip .label, .oa-resp .stage.waiting .label, .oa-resp .stage.closed .label { color: var(--oa-grey); font-weight: 500; }
.oa-resp .stage .date { color: var(--oa-muted); font-size: 11px; }
/* Spec Change 1 C4: "Entered from EOB" under the time of a Paid stage from a hand-entered EOB */
.oa-resp .stage .note { color: var(--oa-muted); font-size: 11px; font-style: italic; }
.oa-resp .fail-reason { margin: 4px 12px 12px; border-left: 3px solid var(--oa-red); background: var(--oa-red-bg); border-radius: 0 8px 8px 0; padding: 8px 12px; }
.oa-resp .fail-reason.amber { border-left-color: var(--oa-amber); background: var(--oa-amber-bg); }
.oa-resp .fail-reason .r { font-weight: 600; }
.oa-resp .fail-reason .who { color: var(--oa-muted); font-size: 12px; }
.oa-resp details { margin: 0 12px 12px; }
.oa-resp details > summary { cursor: pointer; color: var(--oa-brand); font-size: 12px; list-style: none; }
.oa-resp details > summary::-webkit-details-marker { display: none; }
.oa-resp .files { margin-top: 6px; border: 1px solid var(--oa-line); border-radius: 8px; overflow: hidden; }
.oa-resp .files div { display: grid; grid-template-columns: 70px 1fr 140px; gap: 10px; padding: 6px 10px; font-size: 12px; border-top: 1px solid var(--oa-line); }
.oa-resp .files div:first-child { border-top: 0; }
.oa-resp .files code { font-family: Consolas, monospace; font-size: 11.5px; color: var(--oa-ink); }
.oa-resp .files a { color: var(--oa-brand); }
@media (max-width: 640px) {
    .oa-resp .summary dl { grid-template-columns: 1fr; }
    .oa-resp .tracker { grid-template-columns: repeat(2, 1fr); row-gap: 14px; }
    .oa-resp .stage::before { display: none; }
    .oa-resp .files div { grid-template-columns: 1fr; gap: 2px; }
}

/* 3. Claims list: the short reason under the Rejected / Denied / Patient owes pill */
.why-line { font-size: 12px; color: #dc2626; margin-top: 3px; white-space: normal; }
.why-line.amber { color: #b45309; }
