/* ── 1. Dashboard quick actions ── */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--space-4);
}

/* Patients module (`/patients/`) — workflow tiles match dashboard quick links */
.patients-page {
    gap: var(--space-5);
}

.patients-hub__grid {
    align-items: stretch;
}

.reports-hub__grid {
    align-items: stretch;
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

@media (max-width: 1280px) {
    .reports-hub__grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 980px) {
    .reports-hub__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .reports-hub__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 460px) {
    .reports-hub__grid {
        grid-template-columns: 1fr;
    }
}

.patients-hub-tile,
.tests-hub-tile,
.reports-hub-tile {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: var(--space-3);
    min-height: 3.25rem;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 700;
    text-align: left;
    text-decoration: none;
    color: #fff;
    border: none;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
    transition:
        transform 0.12s ease,
        box-shadow 0.12s ease,
        filter 0.12s ease;
}

.patients-hub-tile:hover,
.tests-hub-tile:hover,
.reports-hub-tile:hover {
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.14);
    filter: brightness(1.03);
}

.patients-hub-tile:focus-visible,
.tests-hub-tile:focus-visible,
.reports-hub-tile:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.patients-hub-tile__icon,
.tests-hub-tile__icon,
.reports-hub-tile__icon {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    opacity: 0.95;
}

.patients-hub-tile__icon svg,
.patients-hub-tile__icon-svg,
.tests-hub-tile__icon svg,
.tests-hub-tile__icon-svg,
.reports-hub-tile__icon svg,
.reports-hub-tile__icon-svg {
    display: block;
    color: inherit;
}

.patients-hub-tile__text,
.tests-hub-tile__text,
.reports-hub-tile__text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    min-width: 0;
}

