/* ============================================================
   HomeCare EHR — Bootstrap 5 Theme Overrides
   IBM Plex + Teal/Seafoam Theme (Default)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=IBM+Plex+Sans+Condensed:wght@500;600&family=IBM+Plex+Sans:wght@400;500;600&display=swap');

/* --- Design Tokens (Teal/Seafoam Theme - Default) --- */
:root, [data-theme="seafoam"] {
    /* Surfaces */
    --cc-bg-primary: #eaeeed;      /* paper */
    --cc-bg-secondary: #f5f8f7;    /* surface-2 */
    --cc-bg-card: #ffffff;         /* surface */
    --cc-bg-hover: #e2efee;        /* accent-tint */
    --cc-bg-active: #d9e0de;       /* rule */

    /* Text */
    --cc-text-primary: #16202b;    /* ink */
    --cc-text-secondary: #4a5a66;  /* ink-2 */
    --cc-text-muted: #7c8a92;      /* ink-3 */

    /* Accents */
    --cc-accent: #0f5a5c;          /* teal primary */
    --cc-accent-soft: #e2efee;     /* accent-tint */
    --cc-accent-secondary: #14807f;
    --cc-accent-tertiary: #b8d4d3;

    /* Borders */
    --cc-border: #bdc8c5;          /* rule-2 */
    --cc-border-light: #d9e0de;    /* rule */
    --cc-divider: #d9e0de;

    /* Status colors */
    --cc-success: #2c6440;
    --cc-success-bg: #e6f1e8;      /* green-tint */
    --cc-error: #8f2626;
    --cc-error-bg: #f9eae8;        /* red-tint */
    --cc-warning: #8a5200;
    --cc-warning-bg: #fbf0da;      /* amber-tint */
    --cc-info: #4b3f83;
    --cc-info-bg: #ecebf6;         /* violet-tint */

    /* Layout */
    --cc-sidebar-width: 320px;

    /* Typography */
    --cc-font-display: 'IBM Plex Sans Condensed', -apple-system, sans-serif;
    --cc-font-body: 'IBM Plex Sans', -apple-system, sans-serif;
    --cc-font-mono: 'IBM Plex Mono', monospace;

    /* Login button */
    --cc-login-btn: #0f5a5c;
    --cc-login-btn-hover: #0a4749;
}

/* --- Warm Terracotta Theme (Alternate) --- */
[data-theme="warm"] {
    --cc-bg-primary: #faf8f5;
    --cc-bg-secondary: #f5f0ea;
    --cc-bg-card: #ffffff;
    --cc-bg-hover: #f0ebe4;
    --cc-bg-active: #ebe5db;
    --cc-text-primary: #1a1714;
    --cc-text-secondary: #6b6459;
    --cc-text-muted: #9c9488;
    --cc-accent: #c96442;
    --cc-accent-soft: #c9644215;
    --cc-accent-secondary: #d4956b;
    --cc-accent-tertiary: #e8c4a0;
    --cc-border: #e8e2d9;
    --cc-border-light: #f0ebe4;
    --cc-divider: #e4ddd3;
    --cc-success: #4a8c5c;
    --cc-success-bg: #4a8c5c14;
    --cc-error: #c44b3f;
    --cc-error-bg: #c44b3f14;
    --cc-warning: #b8860b;
    --cc-warning-bg: #fff3cd;
    --cc-info: #5b21b6;
    --cc-info-bg: #ede9fe;
    --cc-login-btn: #c96442;
    --cc-login-btn-hover: #b8583a;
}

