@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');

html, body {
    font-family: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: #f5f7fa;
    color: #1f2937;
}

/* ============ Dashboard Shell ============ */
.dashboard-shell {
    padding: 1.5rem 1.75rem;
    max-width: 100%;
    width: 100%;
    margin: 0;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.dashboard-greeting h1 {
    font-size: 1.6rem;
    font-weight: 600;
    color: #0f172a;
    margin: 0;
}

.dashboard-greeting .subtitle {
    color: #64748b;
    font-size: 0.95rem;
    margin-top: 0.25rem;
}

/* ============ Sidebar Brand ============ */
.clinic-sidebar-brand {
    padding: 1.25rem 1rem 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    color: #fff;
}
.clinic-sidebar-brand .brand-line-1 {
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    opacity: 0.7;
}
.clinic-sidebar-brand .brand-line-2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-section-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255,255,255,0.5);
    padding: 1rem 1.5rem 0.4rem;
}

.nav-link-disabled {
    color: rgba(255,255,255,0.75) !important;
    cursor: not-allowed;
    pointer-events: none;
}
.nav-link-disabled .oi { opacity: 0.85; }

/* ============ Top Header ============ */
.top-header {
    background-color: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    padding: 0.6rem 1.5rem;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 1rem;
}

.top-header .icon-btn {
    background: transparent;
    border: 0;
    color: #64748b;
    font-size: 1.1rem;
    padding: 0.35rem 0.5rem;
    border-radius: 8px;
}
.top-header .icon-btn:hover {
    background-color: #f1f5f9;
    color: #0f172a;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f7cff, #6f5cff);
    color: #fff;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}
.user-meta { line-height: 1.1; }
.user-meta .user-name { font-weight: 600; color: #0f172a; font-size: 0.9rem; }
.user-meta .user-role { font-size: 0.75rem; color: #64748b; }

.logout-link {
    color: #64748b;
    text-decoration: none;
    font-size: 0.85rem;
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}
.logout-link:hover { background: #f1f5f9; color: #0f172a; }

/* ============ Metric Cards ============ */
.metrics-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin-bottom: 1.75rem; }

.metric-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 1.1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 1px 2px rgba(15,23,42,0.04);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.metric-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15,23,42,0.06);
}

.metric-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.metric-card .metric-number {
    font-size: 1.8rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.1;
}
.metric-card .metric-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #334155;
    margin-top: 2px;
}
.metric-card .metric-helper {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 2px;
}

