/* Refill cards (W2-B). Shared card layout is in base.css. Every rule is
   scoped to .refill-card or the reject dialog so inbox cards are unaffected. */

/* P1.2196: who, what and when, above the athena ids. */
.refill-card .refill-patient-line { font-weight: 600; font-size: 0.9rem; color: #222; }

/* P1.2189: controlled substance, approved by the physician in athena.
   POLISH row 4 (P3.2226): plain informational text in the info column, not a
   button look-alike: no border or fill, left-aligned, normal weight, default
   cursor. */
.refill-card .epcs-note { background: none; border: 0; padding: 0; margin-top: 4px; color: #873600; font-size: 0.82rem; font-weight: 400; text-align: left; cursor: default; }

/* R.158 Q9 (W3-H1): a controlled card nobody here may act on is read-only;
   this line says who may. */
.refill-card .refill-readonly-note { margin-top: 4px; color: #555; font-size: 0.8rem; }
/* R.206 Q1: the quiet open-urgent-result line, with a link-looking button. */
.refill-card .refill-open-result { margin-top: 4px; color: #555; font-size: 0.8rem; }
.refill-card .refill-open-result-link {
  background: none; border: 0; padding: 0; color: #1a5fb4; font: inherit;
  text-decoration: underline; cursor: pointer;
}
/* The qualified prescriber's "Done in athena" (nothing is sent). */
.refill-card .btn-done-athena { background: #5d6d7e; color: white; }

/* R.178 Q9 (1a): the tab line for staff while the protocol is unsigned. */
.refill-protocol-line { margin: 0 0 10px; color: #555; font-size: 0.85rem; }
/* P3.2704 row 6: a phone number in a preview stays on one line, at any width. */
.phone-nowrap { white-space: nowrap; }
/* R.178 Q2 (4): the confirm inside a refill card sits under the card text. */
.refill-card .refill-confirm-slot:empty { display: none; }

/* P1.2194: review before send. */
.refill-card .btn-review { background: #2e86c1; color: white; }
.refill-card .btn-approve:disabled,
.refill-card .btn-approve[data-needs-review] { background: #a9cfb8; cursor: not-allowed; opacity: 1; }
/* P3.2809: the locked Approve & Send stays clickable (shell.css makes other
   aria-disabled buttons inert) so the click can say what to do first. */
.refill-card .btn-approve[aria-disabled="true"][data-needs-review] { pointer-events: auto; }
/* P3.2309 row 5: both sentences share one grid cell, so the line is the same
   height before and after "Review message" and the buttons below never move. */
.refill-card .send-hint { display: grid; font-size: 0.72rem; color: #666; text-align: center; }
.refill-card .send-hint > span { grid-area: 1 / 1; }
.refill-card .send-hint:not(.is-read) .send-hint-read,
.refill-card .send-hint.is-read .send-hint-unread { visibility: hidden; }
/* P3.2866 row 2: a click on the greyed Approve & Send highlights this hint for ~3 s.
   Colour/weight only (no motion), so it is reduced-motion safe and the line never reflows. */
.refill-card .send-hint.is-nudged { color: #7d3c00; background: #fdebd0; font-weight: 600; border-radius: 4px; }
.refill-card .refill-draft-panel { margin-top: 8px; }
.refill-card .refill-draft-label { font-size: 0.75rem; font-weight: 600; color: #1a5276; }
.refill-card .refill-draft-text { white-space: pre-wrap; }

/* P1.2197: in-page reject dialog (#dialog-root). */
.reject-dialog { width: min(560px, calc(100vw - 32px)); max-width: 100%; border: none; border-radius: 10px; padding: 18px 20px; box-shadow: 0 8px 30px rgba(0,0,0,.25); color: #333; }
.reject-dialog::backdrop { background: rgba(0,0,0,.35); }
.reject-dialog-title { margin: 0 0 4px; font-size: 1rem; overflow-wrap: anywhere; }
/* P3.2217: the item line under the title; wraps at 200% phone zoom. */
.reject-dialog-item { margin: 0 0 10px; font-size: 0.9rem; font-weight: 600; color: #1a5276; overflow-wrap: anywhere; }
.reject-label { display: block; font-size: 0.82rem; font-weight: 600; margin-bottom: 6px; }
.reject-text { display: block; width: 100%; font: inherit; font-size: 0.9rem; padding: 8px; border: 1px solid #bbb; border-radius: 6px; resize: vertical; }
/* R.158 Q8 (W3-H1): the fixed refusal sentence (read-only), the optional
   patient note with its count, and the staff note that is never sent. */
.reject-fixed-label { font-size: 0.8rem; font-weight: 600; color: #555; margin-top: 4px; }
.reject-fixed { background: #f4f6f7; border-left: 3px solid #aab7b8; padding: 6px 10px; margin: 4px 0 10px; font-size: 0.85rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.reject-fixed.reject-fixed-unknown { color: #873600; }
.reject-patient-group, .reject-staff-group { margin-bottom: 10px; }
.reject-note-count, .reject-staff-count { font-size: 0.75rem; color: #666; margin-top: 4px; text-align: right; }
.reject-note-error, .reject-staff-error { color: #c0392b; font-size: 0.8rem; margin-top: 4px; }
.reject-hint { font-size: 0.75rem; color: #666; margin-top: 4px; }
.reject-name-warning { margin-top: 6px; padding: 8px 10px; border: 1px solid #d68910; border-left-width: 4px; background: #fef5e7; border-radius: 6px; font-size: 0.82rem; color: #6e4a00; }
.reject-name-warning[hidden] { display: none; }
.reject-name-warning .btn { margin-top: 6px; display: block; }
.reject-preview-hint { font-size: 0.75rem; color: #666; margin-top: 4px; }
.reject-preview-label { font-size: 0.8rem; font-weight: 600; color: #555; margin-top: 12px; }
.reject-preview { background: #f4f6f7; border-left: 3px solid #5d6d7e; padding: 8px 12px; margin-top: 4px; font-size: 0.88rem; white-space: pre-wrap; overflow-wrap: anywhere; min-height: 2.2em; }
.reject-dialog-buttons { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; flex-wrap: wrap; }
/* P3.4865 row 5: long dialog scrolls in its body; Cancel/Send stay in view. */
.reject-dialog[open] { display: flex; flex-direction: column; max-height: calc(100vh - 32px); overflow: hidden; }
.reject-dialog-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.reject-dialog-buttons { flex: none; margin-top: 0; padding-top: 10px; border-top: 1px solid #e5e7e9; background: #fff; }
.reject-dialog .btn:disabled { opacity: 0.45; cursor: not-allowed; }
.reject-dialog .btn-cancel { background: #e5e7e9; color: #333; }

/* P3.8031: a controlled refill leaves P17 only after this explicit modal confirm. */
.controlled-done-dialog { width: min(560px, calc(100vw - 32px)); max-width: 100%; border: none; border-radius: 10px; padding: 18px 20px; box-shadow: 0 8px 30px rgba(0,0,0,.25); color: #333; }
.controlled-done-dialog::backdrop { background: rgba(0,0,0,.35); }
.controlled-done-title { margin: 0 0 8px; font-size: 1.1rem; overflow-wrap: anywhere; }
.controlled-done-item { margin: 0 0 10px; font-weight: 600; color: #1a5276; overflow-wrap: anywhere; }
.controlled-done-warning { margin: 0; overflow-wrap: anywhere; }
.controlled-done-buttons { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.controlled-done-dialog .btn-cancel { background: #e5e7e9; color: #333; }
@media (max-width: 640px) { .controlled-done-dialog { padding: 14px; } .controlled-done-buttons .btn { flex: 1 1 160px; padding: 10px 12px; } }

@media (max-width: 640px) {
  .reject-dialog { padding: 14px; }
  .reject-dialog-buttons .btn { flex: 1 1 120px; padding: 10px 12px; }
}
.refill-card .refill-draft-close { margin-top: 8px; }
.refill-confirm .refill-confirm-item { font-size: 0.8rem; margin-bottom: 6px; overflow-wrap: anywhere; }
.reject-hint-above { font-size: 0.75rem; color: #666; margin: 2px 0 4px; }