/* --- Dark Theme --- */
[data-theme="dark"] {
    --cc-bg-primary: #0e1419;
    --cc-bg-secondary: #151c22;
    --cc-bg-card: #1c252d;
    --cc-bg-hover: #243038;
    --cc-bg-active: #2d3942;
    --cc-text-primary: #e4eaed;
    --cc-text-secondary: #9ca8af;
    --cc-text-muted: #687076;
    --cc-accent: #4dd4d8;
    --cc-accent-soft: #4dd4d818;
    --cc-accent-secondary: #2aa9ac;
    --cc-accent-tertiary: #1a4d4f;
    --cc-border: #2d3942;
    --cc-border-light: #243038;
    --cc-divider: #2d3942;
    --cc-success: #4ade80;
    --cc-success-bg: #4ade8018;
    --cc-error: #f87171;
    --cc-error-bg: #f8717118;
    --cc-warning: #fbbf24;
    --cc-warning-bg: #fbbf2418;
    --cc-info: #a5b4fc;
    --cc-info-bg: #a5b4fc18;
    --cc-login-btn: #4dd4d8;
    --cc-login-btn-hover: #3bc4c8;
}

/* --- Base --- */
body {
    font-family: var(--cc-font-body);
    color: var(--cc-text-primary);
    background: var(--cc-bg-primary);
    -webkit-font-smoothing: antialiased;
}

/* ============================================================
   SIDEBAR
   ============================================================ */

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.12s ease;
}

.user-profile:hover {
    background: var(--cc-bg-hover);
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: var(--cc-bg-secondary);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--cc-text-muted);
}

.user-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--cc-text-primary);
}

.user-org {
    font-size: 12px;
    color: var(--cc-text-muted);
}

/* --- Collapsed State (lg+) --- */

.sidebar.collapsed .user-info,
.sidebar.collapsed .user-chevron {
    display: none;
}

.sidebar.collapsed .user-profile {
    justify-content: center;
}

/* ============================================================
   DASHBOARD PAGE
   ============================================================ */
.page-title {
    font-family: var(--cc-font-display);
    font-size: 28px;
    font-weight: 400;
    letter-spacing: -0.03em;
    color: var(--cc-text-primary);
}

.page-subtitle {
    font-size: 14px;
    color: var(--cc-text-muted);
}

/* Stat Cards */
.stat-card {
    background: var(--cc-bg-card);
    border: 1px solid var(--cc-border);
    border-radius: 12px;
    padding: 20px 22px;
    transition: box-shadow 0.2s ease;
    animation: fadeIn 0.4s ease both;
}

.stat-card:hover {
    box-shadow: 0 2px 8px rgba(26, 23, 20, 0.06);
}

.stat-card:nth-child(1) { animation-delay: 0.05s; }
.stat-card:nth-child(2) { animation-delay: 0.1s; }
.stat-card:nth-child(3) { animation-delay: 0.15s; }
.stat-card:nth-child(4) { animation-delay: 0.2s; }

.stat-label {
    font-size: 13px;
    color: var(--cc-text-muted);
}

.stat-icon {
    font-size: 18px;
    color: var(--cc-text-muted);
}

.stat-value {
    font-family: var(--cc-font-display);
    font-size: 32px;
    font-weight: 400;
    letter-spacing: -0.03em;
    color: var(--cc-text-primary);
    line-height: 1;
}

.stat-change {
    font-size: 12px;
    font-weight: 500;
}

.stat-change.text-success-custom { color: var(--cc-success); }
.stat-change.text-danger-custom { color: var(--cc-error); }

/* Cards */
.cc-card {
    background: var(--cc-bg-card);
    border: 1px solid var(--cc-border);
    border-radius: 12px;
    overflow: hidden;
    animation: fadeIn 0.4s ease both;
    animation-delay: 0.25s;
}

.cc-card-header {
    padding: 16px 22px 12px;
    border-bottom: 1px solid var(--cc-border-light);
}

.cc-card-title {
    font-family: var(--cc-font-display);
    font-size: 16px;
    font-weight: 400;
    color: var(--cc-text-primary);
    margin: 0;
}

.cc-card-action {
    font-size: 13px;
    color: var(--cc-accent);
    text-decoration: none;
    font-weight: 500;
}

.cc-card-action:hover {
    opacity: 0.75;
    color: var(--cc-accent);
}

.cc-card-body {
    padding: 16px 22px 20px;
}

/* Tables */
.cc-table {
    font-size: 13px;
}

