/* Inbox cards (W2-C). Shared card layout is in base.css. */

/* P3.2205: urgent (critical value / critical flag / alarm keyword) cards. */
.card.urgent { border-left: 5px solid #c0392b; }
.urgent-label { display: inline-block; background: #c0392b; color: white; font-size: 0.7rem; font-weight: 700; letter-spacing: .06em; padding: 2px 8px; border-radius: 4px; margin-bottom: 4px; }

/* P1.2196: patient name, DOB and received time. */
.card-info .patient-line { font-size: 0.85rem; color: #333; margin-top: 2px; }

/* P1.2195: the triggering observation is the primary lab content. */
.trigger-obs { background: #fdedec; border-left: 3px solid #c0392b; padding: 7px 11px; border-radius: 0 4px 4px 0; margin-top: 6px; font-size: 0.82rem; }
.trigger-obs-value { font-weight: 700; font-size: 0.95rem; color: #7b241c; }
.trigger-obs-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; color: #555; margin-top: 2px; }
.trigger-obs-history { color: #555; margin-top: 2px; }
.trigger-obs-history-label { color: #777; }

/* P1.2214: the rule fired on a result this message does not name. No value
   box: a plain notice, then the earlier result on its own line. */
.trigger-obs-missing { background: #fbfcfc; border-left: 3px solid #aab7b8; padding: 7px 11px; border-radius: 0 4px 4px 0; margin-top: 6px; font-size: 0.82rem; overflow-wrap: anywhere; }
.trigger-obs-notice { font-weight: 600; color: #2c3e50; }
.trigger-obs-earlier { color: #7b241c; margin-top: 2px; }
/* Round 5 (P1.2214): this message's own results, then the earlier result line. */
.trigger-obs-group > .trigger-obs-earlier { font-size: 0.82rem; margin-top: 4px; padding-left: 14px; overflow-wrap: anywhere; }

/* Other tracked labs: collapsed under their own heading, never primary. */
.other-labs { margin-top: 8px; font-size: 0.78rem; }
.other-labs-toggle { cursor: pointer; color: #666; }
.card-info .trend-cards { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.trend-card { background: #f8f9f9; border-left: 3px solid #5d6d7e; padding: 7px 11px; border-radius: 0 4px 4px 0; font-size: 0.78rem; flex: 1 1 220px; min-width: 0; }
.trend-card.controlled, .trend-card.at_goal, .trend-card.euthyroid, .trend-card.normal_g1 { border-left-color: #27ae60; }
.trend-card.uncontrolled, .trend-card.stage_5, .trend-card.hyperthyroid, .trend-card.hypothyroid { border-left-color: #c0392b; }
.trend-card.needs_attention, .trend-card.above_goal, .trend-card.stage_3a, .trend-card.stage_3b, .trend-card.stage_4 { border-left-color: #d35400; }
.trend-card .trend-date { color: #888; }
.trend-card .trend-meta { color: #666; }
.trend-card .trend-rec { color: #444; }

/* P1.2194: reviewed draft and the send gate. */
.draft-panel { background: #eaf4fb; border-left: 3px solid #2e86c1; padding: 8px 12px; border-radius: 0 4px 4px 0; margin-top: 8px; font-size: 0.85rem; color: #1a5276; }
.draft-panel-label { font-weight: 600; margin-bottom: 4px; }
.draft-text { white-space: pre-wrap; color: #1b2631; }
.inbox-card .btn-review { background: #2e86c1; color: white; }
.inbox-card .btn:disabled { opacity: 0.45; cursor: not-allowed; }
.send-hint { font-size: 0.72rem; color: #777; max-width: 140px; }
.inbox-card .send-hint { line-height: 1.3; min-height: 2.6em; }
/* P3.2309 row 5: "Message read" takes the unread hint's place at the same height. */
.inbox-card .send-hint.send-hint-done { color: #1e8449; }

/* P3.2202: in-page confirm inside the card. */
.inbox-confirm { margin-top: 8px; padding: 8px 12px; border: 1px solid #aab7b8; border-radius: 6px; background: #fbfcfc; font-size: 0.85rem; }
.inbox-confirm.sends-message { border-color: #2e86c1; background: #eaf4fb; }
.inbox-confirm-text { font-weight: 600; margin-bottom: 6px; }
.inbox-confirm-buttons { display: flex; flex-wrap: wrap; gap: 6px; }
.inbox-confirm .btn-cancel { background: #d5dbdb; color: #2c3e50; }

@media (max-width: 640px) {
  .send-hint { max-width: none; flex-basis: 100%; }
  .inbox-card .send-hint { min-height: 0; }
  .inbox-confirm-buttons .btn { flex: 1 1 120px; padding: 10px 12px; }
}

/* P3.2290: controlled-medicine note, same plain look as on refill cards
   (refills.css scopes its rule to .refill-card). */
.inbox-card .epcs-note { margin-top: 4px; color: #873600; font-size: 0.82rem; font-weight: 400; cursor: default; }

/* Round 5 W3-H2 (R.158). Classes only (strict CSP). */
/* Q9 / Q3: why a card has no (or fewer) buttons for this person. */
.inbox-card .inbox-readonly-note { margin-top: 4px; color: #555; font-size: 0.8rem; }
/* Q9: the qualified prescriber's "Done in athena"; Q18 (b): "Looks fine". */
.inbox-card .btn-done-athena { background: #5d6d7e; color: white; }
.inbox-card .btn-looks-fine { background: #1e8449; color: white; }
/* Q4 (a): the physician's notice about escalated items, above the counts. */
.escalated-notice { margin: 0 0 12px; padding: 8px 12px; border-left: 4px solid #c0392b; border-radius: 0 6px 6px 0; background: #fdedec; color: #7b241c; font-weight: 600; font-size: 0.9rem; }
/* Q4 (a): pinned right under the count boxes for the physician. */
#i-escalated-section.escalated-pinned { margin-top: 0; margin-bottom: 24px; }
/* P1.2214: this message's own result with no abnormal flag (not the alert). */
.trigger-obs.obs-normal { background: #f4f6f7; border-left-color: #5d6d7e; }
.trigger-obs.obs-normal .trigger-obs-value { color: #1b2631; }
/* Q15 (a): the physician's un-escalated urgent cards, above the escalated list. */
#i-urgent-section { margin-top: 0; margin-bottom: 24px; }
.who-to-ask { margin: 0 0 8px; color: #4a5563; font-size: 0.88rem; }
