/* Patient insurance (Client/Pages/ListView/PatientInsurances.razor) and Add/Edit coverage
   (Client/Pages/DetailView/EditPatientInsurance.razor, which also uses patient-editor.css). Card and list views read
   the same way: payer, priority, member ID, coverage period, eligibility, actions. */
.pi, .pi-editor {
    --pi-accent: var(--rz-primary, #1d4ed8);
    --pi-text: var(--rz-text-color, #1e293b);
    --pi-muted: var(--rz-text-secondary-color, #64748b);
    --pi-border: var(--rz-base-300, #e2e8f0);
    --pi-surface: var(--rz-base-background-color, #fff);
    --pi-raised: var(--rz-base-50, #f8fafc);
    --pi-ok: var(--rz-success, #16a34a);
    --pi-warn: var(--rz-warning, #d97706);
    --pi-bad: var(--rz-danger, #dc2626);
}

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

/* Cards */
.pi-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.pi-card { display: flex; flex-direction: column; border: 1px solid var(--pi-border); border-radius: 12px; background: var(--pi-surface);
    padding: 14px 16px; color: var(--pi-text); }
.pi-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.pi-payer { display: flex; flex-direction: column; min-width: 0; }
.pi-payer-name { font-weight: 700; font-size: 16px; line-height: 1.3; overflow-wrap: anywhere; white-space: normal; }
.pi-payer-type { color: var(--pi-muted); font-size: 13px; }
.pi-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 16px; margin: 0 0 12px; font-size: 13.5px; }
.pi-facts dt { color: var(--pi-muted); font-weight: 400; display: flex; align-items: center; gap: 8px; }
.pi-facts dt i { width: 16px; text-align: center; }
.pi-facts dd { margin: 0; display: flex; align-items: center; gap: 6px; min-width: 0; overflow-wrap: anywhere; }
.pi-copy { border: 0; background: none; padding: 2px 4px; border-radius: 4px; color: var(--pi-muted); cursor: pointer; }
.pi-copy:hover, .pi-copy:focus-visible { color: var(--pi-accent); background: var(--pi-raised); }
.pi-card-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--pi-border); }
.pi-muted { color: var(--pi-muted); }

/* Priority and eligibility chips (both views) */
.pi-priority { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.pi-priority.primary { background: var(--pi-accent); color: #fff; }
.pi-priority.secondary { background: color-mix(in srgb, var(--pi-accent) 14%, transparent); color: var(--pi-accent); }
.pi-priority.other { background: var(--pi-raised); color: var(--pi-muted); border: 1px solid var(--pi-border); }
.pi-elig { display: inline-block; padding: 2px 10px; border-radius: 6px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.pi-elig.ok { color: var(--pi-ok); background: color-mix(in srgb, var(--pi-ok) 12%, transparent); }
.pi-elig.bad { color: var(--pi-bad); background: color-mix(in srgb, var(--pi-bad) 12%, transparent); }
.pi-elig.warn { color: #92400e; background: color-mix(in srgb, var(--pi-warn) 18%, transparent); }
.pi-elig.neutral { color: var(--pi-muted); background: var(--pi-raised); border: 1px solid var(--pi-border); }

/* List */
.pi .pi-payer-name { font-size: 14px; }
.pi-period { white-space: normal; line-height: 1.35; }
/* Everything fits on one page: no pager (asked for on this page). */
.pi-one-page .rz-pager { display: none !important; }

/* Add/Edit coverage */
.pi-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.pi-label { font-size: 13px; font-weight: 600; }
.pi-req { color: var(--pi-bad); }
.pi-priority-bar { width: 100%; }
.pi-priority-bar .rz-button { flex: 1; }
.pi-priority-bar .rz-button.rz-state-active { font-weight: 700; }
.pi-copay { max-width: 260px; }
.pi-currency { padding: 0 4px 0 10px; color: var(--pi-muted); font-weight: 600; }

@media (max-width: 700px) {
    .pi-cards { grid-template-columns: minmax(0, 1fr); }
}