.cc-table thead th {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--cc-text-muted);
    border-bottom: 1px solid var(--cc-border-light);
    padding: 0 8px 10px;
    background: transparent;
}

.cc-table tbody td {
    padding: 10px 8px;
    border-bottom: 1px solid var(--cc-border-light);
    vertical-align: middle;
}

.cc-table tbody tr:last-child td {
    border-bottom: none;
}

.cc-table tbody tr:hover {
    background: var(--cc-bg-secondary);
}

.text-muted-custom {
    color: var(--cc-text-muted) !important;
}

.key-name {
    font-weight: 500;
    color: var(--cc-text-primary);
}

.code-badge {
    font-family: var(--cc-font-mono);
    font-size: 12px;
    background: var(--cc-bg-secondary);
    padding: 2px 8px;
    border-radius: 4px;
    color: var(--cc-text-secondary);
}

.status-badge {
    font-size: 12px;
    font-weight: 500;
    padding: 2px 10px;
    border-radius: 20px;
}

.status-success {
    background: var(--cc-success-bg);
    color: var(--cc-success);
}

.status-error {
    background: var(--cc-error-bg);
    color: var(--cc-error);
}

/* Usage Bars */
.usage-row {
    padding: 10px 0;
}

.usage-row:not(:last-child) {
    border-bottom: 1px solid var(--cc-border-light);
}

.usage-model {
    font-family: var(--cc-font-mono);
    font-size: 13px;
    font-weight: 500;
    color: var(--cc-text-primary);
}

.usage-requests {
    font-size: 12px;
    color: var(--cc-text-muted);
}

.usage-bar-track {
    height: 8px;
    background: var(--cc-bg-secondary);
    border-radius: 4px;
    overflow: hidden;
}

.usage-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.usage-pct {
    font-size: 13px;
    font-weight: 500;
    color: var(--cc-text-secondary);
    min-width: 36px;
    text-align: right;
}

/* Animation */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   OASIS-E2 Form Styles
   ============================================================ */

/* Form Fields */

.oasis-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--cc-text-primary);
    margin-bottom: 4px;
}

