/* Diagnosis (Client/Pages/ListView/Problems.razor), Add/Edit diagnosis (Client/Pages/DetailView/EditProblem.razor,
   which also uses patient-editor.css) and the Clinical Intake diagnosis step. Card and list views read the same way:
   name and ICD-10, clinical status, verification, onset, actions. Status chip colours come from DiagnosisDisplay. */
.dx, .dx-editor, .ik-rows {
    --dx-accent: var(--rz-primary, #1d4ed8);
    --dx-text: var(--rz-text-color, #1e293b);
    --dx-muted: var(--rz-text-secondary-color, #64748b);
    --dx-border: var(--rz-base-300, #e2e8f0);
    --dx-surface: var(--rz-base-background-color, #fff);
    --dx-raised: var(--rz-base-50, #f8fafc);
    --dx-ok: var(--rz-success, #16a34a);
    --dx-warn: var(--rz-warning, #d97706);
    --dx-bad: var(--rz-danger, #dc2626);
    --dx-info: var(--rz-info, #2563eb);
}

/* Toolbar segmented controls (view switch, All / Active / Inactive) */
.dx-seg { display: inline-flex; border: 1px solid var(--dx-border); border-radius: 8px; overflow: hidden; }
.dx-seg button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: var(--dx-surface); color: var(--dx-text);
    padding: 6px 14px; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.dx-seg button + button { border-left: 1px solid var(--dx-border); }
.dx-seg button.on { background: var(--dx-accent); color: #fff; }

/* Status chips: one colour per status in every view */
.dx-chip { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.dx-chip.info { color: var(--dx-info); background: color-mix(in srgb, var(--dx-info) 13%, transparent); }
.dx-chip.ok { color: var(--dx-ok); background: color-mix(in srgb, var(--dx-ok) 14%, transparent); }
.dx-chip.warn { color: #92400e; background: color-mix(in srgb, var(--dx-warn) 18%, transparent); }
.dx-chip.bad { color: var(--dx-bad); background: color-mix(in srgb, var(--dx-bad) 12%, transparent); }
.dx-chip.neutral { color: var(--dx-muted); background: var(--dx-raised); border: 1px solid var(--dx-border); }

/* Cards: one row per diagnosis, the name taking the most room */
/* Cards sit in columns of a readable width (one card stretched across a wide screen left a gap in the middle). */
.dx-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 640px), 1fr)); gap: 12px; align-items: stretch; }
.dx-card { display: grid; grid-template-columns: minmax(220px, 1fr) auto auto; align-items: center; gap: 12px 24px;
    border: 1px solid var(--dx-border); border-radius: 12px; background: var(--dx-surface); padding: 14px 18px; color: var(--dx-text); }
.dx-name { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding-right: 18px; border-right: 1px solid var(--dx-border); }
.dx-title { font-weight: 700; font-size: 16.5px; line-height: 1.3; overflow-wrap: anywhere; white-space: normal; }
.dx-code { color: var(--dx-muted); font-size: 13.5px; display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dx-code b { color: var(--dx-text); font-weight: 600; }
.dx-chronic { color: var(--dx-bad); font-size: 12.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.dx-chronic-icon { color: var(--dx-bad); margin-left: 6px; }
.dx-facts { display: flex; flex-wrap: wrap; gap: 10px 28px; margin: 0; }
.dx-facts dt { color: var(--dx-muted); font-weight: 400; font-size: 13px; margin-bottom: 4px; }
.dx-facts dd { margin: 0; font-weight: 600; font-size: 14.5px; }
.dx-actions { display: flex; align-items: center; gap: 4px; justify-self: end; }
.dx-muted { color: var(--dx-muted); font-weight: 400; }

/* List */
.dx-row-title { font-weight: 700; white-space: normal; overflow-wrap: anywhere; line-height: 1.35; }
.dx-nowrap { white-space: nowrap; }
.dx-one-page .rz-pager { display: none !important; }

/* Add/Edit diagnosis */
.dx-editor-body { display: flex; flex-direction: column; gap: 6px; padding: 4px 2px 14px; }
.dx-editor .pe-grid2 { margin-top: 4px; }

@media (max-width: 900px) {
    .dx-card { grid-template-columns: minmax(0, 1fr); }
    .dx-name { border-right: 0; padding-right: 0; }
    .dx-actions { justify-self: start; }
}