.metric-card.accent-blue   { border-left: 3px solid #3b82f6; }
.metric-card.accent-amber  { border-left: 3px solid #f59e0b; }
.metric-card.accent-rose   { border-left: 3px solid #ef4444; }
.metric-card.accent-green  { border-left: 3px solid #10b981; }

.metric-icon.bg-blue  { background: #e0ecff; color: #2563eb; }
.metric-icon.bg-amber { background: #fef3c7; color: #b45309; }
.metric-icon.bg-rose  { background: #fee2e2; color: #b91c1c; }
.metric-icon.bg-green { background: #d1fae5; color: #047857; }

/* ============ Main grid (table + right panel) ============ */
.workflow-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 1.25rem;
}
@media (max-width: 1100px) {
    .workflow-grid { grid-template-columns: 1fr; }
}

/* Full-width article: avoid the demo template restricting horizontal space */
main > article.content {
    padding: 0 !important;
    max-width: 100%;
}

/* ============ Dashboard Card / Table Container ============ */
.dashboard-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 1.25rem;
    box-shadow: 0 1px 2px rgba(15,23,42,0.04);
}

.dashboard-card .card-section-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: #0f172a;
    margin: 0 0 0.9rem;
}

.filters-row {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 1rem;
}
.filters-row .form-select,
.filters-row .form-control {
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background-color: #f8fafc;
    font-size: 0.875rem;
}
.filters-row .form-select { max-width: 180px; }
.filters-row .search-input { flex: 1; min-width: 180px; }
.filters-row .refresh-btn {
    background-color: #2563eb;
    border-color: #2563eb;
    color: #fff;
    border-radius: 8px;
    padding: 0.4rem 0.85rem;
    font-size: 0.85rem;
    font-weight: 500;
}
.filters-row .refresh-btn:hover { background-color: #1d4ed8; }

/* ============ Inbox Table ============ */
.inbox-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.inbox-table thead th {
    text-align: left;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    font-weight: 600;
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid #e5e7eb;
    background: #f8fafc;
}
.inbox-table tbody tr {
    cursor: pointer;
    transition: background 0.12s ease;
}
.inbox-table tbody tr:hover { background: #f8fafc; }
.inbox-table tbody td {
    padding: 0.7rem 0.75rem;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.875rem;
    vertical-align: middle;
}
.inbox-table .patient-name { font-weight: 600; color: #0f172a; }
.inbox-table .patient-phone { font-size: 0.75rem; color: #94a3b8; }

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1;
}
.status-new       { background: #dbeafe; color: #1d4ed8; }
.status-intakesent{ background: #cffafe; color: #0e7490; }
.status-incomplete{ background: #fef3c7; color: #b45309; }
.status-ready     { background: #d1fae5; color: #047857; }
.status-confirmed { background: #ede9fe; color: #6d28d9; }
.status-archived  { background: #e2e8f0; color: #475569; }
.status-default   { background: #fee2e2; color: #b91c1c; }
.req-badge-modification { background: #ede9fe; color: #6d28d9; }

.source-badge {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
}
.source-phoneai  { background: #eef2ff; color: #4338ca; }
.source-webform  { background: #f1f5f9; color: #475569; }

.next-step {
    font-size: 0.8rem;
    color: #475569;
    font-weight: 500;
}
.next-step-done {
    color: #047857;
    font-weight: 600;
}

.view-btn {
    background: transparent;
    border: 1px solid #cbd5e1;
    color: #1e293b;
    border-radius: 8px;
    padding: 0.25rem 0.7rem;
    font-size: 0.78rem;
    font-weight: 500;
}
.view-btn:hover { background: #2563eb; border-color: #2563eb; color: #fff; }

.empty-state {
    text-align: center;
    color: #94a3b8;
    padding: 2rem;
    font-size: 0.9rem;
}

/* ============ Action Panel ============ */
.action-panel { display: flex; flex-direction: column; gap: 1rem; }
.action-panel h6 {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    margin: 0 0 0.6rem;
}
.action-queue-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.55rem 0.75rem;
    border-radius: 10px;
    background: #f8fafc;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}
.action-queue-item:hover { background: #eef2ff; }
.action-queue-item .count-badge {
    min-width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 700;
    color: #fff;
}
.count-blue  { background: #3b82f6; }
.count-amber { background: #f59e0b; }
.count-rose  { background: #ef4444; }
.count-green { background: #10b981; }

.quick-action-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    color: #94a3b8;
    border-radius: 10px;
    padding: 0.6rem 0.75rem;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    cursor: not-allowed;
    width: 100%;
    text-align: left;
}
.quick-action-button .qa-icon {
    width: 28px; height: 28px; border-radius: 8px;
    background: #e2e8f0; color: #64748b;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.85rem;
}

/* ============ Login Polish ============ */
.login-shell {
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.login-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
    padding: 2rem;
}
.login-brand {
    text-align: center;
    margin-bottom: 1.5rem;
}
.login-brand .brand-small {
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    color: #64748b;
    text-transform: uppercase;
}
.login-brand .brand-large {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
    margin-top: 4px;
}
.login-brand .brand-sub {
    font-size: 0.85rem;
    color: #64748b;
    margin-top: 0.4rem;
}
.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
.password-input-wrapper .form-control {
    padding-right: 2.75rem;
}
.password-toggle-btn {
    position: absolute;
    right: 0.25rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    background: none;
    border: none;
    padding: 0;
    color: #64748b;
    cursor: pointer;
    border-radius: 6px;
}
.password-toggle-btn:hover {
    color: #0f172a;
}
.password-toggle-btn:focus-visible {
    outline: 2px solid #93c5fd;
    outline-offset: 2px;
}

/* ============ Request Detail Page ============ */
.detail-shell {
    padding: 1.5rem 1.75rem;
    max-width: 100%;
}

.detail-back-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.detail-back-btn {
    background: transparent;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
    color: #475569;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.detail-back-btn:hover { background: #f1f5f9; color: #0f172a; }

.detail-page-title { font-size: 1.4rem; font-weight: 700; color: #0f172a; margin: 0; }
.detail-page-subtitle { font-size: 0.9rem; color: #64748b; margin: 0.15rem 0 0; }

.detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 1.25rem;
    align-items: start;
}
@media (max-width: 1000px) {
    .detail-grid { grid-template-columns: 1fr; }
}

.detail-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 1.25rem;
    box-shadow: 0 1px 2px rgba(15,23,42,0.04);
    margin-bottom: 1rem;
}
.detail-card:last-child { margin-bottom: 0; }

.detail-card-title {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #64748b;
    font-weight: 600;
    margin: 0 0 0.9rem;
}

.patient-header-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 0.5rem;
}
.patient-header-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
    font-size: 0.85rem;
    color: #64748b;
}

.info-row {
    display: flex;
    gap: 0.75rem;
    padding: 0.45rem 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.875rem;
}
.info-row:last-child { border-bottom: none; }
.info-label { color: #94a3b8; font-weight: 500; min-width: 140px; flex-shrink: 0; }
.info-value { color: #1e293b; }
.info-value a { color: #2563eb; text-decoration: none; }
.info-value a:hover { text-decoration: underline; }
.info-muted { color: #94a3b8; font-size: 0.8rem; }

.ai-summary-card {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    padding: 1rem 1.1rem;
}
.ai-summary-label { font-size: 0.75rem; font-weight: 600; color: #1d4ed8; margin-bottom: 0.4rem; text-transform: uppercase; letter-spacing: 0.06em; }
.ai-summary-text { font-size: 0.875rem; color: #1e3a5f; line-height: 1.55; margin: 0; }

.action-btn {
    width: 100%;
    text-align: left;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.6rem 0.9rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #1e293b;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.12s;
}
.action-btn:last-child { margin-bottom: 0; }
.action-btn:hover:not(:disabled) { background: #e0ecff; border-color: #93c5fd; color: #1d4ed8; }
.action-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.action-btn-success:hover:not(:disabled) { background: #d1fae5; border-color: #6ee7b7; color: #047857; }
.action-btn-danger:hover:not(:disabled) { background: #fee2e2; border-color: #fca5a5; color: #b91c1c; }
.action-btn-confirm:hover:not(:disabled) { background: #ede9fe; border-color: #c4b5fd; color: #6d28d9; }

.intake-status-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0;
    font-size: 0.875rem;
}
.intake-status-icon { font-size: 1rem; }

.callback-form { margin-top: 0.75rem; }
.callback-form .form-control,
.callback-form .form-select { border-radius: 8px; border-color: #e2e8f0; font-size: 0.875rem; }
.callback-form label { font-size: 0.8rem; color: #64748b; margin-bottom: 0.25rem; }

.note-success {
    background: #d1fae5;
    border: 1px solid #6ee7b7;
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    color: #047857;
    margin-top: 0.5rem;
}
.action-error {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    color: #b91c1c;
    margin-top: 0.5rem;
}

.workflow-status-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
}
.workflow-status-row:last-child { border-bottom: none; }
.workflow-status-row span:first-child { color: #94a3b8; }

/* ============ Callback Queue Page ============ */
.cb-shell {
    padding: 1.5rem 1.75rem;
    max-width: 100%;
}

.cb-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}
.cb-page-title { font-size: 1.4rem; font-weight: 700; color: #0f172a; margin: 0; }
.cb-page-subtitle { font-size: 0.9rem; color: #64748b; margin: 0.15rem 0 0; }
.cb-count-badge {
    display: inline-block;
    background: #e0f2fe;
    color: #0369a1;
    border-radius: 20px;
    padding: 0.15rem 0.65rem;
    font-size: 0.78rem;
    font-weight: 600;
    margin-left: 0.5rem;
}
.cb-header-actions { display: flex; align-items: center; gap: 0.5rem; }
.cb-refresh-btn {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.4rem 0.85rem;
    font-size: 0.85rem;
    color: #475569;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.cb-refresh-btn:hover { background: #f1f5f9; color: #0f172a; }
.cb-refresh-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.cb-summary-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.9rem;
    margin-bottom: 1.25rem;
}
@media (max-width: 700px) { .cb-summary-cards { grid-template-columns: 1fr; } }

.cb-summary-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 1rem 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.9rem;
    box-shadow: 0 1px 2px rgba(15,23,42,0.04);
}
.cb-summary-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}
.cb-summary-icon-blue { background: #e0f2fe; }
.cb-summary-icon-rose { background: #ffe4e6; }
.cb-summary-icon-amber { background: #fef3c7; }
.cb-summary-label { font-size: 0.78rem; color: #64748b; font-weight: 500; }
.cb-summary-value { font-size: 1.5rem; font-weight: 700; color: #0f172a; line-height: 1.1; }

.cb-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 1.25rem;
    box-shadow: 0 1px 2px rgba(15,23,42,0.04);
}

.cb-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 1.1rem;
    align-items: center;
}
.cb-filter-bar .form-select,
.cb-filter-bar .form-control {
    border-radius: 8px;
    border-color: #e2e8f0;
    font-size: 0.85rem;
    height: 36px;
    padding-top: 0.3rem;
    padding-bottom: 0.3rem;
    min-width: 130px;
    max-width: 180px;
}
.cb-filter-bar .form-control { max-width: 220px; }

.cb-table { width: 100%; border-collapse: collapse; }
.cb-table th {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
    font-weight: 600;
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid #f1f5f9;
    white-space: nowrap;
}
.cb-table td {
    padding: 0.75rem 0.75rem;
    border-bottom: 1px solid #f8fafc;
    vertical-align: middle;
    font-size: 0.875rem;
    color: #334155;
}
.cb-table tr:last-child td { border-bottom: none; }
.cb-table tr:hover td { background: #fafbff; }

.cb-patient-name { font-weight: 600; color: #0f172a; }
.cb-patient-phone { font-size: 0.8rem; color: #94a3b8; margin-top: 1px; }
.cb-reason-text { max-width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #334155; }

.cb-priority-high {
    display: inline-block; background: #ffe4e6; color: #be123c;
    border-radius: 20px; padding: 0.15rem 0.6rem; font-size: 0.75rem; font-weight: 600;
}
.cb-priority-normal {
    display: inline-block; background: #f1f5f9; color: #475569;
    border-radius: 20px; padding: 0.15rem 0.6rem; font-size: 0.75rem; font-weight: 600;
}

.cb-status-pending    { display:inline-block; background:#fef3c7; color:#92400e; border-radius:20px; padding:0.15rem 0.6rem; font-size:0.75rem; font-weight:600; }
.cb-status-inprogress { display:inline-block; background:#e0f2fe; color:#0369a1; border-radius:20px; padding:0.15rem 0.6rem; font-size:0.75rem; font-weight:600; }
.cb-status-completed  { display:inline-block; background:#d1fae5; color:#047857; border-radius:20px; padding:0.15rem 0.6rem; font-size:0.75rem; font-weight:600; }
.cb-status-cancelled  { display:inline-block; background:#f1f5f9; color:#64748b; border-radius:20px; padding:0.15rem 0.6rem; font-size:0.75rem; font-weight:600; }

.cb-due-overdue { color: #dc2626; font-weight: 600; }
.cb-due-today   { color: #0369a1; font-weight: 600; }

.cb-action-btn {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 7px;
    padding: 0.3rem 0.6rem;
    font-size: 0.78rem;
    font-weight: 500;
    color: #475569;
    white-space: nowrap;
    margin-right: 0.3rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}
.cb-action-btn:last-child { margin-right: 0; }
.cb-action-btn:hover:not(:disabled) { background: #e0ecff; border-color: #93c5fd; color: #1d4ed8; }
.cb-action-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.cb-action-btn-success:hover:not(:disabled) { background: #d1fae5; border-color: #6ee7b7; color: #047857; }
.cb-action-btn-view:hover:not(:disabled) { background: #ede9fe; border-color: #c4b5fd; color: #6d28d9; }

.cb-empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #94a3b8;
}
.cb-empty-icon { font-size: 2rem; margin-bottom: 0.5rem; }
.cb-empty-text { font-size: 0.9rem; }

.cb-feedback-bar {
    border-radius: 8px;
    padding: 0.5rem 0.85rem;
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

/* ============ Requests Inbox Page ============ */
.req-shell {
    padding: 1.5rem 1.75rem;
    max-width: 100%;
}

.req-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}
.req-page-title { font-size: 1.4rem; font-weight: 700; color: #0f172a; margin: 0; }
.req-page-subtitle { font-size: 0.9rem; color: #64748b; margin: 0.15rem 0 0; }
.req-header-right { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.req-shown-badge {
    background: #f1f5f9; color: #475569;
    border-radius: 20px; padding: 0.2rem 0.7rem;
    font-size: 0.78rem; font-weight: 600;
}
.req-refresh-btn {
    background: #fff; border: 1px solid #e2e8f0; border-radius: 8px;
    padding: 0.4rem 0.85rem; font-size: 0.85rem; color: #475569;
    display: inline-flex; align-items: center; gap: 0.4rem;
}
.req-refresh-btn:hover { background: #f1f5f9; color: #0f172a; }
.req-refresh-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.req-summary-cards {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}
@media (max-width: 900px)  { .req-summary-cards { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px)  { .req-summary-cards { grid-template-columns: repeat(2, 1fr); } }

.req-summary-card {
    background: #fff; border: 1px solid #e5e7eb; border-radius: 12px;
    padding: 0.85rem 1rem;
    box-shadow: 0 1px 2px rgba(15,23,42,0.04);
    cursor: pointer; transition: border-color 0.12s;
}
.req-summary-card:hover { border-color: #93c5fd; }
.req-summary-card.active { border-color: #3b82f6; background: #eff6ff; }
.req-summary-label { font-size: 0.75rem; color: #64748b; font-weight: 500; margin-bottom: 0.25rem; }
.req-summary-value { font-size: 1.5rem; font-weight: 700; color: #0f172a; line-height: 1.1; }

.req-card {
    background: #fff; border: 1px solid #e5e7eb; border-radius: 14px;
    padding: 1.25rem; box-shadow: 0 1px 2px rgba(15,23,42,0.04);
}

.req-filter-bar {
    display: flex; flex-wrap: wrap; gap: 0.55rem;
    margin-bottom: 1rem; align-items: center;
}
.req-filter-bar .form-select,
.req-filter-bar .form-control {
    border-radius: 8px; border-color: #e2e8f0; font-size: 0.85rem;
    height: 36px; padding-top: 0.3rem; padding-bottom: 0.3rem;
    min-width: 120px; max-width: 170px;
}
.req-filter-bar .form-control { max-width: 230px; }

.req-table { width: 100%; border-collapse: collapse; }
.req-table th {
    font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em;
    color: #94a3b8; font-weight: 600; padding: 0.55rem 0.75rem;
    border-bottom: 1px solid #f1f5f9; white-space: nowrap;
}
.req-table td {
    padding: 0.7rem 0.75rem; border-bottom: 1px solid #f8fafc;
    vertical-align: middle; font-size: 0.875rem; color: #334155;
}
.req-table tr:last-child td { border-bottom: none; }
.req-table tbody tr { cursor: pointer; }
.req-table tbody tr:hover td { background: #f8faff; }

.req-patient-name  { font-weight: 600; color: #0f172a; }
.req-patient-sub   { font-size: 0.78rem; color: #94a3b8; margin-top: 1px; }
.req-service-name  { color: #1e293b; }
.req-service-loc   { font-size: 0.78rem; color: #94a3b8; margin-top: 1px; }
.req-created-date  { font-size: 0.85rem; color: #334155; }
.req-next-step     { font-size: 0.8rem; color: #475569; }

.req-intake-notsent  { display:inline-block; background:#f1f5f9; color:#64748b; border-radius:20px; padding:0.12rem 0.55rem; font-size:0.73rem; font-weight:600; }
.req-intake-sent     { display:inline-block; background:#e0f2fe; color:#0369a1; border-radius:20px; padding:0.12rem 0.55rem; font-size:0.73rem; font-weight:600; }
.req-intake-incomplete { display:inline-block; background:#fef3c7; color:#92400e; border-radius:20px; padding:0.12rem 0.55rem; font-size:0.73rem; font-weight:600; }
.req-intake-complete { display:inline-block; background:#d1fae5; color:#047857; border-radius:20px; padding:0.12rem 0.55rem; font-size:0.73rem; font-weight:600; }

.req-action-btn {
    background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 7px;
    padding: 0.28rem 0.55rem; font-size: 0.76rem; font-weight: 500; color: #475569;
    white-space: nowrap; margin-right: 0.3rem;
    display: inline-flex; align-items: center; gap: 0.3rem;
}
.req-action-btn:last-child { margin-right: 0; }
.req-action-btn:hover:not(:disabled) { background: #e0ecff; border-color: #93c5fd; color: #1d4ed8; }
.req-action-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.req-action-btn-intake:hover:not(:disabled) { background: #d1fae5; border-color: #6ee7b7; color: #047857; }

.req-empty-state { text-align: center; padding: 3rem 1rem; color: #94a3b8; }
.req-empty-icon  { font-size: 2rem; margin-bottom: 0.5rem; }
.req-empty-text  { font-size: 0.9rem; }

.req-feedback-bar {
    border-radius: 8px; padding: 0.5rem 0.85rem;
    font-size: 0.85rem; margin-bottom: 0.75rem;
}

/* ============ Intake Management Page ============ */
.intk-shell {
    padding: 1.5rem 1.75rem;
    max-width: 100%;
}

.intk-page-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1.25rem;
}
.intk-page-title    { font-size: 1.4rem; font-weight: 700; color: #0f172a; margin: 0; }
.intk-page-subtitle { font-size: 0.9rem; color: #64748b; margin: 0.15rem 0 0; }
.intk-header-right  { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.intk-shown-badge {
    background: #f1f5f9; color: #475569;
    border-radius: 20px; padding: 0.2rem 0.7rem;
    font-size: 0.78rem; font-weight: 600;
}
.intk-refresh-btn {
    background: #fff; border: 1px solid #e2e8f0; border-radius: 8px;
    padding: 0.4rem 0.85rem; font-size: 0.85rem; color: #475569;
    display: inline-flex; align-items: center; gap: 0.4rem;
}
.intk-refresh-btn:hover    { background: #f1f5f9; color: #0f172a; }
.intk-refresh-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.intk-summary-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem; margin-bottom: 1.25rem;
}
@media (max-width: 800px) { .intk-summary-cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .intk-summary-cards { grid-template-columns: 1fr 1fr; } }

.intk-summary-card {
    background: #fff; border: 1px solid #e5e7eb; border-radius: 12px;
    padding: 0.85rem 1rem; box-shadow: 0 1px 2px rgba(15,23,42,0.04);
    cursor: pointer; transition: border-color 0.12s;
}
.intk-summary-card:hover  { border-color: #93c5fd; }
.intk-summary-card.active { border-color: #3b82f6; background: #eff6ff; }
.intk-summary-label { font-size: 0.75rem; color: #64748b; font-weight: 500; margin-bottom: 0.25rem; }
.intk-summary-value { font-size: 1.5rem; font-weight: 700; color: #0f172a; line-height: 1.1; }

.intk-card {
    background: #fff; border: 1px solid #e5e7eb; border-radius: 14px;
    padding: 1.25rem; box-shadow: 0 1px 2px rgba(15,23,42,0.04);
}

.intk-filter-bar {
    display: flex; flex-wrap: wrap; gap: 0.55rem;
    margin-bottom: 1rem; align-items: center;
}
.intk-filter-bar .form-select,
.intk-filter-bar .form-control {
    border-radius: 8px; border-color: #e2e8f0; font-size: 0.85rem;
    height: 36px; padding-top: 0.3rem; padding-bottom: 0.3rem;
    min-width: 120px; max-width: 170px;
}
.intk-filter-bar .form-control { max-width: 220px; }

.intk-table { width: 100%; border-collapse: collapse; }
.intk-table th {
    font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em;
    color: #94a3b8; font-weight: 600; padding: 0.55rem 0.75rem;
    border-bottom: 1px solid #f1f5f9; white-space: nowrap;
}
.intk-table td {
    padding: 0.7rem 0.75rem; border-bottom: 1px solid #f8fafc;
    vertical-align: middle; font-size: 0.875rem; color: #334155;
}
.intk-table tr:last-child td { border-bottom: none; }
.intk-table tbody tr { cursor: pointer; }
.intk-table tbody tr:hover td { background: #f8faff; }

.intk-patient-name { font-weight: 600; color: #0f172a; }
.intk-patient-sub  { font-size: 0.78rem; color: #94a3b8; margin-top: 1px; }
.intk-service-name { color: #1e293b; }
.intk-service-loc  { font-size: 0.78rem; color: #94a3b8; margin-top: 1px; }
.intk-created-date { font-size: 0.85rem; color: #334155; }
.intk-next-step    { font-size: 0.8rem; color: #475569; }

.intk-action-btn {
    background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 7px;
    padding: 0.28rem 0.55rem; font-size: 0.76rem; font-weight: 500; color: #475569;
    white-space: nowrap; margin-right: 0.3rem;
    display: inline-flex; align-items: center; gap: 0.3rem;
}
.intk-action-btn:last-child { margin-right: 0; }
.intk-action-btn:hover:not(:disabled) { background: #e0ecff; border-color: #93c5fd; color: #1d4ed8; }
.intk-action-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.intk-action-btn-send:hover:not(:disabled) { background: #d1fae5; border-color: #6ee7b7; color: #047857; }

.intk-empty-state { text-align: center; padding: 3rem 1rem; color: #94a3b8; }
.intk-empty-icon  { font-size: 2rem; margin-bottom: 0.5rem; }
.intk-empty-text  { font-size: 0.9rem; }

.intk-feedback-bar {
    border-radius: 8px; padding: 0.5rem 0.85rem;
    font-size: 0.85rem; margin-bottom: 0.75rem;
}

/* ============ Patients Directory Page ============ */
.pat-shell {
    padding: 1.5rem 1.75rem;
    max-width: 100%;
}

.pat-page-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1.25rem;
}
.pat-page-title    { font-size: 1.4rem; font-weight: 700; color: #0f172a; margin: 0; }
.pat-page-subtitle { font-size: 0.9rem; color: #64748b; margin: 0.15rem 0 0; }
.pat-header-right  { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.pat-shown-badge {
    background: #f1f5f9; color: #475569;
    border-radius: 20px; padding: 0.2rem 0.7rem;
    font-size: 0.78rem; font-weight: 600;
}
.pat-refresh-btn {
    background: #fff; border: 1px solid #e2e8f0; border-radius: 8px;
    padding: 0.4rem 0.85rem; font-size: 0.85rem; color: #475569;
    display: inline-flex; align-items: center; gap: 0.4rem;
}
.pat-refresh-btn:hover    { background: #f1f5f9; color: #0f172a; }
.pat-refresh-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.pat-info-banner {
    background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px;
    padding: 0.6rem 1rem; font-size: 0.82rem; color: #64748b;
    margin-bottom: 1.25rem;
    display: flex; align-items: center; gap: 0.5rem;
}

.pat-summary-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem; margin-bottom: 1.25rem;
}
@media (max-width: 800px) { .pat-summary-cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .pat-summary-cards { grid-template-columns: 1fr 1fr; } }

.pat-summary-card {
    background: #fff; border: 1px solid #e5e7eb; border-radius: 12px;
    padding: 0.85rem 1rem; box-shadow: 0 1px 2px rgba(15,23,42,0.04);
}
.pat-summary-label { font-size: 0.75rem; color: #64748b; font-weight: 500; margin-bottom: 0.25rem; }
.pat-summary-value { font-size: 1.5rem; font-weight: 700; color: #0f172a; line-height: 1.1; }

.pat-card {
    background: #fff; border: 1px solid #e5e7eb; border-radius: 14px;
    padding: 1.25rem; box-shadow: 0 1px 2px rgba(15,23,42,0.04);
}

.pat-filter-bar {
    display: flex; flex-wrap: wrap; gap: 0.55rem;
    margin-bottom: 1rem; align-items: center;
}
.pat-filter-bar .form-select,
.pat-filter-bar .form-control {
    border-radius: 8px; border-color: #e2e8f0; font-size: 0.85rem;
    height: 36px; padding-top: 0.3rem; padding-bottom: 0.3rem;
    min-width: 120px; max-width: 170px;
}
.pat-filter-bar .form-control { max-width: 230px; }

.pat-table { width: 100%; border-collapse: collapse; }
.pat-table th {
    font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em;
    color: #94a3b8; font-weight: 600; padding: 0.55rem 0.75rem;
    border-bottom: 1px solid #f1f5f9; white-space: nowrap;
}
.pat-table td {
    padding: 0.7rem 0.75rem; border-bottom: 1px solid #f8fafc;
    vertical-align: middle; font-size: 0.875rem; color: #334155;
}
.pat-table tr:last-child td { border-bottom: none; }
.pat-table tbody tr { cursor: pointer; }
.pat-table tbody tr:hover td { background: #f8faff; }

.pat-name         { font-weight: 600; color: #0f172a; }
.pat-source-text  { font-size: 0.75rem; color: #94a3b8; margin-top: 2px; }
.pat-contact-sub  { font-size: 0.8rem; color: #64748b; }
.pat-contact-none { font-size: 0.8rem; color: #cbd5e1; font-style: italic; }
.pat-date         { font-size: 0.85rem; color: #334155; }
.pat-req-count    { font-size: 0.85rem; font-weight: 600; color: #334155; }

.pat-svc-badge {
    display: inline-block; background: #f1f5f9; color: #475569;
    border-radius: 6px; padding: 0.1rem 0.45rem;
    font-size: 0.72rem; font-weight: 500; margin: 1px 2px 1px 0;
    white-space: nowrap;
}
.pat-svc-more {
    font-size: 0.72rem; color: #94a3b8; margin-left: 2px;
}

.pat-action-btn {
    background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 7px;
    padding: 0.28rem 0.6rem; font-size: 0.76rem; font-weight: 500; color: #475569;
    display: inline-flex; align-items: center; gap: 0.3rem; white-space: nowrap;
}
.pat-action-btn:hover { background: #e0ecff; border-color: #93c5fd; color: #1d4ed8; }

.pat-empty-state { text-align: center; padding: 3rem 1rem; color: #94a3b8; }
.pat-empty-icon  { font-size: 2rem; margin-bottom: 0.5rem; }
.pat-empty-text  { font-size: 0.9rem; }

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #0071c1;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

/* ============ Patient Intake Public Page (.pin-*) ============ */
.pin-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #eef4ff 0%, #f0fdfa 100%);
    padding: 1rem;
    display: flex;
    flex-direction: column;
}

.pin-shell {
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    padding: 1rem 0 2rem;
}

.pin-emergency-notice {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    color: #664d03;
    margin-bottom: 1rem;
    font-weight: 500;
}

.pin-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(15,23,42,0.08);
    padding: 1.75rem 1.5rem;
}

.pin-loading {
    text-align: center;
    padding: 3rem 1rem;
    color: #64748b;
    font-size: 0.9rem;
}

.pin-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid #f1f5f9;
}

.pin-header-logo {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.pin-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 0.35rem;
}

.pin-subtitle {
    font-size: 0.875rem;
    color: #64748b;
    margin: 0;
}

.pin-section {
    margin-bottom: 1.25rem;
}

.pin-section-title {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #94a3b8;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.pin-field-row {
    margin-bottom: 0.9rem;
}

.pin-label {
    display: block;
    font-size: 0.825rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.3rem;
}

.pin-optional {
    font-weight: 400;
    color: #94a3b8;
    font-size: 0.78rem;
}

.pin-readonly {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: #475569;
}

.pin-input {
    display: block;
    width: 100%;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 0.55rem 0.75rem;
    font-size: 0.875rem;
    color: #1f2937;
    transition: border-color 0.15s;
}

.pin-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
}

.pin-textarea {
    display: block;
    width: 100%;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 0.55rem 0.75rem;
    font-size: 0.875rem;
    color: #1f2937;
    resize: vertical;
    transition: border-color 0.15s;
    font-family: inherit;
}

.pin-textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
}

.pin-consent-row {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    margin: 1.25rem 0;
    padding: 1rem;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
}

.pin-checkbox {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 2px;
    cursor: pointer;
    accent-color: #16a34a;
}

.pin-consent-label {
    font-size: 0.875rem;
    color: #166534;
    cursor: pointer;
    line-height: 1.5;
}

.pin-submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.75rem 1rem;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.pin-submit-btn:hover:not(:disabled) { background: #1d4ed8; }
.pin-submit-btn:disabled { background: #93c5fd; cursor: not-allowed; opacity: 0.7; }

.pin-error-bar {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    border-radius: 8px;
    padding: 0.6rem 0.85rem;
    font-size: 0.875rem;
    color: #b91c1c;
    margin-bottom: 1rem;
}

.pin-invalid {
    text-align: center;
    padding: 2rem 0.5rem;
}

.pin-invalid-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.pin-invalid-title { font-size: 1.2rem; font-weight: 700; color: #0f172a; margin: 0 0 0.5rem; }
.pin-invalid-msg { font-size: 0.9rem; color: #64748b; margin: 0; line-height: 1.55; }

.pin-success {
    text-align: center;
    padding: 2rem 0.5rem;
}

.pin-success-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #d1fae5;
    color: #047857;
    font-size: 1.5rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
}

.pin-success-title { font-size: 1.2rem; font-weight: 700; color: #0f172a; margin: 0 0 0.5rem; }
.pin-success-msg { font-size: 0.9rem; color: #64748b; margin: 0; line-height: 1.55; }

@media (max-width: 600px) {
    .pin-card { padding: 1.25rem 1rem; border-radius: 12px; }
    .pin-shell { padding: 0.5rem 0 1.5rem; }
}

/* ============ Settings Page ============ */
.set-page {
    padding: 1.5rem 1.75rem;
    max-width: 100%;
}

.set-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.set-page-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.set-page-subtitle {
    font-size: 0.9rem;
    color: #64748b;
    margin: 0.15rem 0 0;
}

.set-env-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: #f1f5f9;
    color: #475569;
    border-radius: 20px;
    padding: 0.3rem 0.85rem;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

/* --- Warning panel --- */
.set-warning-panel {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-left: 4px solid #f59e0b;
    border-radius: 10px;
    padding: 0.85rem 1rem;
    margin-bottom: 1.25rem;
}

.set-warning-title {
    font-weight: 700;
    color: #92400e;
    font-size: 0.88rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.set-warning-list {
    margin: 0;
    padding-left: 1.25rem;
    color: #78350f;
    font-size: 0.85rem;
    line-height: 1.65;
}

.set-all-clear {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    color: #166534;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

/* --- Grid --- */
.set-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

/* --- Cards --- */
.set-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 1px 3px rgba(15,23,42,0.04);
}

.set-card-full {
    grid-column: 1 / -1;
}

.set-card-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 1rem;
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

/* --- Field rows --- */
.set-field-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.45rem 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.875rem;
    flex-wrap: wrap;
}

.set-field-row:last-of-type { border-bottom: none; }

.set-field-label {
    color: #64748b;
    font-weight: 500;
    min-width: 9rem;
    flex-shrink: 0;
}

.set-field-value {
    color: #1e293b;
    font-weight: 400;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.set-masked-value {
    font-family: 'Courier New', monospace;
    color: #475569;
    font-size: 0.82rem;
}

.set-url-value {
    color: #2563eb;
    word-break: break-all;
    font-size: 0.83rem;
}

/* --- Status pills --- */
.set-status-pill {
    display: inline-block;
    border-radius: 20px;
    padding: 0.15rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.set-status-ok {
    background: #d1fae5;
    color: #065f46;
}

.set-status-warning {
    background: #fef3c7;
    color: #92400e;
}

.set-status-danger {
    background: #fee2e2;
    color: #991b1b;
}

/* --- Service pills --- */
.set-service-pill {
    display: inline-block;
    background: #eff6ff;
    color: #1d4ed8;
    border-radius: 20px;
    padding: 0.15rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 500;
}

/* --- Safety notes --- */
.set-safety-note {
    margin-top: 0.85rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    color: #475569;
    line-height: 1.55;
}

.set-safety-note-danger {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #9a3412;
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
}

/* --- Error bar --- */
.set-error-bar {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    border-radius: 8px;
    padding: 0.6rem 0.85rem;
    font-size: 0.875rem;
    color: #b91c1c;
    margin-bottom: 0.5rem;
}

/* --- Checklist --- */
.set-checklist {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.35rem 1.5rem;
}

.set-checklist li {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.875rem;
    padding: 0.3rem 0;
    line-height: 1.45;
}

.set-check-pass { color: #0f172a; }
.set-check-warn { color: #92400e; }

.set-check-icon {
    flex-shrink: 0;
    margin-top: 2px;
    font-size: 0.8rem;
}

.set-check-pass .set-check-icon { color: #16a34a; }
.set-check-warn .set-check-icon { color: #d97706; }

/* --- Footer note --- */
.set-footer-note {
    font-size: 0.78rem;
    color: #94a3b8;
    margin-top: 1rem;
    text-align: right;
}

@media (max-width: 900px) {
    .set-grid { grid-template-columns: 1fr; }
    .set-checklist { grid-template-columns: 1fr; }
    .set-card-full { grid-column: 1; }
}

/* --- Clinic Configuration card header --- */
.set-clinic-config-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.set-readonly-note {
    font-size: 0.82rem;
    color: #64748b;
    font-style: italic;
}

/* --- Edit form --- */
.set-edit-form {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    margin-top: 0.25rem;
}

.set-form-row {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.set-form-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: #475569;
}

.set-form-input,
.set-form-select,
.set-form-textarea {
    max-width: 480px;
}

/* --- Service list editor --- */
.set-service-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    min-height: 2rem;
    margin-bottom: 0.4rem;
}

.set-service-pill-edit {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.set-service-remove {
    background: none;
    border: none;
    color: #1d4ed8;
    cursor: pointer;
    font-size: 1.05rem;
    padding: 0 0.15rem;
    line-height: 1;
    vertical-align: middle;
}

.set-service-remove:hover {
    color: #991b1b;
}

.set-service-add {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    max-width: 480px;
}

.set-service-input {
    flex: 1;
}

/* --- Form actions --- */
.set-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e2e8f0;
}

/* --- Save status messages --- */
.set-save-status {
    margin-top: 0.75rem;
    padding: 0.5rem 0.85rem;
    border-radius: 8px;
    font-size: 0.87rem;
    font-weight: 500;
}

.set-save-ok {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.set-save-error {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    color: #991b1b;
}

/* ============================================================
   Calendar
   ============================================================ */

/* Shell */
.cal-shell {
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-height: 100vh;
}

/* Top bar */
.cal-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.cal-topbar-left,
.cal-topbar-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.cal-nav-btn {
    padding: 0.25rem 0.6rem;
    font-size: 1rem;
    line-height: 1;
}
.cal-week-label {
    font-weight: 600;
    font-size: 0.95rem;
    color: #0f172a;
    min-width: 180px;
}
.cal-new-btn {
    padding: 0.25rem 0.75rem;
}
.cal-view-toggle .btn {
    padding: 0.25rem 0.6rem;
    font-size: 0.8rem;
}

/* Week grid */
.cal-week-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow-x: auto;
}
.cal-grid {
    display: flex;
    flex: 1;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
    min-width: 700px;
}

/* Time label column */
.cal-time-col {
    position: relative;
    width: 56px;
    min-width: 56px;
    border-right: 1px solid #e5e7eb;
    background: #fafafa;
}
.cal-time-header-spacer {
    height: 72px; /* matches day header + all-day lane height */
    border-bottom: 1px solid #e5e7eb;
}
.cal-time-label {
    position: absolute;
    left: 0;
    right: 0;
    text-align: right;
    padding-right: 6px;
    font-size: 0.7rem;
    color: #9ca3af;
    transform: translateY(-0.5em);
}
.cal-time-label-first {
    top: 2px;
    transform: none;
}

/* Day column */
.cal-day-col {
    flex: 1;
    border-right: 1px solid #e5e7eb;
    min-width: 80px;
}
.cal-day-col:last-child {
    border-right: none;
}
.cal-day-col.cal-day-today {
    background: #f0fdf9;
}

/* Day header */
.cal-day-header {
    height: 44px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.78rem;
    color: #6b7280;
    position: relative;
    gap: 1px;
}
.cal-day-header.cal-day-header-today {
    background: #0F6E56;
    color: white;
}
.cal-day-name {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.cal-day-number {
    font-weight: 700;
    font-size: 1rem;
    line-height: 1;
}
.cal-day-number-today {
    color: white;
}
.cal-intake-badge {
    position: absolute;
    top: 2px;
    right: 4px;
    background: #f59e0b;
    color: white;
    font-size: 0.6rem;
    padding: 1px 4px;
    border-radius: 10px;
    font-weight: 600;
}

/* All-day lane */
.cal-allday-lane {
    min-height: 28px;
    max-height: 60px;
    overflow-y: auto;
    padding: 2px 3px;
    border-bottom: 2px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Time grid */
.cal-time-grid {
    overflow: hidden;
}
.cal-slot-line {
    position: absolute;
    left: 0;
    right: 0;
    border-bottom: 1px solid #f3f4f6;
}
.cal-slot-line:nth-child(even) {
    border-bottom-color: #e5e7eb;
}

/* Current time line */
.cal-now-line {
    position: absolute;
    left: 0;
    right: 0;
    border-top: 2px solid #ef4444;
    z-index: 10;
}
.cal-now-line::before {
    content: '';
    position: absolute;
    left: -4px;
    top: -4px;
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
}

/* Event chips — timed (absolute) and all-day (static) */
.cal-event {
    position: absolute;
    left: 2px;
    right: 2px;
    border-radius: 4px;
    padding: 2px 5px;
    font-size: 0.72rem;
    cursor: pointer;
    overflow: hidden;
    border-left-width: 3px;
    border-left-style: solid;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
    transition: filter 0.1s;
    z-index: 5;
}
.cal-event:hover {
    filter: brightness(0.93);
}
.cal-allday-lane .cal-event {
    position: static;
    border-radius: 3px;
    padding: 1px 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cal-event-time {
    display: block;
    font-size: 0.65rem;
    opacity: 0.8;
    margin-bottom: 1px;
}
.cal-event-title {
    display: block;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cal-event-sub {
    display: block;
    font-size: 0.65rem;
    opacity: 0.8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Event colour classes (approved pastel palette) */
.cal-appt-scheduled { background: #E1F5EE; color: #0F6E56; border-left-color: #1D9E75; }
.cal-appt-urgent    { background: #FAEEDA; color: #633806; border-left-color: #EF9F27; }
.cal-appt-modified  { background: #E6F1FB; color: #0C447C; border-left-color: #378ADD; }
.cal-appt-cancelled { background: #F3F4F6; color: #6B7280; border-left-color: #D1D5DB; }
.cal-appt-completed { background: #D1FAE5; color: #065F46; border-left-color: #6EE7B7; }
.cal-appt-noshow    { background: #FEE2E2; color: #991B1B; border-left-color: #FCA5A5; }
.cal-callback        { background: #EEEDFE; color: #3C3489; border-left-color: #7F77DD; }
.cal-callback-urgent { background: #FEE2E2; color: #991B1B; border-left-color: #EF4444; }
.cal-intake         { background: #FBEAF0; color: #72243E; border-left-color: #D4537E; }

/* Legend */
.cal-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.6rem 0;
    font-size: 0.75rem;
    color: #6b7280;
}
.cal-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
}
.cal-legend-swatch {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 2px;
    border-left-width: 3px;
    border-left-style: solid;
}

/* Month stub (kept for safety) */
.cal-month-stub {
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 2rem;
}

/* Day view — single-column grid */
.cal-grid-day {
    min-width: 300px;
    max-width: 800px;
}

/* Month view grid */
.cal-month-container {
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
}
.cal-month-dow-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #f9fafb;
    border-bottom: 2px solid #e5e7eb;
}
.cal-month-dow {
    padding: 0.4rem 0;
    text-align: center;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
}
.cal-month-week {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border-bottom: 1px solid #e5e7eb;
    min-height: 110px;
}
.cal-month-week:last-child {
    border-bottom: none;
}
.cal-month-cell {
    border-right: 1px solid #e5e7eb;
    padding: 0.3rem 0.4rem;
    cursor: pointer;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: white;
    transition: background 0.1s;
}
.cal-month-cell:last-child {
    border-right: none;
}
.cal-month-cell:hover {
    background: #f0fdf9;
}
.cal-month-cell-other {
    background: #fafafa;
}
.cal-month-cell-other:hover {
    background: #f3f4f6;
}
.cal-month-cell-today {
    background: #f0fdf9;
}
.cal-month-cell-today:hover {
    background: #e6faf4;
}
.cal-month-cell-header {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-bottom: 1px;
}
.cal-month-day-number {
    font-size: 0.8rem;
    font-weight: 600;
    color: #374151;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}
.cal-month-cell-other .cal-month-day-number {
    color: #9ca3af;
}
.cal-month-day-today {
    background: #0F6E56;
    color: white !important;
}
.cal-month-chip {
    display: block;
    border-radius: 3px;
    padding: 1px 5px;
    font-size: 0.68rem;
    cursor: pointer;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    border-left-width: 3px;
    border-left-style: solid;
    line-height: 1.5;
}
.cal-month-chip:hover {
    filter: brightness(0.93);
}
.cal-month-chip-time {
    font-size: 0.62rem;
    opacity: 0.7;
    margin-right: 3px;
}
.cal-month-overflow {
    font-size: 0.68rem;
    color: #6b7280;
    padding: 1px 3px;
    cursor: pointer;
}
.cal-month-overflow:hover {
    color: #0F6E56;
    text-decoration: underline;
}

/* Appointment new form */
.appt-new-shell {
    max-width: 560px;
    margin: 2rem auto;
    padding: 0 1rem;
}
.appt-new-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.75rem;
}
.appt-new-card h2 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    color: #0f172a;
}
.appt-conflict-result {
    margin-top: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 5px;
    font-size: 0.85rem;
}
.appt-conflict-none {
    background: #d1fae5;
    color: #065f46;
}
.appt-conflict-found {
    background: #fef3c7;
    color: #92400e;
}
.appt-conflict-item {
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

/* ============ Settings — Business Hours + Cancellation Policy ============ */
.set-section-divider {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 0.35rem;
    margin: 1.1rem 0 0.75rem;
}
.set-hours-table-wrapper {
    overflow-x: auto;
    margin-bottom: 0.5rem;
}
.set-hours-table {
    min-width: 560px;
    font-size: 0.82rem;
}
.set-hours-table th {
    font-weight: 600;
    font-size: 0.75rem;
    color: #6b7280;
    white-space: nowrap;
}
.set-hours-table td {
    vertical-align: middle;
    padding: 0.3rem 0.4rem;
}
.set-hours-day {
    font-weight: 500;
    min-width: 90px;
}
.set-hours-table input[type="time"] {
    min-width: 110px;
}
.set-holiday-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.4rem;
    flex-wrap: wrap;
}
.set-holiday-row input[type="date"] {
    max-width: 150px;
}
.set-holiday-row input[type="text"] {
    flex: 1;
    min-width: 160px;
}

/* ============ Appointment Detail Page ============ */
.appt-detail-heading {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.appt-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    border-left-width: 3px;
    border-left-style: solid;
    font-size: 0.78rem;
    font-weight: 600;
}

.appt-policy-box {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 5px;
    padding: 0.6rem 0.85rem;
    font-size: 0.875rem;
    color: #1e40af;
    max-width: 680px;
}
.appt-policy-label {
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.2rem;
    color: #1d4ed8;
}

.appt-cancelled-banner {
    background: #f3f4f6;
    color: #6b7280;
    border-left: 3px solid #d1d5db;
    padding: 0.6rem 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
    max-width: 680px;
}

/* ============ Dashboard — Upcoming Follow-ups Widget ============ */
.upf-card {
    margin-bottom: 1.25rem;
}
.upf-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.85rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.upf-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.upf-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.875rem;
    flex-wrap: wrap;
}
.upf-row:last-child { border-bottom: none; }
.upf-patient {
    font-weight: 600;
    color: #0f172a;
    min-width: 120px;
}
.upf-reason {
    flex: 1;
    color: #475569;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
.upf-due {
    font-size: 0.82rem;
    color: #64748b;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex-wrap: wrap;
}
.upf-overdue-badge {
    display: inline-block;
    background: #fee2e2;
    color: #b91c1c;
    border-radius: 20px;
    padding: 0.1rem 0.45rem;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
}
.upf-high-badge {
    display: inline-block;
    background: #ffe4e6;
    color: #be123c;
    border-radius: 20px;
    padding: 0.1rem 0.45rem;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
}
.upf-view-btn {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 7px;
    padding: 0.25rem 0.6rem;
    font-size: 0.78rem;
    font-weight: 500;
    color: #475569;
    white-space: nowrap;
    flex-shrink: 0;
    cursor: pointer;
}
.upf-view-btn:hover {
    background: #ede9fe;
    border-color: #c4b5fd;
    color: #6d28d9;
}
.upf-done-btn {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 7px;
    padding: 0.25rem 0.6rem;
    font-size: 0.78rem;
    font-weight: 500;
    color: #047857;
    white-space: nowrap;
    flex-shrink: 0;
    cursor: pointer;
}
.upf-done-btn:hover:not(:disabled) {
    background: #d1fae5;
    border-color: #6ee7b7;
}
.upf-done-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.upf-empty {
    font-size: 0.875rem;
    color: #94a3b8;
    text-align: center;
    padding: 1rem 0;
}
.upf-all-link {
    font-size: 0.82rem;
    color: #2563eb;
    text-decoration: none;
}
.upf-all-link:hover { text-decoration: underline; }

/* ============ Reports Page ============ */
.rpt-shell {
    padding: 1.5rem 1.75rem;
    max-width: 100%;
}

.rpt-page-header {
    margin-bottom: 1.25rem;
}
.rpt-page-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}
.rpt-page-subtitle {
    font-size: 0.9rem;
    color: #64748b;
    margin: 0.15rem 0 0;
}

.rpt-range-selector {
    display: flex;
    gap: 0;
    margin-bottom: 1.5rem;
}
.rpt-range-selector .btn {
    border-radius: 0;
    font-size: 0.85rem;
    padding: 0.4rem 0.9rem;
}
.rpt-range-selector .btn:first-child { border-radius: 8px 0 0 8px; }
.rpt-range-selector .btn:last-child  { border-radius: 0 8px 8px 0; }

.rpt-section {
    margin-bottom: 1.5rem;
}
.rpt-section-title {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #64748b;
    font-weight: 600;
    margin: 0 0 0.85rem;
}

.rpt-channel-row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 0.35rem;
}

.rpt-est-note {
    font-size: 0.72rem;
    color: #94a3b8;
    margin-top: 2px;
}

/* Bar chart */
.rpt-bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 120px;
    padding-bottom: 26px;
    border-bottom: 1px solid #e5e7eb;
    overflow-x: auto;
    min-width: 0;
    position: relative;
}

.rpt-bar-col {
    flex: 1;
    min-width: 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    justify-content: flex-end;
    position: relative;
}

.rpt-bar-count {
    font-size: 10px;
    color: #9ca3af;
    margin-bottom: 2px;
    min-height: 14px;
    line-height: 1;
}

.rpt-bar-fill {
    width: 80%;
    background: #3b82f6;
    border-radius: 3px 3px 0 0;
    min-height: 2px;
}

.rpt-bar-label {
    position: absolute;
    bottom: -22px;
    font-size: 10px;
    color: #9ca3af;
    white-space: nowrap;
    text-align: center;
}

.rpt-chart-empty {
    color: #94a3b8;
    font-size: 0.85rem;
    text-align: center;
    padding: 1.5rem 0;
}

/* Reports link card on dashboard */
.rpt-link-card {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: #1e293b;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.55rem 0.75rem;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    transition: background 0.12s;
}
.rpt-link-card:hover {
    background: #e0ecff;
    border-color: #93c5fd;
    color: #1d4ed8;
    text-decoration: none;
}

/* ============ Notification Bell ============ */
.notif-bell-wrapper { position: relative; display: inline-block; }
.notif-badge {
    position: absolute; top: -4px; right: -6px;
    background: #EF4444; color: white;
    font-size: 10px; font-weight: 700;
    min-width: 18px; height: 18px;
    border-radius: 9px; padding: 0 4px;
    display: flex; align-items: center; justify-content: center;
    pointer-events: none;
}
.notif-dropdown {
    position: absolute; right: 0; top: calc(100% + 8px);
    width: 340px; max-height: 480px; overflow-y: auto;
    background: white; border: 1px solid #E5E7EB;
    border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    z-index: 9999;
}
.notif-header {
    padding: 14px 16px 10px;
    font-size: 14px; font-weight: 700; color: #1F2937;
    border-bottom: 1px solid #F3F4F6;
}
.notif-section-title {
    padding: 8px 16px 4px;
    font-size: 11px; font-weight: 600; color: #6B7280;
    text-transform: uppercase; letter-spacing: 0.6px;
}
.notif-item {
    padding: 8px 16px; cursor: pointer;
    border-bottom: 1px solid #F9FAFB;
    transition: background 0.15s;
}
.notif-item:hover { background: #F9FAFB; }
.notif-item-name { font-size: 13px; font-weight: 600; color: #111827; }
.notif-item-sub { font-size: 12px; color: #6B7280; margin-top: 1px; }
.notif-empty {
    padding: 28px 16px; text-align: center;
    font-size: 13px; color: #6B7280;
}
.notif-footer {
    padding: 10px 16px; border-top: 1px solid #F3F4F6;
    display: flex; gap: 12px;
}
.notif-footer a {
    font-size: 12px; color: #0F6E56; font-weight: 600;
    text-decoration: none;
}
.notif-footer a:hover { text-decoration: underline; }
.notif-overlay {
    position: fixed; inset: 0; z-index: 9998;
}