.oasis-input, .oasis-input.form-control, .oasis-input.form-select {
    font-family: var(--cc-font-body);
    font-size: 13.5px;
    border: 1px solid var(--cc-border);
    border-radius: 6px;
    background: var(--cc-bg-card);
    color: var(--cc-text-primary);
    padding: 6px 10px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.oasis-input:focus {
    border-color: var(--cc-accent);
    box-shadow: 0 0 0 3px var(--cc-accent-soft);
}

.form-check-input:checked {
    background-color: var(--cc-accent);
    border-color: var(--cc-accent);
}

.form-check-input:focus {
    box-shadow: 0 0 0 3px var(--cc-accent-soft);
    border-color: var(--cc-accent);
}

/* Buttons */
.oasis-btn {
    font-family: var(--cc-font-body);
    font-size: 13px;
    border-radius: 6px;
    border-color: var(--cc-border);
    color: var(--cc-text-secondary);
}

.oasis-btn:hover {
    background: var(--cc-bg-hover);
    border-color: var(--cc-border);
    color: var(--cc-text-primary);
}

.oasis-btn-primary {
    font-family: var(--cc-font-body);
    font-size: 13px;
    border-radius: 6px;
    background: var(--cc-accent);
    border-color: var(--cc-accent);
    color: #fff;
}

.oasis-btn-primary:hover {
    background: var(--cc-accent-secondary);
    border-color: var(--cc-accent-secondary);
    color: #fff;
}

/* Progress */
.oasis-progress .progress {
    overflow: hidden;
}

/* ============================================================
   OASIS Progress Tracking
   ============================================================ */

/* Sticky header */
.page-sticky-header {
    position: sticky;
    top: 0;
    z-index: 1020;
    background: var(--cc-bg-secondary);
    padding: 16px 24px 14px;
    margin: -16px -24px 16px;
    border-bottom: 1px solid var(--cc-border);
}

@media (max-width: 767.98px) {
    .page-sticky-header {
        padding: 12px 16px 10px;
        margin: -12px -12px 12px;
    }
}

/* ============================================================
   Patient name + badges (shared: NavMenu patient cards, OASIS page header)
   ============================================================ */

.patient-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--cc-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Percentage badge */
.patient-pct {
    font-family: var(--cc-font-mono);
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}

.patient-pct.pct-high {
    background: #d4edda;
    color: #276738;
}

.patient-pct.pct-mid {
    background: #fff3cd;
    color: #856404;
}

.patient-pct.pct-low {
    background: #f8d7da;
    color: #842029;
}

/* Need review badge */
.patient-review-badge {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
}

.patient-review-badge.review-high {
    background: #f8d7da;
    color: #842029;
}

.patient-review-badge.review-mid {
    background: #fff3cd;
    color: #856404;
}

.patient-review-badge.review-low {
    background: #d4edda;
    color: #276738;
}

.patient-review-badge.review-done {
    background: var(--cc-success-bg);
    color: var(--cc-success);
}

/* ============================================================
   Home Health Agency KPI Dashboard
   ============================================================ */

/* KPI Target label under stat cards */
.kpi-target {
    font-size: 11px;
    color: var(--cc-text-muted);
    margin-top: 4px;
    font-style: italic;
}

/* Star rating */
.kpi-stars {
    font-size: 14px;
    color: #d4956b;
    letter-spacing: 1px;
}

.kpi-stars .bi-star { color: var(--cc-border); }

/* --- OASIS Compliance Bars --- */
.kpi-bar-row {
    margin-bottom: 14px;
}

.kpi-bar-row:last-child { margin-bottom: 0; }

.kpi-bar-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.kpi-bar-label {
    font-size: 13px;
    color: var(--cc-text-secondary);
}

.kpi-bar-value {
    font-family: var(--cc-font-mono);
    font-size: 13px;
    font-weight: 600;
}

.kpi-bar-value.kpi-met { color: var(--cc-success); }
.kpi-bar-value.kpi-unmet { color: var(--cc-error); }

.kpi-bar-track {
    position: relative;
    height: 8px;
    background: var(--cc-border-light);
    border-radius: 4px;
    overflow: visible;
}

.kpi-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.kpi-bar-target {
    position: absolute;
    top: -3px;
    width: 2px;
    height: 14px;
    background: var(--cc-text-muted);
    border-radius: 1px;
    transform: translateX(-1px);
}

.kpi-bar-target-label {
    font-size: 10.5px;
    color: var(--cc-text-muted);
    margin-top: 2px;
    display: block;
    text-align: right;
}

/* --- Quality Measures List --- */
.kpi-quality-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--cc-border-light);
}

.kpi-quality-row:last-child { border-bottom: none; }

.kpi-quality-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--cc-bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--cc-text-muted);
    font-size: 15px;
    flex-shrink: 0;
}

.kpi-quality-info { flex: 1; min-width: 0; }

.kpi-quality-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--cc-text-primary);
}

.kpi-quality-detail {
    font-size: 11.5px;
    color: var(--cc-text-muted);
}

.kpi-quality-value {
    font-family: var(--cc-font-mono);
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
}

.kpi-val-good { color: var(--cc-success); }
.kpi-val-warn { color: #b8860b; }
.kpi-val-bad { color: var(--cc-error); }

/* --- Clinician Table Extras --- */
.kpi-discipline-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    white-space: nowrap;
}

.kpi-overdue-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    background: #f8d7da;
    color: #842029;
}

.kpi-mini-bar {
    width: 50px;
    height: 6px;
    background: var(--cc-border-light);
    border-radius: 3px;
    overflow: hidden;
}

.kpi-mini-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s ease;
}

.kpi-mini-pct {
    font-family: var(--cc-font-mono);
    font-size: 12px;
    font-weight: 500;
    color: var(--cc-text-secondary);
    min-width: 30px;
}

/* --- Patient Pipeline --- */
.kpi-pipeline-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px solid var(--cc-border-light);
}