.patients-hub-tile__title,
.tests-hub-tile__title,
.reports-hub-tile__title {
    font-size: var(--text-sm);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.patients-hub-tile__desc,
.tests-hub-tile__desc,
.reports-hub-tile__desc {
    font-size: var(--text-xs);
    font-weight: 600;
    color: rgba(255, 255, 255, 0.88);
    line-height: 1.3;
}

.patients-hub-tile--new {
    background: linear-gradient(145deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid #bae6fd;
    color: #0f172a;
}

.patients-hub-tile--visits {
    background: linear-gradient(145deg, #ecfeff 0%, #cffafe 100%);
    border: 1px solid #99f6e4;
    color: #0f172a;
}

.patients-hub-tile--history {
    background: linear-gradient(145deg, #eef2ff 0%, #e0e7ff 100%);
    border: 1px solid #c7d2fe;
    color: #0f172a;
}

.patients-hub-tile--reports {
    background: linear-gradient(145deg, #fdf2f8 0%, #fce7f3 100%);
    border: 1px solid #fbcfe8;
    color: #0f172a;
}

.patients-hub-tile--payments-today {
    background: linear-gradient(145deg, #eff6ff 0%, #dbeafe 100%);
    border: 1px solid #bfdbfe;
    color: #0f172a;
}

.patients-hub-tile--payments-7d {
    background: linear-gradient(145deg, #ecfeff 0%, #cffafe 100%);
    border: 1px solid #99f6e4;
    color: #0f172a;
}

.patients-hub-tile--payments-30d {
    background: linear-gradient(145deg, #f5f3ff 0%, #ede9fe 100%);
    border: 1px solid #c4b5fd;
    color: #0f172a;
}

.patients-hub-tile--pending-today {
    background: linear-gradient(145deg, #fff7ed 0%, #ffedd5 100%);
    border: 1px solid #fdba74;
    color: #0f172a;
}

.patients-hub-tile--pending-patient {
    background: linear-gradient(145deg, #fef2f2 0%, #fee2e2 100%);
    border: 1px solid #fca5a5;
    color: #0f172a;
}

.patients-hub-tile--pending-panel {
    background: linear-gradient(145deg, #f0fdfa 0%, #ccfbf1 100%);
    border: 1px solid #99f6e4;
    color: #0f172a;
}

.patients-hub-tile .patients-hub-tile__desc {
    color: #475569;
}

.patients-hub-tile .patients-hub-tile__icon {
    width: 2rem;
    height: 2rem;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.72);
}

.patients-hub-tile--new .patients-hub-tile__icon {
    color: #0369a1;
}

.patients-hub-tile--visits .patients-hub-tile__icon {
    color: #0f766e;
}

.patients-hub-tile--history .patients-hub-tile__icon {
    color: #4f46e5;
}

.patients-hub-tile--reports .patients-hub-tile__icon {
    color: #be185d;
}

.patients-hub-tile--payments-today .patients-hub-tile__icon {
    color: #1d4ed8;
}

.patients-hub-tile--payments-7d .patients-hub-tile__icon {
    color: #0f766e;
}

.patients-hub-tile--payments-30d .patients-hub-tile__icon {
    color: #6d28d9;
}

.patients-hub-tile--pending-today .patients-hub-tile__icon {
    color: #c2410c;
}

.patients-hub-tile--pending-patient .patients-hub-tile__icon {
    color: #b91c1c;
}

.patients-hub-tile--pending-panel .patients-hub-tile__icon {
    color: #0f766e;
}

.patients-hub-tile:hover,
.patients-hub-tile:focus-visible {
    color: #0f172a;
}

.tests-page {
    gap: var(--space-5);
}

.reports-page,
.reports-approvals-page {
    gap: var(--space-5);
}

.tests-hub__grid {
    align-items: stretch;
}

.tests-hub-tile--catalog {
    background: linear-gradient(135deg, #145da0 0%, #0e7490 48%, #0891b2 100%);
}

.tests-hub-tile--params {
    background: linear-gradient(135deg, #5b21b6 0%, #7c3aed 42%, #c026d3 100%);
}

.reports-hub-tile--entry {
    background: linear-gradient(135deg, #0369a1 0%, #0d9488 48%, #14b8a6 100%);
}

.reports-hub-tile--approvals {
    background: linear-gradient(135deg, #5b21b6 0%, #7c3aed 42%, #c026d3 100%);
}

.reports-hub-tile--noninteractive {
    cursor: default;
}

.reports-hub-tile--noninteractive:hover,
.reports-hub-tile--noninteractive:focus-visible {
    transform: none;
    filter: none;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
}

/* Reports module (`/reports/`) — KPI-style tiles in dash-quick grid */
.reports-hub-tile.reports-hub-tile--stat {
    min-height: 3.25rem;
    align-items: center;
    padding: var(--space-3) var(--space-4);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.reports-hub-tile.reports-hub-tile--stat:hover,
.reports-hub-tile.reports-hub-tile--stat:focus-visible {
    color: var(--color-text);
}

.reports-hub-tile--stat .reports-hub-tile__icon {
    width: 2rem;
    height: 2rem;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.55);
}

.reports-hub-tile__kpi {
    font-size: var(--text-base);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.reports-hub-tile--stat .reports-hub-tile__title {
    font-size: var(--text-sm);
    font-weight: 800;
    letter-spacing: -0.01em;
    text-transform: none;
    color: var(--color-text-tertiary);
}

.reports-hub-tile--stat .reports-hub-tile__desc {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
    color: var(--color-text-secondary);
}

.reports-approvals-page .dash-kpi-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 1100px) {
    .reports-approvals-page .dash-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .reports-approvals-page .dash-kpi-grid {
        grid-template-columns: 1fr;
    }
}

.reports-approvals-page .dash-kpi {
    min-height: 2.85rem;
    align-items: center;
    padding: var(--space-2) var(--space-3);
    gap: var(--space-2);
}

.reports-approvals-page .dash-kpi__icon {
    width: 1.75rem;
    height: 1.75rem;
}

.reports-approvals-page .dash-kpi__label {
    font-size: 0.62rem;
    line-height: 1.15;
}

.reports-approvals-page .dash-kpi__value {
    font-size: var(--text-base);
    line-height: 1.1;
}

.reports-approvals-page .dash-kpi__hint {
    font-size: 0.68rem;
    line-height: 1.15;
}

.reports-hub-tile--stat-no-count .reports-hub-tile__title {
    font-size: var(--text-sm);
    font-weight: 800;
    letter-spacing: -0.01em;
    text-transform: none;
    color: var(--color-text);
}

.reports-hub-tile--stat-no-count .reports-hub-tile__desc {
    font-size: var(--text-xs);
}

.reports-hub-tile--stat-all {
    background: linear-gradient(145deg, #f8fafc 0%, #e2e8f0 100%);
    border-color: #cbd5e1;
}

.reports-hub-tile--stat-all .reports-hub-tile__kpi,
.reports-hub-tile--stat-all .reports-hub-tile__icon {
    color: #334155;
}

.reports-hub-tile--stat-pending {
    background: linear-gradient(145deg, #fffbeb 0%, #fef3c7 100%);
    border-color: #fcd34d;
}

.reports-hub-tile--stat-pending .reports-hub-tile__kpi,
.reports-hub-tile--stat-pending .reports-hub-tile__icon {
    color: #b45309;
}

.reports-hub-tile--stat-partial {
    background: linear-gradient(145deg, #f5f3ff 0%, #ede9fe 100%);
    border-color: #c4b5fd;
}

.reports-hub-tile--stat-partial .reports-hub-tile__kpi,
.reports-hub-tile--stat-partial .reports-hub-tile__icon {
    color: #6d28d9;
}

.reports-hub-tile--stat-done {
    background: linear-gradient(145deg, #ecfdf5 0%, #d1fae5 100%);
    border-color: #86efac;
}

.reports-hub-tile--stat-done .reports-hub-tile__kpi,
.reports-hub-tile--stat-done .reports-hub-tile__icon {
    color: #047857;
}

.reports-hub-tile--stat-sent {
    background: linear-gradient(145deg, #fdf4ff 0%, #f3e8ff 100%);
    border-color: #d8b4fe;
}

.reports-hub-tile--stat-sent .reports-hub-tile__kpi,
.reports-hub-tile--stat-sent .reports-hub-tile__icon {
    color: #7e22ce;
}

.reports-hub-tile--stat-yet {
    background: linear-gradient(145deg, #fff7ed 0%, #ffedd5 100%);
    border-color: #fdba74;
}

.reports-hub-tile--stat-yet .reports-hub-tile__kpi,
.reports-hub-tile--stat-yet .reports-hub-tile__icon {
    color: #c2410c;
}

.reports-hub-tile--stat-ready {
    background: linear-gradient(145deg, #f0fdfa 0%, #ccfbf1 100%);
    border-color: #5eead4;
}

.reports-hub-tile--stat-ready .reports-hub-tile__kpi,
.reports-hub-tile--stat-ready .reports-hub-tile__icon {
    color: #0f766e;
}

.reports-hub-tile--stat-overdue {
    background: linear-gradient(145deg, #fef2f2 0%, #fee2e2 100%);
    border-color: #fca5a5;
}

.reports-hub-tile--stat-overdue .reports-hub-tile__kpi,
.reports-hub-tile--stat-overdue .reports-hub-tile__icon {
    color: #b91c1c;
}

.reports-hub-tile--stat-notests {
    background: linear-gradient(145deg, #fafaf9 0%, #e7e5e4 100%);
    border-color: #d6d3d1;
}

.reports-hub-tile--stat-notests .reports-hub-tile__kpi,
.reports-hub-tile--stat-notests .reports-hub-tile__icon {
    color: #57534e;
}

.reports-hub-tile--stat-queue {
    background: linear-gradient(145deg, #eef2ff 0%, #e0e7ff 100%);
    border-color: #a5b4fc;
}

.reports-hub-tile--stat-queue .reports-hub-tile__icon {
    color: #4338ca;
}

.reports-hub-tile--current {
    outline: 2px solid rgba(var(--color-primary-rgb), 0.45);
    outline-offset: 2px;
}

.reports-filter-banner {
    margin-bottom: var(--space-3);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    background: var(--color-bg-surface-hover);
}

.payments-page {
    gap: var(--space-5);
}

.payments-hub__grid {
    align-items: stretch;
}

.payments-hub-tile {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: var(--space-3);
    min-height: 3.25rem;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 700;
    text-align: left;
    text-decoration: none;
    color: var(--color-text);
    border: 1px solid var(--color-border);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition:
        transform 0.12s ease,
        box-shadow 0.12s ease,
        filter 0.12s ease;
}

.payments-hub-tile:hover,
.payments-hub-tile:focus-visible {
    color: var(--color-text);
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}

.payments-hub-tile__icon {
    width: 2rem;
    height: 2rem;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.6);
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.payments-hub-tile__icon svg,
.payments-hub-tile__icon-svg {
    display: block;
    color: inherit;
}

.payments-hub-tile__text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
    min-width: 0;
}

.payments-hub-tile__kpi {
    font-size: var(--text-base);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.payments-hub-tile__title {
    font-size: var(--text-sm);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.01em;
    color: var(--color-text);
}

.payments-hub-tile__desc {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--color-text-secondary);
    line-height: 1.25;
}

.payments-hub-tile__trio,
.billing-hub-tile__trio,
.doctors-hub-tile__trio,
.panels-hub-tile__trio {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--color-text-secondary);
    line-height: 1.35;
    letter-spacing: 0.02em;
    margin: 0.1rem 0 0.2rem;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.payments-hub-tile--collections-today { background: linear-gradient(145deg, #eff6ff 0%, #dbeafe 100%); border-color: #bfdbfe; }
.payments-hub-tile--collections-7d { background: linear-gradient(145deg, #ecfeff 0%, #cffafe 100%); border-color: #99f6e4; }
.payments-hub-tile--collections-30d { background: linear-gradient(145deg, #eef2ff 0%, #e0e7ff 100%); border-color: #c7d2fe; }
.payments-hub-tile--pending-patient-today { background: linear-gradient(145deg, #fff7ed 0%, #ffedd5 100%); border-color: #fdba74; }
.payments-hub-tile--pending-patient-7d { background: linear-gradient(145deg, #fef2f2 0%, #fee2e2 100%); border-color: #fca5a5; }
.payments-hub-tile--pending-patient-30d { background: linear-gradient(145deg, #fdf2f8 0%, #fce7f3 100%); border-color: #fbcfe8; }
.payments-hub-tile--pending-panel-today { background: linear-gradient(145deg, #f0fdfa 0%, #ccfbf1 100%); border-color: #99f6e4; }
.payments-hub-tile--pending-panel-7d { background: linear-gradient(145deg, #f5f3ff 0%, #ede9fe 100%); border-color: #c4b5fd; }
.payments-hub-tile--pending-panel-30d { background: linear-gradient(145deg, #f8fafc 0%, #e2e8f0 100%); border-color: #cbd5e1; }
.payments-hub-tile--pending-total-patients { background: linear-gradient(145deg, #ecfdf5 0%, #d1fae5 100%); border-color: #86efac; }
.payments-hub-tile--pending-total-panels { background: linear-gradient(145deg, #fffbeb 0%, #fef3c7 100%); border-color: #fcd34d; }

.payments-hub-tile--collections-today .payments-hub-tile__icon,
.payments-hub-tile--collections-today .payments-hub-tile__kpi { color: #1d4ed8; }
.payments-hub-tile--collections-7d .payments-hub-tile__icon,
.payments-hub-tile--collections-7d .payments-hub-tile__kpi { color: #0f766e; }
.payments-hub-tile--collections-30d .payments-hub-tile__icon,
.payments-hub-tile--collections-30d .payments-hub-tile__kpi { color: #4338ca; }
.payments-hub-tile--pending-patient-today .payments-hub-tile__icon,
.payments-hub-tile--pending-patient-today .payments-hub-tile__kpi { color: #c2410c; }
.payments-hub-tile--pending-patient-7d .payments-hub-tile__icon,
.payments-hub-tile--pending-patient-7d .payments-hub-tile__kpi { color: #b91c1c; }
.payments-hub-tile--pending-patient-30d .payments-hub-tile__icon,
.payments-hub-tile--pending-patient-30d .payments-hub-tile__kpi { color: #be185d; }
.payments-hub-tile--pending-panel-today .payments-hub-tile__icon,
.payments-hub-tile--pending-panel-today .payments-hub-tile__kpi { color: #0f766e; }
.payments-hub-tile--pending-panel-7d .payments-hub-tile__icon,
.payments-hub-tile--pending-panel-7d .payments-hub-tile__kpi { color: #6d28d9; }
.payments-hub-tile--pending-panel-30d .payments-hub-tile__icon,
.payments-hub-tile--pending-panel-30d .payments-hub-tile__kpi { color: #334155; }
.payments-hub-tile--pending-total-patients .payments-hub-tile__icon,
.payments-hub-tile--pending-total-patients .payments-hub-tile__kpi { color: #047857; }
.payments-hub-tile--pending-total-panels .payments-hub-tile__icon,
.payments-hub-tile--pending-total-panels .payments-hub-tile__kpi { color: #b45309; }

.form-error {
    display: block;
    margin-top: 4px;
    font-size: var(--text-xs);
    color: #b91c1c;
}

.list-plain {
    list-style: none;
    margin: 0;
    padding: 0;
}

.list-plain li + li {
    margin-top: 6px;
}

.role-access-wrap {
    grid-column: 1 / -1;
    margin-top: var(--space-2);
    padding: var(--space-3);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-bg-surface);
}

.role-access-bands {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.role-access-band {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-3);
    background: var(--color-bg-elevated);
}

.role-access-band--hospital {
    border-left: 4px solid #0d9488;
}

.role-access-band--lab {
    border-left: 4px solid #2563eb;
}

.role-access-band--pharmacy {
    border-left: 4px solid #7c3aed;
}

.role-access-band--platform {
    border-left: 4px solid #64748b;
}

.role-access-band--shared {
    border-left: 4px solid #ca8a04;
}

.role-access-band__header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
}

.role-access-band__badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    font-size: var(--text-xs);
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border);
}

.role-access-band--hospital .role-access-band__badge { color: #0f766e; }
.role-access-band--lab .role-access-band__badge { color: #1d4ed8; }
.role-access-band--pharmacy .role-access-band__badge { color: #6d28d9; }

.custom-role-title-wrap {
    grid-column: 1 / -1;
}

.role-field-wrap {
    display: contents;
}

.user-module-badge--hospital { color: #0f766e; }
.user-module-badge--laboratory { color: #1d4ed8; }
.user-module-badge--pharmacy { color: #6d28d9; }

.role-access-title {
    margin: 0 0 4px;
    font-size: var(--text-base);
    font-weight: 800;
    color: var(--color-text);
}

.role-access-subtitle {
    margin: 0 0 var(--space-3);
}

.role-access-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    gap: var(--space-3);
}

.role-access-group {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-bg-elevated);
    padding: var(--space-3);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.role-access-group h3 {
    margin: 0 0 var(--space-1);
    font-size: var(--text-sm);
    font-weight: 800;
    color: var(--color-text);
}

.role-access-check {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    color: var(--color-text);
    line-height: 1.3;
}

.role-access-check input[type="checkbox"] {
    margin: 0;
}

.billing-page {
    gap: var(--space-5);
}

.billing-hub__grid {
    align-items: stretch;
}

.billing-hub-tile {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: var(--space-3);
    min-height: 3.25rem;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 700;
    text-align: left;
    text-decoration: none;
    color: var(--color-text);
    border: 1px solid var(--color-border);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition:
        transform 0.12s ease,
        box-shadow 0.12s ease,
        filter 0.12s ease;
}

.billing-hub-tile:hover,
.billing-hub-tile:focus-visible {
    color: var(--color-text);
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}

.billing-hub-tile__icon {
    width: 2rem;
    height: 2rem;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.62);
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.billing-hub-tile__icon svg,
.billing-hub-tile__icon-svg {
    display: block;
    color: inherit;
}

.billing-hub-tile__text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
    min-width: 0;
}

.billing-hub-tile__kpi {
    font-size: var(--text-base);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.billing-hub-tile__title {
    font-size: var(--text-sm);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.01em;
    color: var(--color-text);
}

.billing-hub-tile__desc {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--color-text-secondary);
    line-height: 1.25;
}

.billing-hub-tile--invoice-today { background: linear-gradient(145deg, #eff6ff 0%, #dbeafe 100%); border-color: #bfdbfe; }
.billing-hub-tile--invoice-7d { background: linear-gradient(145deg, #eef2ff 0%, #e0e7ff 100%); border-color: #c7d2fe; }
.billing-hub-tile--invoice-30d { background: linear-gradient(145deg, #f5f3ff 0%, #ede9fe 100%); border-color: #c4b5fd; }
.billing-hub-tile--billed-today { background: linear-gradient(145deg, #ecfeff 0%, #cffafe 100%); border-color: #99f6e4; }
.billing-hub-tile--billed-7d { background: linear-gradient(145deg, #f0fdfa 0%, #ccfbf1 100%); border-color: #99f6e4; }
.billing-hub-tile--billed-30d { background: linear-gradient(145deg, #ecfdf5 0%, #d1fae5 100%); border-color: #86efac; }
.billing-hub-tile--pending-today { background: linear-gradient(145deg, #fff7ed 0%, #ffedd5 100%); border-color: #fdba74; }
.billing-hub-tile--pending-total { background: linear-gradient(145deg, #fef2f2 0%, #fee2e2 100%); border-color: #fca5a5; }
.billing-hub-tile--discount { background: linear-gradient(145deg, #fdf2f8 0%, #fce7f3 100%); border-color: #fbcfe8; }
.billing-hub-tile--paid-today { background: linear-gradient(145deg, #f0f9ff 0%, #e0f2fe 100%); border-color: #bae6fd; }
.billing-hub-tile--settled { background: linear-gradient(145deg, #f8fafc 0%, #e2e8f0 100%); border-color: #cbd5e1; }

.billing-hub-tile--invoice-today .billing-hub-tile__icon, .billing-hub-tile--invoice-today .billing-hub-tile__kpi { color: #1d4ed8; }
.billing-hub-tile--invoice-7d .billing-hub-tile__icon, .billing-hub-tile--invoice-7d .billing-hub-tile__kpi { color: #4338ca; }
.billing-hub-tile--invoice-30d .billing-hub-tile__icon, .billing-hub-tile--invoice-30d .billing-hub-tile__kpi { color: #6d28d9; }
.billing-hub-tile--billed-today .billing-hub-tile__icon, .billing-hub-tile--billed-today .billing-hub-tile__kpi { color: #0f766e; }
.billing-hub-tile--billed-7d .billing-hub-tile__icon, .billing-hub-tile--billed-7d .billing-hub-tile__kpi { color: #0d9488; }
.billing-hub-tile--billed-30d .billing-hub-tile__icon, .billing-hub-tile--billed-30d .billing-hub-tile__kpi { color: #047857; }
.billing-hub-tile--pending-today .billing-hub-tile__icon, .billing-hub-tile--pending-today .billing-hub-tile__kpi { color: #c2410c; }
.billing-hub-tile--pending-total .billing-hub-tile__icon, .billing-hub-tile--pending-total .billing-hub-tile__kpi { color: #b91c1c; }
.billing-hub-tile--discount .billing-hub-tile__icon, .billing-hub-tile--discount .billing-hub-tile__kpi { color: #be185d; }
.billing-hub-tile--paid-today .billing-hub-tile__icon, .billing-hub-tile--paid-today .billing-hub-tile__kpi { color: #0369a1; }
.billing-hub-tile--settled .billing-hub-tile__icon, .billing-hub-tile--settled .billing-hub-tile__kpi { color: #334155; }

.doctors-page,
.panels-page {
    gap: var(--space-5);
}

.doctors-hub__grid,
.panels-hub__grid {
    align-items: stretch;
}

.doctors-hub-tile,
.panels-hub-tile {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: var(--space-3);
    min-height: 3.25rem;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 700;
    text-align: left;
    text-decoration: none;
    color: var(--color-text);
    border: 1px solid var(--color-border);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition:
        transform 0.12s ease,
        box-shadow 0.12s ease,
        filter 0.12s ease;
}

.doctors-hub-tile:hover,
.doctors-hub-tile:focus-visible,
.panels-hub-tile:hover,
.panels-hub-tile:focus-visible {
    color: var(--color-text);
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}

.doctors-hub-tile__icon,
.panels-hub-tile__icon {
    width: 2rem;
    height: 2rem;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.62);
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.doctors-hub-tile__icon svg,
.doctors-hub-tile__icon-svg,
.panels-hub-tile__icon svg,
.panels-hub-tile__icon-svg {
    display: block;
    color: inherit;
}

.doctors-hub-tile__text,
.panels-hub-tile__text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
    min-width: 0;
}

.doctors-hub-tile__kpi,
.panels-hub-tile__kpi {
    font-size: var(--text-base);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.doctors-hub-tile__title,
.panels-hub-tile__title {
    font-size: var(--text-sm);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.01em;
    color: var(--color-text);
}

.doctors-hub-tile__desc,
.panels-hub-tile__desc {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--color-text-secondary);
    line-height: 1.25;
}

.doctors-hub-tile--total { background: linear-gradient(145deg, #eef2ff 0%, #e0e7ff 100%); border-color: #c7d2fe; }
.doctors-hub-tile--contact { background: linear-gradient(145deg, #ecfeff 0%, #cffafe 100%); border-color: #99f6e4; }
.doctors-hub-tile--email { background: linear-gradient(145deg, #fdf2f8 0%, #fce7f3 100%); border-color: #fbcfe8; }
.doctors-hub-tile--clinic { background: linear-gradient(145deg, #f8fafc 0%, #e2e8f0 100%); border-color: #cbd5e1; }
.doctors-hub-tile--special { background: linear-gradient(145deg, #f5f3ff 0%, #ede9fe 100%); border-color: #c4b5fd; }
.doctors-hub-tile--active { background: linear-gradient(145deg, #ecfdf5 0%, #d1fae5 100%); border-color: #86efac; }
.doctors-hub-tile--referrals { background: linear-gradient(145deg, #ecfeff 0%, #e0f2fe 100%); border-color: #7dd3fc; }
.doctors-hub-tile--missing-phone { background: linear-gradient(145deg, #fffbeb 0%, #fef3c7 100%); border-color: #fcd34d; }
.doctors-hub-tile--missing-email { background: linear-gradient(145deg, #fff1f2 0%, #ffe4e6 100%); border-color: #fda4af; }
.doctors-hub-tile--missing-clinic { background: linear-gradient(145deg, #f8fafc 0%, #e2e8f0 100%); border-color: #cbd5e1; }

.doctors-hub-tile--total .doctors-hub-tile__icon, .doctors-hub-tile--total .doctors-hub-tile__kpi { color: #4338ca; }
.doctors-hub-tile--contact .doctors-hub-tile__icon, .doctors-hub-tile--contact .doctors-hub-tile__kpi { color: #0f766e; }
.doctors-hub-tile--email .doctors-hub-tile__icon, .doctors-hub-tile--email .doctors-hub-tile__kpi { color: #be185d; }
.doctors-hub-tile--clinic .doctors-hub-tile__icon, .doctors-hub-tile--clinic .doctors-hub-tile__kpi { color: #334155; }
.doctors-hub-tile--special .doctors-hub-tile__icon, .doctors-hub-tile--special .doctors-hub-tile__kpi { color: #6d28d9; }
.doctors-hub-tile--active .doctors-hub-tile__icon, .doctors-hub-tile--active .doctors-hub-tile__kpi { color: #047857; }
.doctors-hub-tile--referrals .doctors-hub-tile__icon, .doctors-hub-tile--referrals .doctors-hub-tile__kpi { color: #0369a1; }
.doctors-hub-tile--missing-phone .doctors-hub-tile__icon, .doctors-hub-tile--missing-phone .doctors-hub-tile__kpi { color: #b45309; }
.doctors-hub-tile--missing-email .doctors-hub-tile__icon, .doctors-hub-tile--missing-email .doctors-hub-tile__kpi { color: #be123c; }
.doctors-hub-tile--missing-clinic .doctors-hub-tile__icon, .doctors-hub-tile--missing-clinic .doctors-hub-tile__kpi { color: #475569; }

.panels-hub-tile--total { background: linear-gradient(145deg, #eff6ff 0%, #dbeafe 100%); border-color: #bfdbfe; }
.panels-hub-tile--avg { background: linear-gradient(145deg, #fdf2f8 0%, #fce7f3 100%); border-color: #fbcfe8; }
.panels-hub-tile--max { background: linear-gradient(145deg, #f5f3ff 0%, #ede9fe 100%); border-color: #c4b5fd; }
.panels-hub-tile--contact { background: linear-gradient(145deg, #ecfeff 0%, #cffafe 100%); border-color: #99f6e4; }
.panels-hub-tile--email { background: linear-gradient(145deg, #fdf2f8 0%, #fce7f3 100%); border-color: #fbcfe8; }
.panels-hub-tile--credit { background: linear-gradient(145deg, #fff7ed 0%, #ffedd5 100%); border-color: #fdba74; }
.panels-hub-tile--linked { background: linear-gradient(145deg, #ecfdf5 0%, #d1fae5 100%); border-color: #86efac; }
.panels-hub-tile--visits { background: linear-gradient(145deg, #eef2ff 0%, #e0e7ff 100%); border-color: #c7d2fe; }
.panels-hub-tile--pending { background: linear-gradient(145deg, #fef2f2 0%, #fee2e2 100%); border-color: #fca5a5; }
.panels-hub-tile--pending-amt { background: linear-gradient(145deg, #fff7ed 0%, #ffedd5 100%); border-color: #fb923c; }
.panels-hub-tile--gaps { background: linear-gradient(145deg, #f8fafc 0%, #e2e8f0 100%); border-color: #cbd5e1; }

.panels-hub-tile--total .panels-hub-tile__icon, .panels-hub-tile--total .panels-hub-tile__kpi { color: #1d4ed8; }
.panels-hub-tile--avg .panels-hub-tile__icon, .panels-hub-tile--avg .panels-hub-tile__kpi { color: #be185d; }
.panels-hub-tile--max .panels-hub-tile__icon, .panels-hub-tile--max .panels-hub-tile__kpi { color: #6d28d9; }
.panels-hub-tile--contact .panels-hub-tile__icon, .panels-hub-tile--contact .panels-hub-tile__kpi { color: #0f766e; }
.panels-hub-tile--email .panels-hub-tile__icon, .panels-hub-tile--email .panels-hub-tile__kpi { color: #be185d; }
.panels-hub-tile--credit .panels-hub-tile__icon, .panels-hub-tile--credit .panels-hub-tile__kpi { color: #c2410c; }
.panels-hub-tile--linked .panels-hub-tile__icon, .panels-hub-tile--linked .panels-hub-tile__kpi { color: #047857; }
.panels-hub-tile--visits .panels-hub-tile__icon, .panels-hub-tile--visits .panels-hub-tile__kpi { color: #4338ca; }
.panels-hub-tile--pending .panels-hub-tile__icon, .panels-hub-tile--pending .panels-hub-tile__kpi { color: #b91c1c; }
.panels-hub-tile--pending-amt .panels-hub-tile__icon, .panels-hub-tile--pending-amt .panels-hub-tile__kpi { color: #c2410c; }
.panels-hub-tile--gaps .panels-hub-tile__icon, .panels-hub-tile--gaps .panels-hub-tile__kpi { color: #475569; }

/* Tests landing (`/tests/`) — two wide columns: hero tile + catalog list */
.tests-hub--split .tests-hub-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-5);
    width: 100%;
}

.tests-hub-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.rate-list-sections-grid {
    border: 1px solid #d8dee8;
    border-radius: var(--radius-md);
    padding: var(--space-2);
    max-height: 13.5rem;
    overflow-y: auto;
    background: #fff;
    display: grid;
    gap: 0.35rem;
}

.rate-list-sections-field {
    grid-column: 1 / -1;
}

.rate-list-sections-dropdown {
    position: relative;
    max-width: 34rem;
}

.rate-list-sections-dropdown__toggle {
    width: 100%;
    justify-content: space-between;
    min-height: 2.55rem;
    border-radius: var(--radius-md);
    background: #fff;
    border: 1px solid #d8dee8;
    font-weight: 600;
}

.rate-list-sections-dropdown__panel {
    margin-top: var(--space-2);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.12);
    border: 1px solid #d8dee8;
    background: #fff;
    padding: var(--space-2);
}

.rate-list-sections-grid__item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-size: var(--text-sm);
    padding: 0.35rem 0.25rem;
    border-radius: var(--radius-sm);
}

.rate-list-sections-grid__item:hover {
    background: #f8fafc;
}

.rate-list-sections-grid__item input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
}

.tests-hub-column {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    min-width: 0;
}

/* Reports landing (`/reports/`) — same split layout as tests workspace */
.reports-hub--split .reports-hub-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-5);
    width: 100%;
}

.reports-hub-column {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    min-width: 0;
}

.tests-hub-tile.tests-hub-tile--hero,
.reports-hub-tile.reports-hub-tile--hero {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    width: 100%;
    min-height: 11.5rem;
    padding: var(--space-6) var(--space-6);
    border-radius: var(--radius-lg);
    gap: var(--space-4);
}

.tests-hub-tile.tests-hub-tile--hero .tests-hub-tile__icon,
.reports-hub-tile.reports-hub-tile--hero .reports-hub-tile__icon {
    width: 3.25rem;
    height: 3.25rem;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.18);
}

.tests-hub-tile.tests-hub-tile--hero .tests-hub-tile__icon svg,
.tests-hub-tile.tests-hub-tile--hero .tests-hub-tile__icon-svg,
.reports-hub-tile.reports-hub-tile--hero .reports-hub-tile__icon svg,
.reports-hub-tile.reports-hub-tile--hero .reports-hub-tile__icon-svg {
    width: 2.125rem;
    height: 2.125rem;
}

.tests-hub-tile.tests-hub-tile--hero .tests-hub-tile__title,
.reports-hub-tile.reports-hub-tile--hero .reports-hub-tile__title {
    font-size: var(--text-xl);
    font-weight: 800;
    letter-spacing: -0.03em;
}

.tests-hub-tile.tests-hub-tile--hero .tests-hub-tile__desc,
.reports-hub-tile.reports-hub-tile--hero .reports-hub-tile__desc {
    font-size: var(--text-sm);
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    max-width: 42ch;
}

.tests-hub-catalog,
.reports-hub-catalog {
    flex: 1 1 auto;
    min-height: 12rem;
    padding: var(--space-4) var(--space-4);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    background: var(--color-bg-elevated);
    box-shadow: var(--shadow-sm);
}

.tests-hub-catalog__head,
.reports-hub-catalog__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--color-border);
}

.tests-hub-catalog__title,
.reports-hub-catalog__title {
    margin: 0;
    font-size: var(--text-sm);
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--color-text-tertiary);
}

.tests-hub-catalog__link,
.reports-hub-catalog__link {
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--color-primary);
    text-decoration: none;
    white-space: nowrap;
}

.tests-hub-catalog__link:hover,
.reports-hub-catalog__link:hover {
    text-decoration: underline;
}

.tests-hub-catalog__list,
.reports-hub-catalog__list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: min(55vh, 28rem);
    overflow: auto;
}

.tests-hub-catalog__item,
.reports-hub-catalog__item {
    display: grid;
    grid-template-columns: minmax(5rem, auto) 1fr auto;
    gap: var(--space-3);
    align-items: baseline;
    padding: var(--space-3) var(--space-2);
    border-radius: var(--radius-sm);
    border-bottom: 1px solid var(--color-border);
    font-size: var(--text-sm);
}

.tests-hub-catalog__item:last-child,
.reports-hub-catalog__item:last-child {
    border-bottom: none;
}

.tests-hub-catalog__item:hover,
.reports-hub-catalog__item:hover {
    background: var(--color-bg-surface-hover);
}

.tests-hub-catalog__id,
.reports-hub-catalog__id {
    font-weight: 700;
    color: var(--color-text-secondary);
}

.tests-hub-catalog__name,
.reports-hub-catalog__name {
    font-weight: 600;
    color: var(--color-text);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tests-hub-catalog__meta,
.reports-hub-catalog__meta {
    font-size: var(--text-xs);
    justify-self: end;
}

.tests-hub-catalog__empty,
.reports-hub-catalog__empty {
    margin: 0;
    padding: var(--space-3) 0;
    font-size: var(--text-sm);
}

li.tests-hub-catalog__empty,
li.reports-hub-catalog__empty {
    list-style: none;
    border: none;
}

@media (max-width: 900px) {
    .tests-hub--split .tests-hub-columns,
    .reports-hub--split .reports-hub-columns {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .tests-hub-catalog__item,
    .reports-hub-catalog__item {
        grid-template-columns: 1fr;
        gap: var(--space-1);
    }

    .tests-hub-catalog__meta,
    .reports-hub-catalog__meta {
        justify-self: start;
    }
}

.patients-list-card,
.list-table-card {
    background: var(--color-bg-elevated);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    padding: var(--space-4);
}

.patients-list-card > h2:first-child {
    font-size: var(--text-base);
    font-weight: 800;
    letter-spacing: -0.02em;
}

.patients-list-card__filters {
    margin-top: var(--space-3);
    margin-bottom: var(--space-4);
    padding: var(--space-2);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    background: var(--color-bg-surface);
    gap: var(--space-2);
    flex-wrap: nowrap;
    overflow-x: auto;
    width: 100%;
    box-sizing: border-box;
}

/* Full-width ledger row (billing / payments): one form carries filter-bar + hub-filter-row */
.filter-bar.patients-list-card__filters.hub-filter-row,
.filter-bar.patients-list-card__filters > .hub-filter-row {
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.patients-list-card__filters.hub-filter-row > div.filter-field:first-of-type,
.patients-list-card__filters > .hub-filter-row > div.filter-field:first-of-type {
    flex: 1 1 auto;
    min-width: 10rem;
}

/* Patients list: compact columns. Ledger hub uses inner .hub-filter-row flex only (no 140px on each cell). */
.patients-list-card__filters:not(.hub-filter-row) > .filter-field:not(.hub-filter-row) {
    flex: 0 0 140px;
    min-width: 120px;
}

.patients-list-card__filters:not(.hub-filter-row) > .filter-field--date-range {
    flex: 0 0 220px;
    min-width: 200px;
}

.patients-filter-date-range__row {
    display: flex;
    gap: 0.35rem;
    align-items: center;
}

.patients-filter-date-range__row--labeled {
    align-items: flex-end;
}

.patients-filter-date-range__field {
    flex: 1;
    min-width: 0;
}

.patients-list-card__filters .patients-filter-date-range__field label {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-tertiary);
}

.patients-filter-date-range__field input[type="date"] {
    width: 100%;
}

.patients-filter-date-range__sep {
    flex: 0 0 auto;
    color: var(--color-text-tertiary);
    font-size: 0.75rem;
    line-height: 1;
    user-select: none;
}

.patients-list-card__filters:not(.hub-filter-row) > .filter-field--panel-site {
    flex: 0 0 220px;
    min-width: 180px;
}

/* Hub list filters (patients, reports, approver): full-width grid, single-line labels */
.filter-bar--hub-list.patients-list-card__filters {
    display: grid;
    grid-template-columns:
        minmax(9.5rem, 1.15fr)
        minmax(6.5rem, 0.75fr)
        minmax(13rem, 1.35fr)
        minmax(15.5rem, 1.65fr)
        minmax(8.5rem, 0.95fr)
        auto;
    align-items: end;
    gap: var(--space-3);
    flex-wrap: unset;
    overflow-x: visible;
    padding: var(--space-3);
}

.filter-bar--hub-list.patients-list-card__filters > .filter-field {
    flex: unset;
    min-width: 0;
    width: 100%;
}

.filter-bar--hub-list.patients-list-card__filters > .filter-field--date-range,
.filter-bar--hub-list.patients-list-card__filters > .filter-field--panel-site {
    flex: unset;
    min-width: 0;
}

.filter-bar--hub-list.patients-list-card__filters .filter-field label {
    white-space: nowrap;
    text-transform: none;
    letter-spacing: 0.01em;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--color-text-secondary);
}

.filter-bar--hub-list.patients-list-card__filters .patients-filter-date-range__field label {
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.65rem;
    color: var(--color-text-tertiary);
}

.filter-bar--hub-list.patients-list-card__filters .hub-list-filters__actions {
    padding-top: 0;
    justify-self: end;
}

.filter-bar--hub-list .patients-hub-filter-actions {
    flex-wrap: nowrap;
    gap: var(--space-2);
}

.filter-bar--hub-list .patients-hub-filter-actions .btn--filter {
    min-height: 2.125rem;
    padding: 0.4rem 1rem;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    border-radius: var(--radius-md);
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.filter-bar--hub-list .patients-hub-filter-actions .btn--filter:not(.btn--secondary) {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark, #0f4d8a) 100%);
}

.filter-bar--hub-list .patients-hub-filter-actions .btn--filter.btn--secondary {
    background: #fff;
    border-color: var(--color-border-strong);
}

.filter-bar--hub-list .patients-hub-filter-actions .btn--filter.btn--secondary:hover {
    background: var(--color-bg-surface);
    border-color: var(--color-primary);
    color: var(--color-primary);
}

@media (max-width: 1100px) {
    .filter-bar--hub-list.patients-list-card__filters {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .filter-bar--hub-list.patients-list-card__filters .hub-list-filters__actions {
        grid-column: 1 / -1;
        justify-self: stretch;
    }

    .filter-bar--hub-list .patients-hub-filter-actions {
        justify-content: flex-end;
    }
}

@media (max-width: 640px) {
    .filter-bar--hub-list.patients-list-card__filters {
        grid-template-columns: 1fr;
    }

    .filter-bar--hub-list.patients-list-card__filters .hub-list-filters__actions {
        grid-column: 1 / -1;
        justify-self: stretch;
    }

    .filter-bar--hub-list.patients-list-card__filters .patients-filter-date-range__row--labeled {
        flex-wrap: wrap;
    }
}

/* Owner metrics — Cross-tenant audit (`/system/`) */
.owner-metrics-page .filter-bar--hub-list.patients-list-card__filters {
    grid-template-columns:
        minmax(12rem, 1.45fr)
        minmax(13rem, 1.35fr)
        minmax(9rem, 0.95fr)
        auto;
    margin-bottom: var(--space-3);
}

@media (max-width: 1100px) {
    .owner-metrics-page .filter-bar--hub-list.patients-list-card__filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .owner-metrics-page .filter-bar--hub-list.patients-list-card__filters .hub-list-filters__actions {
        grid-column: 1 / -1;
        justify-self: stretch;
    }
}

@media (max-width: 640px) {
    .owner-metrics-page .filter-bar--hub-list.patients-list-card__filters {
        grid-template-columns: 1fr;
    }

    .owner-metrics-page .filter-bar--hub-list .patients-hub-filter-actions {
        justify-content: stretch;
        width: 100%;
    }

    .owner-metrics-page .filter-bar--hub-list .patients-hub-filter-actions .btn--filter {
        flex: 1 1 auto;
    }
}

/* Reports list (`/reports/`) */
.reports-page .filter-bar--hub-list.patients-list-card__filters {
    grid-template-columns:
        minmax(8.5rem, 0.85fr)
        minmax(8.5rem, 0.85fr)
        minmax(11rem, 1.25fr)
        minmax(10.5rem, 1.05fr)
        minmax(15.5rem, 1.65fr)
        auto;
}

/* Approver dashboard (`/reports/approvals/`) */
.reports-approvals-page .filter-bar--hub-list.patients-list-card__filters {
    grid-template-columns:
        minmax(11rem, 1.25fr)
        minmax(8.5rem, 0.85fr)
        minmax(8.5rem, 0.85fr)
        minmax(10.5rem, 1.05fr)
        minmax(15.5rem, 1.65fr)
        auto;
}

@media (max-width: 1100px) {
    .reports-page .filter-bar--hub-list.patients-list-card__filters,
    .reports-approvals-page .filter-bar--hub-list.patients-list-card__filters {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .reports-page .filter-bar--hub-list.patients-list-card__filters .hub-list-filters__actions,
    .reports-approvals-page .filter-bar--hub-list.patients-list-card__filters .hub-list-filters__actions {
        grid-column: 1 / -1;
        justify-self: stretch;
    }
}

@media (max-width: 640px) {
    .reports-page .filter-bar--hub-list.patients-list-card__filters,
    .reports-approvals-page .filter-bar--hub-list.patients-list-card__filters {
        grid-template-columns: 1fr;
    }

    .reports-page .filter-bar--hub-list .patients-hub-filter-actions,
    .reports-approvals-page .filter-bar--hub-list .patients-hub-filter-actions {
        justify-content: stretch;
        width: 100%;
    }

    .reports-page .filter-bar--hub-list .patients-hub-filter-actions .btn--filter,
    .reports-approvals-page .filter-bar--hub-list .patients-hub-filter-actions .btn--filter {
        flex: 1 1 auto;
    }
}

/* Searchable Panel / Hospital / Clinic combobox (Patients list) */
.searchable-combobox {
    position: relative;
    width: 100%;
}

.searchable-combobox__toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem;
    width: 100%;
    margin: 0;
    padding: 0.32rem 0.45rem;
    font-size: 0.78rem;
    font-family: inherit;
    color: var(--color-text);
    text-align: left;
    background: #ffffff;
    border: 1px solid var(--color-border-strong, #cbd5e1);
    border-radius: var(--radius-md, 6px);
    cursor: pointer;
    min-height: calc(0.32rem * 2 + 0.78rem * 1.35 + 2px);
}

.searchable-combobox__toggle:hover {
    border-color: var(--color-primary, #145da0);
}

.searchable-combobox__toggle:focus {
    outline: 2px solid var(--color-focus-ring, #38bdf8);
    outline-offset: 1px;
}

.searchable-combobox__toggle-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.searchable-combobox__caret {
    flex-shrink: 0;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid var(--color-text-tertiary, #64748b);
    margin-top: 2px;
}

.searchable-combobox__panel {
    display: flex;
    flex-direction: column;
    max-height: min(360px, 72vh);
    margin-top: 4px;
    background: #ffffff;
    border: 1px solid var(--color-border-strong, #cbd5e1);
    border-radius: var(--radius-md, 6px);
    box-shadow: var(--shadow-md, 0 10px 25px rgba(15, 23, 42, 0.12));
    overflow: hidden;
}

/* Author `display:flex` would otherwise override the HTML hidden attribute */
.searchable-combobox__panel[hidden] {
    display: none !important;
}

.searchable-combobox__search-wrap {
    flex-shrink: 0;
    padding: 0.4rem 0.45rem;
    border-bottom: 1px solid var(--color-border, #e2e8f0);
    background: var(--color-bg-surface, #f8fafc);
}

.searchable-combobox__search {
    width: 100%;
    margin: 0;
    padding: 0.35rem 0.45rem;
    font-size: 0.8rem;
    font-family: inherit;
    border: 1px solid var(--color-border-strong, #cbd5e1);
    border-radius: var(--radius-sm, 4px);
    background: #fff;
}

.searchable-combobox__search:focus {
    outline: 2px solid var(--color-focus-ring, #38bdf8);
    outline-offset: 0;
}

.searchable-combobox__list {
    flex: 1;
    min-height: 3rem;
    max-height: min(280px, 55vh);
    margin: 0;
    padding: 0.2rem 0;
    list-style: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.searchable-combobox__group {
    padding: 0.35rem 0.55rem 0.2rem;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-tertiary, #64748b);
    background: var(--color-bg-surface, #f8fafc);
    border-top: 1px solid var(--color-border, #e2e8f0);
    pointer-events: none;
}

.searchable-combobox__group:first-child {
    border-top: 0;
}

.searchable-combobox__empty {
    padding: 0.75rem 0.65rem;
    font-size: 0.8rem;
    color: var(--color-text-tertiary, #64748b);
    text-align: center;
}

.searchable-combobox__option {
    padding: 0.42rem 0.65rem;
    font-size: 0.8rem;
    cursor: pointer;
    color: var(--color-text);
}

.searchable-combobox__option:hover,
.searchable-combobox__option:focus {
    background: var(--color-primary-soft, #e0f0ff);
    outline: none;
}

.searchable-combobox__option[aria-selected="true"] {
    background: var(--color-primary, #145da0);
    color: #fff;
}

.searchable-combobox__option[aria-selected="true"]:hover {
    background: #0f4d8a;
    color: #fff;
}

.patients-table-panel-site .small {
    margin-top: 0.15rem;
}

.patients-list-card__filters .filter-field label {
    margin-bottom: 0.25rem;
    font-size: 0.65rem;
}

.patients-list-card__filters .filter-field input,
.patients-list-card__filters .filter-field select {
    padding: 0.32rem 0.45rem;
    font-size: 0.78rem;
}

.patients-list-card__filters .filter-actions-inline {
    padding-top: calc(0.65rem * 1.25 + 0.25rem);
}

.hub-filter-row > div > .filter-field,
.hub-filter-row > div .filter-field {
    width: 100%;
    min-width: 0;
}

@media (max-width: 1200px) {
    .patients-list-card__filters:not(.filter-bar--hub-list) {
        flex-wrap: wrap;
        overflow-x: visible;
    }
}

.patients-list-card__table {
    border-radius: var(--radius-sm);
}

.patients-list-card__table .catalog-actions-col,
.patients-list-card__table .catalog-actions-cell {
    text-align: center;
    vertical-align: middle;
}

.patients-list-card__table .catalog-row-actions {
    justify-content: center;
}

/* Recent patients table: single-line rows, compact actions */
.patients-list-card__table .data-table--patients-recent {
    table-layout: fixed;
    width: 100%;
}

.patients-list-card__table .data-table--patients-recent th,
.patients-list-card__table .data-table--patients-recent td {
    padding: var(--space-2) var(--space-3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}

.patients-list-card__table .data-table--patients-recent .patients-recent-col-name {
    width: 16%;
}

.patients-list-card__table .data-table--patients-recent .patients-recent-col-visit {
    width: 9%;
}

.patients-list-card__table .data-table--patients-recent .patients-recent-col-lab {
    width: 10%;
}

.patients-list-card__table .data-table--patients-recent .patients-recent-col-origin {
    width: 24%;
}

.patients-list-card__table .data-table--patients-recent th.patients-recent-col-origin {
    white-space: nowrap;
    font-size: 0.8125rem;
}

.patients-list-card__table .data-table--patients-recent .patients-recent-col-payment {
    width: 12%;
}

.patients-list-card__table .data-table--patients-recent .patients-recent-col-report {
    width: 11%;
}

.patients-list-card__table .data-table--patients-recent .patients-recent-col-actions {
    width: 18%;
    overflow: visible;
    text-overflow: clip;
}

.patients-list-card__table .data-table--patients-recent .patients-recent-payment-amt {
    margin-left: 0.35rem;
    font-size: 0.8125rem;
    color: var(--color-text-secondary, #64748b);
}

.patients-list-card__table .catalog-row-actions--icon-only {
    flex-wrap: nowrap;
    gap: 0.25rem;
    justify-content: flex-end;
}

.patients-list-card__table .btn--icon-only {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    min-height: 2rem;
    padding: 0.35rem;
    line-height: 0;
}

.patients-list-card__table .btn--icon-only .patient-row-action-icon {
    display: block;
    flex-shrink: 0;
}

.patients-page .patients-list-card__table.table-scroll,
.reports-page .list-table-card .table-scroll,
.reports-page .list-table-card .hub-patient-list__table.table-scroll,
.reports-approvals-page .list-table-card .table-scroll,
.reports-approvals-page .list-table-card .hub-patient-list__table.table-scroll {
    margin-left: 0;
    margin-right: 0;
    margin-top: var(--space-3);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: #fff;
}

.patients-list-card__table .data-table--reports-patients {
    table-layout: fixed;
    width: 100%;
    min-width: 0;
}

.patients-list-card__table .data-table--reports-patients th,
.patients-list-card__table .data-table--reports-patients td {
    padding: var(--space-2) var(--space-3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}

.patients-list-card__table .data-table--reports-patients .reports-col-process,
.patients-list-card__table .data-table--reports-patients .reports-col-status {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    vertical-align: top;
}

.patients-list-card__table .data-table--reports-patients .process-subline {
    display: block;
    margin-top: 0.35rem;
    margin-left: 0;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    line-height: 1.3;
    font-size: 0.75rem;
}

.patients-list-card__table .data-table--reports-patients .reports-col-panel {
    width: 20%;
}

.patients-list-card__table .data-table--reports-patients .reports-col-process {
    width: 10%;
}

.patients-list-card__table .data-table--reports-patients .reports-col-status {
    width: 11%;
}

.patients-list-card__table .data-table--reports-patients .reports-col-process .badge,
.patients-list-card__table .data-table--reports-patients .reports-col-status .badge {
    max-width: 100%;
    white-space: normal;
    line-height: 1.25;
}

.patients-list-card__table .data-table--reports-patients .reports-col-lab {
    width: 8%;
}

.patients-list-card__table .data-table--reports-patients .reports-col-name {
    width: 12%;
}

.patients-list-card__table .data-table--reports-patients .reports-col-visit {
    width: 8%;
}

.patients-list-card__table .data-table--reports-patients .reports-col-actions {
    width: 9%;
    min-width: 4.75rem;
}

/* Approvals queue: same visual language as reports list, original columns */
.patients-list-card__table .data-table--approvals {
    table-layout: fixed;
    width: 100%;
    min-width: 0;
}

.patients-list-card__table .data-table--approvals th,
.patients-list-card__table .data-table--approvals td {
    padding: var(--space-2) var(--space-3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}

.patients-list-card__table .data-table--approvals .approvals-col-patient {
    width: 22%;
    white-space: nowrap;
}

.patients-list-card__table .data-table--approvals .approvals-col-visit {
    width: 9%;
}

.patients-list-card__table .data-table--approvals .approvals-col-tests {
    width: 7%;
    text-align: center;
}

.patients-list-card__table .data-table--approvals .approvals-col-required {
    width: 14%;
    text-align: center;
}

.patients-list-card__table .data-table--approvals .approvals-col-pending {
    width: 14%;
    text-align: center;
}

.patients-list-card__table .data-table--approvals .approvals-col-notsent {
    width: 9%;
    text-align: center;
}

.patients-list-card__table .data-table--approvals .approvals-col-actions {
    width: 9%;
    min-width: 5.5rem;
    overflow: visible;
    text-overflow: clip;
}

.patients-list-card__table .data-table--approvals th.approvals-col-actions {
    overflow: visible;
    text-overflow: clip;
}

.reports-approvals-page .catalog-row-actions--icon-only {
    flex-wrap: nowrap;
    gap: 0.2rem;
    justify-content: center;
}

.patients-list-card__table .data-table--reports-patients th.reports-col-actions {
    overflow: visible;
    text-overflow: clip;
}

.patients-list-card__table .reports-action-icon {
    display: block;
    width: 1.125rem;
    height: 1.125rem;
    object-fit: contain;
    pointer-events: none;
}

.patients-hub-filter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    align-items: center;
}

.kpi {
    font-size: var(--text-3xl);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1;
    background: linear-gradient(90deg, var(--color-text) 0%, var(--color-primary) 42%, var(--color-accent) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.kpi-label {
    margin-top: var(--space-2);
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-tertiary);
}

/* Skip link (keyboard / screen reader) */
.skip-link {
    position: fixed;
    left: 0;
    top: 0;
    padding: var(--space-2) var(--space-4);
    background: var(--color-surface-inverse, #0f172a);
    color: #fff;
    font-size: var(--text-sm);
    font-weight: 600;
    text-decoration: none;
    border-radius: 0 0 var(--radius-md) 0;
    z-index: 10000;
    transform: translateY(-120%);
    transition: transform 0.15s ease;
}

.skip-link:focus {
    transform: translateY(0);
    outline: 2px solid var(--color-focus-ring, #38bdf8);
    outline-offset: 2px;
}

/* OPD hub — prominent quick-action tiles */
.opd-hub__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-4);
}

@media (max-width: 900px) {
    .opd-hub__grid {
        grid-template-columns: 1fr;
    }
}

.opd-hub-tile {
    position: relative;
    min-height: 5.5rem;
    padding: var(--space-4) var(--space-5);
    border-radius: var(--radius-lg);
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.06),
        0 8px 24px rgba(15, 23, 42, 0.08);
    overflow: hidden;
}

.opd-hub-tile::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: currentColor;
    opacity: 0.35;
}

.opd-hub-tile--new::before,
.patients-hub-tile--new.opd-hub-tile::before {
    background: #0284c7;
    opacity: 1;
}

.opd-hub-tile.patients-hub-tile--visits::before {
    background: #0d9488;
    opacity: 1;
}

.opd-hub-tile.patients-hub-tile--reports::before {
    background: #db2777;
    opacity: 1;
}

.opd-hub-tile__icon {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.85);
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.06);
}

.opd-hub-tile__icon svg {
    width: 1.35rem;
    height: 1.35rem;
}

.opd-hub-tile .patients-hub-tile__title {
    font-size: 1rem;
}

.opd-hub-tile .patients-hub-tile__desc {
    font-size: 0.8125rem;
    line-height: 1.35;
}

.opd-hub-tile__arrow {
    margin-left: auto;
    flex-shrink: 0;
    font-size: 1.125rem;
    font-weight: 700;
    color: rgba(15, 23, 42, 0.35);
    transition: transform 0.12s ease, color 0.12s ease;
}

.opd-hub-tile:hover .opd-hub-tile__arrow,
.opd-hub-tile:focus-visible .opd-hub-tile__arrow {
    transform: translateX(3px);
    color: rgba(15, 23, 42, 0.65);
}

/* OPD recent patients table — readable columns with horizontal scroll */
.opd-recent-table-wrap,
.opd-queue-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.patients-list-card__table .data-table--opd-recent,
.opd-queue-table-wrap .data-table--opd-queue {
    width: 100%;
    min-width: 980px;
    table-layout: auto;
}

.opd-queue-table-wrap .data-table--opd-queue {
    min-width: 1180px;
}

.opd-queue-patient-name {
    display: block;
    font-weight: 600;
    line-height: 1.3;
}

.opd-queue-patient-meta {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.75rem;
    color: var(--color-text-secondary, #64748b);
}

.opd-priority-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.12rem 0.45rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.3;
    white-space: nowrap;
    border: 1px solid transparent;
}

.opd-priority-badge--normal {
    background: #f1f5f9;
    color: #64748b;
    border-color: #e2e8f0;
}

.opd-priority-badge--urgent {
    background: #fef2f2;
    color: #b91c1c;
    border-color: #fecaca;
}

.opd-priority-badge--vip {
    background: #faf5ff;
    color: #7e22ce;
    border-color: #e9d5ff;
}

.opd-priority-badge--senior,
.opd-priority-badge--pwd {
    background: #fffbeb;
    color: #b45309;
    border-color: #fde68a;
}

.opd-recent-col-visit .opd-priority-badge {
    display: block;
    margin-top: 0.25rem;
    width: fit-content;
}

.opd-queue-col-actions {
    min-width: 11rem;
    white-space: nowrap;
}

.opd-queue-actions {
    flex-wrap: wrap;
    gap: 0.35rem;
}

.btn--queue-release {
    background: linear-gradient(135deg, #0f766e 0%, #0d9488 100%);
    border-color: #0f766e;
    color: #fff;
    font-weight: 700;
}

.btn--queue-release:hover {
    filter: brightness(1.05);
    color: #fff;
}

.opd-queue-page__kpis {
    margin-bottom: 0;
}

.opd-queue-filters {
    align-items: end;
    gap: var(--space-3);
}

.filter-bar--hub-list.patients-list-card__filters.opd-queue-filters {
    display: grid;
    grid-template-columns: minmax(12rem, 16rem) auto;
    flex-wrap: unset;
    overflow-x: visible;
}

.filter-bar--hub-list.patients-list-card__filters.opd-queue-filters > .filter-field {
    min-width: 0;
    width: 100%;
}

.filter-bar--hub-list.patients-list-card__filters.opd-queue-filters .hub-list-filters__actions {
    justify-self: end;
}

@media (max-width: 1100px) {
    .filter-bar--hub-list.patients-list-card__filters.opd-queue-filters {
        grid-template-columns: minmax(12rem, 1fr) auto;
    }

    .filter-bar--hub-list.patients-list-card__filters.opd-queue-filters .hub-list-filters__actions {
        grid-column: auto;
        justify-self: end;
    }
}

@media (max-width: 640px) {
    .filter-bar--hub-list.patients-list-card__filters.opd-queue-filters {
        grid-template-columns: 1fr;
    }

    .filter-bar--hub-list.patients-list-card__filters.opd-queue-filters .hub-list-filters__actions {
        grid-column: 1 / -1;
        justify-self: stretch;
    }

    .filter-bar--hub-list.patients-list-card__filters.opd-queue-filters .patients-hub-filter-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }
}

.opd-queue-filters__actions {
    flex-wrap: wrap;
}

.patients-list-card__table .data-table--opd-recent th,
.patients-list-card__table .data-table--opd-recent td,
.opd-queue-table-wrap .data-table--opd-queue th,
.opd-queue-table-wrap .data-table--opd-queue td {
    padding: var(--space-2) var(--space-3);
    vertical-align: top;
}

.patients-list-card__table .data-table--opd-recent .opd-recent-col-name {
    min-width: 10rem;
}

.patients-list-card__table .data-table--opd-recent .opd-recent-col-clinical {
    min-width: 9rem;
}

.patients-list-card__table .data-table--opd-recent .opd-recent-col-status,
.opd-queue-table-wrap .data-table--opd-queue .opd-recent-col-status {
    min-width: 12rem;
    white-space: normal;
}

.patients-list-card__table .data-table--opd-recent .opd-recent-col-actions {
    min-width: 6.5rem;
    white-space: nowrap;
}

.opd-recent-patient-name {
    display: block;
    font-weight: 600;
    line-height: 1.3;
}

.opd-recent-patient-meta {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.75rem;
    color: var(--color-text-secondary, #64748b);
}

.opd-recent-dept {
    display: block;
    font-weight: 600;
    line-height: 1.3;
}

.opd-recent-doctor {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.8125rem;
    line-height: 1.3;
}

.opd-recent-token-sep {
    margin: 0 0.2rem;
    color: var(--color-text-secondary, #64748b);
}

.opd-status {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    max-width: 16rem;
}

.opd-status__detail {
    font-size: 0.75rem;
    line-height: 1.35;
}

.opd-status__link {
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
}

.opd-status__link:hover {
    text-decoration: underline;
}

/* OPD patient list — single-row filter bar */
.filter-bar--hub-list.opd-patients-filters {
    grid-template-columns:
        minmax(11rem, 1.5fr)
        minmax(14rem, 1.25fr)
        minmax(7.5rem, 0.85fr)
        minmax(7.5rem, 0.85fr)
        minmax(6.5rem, 0.7fr)
        auto;
}

@media (max-width: 1100px) {
    .filter-bar--hub-list.opd-patients-filters {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .filter-bar--hub-list.opd-patients-filters .filter-field--search {
        grid-column: 1 / -1;
    }

    .filter-bar--hub-list.opd-patients-filters .hub-list-filters__actions {
        grid-column: 1 / -1;
        justify-self: stretch;
    }
}

@media (max-width: 640px) {
    .filter-bar--hub-list.opd-patients-filters {
        grid-template-columns: 1fr;
    }

    .filter-bar--hub-list.opd-patients-filters .filter-field--search {
        grid-column: auto;
    }
}

.hosp-dept-page__stack {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    margin-top: var(--space-4);
}

.hosp-dept-stats--compact {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--space-3);
}

.hosp-dept-table-card {
    margin-top: 0;
}

.hosp-dept-table__name {
    display: block;
    font-weight: 700;
    color: #0f172a;
}

.hosp-dept-table__notes {
    display: block;
    margin-top: 0.15rem;
    font-size: var(--text-xs);
}

.hosp-dept-table__row--inactive {
    opacity: 0.78;
}

.hosp-dept-table__actions-col {
    white-space: nowrap;
    min-width: 9rem;
}

.hosp-dept-code {
    display: inline-block;
    padding: 0.12rem 0.45rem;
    border-radius: var(--radius-sm);
    background: #e0f2fe;
    color: #0369a1;
    font-weight: 700;
}

.hosp-dept-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.hosp-dept-badge--active {
    background: #ccfbf1;
    color: #0f766e;
}

.hosp-dept-badge--inactive {
    background: #f1f5f9;
    color: #64748b;
}

.hosp-dept-badge--on-call {
    background: #fef3c7;
    color: #b45309;
    margin-left: 0.35rem;
    vertical-align: middle;
}

.doctor-business-hours__on-call {
    grid-column: 1 / -1;
}

.hosp-dept-stat {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    background: var(--color-bg-elevated);
    border: 1px solid rgba(148, 163, 184, 0.22);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.hosp-dept-stat__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: var(--radius-md);
    flex-shrink: 0;
}

.hosp-dept-stat__icon--total { background: #e0f2fe; color: #0369a1; }
.hosp-dept-stat__icon--active { background: #ccfbf1; color: #0f766e; }
.hosp-dept-stat__icon--inactive { background: #f1f5f9; color: #64748b; }
.hosp-dept-stat__icon--doctors { background: #ede9fe; color: #6d28d9; }
.hosp-dept-stat__icon--revenue { background: #dcfce7; color: #15803d; }

.hosp-dept-stat__body {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.hosp-dept-stat__value {
    font-size: 1.2rem;
    font-weight: 800;
    line-height: 1.1;
    color: #0f172a;
}

.hosp-dept-stat__label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
}

.hosp-dept-form-card .form-grid input,
.hosp-dept-form-card .form-grid select,
.hosp-dept-form-card .form-grid textarea {
    width: 100%;
}

@media (max-width: 960px) {
    .hosp-dept-stats--compact {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .hosp-dept-stats--compact {
        grid-template-columns: 1fr;
    }
}

/* Hospital doctor create/edit — compact admin form */
.hosp-doctor-form-page .page-subtitle--compact {
    margin-top: 0.15rem;
}

.hosp-doctor-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    margin-top: var(--space-3);
    width: 100%;
}

.hosp-doctor-form__card {
    margin-top: 0;
    width: 100%;
}

.hosp-doctor-form__card--secondary {
    margin-top: var(--space-3);
    width: 100%;
}

.hosp-doctor-form__schedule-stack {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    width: 100%;
}

.hosp-doctor-form__section + .hosp-doctor-form__section,
.hosp-doctor-form__section--hours {
    margin-top: var(--space-3);
    padding-top: var(--space-3);
    border-top: 1px solid var(--color-border);
}

.hosp-doctor-form__heading {
    margin: 0 0 var(--space-2);
    font-size: var(--text-base);
    font-weight: 700;
    color: #0f172a;
}

.hosp-doctor-form__grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem 1rem;
    align-items: flex-start;
    width: 100%;
}

.hosp-doctor-form__field {
    flex: 0 1 auto;
    min-width: 0;
}

.hosp-doctor-form__field--w-xs {
    width: min(100%, 6.5rem);
}

.hosp-doctor-form__field--w-sm {
    width: min(100%, 9.5rem);
}

.hosp-doctor-form__field--w-md {
    width: min(100%, 12.5rem);
}

.hosp-doctor-form__field--w-lg {
    width: min(100%, 16rem);
}

.hosp-doctor-form__field--w-xl {
    width: min(100%, 20rem);
}

.hosp-doctor-form__field--w-wide {
    flex: 1 1 100%;
    width: min(100%, 42rem);
    max-width: 42rem;
}

.hosp-doctor-form__field--w-file {
    width: min(100%, 18rem);
}

.hosp-doctor-form__label {
    display: block;
    margin-bottom: 0.2rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #64748b;
    line-height: 1.2;
}

.hosp-doctor-form__req {
    color: var(--color-danger, #dc2626);
    margin-left: 0.1rem;
}

.hosp-doctor-form__control,
.hosp-doctor-form__field input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.hosp-doctor-form__field select,
.hosp-doctor-form__field textarea {
    width: 100%;
    max-width: 100%;
    min-height: 2.15rem;
    padding: 0.35rem 0.55rem;
    font-size: var(--text-sm);
    border-radius: var(--radius-sm);
}

.hosp-doctor-form__field input[type="file"] {
    font-size: var(--text-xs);
    max-width: 100%;
}

.hosp-doctor-form__hint {
    margin: 0.2rem 0 0;
    font-size: 0.72rem;
    line-height: 1.35;
}

.hosp-doctor-form__thumb {
    display: block;
    max-width: 100%;
    max-height: 3rem;
    margin: 0.15rem 0 0.35rem;
    object-fit: contain;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 0.2rem;
    background: #fff;
}

.hosp-doctor-form__details {
    margin-top: var(--space-2);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: color-mix(in srgb, var(--color-bg) 92%, #64748b 8%);
}

.hosp-doctor-form__details-summary {
    padding: 0.55rem 0.75rem;
    font-size: var(--text-sm);
    font-weight: 700;
    cursor: pointer;
    list-style-position: outside;
}

.hosp-doctor-form__details[open] .hosp-doctor-form__details-summary {
    border-bottom: 1px solid var(--color-border);
}

.hosp-doctor-form__details .hosp-doctor-form__grid {
    padding: 0.65rem 0.75rem 0.75rem;
}

.hosp-doctor-form__actions {
    margin-top: var(--space-3);
    padding-top: var(--space-2);
    border-top: 1px solid var(--color-border);
}

.hosp-doctor-form__leave-form {
    margin: 0 0 var(--space-2);
}

.hosp-doctor-form__grid--leave .hosp-doctor-form__field input,
.hosp-doctor-form__grid--leave .hosp-doctor-form__field select {
    width: 100%;
    min-height: 2.15rem;
    padding: 0.35rem 0.55rem;
    font-size: var(--text-sm);
    border-radius: var(--radius-sm);
}

.hosp-doctor-form .doctor-business-hours__lede--compact {
    margin-bottom: var(--space-2);
    font-size: var(--text-xs);
}

.hosp-doctor-form .doctor-business-hours__toolbar {
    margin-bottom: var(--space-2);
}

.hosp-doctor-form .doctor-business-hours__row {
    padding: 0.45rem 0;
}

.hosp-doctor-form .doctor-business-hours__meta {
    margin-top: var(--space-2);
    padding-top: var(--space-2);
}

.hosp-doctor-form .doctor-business-hours__meta label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #64748b;
}

.hosp-doctor-form .doctor-business-hours__meta .patient-register-control {
    min-height: 2.15rem;
    padding: 0.35rem 0.55rem;
    font-size: var(--text-sm);
    width: min(100%, 9.5rem);
}

.hosp-doctor-form .doctor-business-hours__meta > div:first-child {
    width: min(100%, 9.5rem);
}

.hosp-doctor-form-page .doctor-business-hours {
    width: 100%;
}

.hosp-doctor-form-page .doctor-business-hours__head,
.hosp-doctor-form-page .doctor-business-hours__row {
    grid-template-columns: 4.5rem 6.5rem minmax(0, 1fr) auto;
}

.hosp-doctor-page__stack {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    margin-top: var(--space-4);
}

.hosp-doctor-table-card {
    margin-top: 0;
}

.hosp-doctor-table__name {
    display: block;
    font-weight: 700;
    color: #0f172a;
}

.hosp-doctor-table__spec {
    display: block;
    margin-top: 0.15rem;
    font-size: var(--text-xs);
}

.hosp-doctor-table__dept {
    font-weight: 600;
    color: var(--color-primary-dark);
    text-decoration: none;
}

.hosp-doctor-table__dept:hover {
    text-decoration: underline;
}

.hosp-doctor-table__fee {
    font-weight: 700;
}

.hosp-doctor-table__contact {
    font-size: var(--text-sm);
}

.hosp-doctor-table__row--inactive {
    opacity: 0.78;
}

.hosp-doctor-table__actions-col {
    white-space: nowrap;
    min-width: 10rem;
}

.hosp-reports-page__stack {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    margin-top: var(--space-4);
}

.hosp-reports-page .filter-bar {
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-3);
}

.hosp-reports-period {
    margin: 0;
    font-size: var(--text-sm);
    flex: 1 1 auto;
}

.hosp-reports-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-4);
}

.hosp-reports-table-card {
    margin-top: 0;
}

.hosp-reports-table-card__title {
    margin: 0 0 var(--space-3);
    padding: var(--space-4) var(--space-4) 0;
    font-size: var(--text-base);
    font-weight: 700;
    color: #0f172a;
}

.hosp-reports-table-card .table-scroll {
    max-height: min(24rem, 50vh);
}

.hosp-reports-table__name {
    font-weight: 600;
    color: #0f172a;
}

.hosp-reports-table__num-col {
    text-align: right;
    white-space: nowrap;
}

@media (max-width: 960px) {
    .hosp-reports-grid {
        grid-template-columns: 1fr;
    }
}

/* Hospital staff & collections — filter layout */
.hosp-staff-efficiency-page__stack {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    margin-top: var(--space-4);
}

.hosp-staff-filters-card > h2 {
    margin-bottom: var(--space-3);
}

.hosp-staff-filters-card .hosp-staff-filters__presets {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-2) var(--space-3);
    padding: 0 var(--space-3) var(--space-3);
    margin-bottom: var(--space-1);
    border-bottom: 1px solid var(--color-border);
}

.hosp-staff-filters-card .hosp-staff-filters__presets-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    margin: 0;
    white-space: nowrap;
}

.hosp-staff-filters-card .hosp-staff-filters__preset-btns {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
}

.hosp-staff-filters-card .btn--filter-preset {
    min-height: 2rem;
    padding: 0.35rem 0.85rem;
    font-size: 0.8125rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    white-space: nowrap;
}

.hosp-staff-filters-card .btn--filter-preset.is-active {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark, #0f4d8a) 100%);
    border-color: var(--color-primary);
    color: #fff;
}

.hosp-staff-efficiency-page .filter-bar--hub-list.hosp-staff-filters {
    grid-template-columns:
        minmax(15rem, 1.55fr)
        minmax(9.5rem, 1fr)
        minmax(11rem, 1.15fr)
        minmax(10rem, 1.1fr)
        auto;
    border-top: 0;
    padding-top: var(--space-3);
}

@media (max-width: 1100px) {
    .hosp-staff-efficiency-page .filter-bar--hub-list.hosp-staff-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hosp-staff-efficiency-page .filter-bar--hub-list.hosp-staff-filters .hub-list-filters__actions {
        grid-column: 1 / -1;
        justify-self: stretch;
    }

    .hosp-staff-efficiency-page .filter-bar--hub-list.hosp-staff-filters .patients-hub-filter-actions {
        justify-content: flex-end;
    }
}

@media (max-width: 640px) {
    .hosp-staff-efficiency-page .filter-bar--hub-list.hosp-staff-filters {
        grid-template-columns: 1fr;
    }

    .hosp-staff-filters-card .hosp-staff-filters__presets {
        flex-direction: column;
        align-items: flex-start;
    }
}

.ipd-catalog-add-form__fieldset {
    margin: 0;
    padding: var(--space-3);
    border: 1px dashed #cbd5e1;
    border-radius: var(--radius-md);
    background: #f8fafc;
}

.ipd-catalog-add-form__legend {
    padding: 0 var(--space-2);
    font-size: var(--text-sm);
    font-weight: 700;
    color: #334155;
}

.ipd-catalog-add-form__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
    gap: var(--space-3);
    align-items: end;
    margin-top: var(--space-2);
}

.ipd-catalog-add-form__grid--wide {
    grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr));
}

.ipd-catalog-add-form .filter-field--checkbox label {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin: 0;
}

.ipd-catalog-add-form .filter-field--actions {
    display: flex;
    align-items: flex-end;
}

/* Ops — backup & restore center */
.ops-backup {
    width: 100%;
}

.ops-backup__intro-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: var(--space-4);
    align-items: start;
}

.ops-backup__title {
    margin: 0 0 var(--space-2);
    font-size: var(--text-lg);
    font-weight: 700;
}

.ops-backup__lede {
    margin: 0;
    font-size: var(--text-sm);
    line-height: 1.55;
}

.ops-backup__meta-strip {
    display: grid;
    gap: var(--space-2);
}

.ops-backup__meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: color-mix(in srgb, var(--color-bg) 94%, #64748b 6%);
}

.ops-backup__meta-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
}

.ops-backup__module-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.ops-backup__module-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-size: var(--text-xs);
    font-weight: 700;
    border: 1px solid transparent;
}

.ops-backup__module-badge--lab {
    color: #1e40af;
    background: #eff6ff;
    border-color: #bfdbfe;
}

.ops-backup__module-badge--hospital {
    color: #9a3412;
    background: #fff7ed;
    border-color: #fed7aa;
}

.ops-backup__module-badge--pharmacy {
    color: #166534;
    background: #ecfdf5;
    border-color: #bbf7d0;
}

.ops-backup__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3);
}

.ops-backup__panel-title {
    margin: 0 0 var(--space-1);
    font-size: var(--text-base);
    font-weight: 700;
}

.ops-backup__panel-lede {
    margin: 0 0 var(--space-3);
    font-size: var(--text-sm);
    line-height: 1.5;
}

.ops-backup__form {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.ops-backup__field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    max-width: 28rem;
}

.ops-backup__label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #64748b;
}

.ops-backup__control {
    width: 100%;
    min-height: 2.25rem;
    padding: 0.4rem 0.6rem;
    font-size: var(--text-sm);
    border-radius: var(--radius-sm);
}

.ops-backup__target-fieldset {
    border: 0;
    margin: 0;
    padding: 0;
}

.ops-backup__target-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 12rem), 1fr));
    gap: var(--space-2);
}

.ops-backup__target {
    display: flex;
    gap: 0.55rem;
    align-items: flex-start;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    background: var(--color-bg);
}

.ops-backup__target:has(input:checked) {
    border-color: var(--color-primary);
    background: color-mix(in srgb, var(--color-primary) 6%, var(--color-bg));
}

.ops-backup__target.is-disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.ops-backup__target-body {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    font-size: var(--text-sm);
    line-height: 1.35;
}

.ops-backup__target-body strong {
    color: #0f172a;
}

.ops-backup__check {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: var(--text-sm);
}

.ops-backup__contents {
    margin-top: var(--space-2);
    font-size: var(--text-sm);
}

.ops-backup__contents-list {
    margin: var(--space-2) 0 0;
    padding-left: 1.1rem;
    line-height: 1.55;
}

.ops-backup__scheduled-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    border: 0;
    padding-top: 0;
}

@media (max-width: 960px) {
    .ops-backup__intro-grid,
    .ops-backup__grid {
        grid-template-columns: 1fr;
    }
}