.kpi-pipeline-row:last-child { border-bottom: none; }

.kpi-pipeline-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.kpi-pipeline-info { flex: 1; }

.kpi-pipeline-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--cc-text-primary);
    display: block;
}

.kpi-pipeline-sub {
    font-size: 11.5px;
    color: var(--cc-text-muted);
}

.kpi-pipeline-count {
    font-family: var(--cc-font-display);
    font-size: 22px;
    font-weight: 500;
    flex-shrink: 0;
}

.kpi-summary-value {
    font-family: var(--cc-font-display);
    font-size: 24px;
    font-weight: 400;
    color: var(--cc-text-primary);
}

.kpi-summary-label {
    font-size: 11px;
    color: var(--cc-text-muted);
}

/* --- Alerts / Action Items --- */
.kpi-alert-count {
    font-family: var(--cc-font-mono);
    font-size: 11px;
    font-weight: 600;
    background: #f8d7da;
    color: #842029;
    padding: 2px 8px;
    border-radius: 10px;
}

.kpi-alert-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 22px;
    border-bottom: 1px solid var(--cc-border-light);
    transition: background 0.1s ease;
}

.kpi-alert-row:last-child { border-bottom: none; }
.kpi-alert-row:hover { background: var(--cc-bg-secondary); }
.kpi-alert-row.resolved { opacity: 0.55; }

.kpi-alert-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.kpi-alert-icon.alert-danger { background: #f8d7da; color: #842029; }
.kpi-alert-icon.alert-warn { background: #fff3cd; color: #856404; }
.kpi-alert-icon.alert-info { background: #dbeafe; color: #1e40af; }
.kpi-alert-icon.alert-ok { background: #d1fae5; color: #065f46; }

.kpi-alert-info { flex: 1; min-width: 0; }

.kpi-alert-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--cc-text-primary);
}

.kpi-alert-detail {
    font-size: 11.5px;
    color: var(--cc-text-muted);
}

.kpi-alert-time {
    font-size: 11px;
    color: var(--cc-text-muted);
    white-space: nowrap;
    flex-shrink: 0;
    margin-top: 2px;
}

/* --- Status badges for activity --- */
.status-badge.status-progress { background: #dbeafe; color: #1e40af; }
.status-badge.status-scheduled { background: #ede9fe; color: #5b21b6; }

/* ============================================================
   Inline error banner (used by Admin/Agency dashboards)
   ============================================================ */
.login-error {
    background: var(--cc-error-bg);
    color: var(--cc-error);
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
}

/* ============================================================
   Dark Theme Overrides (for elements with hardcoded colors)
   ============================================================ */
[data-theme="dark"] .form-check-input:checked {
    background-color: var(--cc-accent);
    border-color: var(--cc-accent);
}

[data-theme="dark"] .form-select,
[data-theme="dark"] .form-control {
    background-color: var(--cc-bg-primary);
    color: var(--cc-text-primary);
    border-color: var(--cc-border);
}

[data-theme="dark"] .form-select:focus,
[data-theme="dark"] .form-control:focus {
    background-color: var(--cc-bg-primary);
    color: var(--cc-text-primary);
    border-color: var(--cc-accent);
    box-shadow: 0 0 0 2px var(--cc-accent-soft);
}

[data-theme="dark"] .table {
    color: var(--cc-text-primary);
}

[data-theme="dark"] .table > :not(caption) > * > * {
    background-color: transparent;
    color: var(--cc-text-primary);
}

[data-theme="dark"] .accordion-button::after {
    filter: invert(0.7);
}

[data-theme="dark"] .patient-pct.pct-high { background: #14412a; color: #86efac; }
[data-theme="dark"] .patient-pct.pct-mid { background: #422006; color: #fcd34d; }
[data-theme="dark"] .patient-pct.pct-low { background: #450a0a; color: #fca5a5; }

[data-theme="dark"] .patient-review-badge.review-high { background: #450a0a; color: #fca5a5; }
[data-theme="dark"] .patient-review-badge.review-mid { background: #422006; color: #fcd34d; }
[data-theme="dark"] .patient-review-badge.review-low { background: #14412a; color: #86efac; }
[data-theme="dark"] .patient-review-badge.review-done { background: #14412a22; color: #34d399; }

[data-theme="dark"] .kpi-overdue-badge { background: #450a0a; color: #fca5a5; }
[data-theme="dark"] .kpi-alert-count { background: #450a0a; color: #fca5a5; }
[data-theme="dark"] .kpi-alert-icon.alert-danger { background: #450a0a; color: #fca5a5; }
[data-theme="dark"] .kpi-alert-icon.alert-warn { background: #422006; color: #fcd34d; }
[data-theme="dark"] .kpi-alert-icon.alert-info { background: #1e3a5f; color: #93c5fd; }
[data-theme="dark"] .kpi-alert-icon.alert-ok { background: #14412a; color: #86efac; }

[data-theme="dark"] .status-badge.status-success { background: #14412a; color: #86efac; }
[data-theme="dark"] .status-badge.status-error { background: #450a0a; color: #fca5a5; }
[data-theme="dark"] .status-badge.status-progress { background: #1e3a5f; color: #93c5fd; }
[data-theme="dark"] .status-badge.status-scheduled { background: #2e1065; color: #c4b5fd; }

[data-theme="dark"] .kpi-val-good { color: #34d399; }
[data-theme="dark"] .kpi-val-warn { color: #fbbf24; }
[data-theme="dark"] .kpi-val-bad { color: #f87171; }

/* ============================================================
   Field Validation Errors
   ============================================================ */

/* Field-level error message below input */
.field-error {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin-top: 6px;
    font-size: 12.5px;
    color: var(--cc-error);
    line-height: 1.4;
}

.field-error i {
    flex-shrink: 0;
    font-size: 12px;
    margin-top: 2px;
}

/* Invalid input styling */
.oasis-input.is-invalid,
.form-control.is-invalid,
.form-select.is-invalid {
    border-color: var(--cc-error) !important;
    background-color: var(--cc-error-bg);
}

.oasis-input.is-invalid:focus,
.form-control.is-invalid:focus,
.form-select.is-invalid:focus {
    border-color: var(--cc-error) !important;
    box-shadow: 0 0 0 3px var(--cc-error-bg);
}

/* Referral page header */
.referral-page-header {
    padding-bottom: 12px;
}

/* ============================================================
   Chips + legacy patient banner
   .chip is shared with Employee.razor. This .patient-name rule
   also wins over the NavMenu patient-card name above.
   ============================================================ */
.patient-banner-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    align-items: flex-start;
}

.patient-info-section {
    flex: 1;
    min-width: 260px;
}

.patient-name {
    font-family: var(--cc-font-display);
    font-size: 22px;
    font-weight: 500;
    color: var(--cc-text-primary);
    margin: 0 0 4px;
}

.patient-sub {
    font-size: 13px;
    color: var(--cc-text-muted);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 2px;
}

.patient-flags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.chip {
    display: inline-flex;
    align-items: center;
    font-size: 11.5px;
    padding: 3px 10px;
    border-radius: 20px;
    white-space: nowrap;
}

.chip-warning {
    background: var(--cc-warning-bg);
    color: var(--cc-warning);
}

.chip-error {
    background: var(--cc-error-bg);
    color: var(--cc-error);
}

.patient-meta-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.meta-item {
    min-width: 100px;
}

.meta-label {
    font-family: var(--cc-font-display);
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--cc-text-muted);
    margin-bottom: 2px;
}

.meta-value {
    font-size: 13px;
    color: var(--cc-text-primary);
}

/* Status badges extensions */
.status-progress {
    background: #dbeafe;
    color: #1e40af;
}

.status-scheduled {
    background: var(--cc-bg-secondary);
    color: var(--cc-text-secondary);
}

.status-warning {
    background: var(--cc-warning-bg);
    color: var(--cc-warning);
}

.status-muted {
    background: var(--cc-bg-secondary);
    color: var(--cc-text-muted);
}
