/* ============================================
   DueseCal - Feriendialyse Dr. Berger
   Brand Colors & Variables
   ============================================ */
:root {
    --brand-teal: #00b4d8;
    --brand-teal-light: #48cae4;
    --brand-teal-dark: #0096c7;
    --brand-dark: #1b2838;
    --brand-darker: #151f2e;
    --brand-darkest: #0d1520;
    --brand-sun: #f9a825;
    --brand-coral: #ff6b6b;
    --brand-sky: #90e0ef;

    --status-green: #2ecc71;
    --status-yellow: #f1c40f;
    --status-orange: #e67e22;
    --status-blue: #3498db;
    --status-gray: #95a5a6;
    --status-red: #e74c3c;
    --status-teal: #1abc9c;

    --status-green-bg: #d5f5e3;
    --status-yellow-bg: #fef9e7;
    --status-orange-bg: #fdebd0;
    --status-blue-bg: #d6eaf8;
    --status-gray-bg: #eaeded;
    --status-red-bg: #fadbd8;
    --status-teal-bg: #d1f2eb;

    /* Theme-aware variables (light defaults) */
    --bg-body: linear-gradient(180deg, #eaf6ff 0%, #f0f4f8 50%, #faf7f2 100%);
    --bg-card: #fff;
    --bg-card-hover: #f0f9ff;
    --bg-surface: #f8fafc;
    --bg-input: #fff;
    --text-primary: #1e293b;
    --text-secondary: #5d6d7e;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --border-light: #edf2f7;
    --bg-subtle: #f1f5f9;
    --shadow-sm: 0 1px 4px rgba(0,0,0,0.07);
    --shadow-md: 0 4px 14px rgba(0,0,0,0.13);

    --font-size-base: 16px;
    --font-size-mobile: 15px;
    --line-height-base: 1.6;
    --touch-target-min: 36px;
    --touch-target-mobile: 44px;
    --card-padding: 1rem;
    --table-row-height: 40px;
    --btn-min-height: 36px;
    --badge-font-size: 10px;
}

/* ============================================
   Dark Theme — Deep Ocean Premium
   ============================================ */
[data-theme="dark"] {
    --bg-body: linear-gradient(180deg, #0b111e 0%, #101828 50%, #151e2e 100%);
    --bg-card: #182234;
    --bg-card-hover: #1e2d42;
    --bg-surface: #131b2a;
    --bg-input: #1a2538;
    --text-primary: #e8edf4;
    --text-secondary: #8b9bb5;
    --text-muted: #7a8fa8;
    --border-color: #253348;
    --border-light: #1e2b3e;
    --bg-subtle: #1a2538;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.35);
    --shadow-md: 0 6px 20px rgba(0,0,0,0.45);

    /* Richer, more vibrant status backgrounds */
    --status-green-bg: linear-gradient(135deg, #0f2d1e, #122e22);
    --status-yellow-bg: linear-gradient(135deg, #2e2a10, #33301a);
    --status-orange-bg: linear-gradient(135deg, #2e2010, #33261a);
    --status-blue-bg: linear-gradient(135deg, #10202e, #1a2833);
    --status-gray-bg: linear-gradient(135deg, #1e2228, #22262c);
    --status-red-bg: linear-gradient(135deg, #2e1010, #331a1a);
    --status-teal-bg: linear-gradient(135deg, #0f2e2a, #1a3330);

    /* Slightly desaturated status colors for dark mode readability */
    --status-green: #3dd68c;
    --status-yellow: #eab308;
    --status-orange: #f59e0b;
    --status-blue: #60a5fa;
    --status-red: #f87171;
    --status-teal: #2dd4bf;

    /* Brand adjustments for dark */
    --brand-teal-light: #5ed4f5;
    --brand-sun: #fbbf24;

    /* Override Bootstrap's own CSS variables for dark mode */
    --bs-body-color: #e8edf4;
    --bs-body-bg: #0b111e;
    --bs-table-color: #e8edf4;
    --bs-table-bg: transparent;
    --bs-table-hover-bg: rgba(94, 212, 245, 0.04);
    --bs-table-hover-color: #e8edf4;
    --bs-table-striped-color: #e8edf4;
    --bs-card-color: #e8edf4;
    --bs-card-bg: #182234;
    --bs-card-border-color: #253348;
    --bs-border-color: #253348;
    --bs-secondary-color: #8b9bb5;
    --bs-tertiary-color: #566882;
    --bs-tertiary-bg: #131b2a;
    --bs-emphasis-color: #e8edf4;
    --bs-heading-color: #e8edf4;
    --bs-link-color: #5ed4f5;
    --bs-link-hover-color: #00b4d8;
    --bs-code-color: #fbbf24;
    color-scheme: dark;
}

/* ============================================
   Typography
   ============================================ */
body {
    font-family: 'Open Sans', sans-serif;
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    background: var(--bg-body);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, h4, h5, h6,
.navbar-brand strong {
    font-family: 'Yanone Kaffeesatz', sans-serif;
    font-weight: 600;
}

main {
    flex: 1;
}

/* Global element defaults — typography & touch targets */
.btn { min-height: var(--btn-min-height); }
.table td, .table th { min-height: var(--table-row-height); padding: 0.6rem 0.75rem; }
.card-body { padding: var(--card-padding); }

/* ============================================
   Navbar & Footer (Brand Dark + Teal)
   ============================================ */
.bg-brand {
    background: linear-gradient(135deg, var(--brand-darkest), #1a3a5c) !important;
    border-bottom: 3px solid var(--brand-sun);
}

/* The navbar's backdrop-filter (glassmorphism section below) creates an
   implicit stacking context. Without an explicit z-index the navbar's
   context sits at auto (≈ 0), which is BELOW the status bar's
   position:sticky + z-index:1020. Any dropdown-menu opening downward
   from the navbar (e.g. center selector, export split-button) gets
   painted behind the status bar and toolbar — making it unreachable.
   Fix: lift the navbar above the status-bar stacking context. */
.navbar {
    position: relative;
    z-index: 1030;
}

.navbar-brand strong {
    font-size: 1.3rem;
    letter-spacing: 0.5px;
}

.text-light-muted {
    color: rgba(255, 255, 255, 0.65) !important;
}

/* ============================================
   Status Bar (time + refresh progress)
   ============================================ */
.stale-alert {
    background: linear-gradient(90deg, #dc2626, #ef4444);
    color: #fff;
    text-align: center;
    padding: 0.4rem 1rem;
    font-size: 0.85em;
    font-weight: 600;
    animation: stale-pulse 1.5s ease-in-out infinite;
    z-index: 1021;
    position: sticky;
    top: 0;
}

@keyframes stale-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.75; }
}

.status-bar {
    background: var(--brand-darker);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.status-bar-inner {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 0.75rem;
    height: 36px;
    font-size: 12px;
}

.office-badge {
    font-size: 0.7em;
    font-weight: 700;
    padding: 1px 8px;
    border-radius: 10px;
    color: #fff;
    white-space: nowrap;
    letter-spacing: 0.3px;
}

.status-time {
    color: var(--brand-teal);
    font-size: 0.75em;
    font-weight: 600;
    white-space: nowrap;
    font-family: 'Yanone Kaffeesatz', monospace;
    letter-spacing: 0.5px;
}

.status-refresh {
    flex: 1;
    height: 6px;
    background: rgba(255,255,255,0.08);
    border-radius: 3px;
    overflow: hidden;
    min-width: 80px;
}

.refresh-progress {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--brand-teal), var(--brand-teal-light));
    border-radius: 3px;
    transition: width 1s linear, background 2s ease;
}

.status-refresh-label {
    color: rgba(255,255,255,0.35);
    font-size: 0.65em;
    font-family: monospace;
    min-width: 24px;
    text-align: right;
}

.footer-brand {
    background: var(--brand-darker);
    border-top: 2px solid var(--brand-teal);
}

.footer-link {
    color: var(--brand-teal) !important;
    text-decoration: none;
}

.footer-link:hover {
    color: var(--brand-teal-light) !important;
}

/* Harmonised footer (2026-04-24) — single centred strip picking up
   feriendialyse.com's tonal cues: navy gradient, cream accents,
   Fraunces tagline. Replaces the older 3-col .footer-brand row. */
.dw-footer {
    background: linear-gradient(180deg,
        rgba(12, 74, 120, 0.16) 0%,
        rgba(6, 26, 44, 0.45) 100%);
    border-top: 1px solid rgba(255, 220, 184, 0.12);
    color: rgba(255, 220, 184, 0.82);
    padding: 1.25rem 1.25rem 1rem;
}
.dw-footer__inner {
    max-width: 1440px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.75rem 1.5rem;
    text-align: center;
}
.dw-footer__brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.3;
}
.dw-footer__brand-name {
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 500;
    font-size: 1rem;
    color: #ffdcb8;
    letter-spacing: 0.01em;
}
.dw-footer__tagline {
    font-family: 'Fraunces', Georgia, serif;
    font-style: italic;
    font-size: 0.9rem;
    color: rgba(255, 220, 184, 0.72);
}
.dw-footer__meta {
    display: inline-flex;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: rgba(255, 220, 184, 0.65);
    letter-spacing: 0.02em;
}
.dw-footer__dot { opacity: 0.5; }
.dw-footer__links {
    display: inline-flex;
    gap: 1rem;
    align-items: center;
    font-size: 0.9rem;
}
.dw-footer__link {
    color: #ffdcb8;
    opacity: 0.85;
    text-decoration: none;
    transition: opacity 0.15s ease, color 0.15s ease;
    /* Tap-target floor — Lighthouse / WCAG 2.5.5 want 44x44 minimum.
       inline-flex centred so the visual size of icon-only links
       (e.g. <i class="bi bi-link"></i>) doesn't change but the hit
       area does (mobile-opt 2026-04-28). */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 0 0.5rem;
}
.dw-footer__link:hover {
    opacity: 1;
    color: #ef6c3a;
    text-decoration: none;
}
[data-theme="light"] .dw-footer {
    background: linear-gradient(180deg, #fff8f1 0%, #fdeedd 100%);
    color: #4a2b1a;
    border-top-color: #f3d5b5;
}
[data-theme="light"] .dw-footer__brand-name { color: #1a3a5c; }
[data-theme="light"] .dw-footer__tagline { color: #8a5a3a; }
[data-theme="light"] .dw-footer__meta { color: #6b4a33; }
[data-theme="light"] .dw-footer__link { color: #1a3a5c; }
[data-theme="light"] .dw-footer__link:hover { color: #ef6c3a; }
@media (max-width: 640px) {
    .dw-footer { padding: 1rem; }
    .dw-footer__inner { gap: 0.4rem 1rem; }
    .dw-footer__tagline { font-size: 0.85rem; }
}

/* Occupancy heatmap — ported 2026-04-24 from
   wp/mu-plugins/47-occupancy-heatmap.php so the clinic-leaf Forecast
   tab in duesecal shows the SAME chart a prospective patient sees on
   feriendialyse.com. Class names match WP so tonal parity stays
   1:1 across repo boundaries. */
.dw-occ-heatmap {
    margin: 0 0 1.25rem;
    padding: 18px 18px 16px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    color: #e9e4d6;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, sans-serif;
}
[data-theme="light"] .dw-occ-heatmap { background: #fff8f1; border-color: #f3d5b5; color: #1a3a5c; }
.dw-occ-heatmap-title {
    margin: 0 0 12px;
    font-family: 'Fraunces', Georgia, serif;
    font-size: 16px;
    letter-spacing: 0.01em;
}
.dw-occ-heatmap-sub {
    margin: 0 0 14px;
    font-size: 12.5px;
    color: rgba(255,220,184,0.6);
}
[data-theme="light"] .dw-occ-heatmap-sub { color: #8a5a3a; }
.dw-occ-months {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(82px, 1fr));
    gap: 6px;
}
.dw-occ-cell {
    position: relative;
    padding: 10px 8px 8px;
    border-radius: 8px;
    text-align: center;
    font-size: 12px;
    line-height: 1.2;
    overflow: hidden;
    border: 1px solid rgba(255,220,184,0.08);
}
.dw-occ-cell .dw-occ-mo {
    font-weight: 600; font-size: 13px; display: block;
    letter-spacing: 0.02em;
}
.dw-occ-cell .dw-occ-lbl {
    display: block; margin-top: 6px;
    font-size: 10.5px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.06em;
    opacity: 0.92;
}
.dw-occ-cell.level-full      { background: rgba(168, 44, 32, 0.42); border-color: rgba(168, 44, 32, 0.55); }
.dw-occ-cell.level-high      { background: rgba(205, 111, 39, 0.38); border-color: rgba(205, 111, 39, 0.5); }
.dw-occ-cell.level-available { background: rgba(46, 139, 87, 0.32); border-color: rgba(46, 139, 87, 0.55); }
.dw-occ-heatmap-paused .dw-occ-paused-banner {
    padding: 18px 20px;
    background: rgba(60, 80, 100, 0.22);
    border: 1px solid rgba(60, 80, 100, 0.55);
    border-radius: 8px;
    text-align: center;
    font-size: 14px;
    line-height: 1.6;
}
.dw-occ-heatmap-paused .dw-occ-paused-banner strong {
    display: block;
    font-family: 'Fraunces', Georgia, serif;
    font-size: 16px;
    margin-bottom: 6px;
    color: #e9e4d6;
}
.dw-occ-heatmap-paused .dw-occ-paused-banner p { margin: 0; color: rgba(255,220,184,0.78); }
.dw-occ-heatmap-legend {
    margin-top: 14px;
    display: flex; flex-wrap: wrap; gap: 10px 16px;
    font-size: 11.5px; color: rgba(255,220,184,0.72);
}
[data-theme="light"] .dw-occ-heatmap-legend { color: #6b4a33; }
.dw-occ-heatmap-legend span::before {
    content: "";
    display: inline-block;
    width: 10px; height: 10px; border-radius: 3px;
    margin-right: 5px; vertical-align: -1px;
}
.dw-occ-heatmap-legend .lg-available::before { background: rgba(46, 139, 87, 0.7); }
.dw-occ-heatmap-legend .lg-high::before      { background: rgba(205, 111, 39, 0.7); }
.dw-occ-heatmap-legend .lg-full::before      { background: rgba(168, 44, 32, 0.8); }
@media (max-width: 640px) {
    .dw-occ-heatmap { padding: 14px 12px 12px; }
    .dw-occ-months { grid-template-columns: repeat(auto-fit, minmax(68px, 1fr)); gap: 4px; }
    .dw-occ-cell { padding: 8px 5px 6px; }
    .dw-occ-cell .dw-occ-mo { font-size: 12px; }
    .dw-occ-cell .dw-occ-lbl { font-size: 9.5px; }
}

/* ============================================
   Center Selection Page
   ============================================ */
.select-center-page {
    max-width: 900px;
    margin: 2rem auto;
}

.center-select-mobile {
    max-width: 400px;
    margin: 0 auto;
}

.center-select-mobile .form-select {
    background-color: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.center-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
    color: inherit;
    width: 100%;
}

.center-card:hover {
    border-color: var(--brand-teal);
    box-shadow: 0 4px 20px rgba(0, 180, 216, 0.15);
    transform: translateY(-2px);
}

.center-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--brand-teal), var(--brand-teal-light));
    color: #fff;
    border-radius: 12px;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.center-card-body {
    flex: 1;
    min-width: 0;
}

.center-card-body h5 {
    font-family: 'Yanone Kaffeesatz', sans-serif;
    font-size: 1.15rem;
    margin: 0 0 0.2rem;
    color: var(--brand-dark);
}

.center-card-body p {
    font-size: 0.85em;
    color: #64748b;
    margin: 0;
}

.center-card-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.8em;
    color: #94a3b8;
    margin-top: 0.25rem;
}

.center-card-arrow {
    font-size: 1.5rem;
    color: var(--brand-teal);
    opacity: 0.4;
    transition: opacity 0.2s;
}

.center-card:hover .center-card-arrow {
    opacity: 1;
}

/* ============================================
   Statistics
   ============================================ */
.stats-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    margin-bottom: 1rem;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.stats-header {
    display: flex;
    align-items: center;
    padding: 0.6rem 1rem;
    background: var(--bg-surface);
    font-family: 'Yanone Kaffeesatz', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid var(--border-color);
}

.stats-header:hover { background: var(--bg-card-hover); }

.stats-header .bi-bar-chart-line { color: var(--brand-teal); }

.stats-chevron {
    transition: transform 0.2s;
}

[aria-expanded="true"] .stats-chevron,
.stats-header:not(.collapsed) .stats-chevron {
    transform: rotate(180deg);
}

.stats-body {
    padding: 1rem;
}

.stats-body canvas {
    max-height: 220px;
}

.stats-legend {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 3px;
    margin-right: 4px;
    vertical-align: middle;
}

.stats-table {
    font-size: 0.85em;
}

.stats-table th {
    white-space: nowrap;
    font-size: 0.85em;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stats-table tbody th {
    text-transform: none;
    color: var(--text-primary);
    font-size: 0.9em;
}

.stats-total {
    background: var(--bg-surface);
    border-left: 2px solid var(--brand-teal) !important;
    text-align: center;
}

.stats-prev th, .stats-prev td {
    color: #94a3b8 !important;
    font-weight: 400 !important;
    font-size: 0.9em;
}

.stats-delta th, .stats-delta td {
    font-size: 0.85em;
    border-bottom: 2px solid var(--border-light);
}

.delta {
    font-weight: 700;
    font-size: 0.85em;
    padding: 1px 4px;
    border-radius: 3px;
    white-space: nowrap;
}

.delta-up {
    color: #16a34a;
    background: rgba(22, 163, 74, 0.1);
}

.delta-down {
    color: #dc2626;
    background: rgba(220, 38, 38, 0.1);
}

.delta-flat {
    color: #94a3b8;
}

/* ============================================
   Patient Search
   ============================================ */
.patient-search-wrapper {
    position: relative;
}

.patient-search-wrapper .input-group-text {
    border-color: rgba(255,255,255,0.3);
}

.patient-search-wrapper input::placeholder {
    color: rgba(255,255,255,0.5);
}

.patient-search-results {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 320px;
    max-height: 400px;
    overflow-y: auto;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0 0 8px 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    z-index: 1050;
}

.patient-search-results.show {
    display: block;
}

.patient-search-item {
    display: block;
    padding: 0.5rem 0.75rem;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid var(--border-light);
    transition: background 0.1s;
}

.patient-search-item:hover {
    background: var(--bg-card-hover);
    color: inherit;
}

.ps-name {
    font-weight: 600;
    font-size: 0.9em;
    color: var(--text-primary);
}

.ps-meta {
    font-size: 0.8em;
    color: var(--text-secondary);
}

.ps-status {
    color: var(--brand-teal);
    font-weight: 600;
}

/* ============================================
   Who is Online
   ============================================ */
.online-dropdown {
    border: none;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.online-header {
    background: var(--brand-dark);
    color: #fff;
    padding: 0.5rem 0.75rem;
    font-weight: 600;
    font-size: 0.85em;
    border-bottom: 2px solid var(--brand-teal);
}

.online-list {
    max-height: 400px;
    overflow-y: auto;
}

.online-sub-header {
    padding: 0.35rem 0.75rem;
    font-size: 0.8em;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.online-list table th {
    background: var(--bg-surface);
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    white-space: nowrap;
    position: sticky;
    top: 0;
}

.online-list table td {
    vertical-align: middle;
    white-space: nowrap;
}

/* Per-user expanded detail row in the online-users panel.
   Renders a dense labelled grid of every CF / device field. */
.online-detail-toggle {
    color: var(--text-secondary);
    text-decoration: none;
    width: 1.6em;
    text-align: center;
}
.online-detail-toggle:hover {
    color: var(--text-primary);
    background: var(--bg-surface);
    border-radius: 3px;
}
.online-detail-row > td {
    background: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    padding: 0.6em 0.75em !important;
    white-space: normal !important;
}
.online-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.4em 1em;
}
.online-detail-cell {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.online-detail-label {
    font-size: 0.7em;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--text-secondary);
    margin-bottom: 1px;
}
.online-detail-value {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.85em;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
}
.online-detail-ua {
    margin-top: 0.6em;
    padding-top: 0.5em;
    border-top: 1px dashed var(--border-color);
}
.online-detail-ua code.online-detail-value {
    display: block;
    word-break: break-all;
    white-space: normal;
    background: var(--bg-card);
    padding: 0.3em 0.5em;
    border-radius: 3px;
    border: 1px solid var(--border-color);
    margin-top: 2px;
}

/* ============================================
   Chat Widget
   ============================================ */
.chat-widget {
    position: fixed;
    bottom: 0;
    right: 20px;
    width: 380px;
    max-height: 500px;
    background: var(--bg-card);
    border-radius: 12px 12px 0 0;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
    z-index: 1060;
    display: flex;
    flex-direction: column;
    transform: translateY(calc(100% - 42px));
    transition: transform 0.3s ease;
    overflow: hidden;
}

.chat-widget.chat-open {
    transform: translateY(0);
}

.chat-header {
    background: linear-gradient(135deg, var(--brand-dark), #1a3a5c);
    color: #fff;
    padding: 0.6rem 1rem;
    font-weight: 600;
    font-size: 0.9em;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    width: 100%;
    align-items: center;
    border: none;
    border-bottom: 2px solid var(--brand-sun);
    user-select: none;
    text-align: left;
}

.chat-header:hover { opacity: 0.9; }

.chat-close {
    margin-left: auto;
    opacity: 0.6;
}

.chat-close:hover { opacity: 1; }

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
    max-height: 350px;
    min-height: 200px;
    background: var(--bg-surface);
    font-size: 14px;
}

.chat-msg {
    margin-bottom: 0.5rem;
    padding: 0.4rem 0.6rem;
    border-radius: 8px;
    font-size: 0.85em;
    max-width: 90%;
}

.chat-msg-user {
    background: rgba(0, 180, 216, 0.1);
    margin-right: auto;
}

.chat-msg-bot {
    background: rgba(46, 204, 113, 0.1);
    margin-left: auto;
}

.chat-msg-head {
    font-size: 0.8em;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.chat-msg-head strong {
    color: var(--text-primary);
}

.chat-msg-body {
    color: var(--text-primary);
    word-break: break-word;
    line-height: 1.4;
}

.chat-input {
    display: flex;
    gap: 0.3rem;
    padding: 0.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-card);
}

.chat-input input {
    flex: 1;
    border-radius: 20px;
    padding-left: 1rem;
    height: 42px;
    font-size: 14px;
}

.chat-input button {
    border-radius: 50%;
    width: 42px;
    height: 42px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    .chat-widget {
        right: 0;
        left: 0;
        width: 100%;
        bottom: env(safe-area-inset-bottom, 0px);
        border-radius: 12px 12px 0 0;
    }
}

/* ============================================
   Auth Pages
   ============================================ */
.auth-container {
    max-width: 420px;
    margin: 4rem auto;
}

.auth-container .card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

.auth-container .card-header {
    background: linear-gradient(135deg, var(--brand-darkest), var(--brand-dark));
    color: #fff;
    border-radius: 12px 12px 0 0 !important;
    border-bottom: 3px solid var(--brand-teal);
    padding: 1.5rem;
}

.auth-container .card-header h2 {
    margin: 0;
    font-size: 1.6rem;
}

.auth-container .btn-brand {
    background: var(--brand-teal);
    border-color: var(--brand-teal);
    color: #fff;
    font-weight: 600;
}

.auth-container .btn-brand:hover {
    background: var(--brand-teal-dark);
    border-color: var(--brand-teal-dark);
}

/* Login page — optimised for standard HD laptops (1366×768, 1440×900).
   2026-04-24: widened 1200→1440 and scaled up typography throughout.
   The old 540→1200 sequence was a gradual creep; now we commit to
   filling the screen instead of a centered form on an empty page. */
.login-page {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* --- Branding header (replaces hero photo) --- */
.login-branding {
    text-align: center;
    padding: 1.5rem 1rem 1rem;
    animation: fadeInDown 0.4s ease-out;
}

.login-branding-logo {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 30px rgba(0, 180, 216, 0.2), 0 4px 20px rgba(0, 0, 0, 0.4);
    margin-bottom: 0.75rem;
}

.login-branding-title {
    font-family: 'Yanone Kaffeesatz', sans-serif;
    font-size: 3rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
    letter-spacing: -0.01em;
    text-shadow: 0 2px 12px rgba(0, 180, 216, 0.15), 0 1px 4px rgba(0, 0, 0, 0.3);
}

.login-branding-motto {
    font-style: italic;
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.85);
    margin: 0.25rem 0 0;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.login-branding-sub {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.55);
    margin: 0.4rem 0 0;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.login-content {
    display: grid;
    /* Form column fixed at 460px (comfortable, not cramped); info
       column fills the rest — on 1440 that's ~870px, plenty of room
       for a 2-column sub-grid within the info-section. */
    grid-template-columns: 460px minmax(0, 1fr);
    gap: 2.5rem;
    margin-bottom: 2rem;
    align-items: start;
}

/* Within the info column, lay out cards in a 2-column sub-grid so
   all four (support / HDI / since 1988 / team + contact) sit side
   by side above the fold on 1440×900. */
.login-info-section {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    align-content: start;
}

.login-info-section > .support-block {
    /* Support block spans both sub-columns: QR + TV side by side
       within it is already internally 2-col via flex. */
    grid-column: 1 / -1;
}

@media (max-width: 1199px) {
    .login-content { grid-template-columns: 420px minmax(0, 1fr); gap: 1.75rem; }
    .login-info-section { grid-template-columns: minmax(0, 1fr); }
}

/* Support block — QR + TV CTA side by side, visually anchored. Bigger
   on HD laptops so the QR is scannable from 40-50 cm away. */
.support-block { padding: 1.25rem 1.5rem !important; }
.support-block h5 { font-size: 1.15rem !important; margin-bottom: 0.75rem !important; }
.support-block .support-row {
    align-items: flex-start;
    gap: 1.5rem !important;
}
.support-block .support-qr img {
    max-width: 170px;
    height: auto;
}
.support-block .support-tv .btn { font-size: 1rem; padding: 0.5rem 1rem; }

.login-form-section .card {
    border: 1px solid rgba(0, 180, 216, 0.12);
    border-radius: 16px;
    background: rgba(24, 34, 52, 0.65);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.login-form-section .card-header {
    background: linear-gradient(135deg, rgba(8, 13, 22, 0.8), rgba(19, 27, 42, 0.8));
    color: #fff;
    border-radius: 16px 16px 0 0 !important;
    border-bottom: 3px solid var(--brand-teal);
    padding: 1.25rem;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.login-form-section .card-header h2 {
    margin: 0;
    font-size: 1.65rem;
}

.login-form-section .btn-brand {
    background: var(--brand-teal);
    border-color: var(--brand-teal);
    color: #fff;
    font-weight: 600;
}

.login-form-section .btn-brand:hover {
    background: var(--brand-teal-dark);
    border-color: var(--brand-teal-dark);
}

.login-form-section .card-body {
    background: transparent;
}

.login-form-section .form-control {
    background: rgba(26, 37, 56, 0.5);
    border-color: rgba(0, 180, 216, 0.1);
    color: var(--text-primary);
    font-size: 1.1rem;
    padding: 0.7rem 1rem;
}

.login-form-section .card-body {
    padding: 1.75rem !important;
}

.login-form-section .btn-brand {
    font-size: 1.05rem;
    padding: 0.7rem 1rem;
    font-weight: 600;
}

.login-form-section .form-control:focus {
    background: rgba(26, 37, 56, 0.7);
    border-color: var(--brand-teal);
    box-shadow: 0 0 0 0.2rem rgba(0, 180, 216, 0.15);
}

.login-form-section .input-group-text {
    background: rgba(24, 34, 52, 0.6);
    border-color: rgba(0, 180, 216, 0.1);
    color: var(--text-secondary);
}

.login-restricted {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.78rem;
    color: var(--brand-sun);
    background: rgba(249, 168, 37, 0.06);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(249, 168, 37, 0.15);
    line-height: 1.5;
}

.login-info-section {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.login-info-card {
    background: rgba(24, 34, 52, 0.5);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 12px;
    padding: 1.25rem 1.4rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.login-info-card:hover {
    transform: translateY(-2px);
    border-color: rgba(0, 180, 216, 0.2);
}

.login-info-card h5 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--brand-teal);
    margin-bottom: 0.6rem;
}

.login-info-card p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 0;
    line-height: 1.55;
}

.login-team {
    display: flex;
    gap: 0.75rem;
}

.login-team-member {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    flex: 1;
    padding: 0.75rem 0.5rem;
    border-radius: 10px;
    background: rgba(19, 27, 42, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    text-align: center;
}

.login-team-avatar {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    margin-bottom: 0.25rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    object-fit: cover;
    object-position: center 15%;
    border: 2px solid var(--brand-teal);
}

.login-team-member strong {
    font-size: 0.9rem;
    color: var(--text-primary);
}

.login-team-role {
    font-size: 0.7rem;
    color: var(--text-secondary);
    line-height: 1.3;
}

.login-team-since {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-style: italic;
}

/* --- Footer sign-off (seamless, no card) --- */
.login-signoff {
    margin-top: 1.5rem;
    padding: 1.25rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.login-signoff-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.login-signoff-left {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.login-signoff-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--brand-teal);
    font-weight: 600;
}

.login-signoff-left strong {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
}

.login-signoff-left span {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.4);
}

.login-signoff-links {
    display: flex;
    gap: 0.75rem;
}

.login-signoff-links a {
    color: rgba(255, 255, 255, 0.5);
    font-size: 1rem;
    text-decoration: none;
    transition: color 0.15s;
}

.login-signoff-links a:hover {
    color: var(--brand-teal);
}

.login-copyright {
    margin-top: 0.75rem;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
    text-align: center;
}

/* Light theme */
[data-theme="light"] .login-signoff {
    border-top-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .login-signoff-left strong {
    color: var(--text-primary);
    opacity: 0.7;
}

[data-theme="light"] .login-signoff-left span {
    color: var(--text-muted);
}

[data-theme="light"] .login-signoff-links a {
    color: var(--text-muted);
}

[data-theme="light"] .login-copyright {
    color: var(--text-muted);
    opacity: 0.6;
}

@media (max-width: 768px) {
    .login-signoff-inner {
        flex-direction: column;
        text-align: center;
    }
}

/* --- Visitor info badge --- */
.login-visitor-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    margin-bottom: 1rem;
    border-radius: 20px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    background: rgba(24, 34, 52, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.04);
    animation: fadeIn 0.6s ease-out 0.3s both;
}

.login-visitor-badge i {
    color: var(--brand-teal);
    opacity: 0.7;
}

.login-visitor-badge code {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.5);
    background: rgba(0, 0, 0, 0.2);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
}

[data-theme="light"] .login-visitor-badge {
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.5);
    border-color: rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .login-visitor-badge code {
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.05);
}

/* --- Language flag images --- */
.lang-flag {
    width: 24px;
    height: 18px;
    border-radius: 3px;
    vertical-align: middle;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: transform 0.15s, box-shadow 0.15s;
}

/* Hit area at 44x44 for mobile WCAG 2.5.5 tap-target sizing — visual
   flag stays 24x18 but the <a> wrapping it gets a comfortable thumb
   hit (mobile-opt 2026-04-28). */
.lang-flag-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
}

.lang-flag-link:hover .lang-flag {
    transform: scale(1.15);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.lang-flag-active .lang-flag {
    outline: 2px solid var(--brand-teal);
    outline-offset: 2px;
}

/* Public pages (e.g. /auth/request-access) — language strip above navbar */
.ra-lang-strip {
    text-align: center;
    padding: 0.5rem 0.5rem 0.6rem;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
[data-theme="light"] .ra-lang-strip {
    background: #e9ecef;
    border-bottom-color: #ced4da;
}

/* --- Login entrance animations --- */
.login-form-section {
    animation: fadeInUp 0.5s ease-out 0.1s both;
}

.login-info-card:nth-child(1) { animation: fadeInUp 0.5s ease-out 0.15s both; }
.login-info-card:nth-child(2) { animation: fadeInUp 0.5s ease-out 0.2s both; }
.login-info-card:nth-child(3) { animation: fadeInUp 0.5s ease-out 0.25s both; }
.login-info-card:nth-child(4) { animation: fadeInUp 0.5s ease-out 0.3s both; }

.treatments-legend {
    animation: fadeIn 0.6s ease-out 0.4s both;
}

.login-signoff {
    animation: fadeIn 0.6s ease-out 0.5s both;
}

@media (max-width: 768px) {
    .login-content {
        grid-template-columns: 1fr;
    }
    .login-branding-title {
        font-size: 1.8rem;
    }
    .login-branding {
        padding: 1.5rem 1rem 1rem;
    }
}

/* ============================================
   Welcome / Landing Page
   ============================================ */
.welcome-page {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 1rem 2rem;
}

.welcome-hero {
    background: linear-gradient(135deg, var(--brand-darkest), var(--brand-dark));
    border-radius: 16px;
    padding: 2rem 2.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--brand-teal-dark);
    box-shadow: 0 4px 24px rgba(0, 180, 216, 0.08);
}

.welcome-hero-inner {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.welcome-avatar {
    font-size: 3.5rem;
    color: var(--brand-teal);
    line-height: 1;
    opacity: 0.9;
}

.welcome-title {
    font-family: 'Yanone Kaffeesatz', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 0.25rem;
}

.welcome-subtitle {
    color: rgba(255,255,255,0.7);
    font-size: 0.85rem;
    margin: 0;
}

.welcome-last-login {
    opacity: 0.6;
    font-size: 0.8rem;
}

.bg-brand-teal {
    background-color: var(--brand-teal) !important;
    color: #fff;
}

.welcome-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.welcome-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.welcome-card-highlight {
    grid-column: 1 / -1;
    border-color: var(--brand-teal-dark);
    box-shadow: 0 2px 16px rgba(0, 180, 216, 0.06);
}

.welcome-card-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
}

.welcome-card-header i {
    font-size: 1.1rem;
    color: var(--brand-teal);
}

.welcome-card-header h3 {
    font-size: 0.95rem;
    margin: 0;
    font-weight: 700;
}

.welcome-card-body {
    padding: 1rem 1.25rem;
}

/* Stats row */
.welcome-stats {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.welcome-stat {
    flex: 1;
    min-width: 100px;
    text-align: center;
    padding: 0.75rem;
    background: var(--bg-subtle);
    border-radius: 10px;
    border: 1px solid var(--border-light);
}

.welcome-stat-value {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--brand-teal);
    line-height: 1.2;
}

.welcome-stat-label {
    display: block;
    font-size: 0.72rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 0.15rem;
}

/* Active centers chips */
.welcome-centers-today h6 {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.welcome-center-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.welcome-center-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem;
    background: var(--bg-subtle);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    font-size: 0.78rem;
}

.welcome-center-chip strong {
    font-weight: 600;
}

.welcome-center-chip small {
    color: var(--text-muted);
    font-size: 0.7rem;
}

/* Phone team view — 3CX-style extension cards */
.phone-team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 0.5rem;
}
.phone-team-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    padding: 0.5rem 0.4rem;
    border-radius: 8px;
    background: var(--bg-subtle);
    border: 1px solid var(--border-light);
    text-align: center;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    cursor: pointer;
    color: var(--text-primary);
}
.phone-team-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
    color: var(--brand-teal);
}
.phone-team-offline {
    opacity: 0.45;
}
.phone-team-away {
    opacity: 0.7;
    border-color: var(--bs-danger, #dc3545);
}
.phone-team-oncall {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.06);
}
.phone-team-name {
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.2;
}
.phone-team-ext {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: monospace;
}
.phone-team-status {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-weight: 500;
}
.phone-dot-on, .phone-dot-off, .phone-dot-call {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.phone-dot-on {
    background: #22c55e;
    box-shadow: 0 0 4px rgba(34, 197, 94, 0.5);
}
.phone-dot-off {
    background: #6b7280;
}
.phone-dot-away {
    background: #ef4444;
    box-shadow: 0 0 4px rgba(239, 68, 68, 0.4);
}
.phone-dot-call {
    background: #f59e0b;
    animation: phonePulse 1.5s ease-in-out infinite;
}
@keyframes phonePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); }
    50% { box-shadow: 0 0 0 6px rgba(245, 158, 11, 0); }
}

/* Operations grid (staff) — auto-size to fill full width */
.welcome-ops-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 0.75rem;
}

.welcome-ops-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem;
    background: var(--bg-subtle);
    border-radius: 10px;
    border: 1px solid var(--border-light);
    text-align: center;
}

.welcome-ops-item i {
    font-size: 1.3rem;
    color: var(--brand-teal);
    margin-bottom: 0.25rem;
}

.welcome-ops-warn i {
    color: var(--brand-sun);
}

.welcome-ops-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.welcome-ops-warn .welcome-ops-value {
    color: var(--brand-sun);
}

.welcome-ops-label {
    font-size: 0.72rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Clickable variant: card becomes <a> when there's something to drill into.
   Inherits .welcome-ops-item flex layout so the icon/value/label still stack. */
.welcome-ops-link {
    color: inherit;
    cursor: pointer;
    transition: transform 120ms ease-out, box-shadow 120ms ease-out;
}
.welcome-ops-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
}
.welcome-ops-link:focus-visible {
    outline: 2px solid var(--brand-teal);
    outline-offset: 2px;
}

/* Cache status grid */
.welcome-cache-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.5rem;
}

.welcome-cache-item {
    display: flex;
    flex-direction: column;
    padding: 0.4rem 0.6rem;
    background: var(--bg-subtle);
    border-radius: 6px;
    font-size: 0.75rem;
}

.welcome-cache-name {
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    font-size: 0.68rem;
    letter-spacing: 0.03em;
}

.welcome-cache-count {
    font-weight: 700;
    color: var(--brand-teal);
}

/* Activity list */
.welcome-activity-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.welcome-activity-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.3rem 0;
    font-size: 0.8rem;
    border-bottom: 1px solid var(--border-light);
}

.welcome-activity-item:last-child {
    border-bottom: none;
}

.welcome-activity-path {
    color: var(--text-primary);
    font-family: monospace;
    font-size: 0.75rem;
}

.welcome-activity-path i {
    color: var(--brand-teal);
}

/* Quick links */
.welcome-quick-links {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.welcome-quick-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 0.75rem 1.25rem;
    background: var(--bg-subtle);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.15s;
    flex: 1;
    min-width: 80px;
    text-align: center;
}

.welcome-quick-link i {
    font-size: 1.4rem;
    color: var(--brand-teal);
}

.welcome-quick-link:hover {
    border-color: var(--brand-teal);
    background: rgba(0, 180, 216, 0.06);
    color: var(--brand-teal);
    transform: translateY(-1px);
}

/* Consent section */
.welcome-consent {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.welcome-consent-inner {
    padding: 1.5rem 2rem;
}

.welcome-consent-inner h4 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--brand-teal);
    margin-bottom: 1rem;
}

.welcome-consent-text {
    max-height: 280px;
    overflow-y: auto;
    padding: 1rem 1.25rem;
    background: var(--bg-subtle);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    margin-bottom: 1.25rem;
    font-size: 0.82rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.welcome-consent-text h6 {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 1rem;
    margin-bottom: 0.4rem;
}

.welcome-consent-text h6:first-child {
    margin-top: 0;
}

.welcome-consent-text ul {
    padding-left: 1.25rem;
    margin-bottom: 0.5rem;
}

.welcome-consent-text li {
    margin-bottom: 0.3rem;
}

.welcome-consent-text a {
    color: var(--brand-teal);
}

.welcome-consent-action {
    text-align: center;
    padding-top: 0.5rem;
}

.welcome-consent-action .form-check {
    display: inline-flex;
    text-align: left;
    font-size: 0.85rem;
}

.welcome-consent-action .form-check-input:checked {
    background-color: var(--brand-teal);
    border-color: var(--brand-teal);
}

.welcome-consent-action .btn-brand {
    background: var(--brand-teal);
    border-color: var(--brand-teal);
    color: #fff;
    font-weight: 700;
    padding: 0.6rem 2.5rem;
    font-size: 1rem;
    border-radius: 8px;
    transition: all 0.2s;
}

.welcome-consent-action .btn-brand:hover:not(:disabled) {
    background: var(--brand-teal-dark);
    border-color: var(--brand-teal-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 180, 216, 0.25);
}

.welcome-consent-action .btn-brand:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

@media (max-width: 768px) {
    .welcome-hero-inner {
        flex-direction: column;
        text-align: center;
    }
    .welcome-title {
        font-size: 1.5rem;
    }
    .welcome-grid {
        grid-template-columns: 1fr;
    }
    .welcome-stats {
        flex-wrap: wrap;
    }
    .welcome-stat {
        min-width: 80px;
    }
    .welcome-consent-inner {
        padding: 1rem 1.25rem;
    }
}

.otp-input {
    text-align: center;
    font-size: 2rem;
    letter-spacing: 0.5em;
    font-weight: 700;
    padding: 0.75rem;
}

/* ============================================
   Toolbar
   ============================================ */
.toolbar-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
}

.toolbar-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-group {
    flex: 1;
    justify-content: center;
}

.btn-nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--brand-dark);
    color: #fff;
    text-decoration: none;
    font-size: 1rem;
    transition: background 0.15s;
}

.btn-nav:hover {
    background: var(--brand-teal);
    color: #fff;
}

.nav-label {
    font-family: 'Yanone Kaffeesatz', sans-serif;
    font-weight: 600;
    font-size: 1.15rem;
    white-space: nowrap;
    min-width: 200px;
    text-align: center;
}

.btn-today {
    display: inline-block;
    padding: 0.3rem 0.75rem;
    background: var(--brand-teal);
    color: #fff;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.85em;
    font-weight: 600;
    transition: background 0.15s;
}

.btn-today:hover {
    background: var(--brand-teal-dark);
    color: #fff;
}

/* ============================================
   Center Info Bar
   ============================================ */
.center-info-bar {
    background: linear-gradient(135deg, var(--brand-dark), #1a3a5c);
    color: #fff;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.85em;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.center-info-bar .bi {
    color: var(--brand-teal);
}

.center-info-bar .separator {
    opacity: 0.3;
}

.center-info-bar .shift-times {
    margin-left: auto;
    display: flex;
    gap: 0.75rem;
}

.shift-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 600;
}

.shift-badge-m { background: rgba(0, 180, 216, 0.15); color: var(--brand-teal); }
.shift-badge-a { background: rgba(249, 168, 37, 0.15); color: var(--brand-sun); }
.shift-badge-e { background: rgba(111, 66, 193, 0.15); color: #9b7dd4; }

/* ============================================
   Week Grid
   ============================================ */
.week-section-header {
    font-family: 'Yanone Kaffeesatz', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    padding: 0.4rem 0.75rem;
    background: linear-gradient(135deg, var(--brand-dark), #2a3f5f);
    border-left: 4px solid var(--brand-sun);
    border-radius: 0 8px 8px 0;
    margin-bottom: 0.4rem;
}

.week-section-header a {
    color: inherit;
    text-decoration: none;
}

.week-section-header a:hover {
    color: var(--brand-sun);
}

.week-grid-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid rgba(0, 180, 216, 0.15);
    box-shadow: 0 2px 12px rgba(0, 180, 216, 0.08);
}

.week-grid {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.week-grid th,
.week-grid td {
    border: 1px solid var(--border-light);
    padding: 0.4rem;
    vertical-align: top;
}

.week-grid thead th {
    text-align: center;
    background: var(--bg-surface);
    padding: 0.6rem 0.4rem;
    position: sticky;
    top: 0;
    z-index: 1;
}

.week-grid thead th a {
    text-decoration: none;
    color: inherit;
}

.shift-col {
    width: 95px;
    min-width: 95px;
}

.day-col {
    min-width: 130px;
}

.day-name {
    display: block;
    font-size: 0.75em;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 600;
}

.day-num {
    display: block;
    font-family: 'Yanone Kaffeesatz', sans-serif;
    font-size: 1.5em;
    font-weight: 700;
    color: var(--text-primary);
}

.shift-label {
    background: var(--bg-surface);
    text-align: center;
    font-size: 0.8em;
    padding: 0.5rem 0.25rem !important;
}

.shift-label strong {
    font-family: 'Yanone Kaffeesatz', sans-serif;
    font-size: 1.1em;
    display: block;
}

.shift-label .shift-time {
    color: var(--text-muted);
    font-size: 0.9em;
}

.day-cell {
    min-height: 70px;
    transition: background 0.15s;
    padding: 0.5rem !important;
}

.day-cell:hover {
    background: var(--bg-card-hover);
}

.today-col .day-num { color: var(--brand-teal); }
.today-col { background: linear-gradient(180deg, rgba(0, 180, 216, 0.08), transparent); }
.today-cell { background: linear-gradient(135deg, rgba(0, 180, 216, 0.08), transparent); }
.today-cell .day-num { color: var(--brand-teal); font-weight: 700; }

/* Days-axis layout (rows=days, cols=shifts) */
.week-grid-days {
    table-layout: auto;
}

.day-header-col {
    width: 100px;
    min-width: 100px;
}

.shift-header-col {
    text-align: center;
    min-width: 260px;
}

.shift-header-col strong {
    font-family: 'Yanone Kaffeesatz', sans-serif;
    font-size: 1.1em;
}

.shift-header-col .shift-time {
    color: var(--text-muted);
    font-size: 0.85em;
    margin-left: 4px;
}

.day-label {
    background: var(--bg-surface);
    text-align: center;
    padding: 0.5rem 0.4rem !important;
    white-space: nowrap;
}

.day-label a {
    text-decoration: none;
    color: inherit;
}

.day-label .day-name {
    font-size: 0.75em;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 600;
}

.day-label .day-num {
    font-family: 'Yanone Kaffeesatz', sans-serif;
    font-size: 1.3em;
    font-weight: 700;
    color: var(--text-primary);
}

.today-cell .day-num { color: var(--brand-teal); }

.empty-cell {
    display: block;
    min-height: 50px;
}

/* ============================================
   Patient Chips — 3-Row Layout
   ============================================ */
.patient-chip {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0.6rem 0.75rem;
    margin-bottom: 5px;
    border-radius: 8px;
    font-size: 0.9em;
    background: var(--bg-card);
    border-left: 5px solid var(--status-gray);
    overflow: hidden;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.07);
}

.patient-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.12);
}

/* Row 1: Name + status pill */
.chip-row1 {
    display: flex;
    align-items: center;
    gap: 6px;
}

.patient-name {
    font-weight: 700;
    font-size: 1em;
    color: var(--text-primary);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.patient-name:hover { color: var(--brand-teal); }

/* Status pill — replaces the old 6px status dot */
.chip-status-pill {
    margin-left: auto;
    font-size: 0.7em;
    font-weight: 700;
    padding: 1px 8px;
    border-radius: 999px;
    white-space: nowrap;
    line-height: 1.5;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    flex-shrink: 0;
}

.status-pill-green  { background: var(--status-green);  color: #fff; }
.status-pill-yellow { background: var(--status-yellow); color: #1e293b; }
.status-pill-orange { background: var(--status-orange); color: #fff; }
.status-pill-blue   { background: var(--status-blue);   color: #fff; }
.status-pill-gray   { background: var(--status-gray);   color: #fff; }
.status-pill-red    { background: var(--status-red);     color: #fff; }
.status-pill-teal   { background: var(--status-teal);   color: #fff; }

/* Row 2: Emoji-prefixed info items */
.chip-row2 {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.chip-info {
    font-size: 0.85em;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* Row 3: Safety badges (left) + action buttons (right) */
.chip-row3 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.chip-safety {
    display: flex;
    align-items: center;
    gap: 3px;
    flex-wrap: wrap;
}

.chip-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    flex-shrink: 0;
}

.chip-abe-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid #2ecc71;
    border-radius: 4px;
    background: transparent;
    color: #2ecc71;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
}

.chip-abe-btn:hover {
    background: #2ecc71;
    color: #fff;
    transform: scale(1.15);
}

/* .chip-chat-btn removed from the slate 2026-04-24; leave the CSS in
   place in case a future feature wants the same shape. Upload button
   below adopts the orange accent to visually separate it from ABE
   (teal) and email-request (warning). */

.chip-upload-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid #e8702a;
    border-radius: 4px;
    background: rgba(232, 112, 42, 0.12);
    color: #f0a672;
    cursor: pointer;
    flex-shrink: 0;
    font-size: 0.9em;
    text-decoration: none;
    transition: all 0.15s;
}
.chip-upload-btn:hover {
    background: #e8702a;
    color: #fff;
    transform: scale(1.15);
    text-decoration: none;
}

.chip-chat-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid var(--brand-teal);
    border-radius: 4px;
    background: rgba(0, 180, 216, 0.1);
    color: var(--brand-teal);
    cursor: pointer;
    flex-shrink: 0;
    font-size: 0.9em;
    transition: all 0.15s;
}

.chip-chat-btn:hover {
    background: var(--brand-teal);
    color: #fff;
    transform: scale(1.15);
}

.chip-email-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.04);
    color: #95a5a6;
    cursor: pointer;
    flex-shrink: 0;
    font-size: 0.9em;
    transition: all 0.15s;
}

.chip-email-btn:hover {
    background: var(--brand-teal);
    border-color: var(--brand-teal);
    color: #fff;
    transform: scale(1.15);
}

.chip-email-alert {
    border-color: var(--status-red);
    background: rgba(231, 76, 60, 0.12);
    color: var(--status-red);
    animation: pulse-alert 2s ease-in-out infinite;
}

.chip-email-alert:hover {
    background: var(--status-red);
    border-color: var(--status-red);
    color: #fff;
}

@keyframes pulse-alert {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Report age badge */
.report-age {
    font-size: 0.7em;
    font-weight: 700;
    padding: 0 3px;
    border-radius: 3px;
    white-space: nowrap;
}

.report-ok {
    color: var(--status-green);
}

.report-warn {
    color: #b45309;
    background: rgba(251, 191, 36, 0.15);
}

/* Document count badge */
.druck-badge {
    font-size: 0.7em;
    font-weight: 600;
    color: #6366f1;
    background: rgba(99, 102, 241, 0.1);
    padding: 0 3px;
    border-radius: 3px;
    white-space: nowrap;
}

.druck-badge .bi { font-size: 0.85em; margin-right: 1px; }

.dw-badge {
    font-size: 0.7em;
    font-weight: 600;
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
    padding: 0 3px;
    border-radius: 3px;
    white-space: nowrap;
}
.dw-badge .bi { font-size: 0.85em; margin-right: 1px; }

.dw-view-page {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 60px);
}

.dw-view-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.dw-view-info {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.dw-view-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.dw-view-pdf {
    flex: 1;
    min-height: 0;
}

.dw-view-pdf iframe {
    border: none;
    display: block;
}

.dw-type-badge {
    background: rgba(0, 180, 216, 0.15);
    color: var(--brand-teal);
    font-size: 0.8em;
    font-weight: 600;
}

/* Serology flags */

.sero-flag {
    font-size: var(--badge-font-size);
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 3px;
    line-height: 1.3;
    white-space: nowrap;
}

.sero-ok {
    color: var(--status-green);
    background: rgba(25, 135, 84, 0.1);
}

.sero-old {
    color: #b45309;
    background: rgba(251, 191, 36, 0.15);
}

.sero-missing {
    color: #fff;
    background: var(--status-red);
}

.report-old {
    color: var(--status-red);
    background: rgba(220, 53, 69, 0.1);
}

/* ============================================
   Status Colors
   ============================================ */
.patient-chip.status-fest { border-left-color: var(--status-green); background: var(--status-green-bg); }
.patient-chip.status-co-f { border-left-color: var(--status-green); background: var(--status-green-bg); }
.patient-chip.status-vorr { border-left-color: var(--status-yellow); background: var(--status-yellow-bg); }
.patient-chip.status-prov { border-left-color: var(--status-orange); background: var(--status-orange-bg); }
.patient-chip.status-info { border-left-color: var(--status-blue); background: var(--status-blue-bg); }
.patient-chip.status-selb { border-left-color: var(--status-teal); background: var(--status-teal-bg); }
.patient-chip.status-anfr { border-left-color: var(--status-gray); background: var(--status-gray-bg); }
.patient-chip.status-abge { border-left-color: var(--status-red); background: var(--status-red-bg); text-decoration: line-through; opacity: 0.7; }
.patient-chip.status-co-c { border-left-color: var(--status-red); background: var(--status-red-bg); }
.patient-chip.status-co-p { border-left-color: var(--status-orange); background: var(--status-orange-bg); }
.patient-chip.status-co-v { border-left-color: var(--status-yellow); background: var(--status-yellow-bg); }

.status-bg-green { background-color: var(--status-green) !important; }
.status-bg-yellow { background-color: var(--status-yellow) !important; color: #1e293b !important; }
.status-bg-orange { background-color: var(--status-orange) !important; }
.status-bg-blue { background-color: var(--status-blue) !important; }
.status-bg-gray { background-color: var(--status-gray) !important; }
.status-bg-red { background-color: var(--status-red) !important; }
.status-bg-teal { background-color: var(--status-teal) !important; }

.status-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 600;
    color: #fff;
}

/* ============================================
   Day View
   ============================================ */
.shift-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
}

.shift-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-light);
}

.shift-section-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--text-primary);
}

.day-table {
    font-size: 0.9em;
    margin: 0;
}

.day-table th {
    background: var(--bg-surface);
    font-weight: 600;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.day-table td,
.day-table th {
    padding: 0.5rem 0.75rem;
    vertical-align: middle;
}

.day-table tbody tr:hover {
    background: var(--bg-surface);
}

.empty-shift {
    color: var(--text-muted);
    font-style: italic;
    padding: 1rem 0;
}

.empty-calendar-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.empty-calendar-icon {
    font-size: 3rem;
    color: var(--brand-teal);
    opacity: 0.4;
    margin-bottom: 1rem;
}

.empty-calendar-state h3 {
    font-family: 'Yanone Kaffeesatz', sans-serif;
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.empty-calendar-state p {
    font-size: 0.85rem;
}

.muted {
    color: var(--text-muted);
}

/* Notes / Bemerkung */
.notes-content {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 1rem;
    font-family: 'Open Sans', sans-serif;
    font-size: 0.85em;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 500px;
    overflow-y: auto;
    color: var(--text-primary);
    margin: 0;
}

/* ============================================
   Patient Detail Page
   ============================================ */
.patient-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.patient-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.patient-card-header {
    background: var(--bg-surface);
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    font-family: 'Yanone Kaffeesatz', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.patient-card-header .bi {
    color: var(--brand-teal);
}

.patient-card-body {
    padding: 0.75rem 1rem;
}

.detail-table {
    width: 100%;
    font-size: 0.9em;
    margin: 0;
}

.detail-table th {
    width: 120px;
    text-align: left;
    vertical-align: top;
    padding: 0.25rem 0.5rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.detail-table td {
    padding: 0.25rem 0.5rem;
    color: var(--text-primary);
}

/* ============================================
   Patient Detail — Priority Section Borders
   ============================================ */
.priority-safety { border-left: 4px solid var(--status-red) !important; }
.priority-travel { border-left: 4px solid var(--brand-teal) !important; }
.priority-docs { border-left: 4px solid var(--brand-sun) !important; }
.priority-reference { border-left: 4px solid var(--text-muted) !important; }

/* Safety alert glow when serology is missing */
.priority-safety.has-alert {
    box-shadow: 0 0 0 1px var(--status-red), var(--shadow-sm);
}

/* Larger patient detail section headers */
.patient-section-header {
    font-size: 1em;
    font-weight: 700;
    padding: 0.75rem 1rem;
}

/* Mobile accordion for reference sections */
.reference-summary {
    padding: 0.75rem 1rem;
    font-weight: 600;
    font-size: 1em;
    color: var(--text-secondary);
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
}
.reference-summary::-webkit-details-marker { display: none; }
.reference-collapse[open] > .reference-summary .bi-chevron-right {
    transform: rotate(90deg);
}
.reference-summary .bi-chevron-right {
    transition: transform 0.2s;
}

@media (min-width: 768px) {
    .reference-collapse { display: block !important; }
    .reference-summary { display: none !important; }
}

/* ============================================
   PDF Preview
   ============================================ */
.pdf-preview {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.pdf-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-bottom: 3px solid var(--brand-teal);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.pdf-header-left h1 {
    font-family: 'Yanone Kaffeesatz', sans-serif;
    font-size: 1.6rem;
    margin: 0;
    color: var(--text-primary);
}

.pdf-subtitle {
    font-size: 0.85em;
    color: var(--text-secondary);
}

.pdf-header-right {
    text-align: right;
    font-size: 0.85em;
    color: var(--text-secondary);
}

.pdf-header-right strong {
    color: var(--brand-teal);
}

.pdf-week {
    margin-bottom: 1.25rem;
}

.pdf-week-title {
    font-family: 'Yanone Kaffeesatz', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    background: var(--bg-surface);
    padding: 0.3rem 0.6rem;
    border-left: 3px solid var(--brand-teal);
    margin-bottom: 0.4rem;
    border-radius: 0 4px 4px 0;
}

.pdf-table {
    font-size: 0.85em;
}

.pdf-table th {
    background: var(--bg-surface);
    font-size: 0.85em;
}

.pdf-shift-col {
    width: 80px;
    text-align: center !important;
}

.pdf-shift-label {
    background: var(--bg-surface);
    text-align: center;
    font-size: 0.85em;
}

.pdf-day-name {
    display: block;
    font-size: 0.8em;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.pdf-day-date {
    display: block;
    font-size: 1.1em;
    font-weight: 700;
}

.pdf-cell {
    vertical-align: top;
    min-width: 100px;
}

.pdf-patient {
    padding: 3px 0;
    border-bottom: 1px solid var(--border-light);
    line-height: 1.3;
    font-size: 0.9em;
}

.pdf-patient:last-child {
    border-bottom: none;
}

.pdf-st {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    margin-right: 3px;
    vertical-align: middle;
}

.pdf-st-green { background: var(--status-green); }
.pdf-st-yellow { background: var(--status-yellow); }
.pdf-st-orange { background: var(--status-orange); }
.pdf-st-blue { background: var(--status-blue); }
.pdf-st-gray { background: var(--status-gray); }
.pdf-st-red { background: var(--status-red); }
.pdf-st-teal { background: var(--status-teal); }

.pdf-flag {
    font-size: 0.75em;
    color: #dc3545;
    font-weight: 700;
    margin-left: 2px;
}

/* ============================================
   Help / User Guide
   ============================================ */
.text-brand { color: var(--brand-teal) !important; }

.help-sidebar {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    position: sticky;
    top: 80px;
    box-shadow: var(--shadow-sm);
}

.help-sidebar-header {
    background: var(--brand-dark);
    color: #fff;
    padding: 0.75rem 1rem;
    font-family: 'Yanone Kaffeesatz', sans-serif;
    font-size: 1.2rem;
    font-weight: 600;
    border-bottom: 2px solid var(--brand-teal);
}

.help-nav {
    display: flex;
    flex-direction: column;
}

.help-nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9em;
    border-left: 3px solid transparent;
    transition: all 0.15s;
}

.help-nav-link:hover {
    background: var(--bg-surface);
    color: var(--brand-teal);
}

.help-nav-link.active {
    background: rgba(0, 180, 216, 0.08);
    color: var(--brand-teal);
    border-left-color: var(--brand-teal);
    font-weight: 600;
}

.help-section {
    padding-top: 1rem;
    padding-bottom: 1.5rem;
}

.help-section h2 {
    font-family: 'Yanone Kaffeesatz', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-light);
}

.help-section h4 {
    font-family: 'Yanone Kaffeesatz', sans-serif;
    font-size: 1.2rem;
    color: var(--text-primary);
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.help-hero {
    text-align: center;
    padding: 2rem 1rem;
    background: linear-gradient(135deg, rgba(0, 180, 216, 0.05), var(--bg-surface));
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.help-hero h1 {
    font-family: 'Yanone Kaffeesatz', sans-serif;
    font-size: 2.2rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.help-hero .lead {
    color: var(--text-secondary);
    font-size: 1.05em;
}

.help-feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1.25rem;
    text-align: center;
    height: 100%;
    transition: transform 0.15s, box-shadow 0.15s;
}

.help-feature-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.help-feature-card .bi {
    font-size: 2rem;
    color: var(--brand-teal);
    display: block;
    margin-bottom: 0.5rem;
}

.help-feature-card h5 {
    font-family: 'Yanone Kaffeesatz', sans-serif;
    font-size: 1.2rem;
    margin-bottom: 0.3rem;
}

.help-feature-card p {
    font-size: 0.85em;
    color: var(--text-secondary);
    margin: 0;
}

.help-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    height: 100%;
}

.help-card h6 {
    font-size: 0.95em;
    margin-bottom: 0.4rem;
}

.help-card p {
    font-size: 0.85em;
    color: var(--text-secondary);
    margin: 0;
}

.help-steps {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.help-step {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding: 0.75rem 1rem;
    background: var(--bg-surface);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.help-step-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    min-width: 32px;
    background: var(--brand-teal);
    color: #fff;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.9em;
}

.help-step strong {
    display: block;
    margin-bottom: 0.2rem;
}

.help-step p {
    font-size: 0.85em;
    color: var(--text-secondary);
    margin: 0;
}

kbd {
    background: var(--brand-dark);
    color: #fff;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.9em;
}

/* ============================================
   Responsive — Tablet
   ============================================ */
@media (max-width: 992px) {
    #patientSearch { width: 120px !important; }
    .patient-search-results { min-width: 280px; }
}

/* ============================================
   Responsive — Mobile (iPhone / Android)
   ============================================ */
@media (max-width: 768px) {
    /* Global */
    body { font-size: var(--font-size-mobile); }
    main { padding: 0.5rem !important; }

    /* Navbar: stack items, compact */
    .navbar { padding: 0.3rem 0.5rem; }
    .navbar-brand strong { font-size: 1.1rem; }
    .navbar-brand small { display: none !important; }
    .navbar-brand img { width: 28px; height: 28px; }

    .d-flex.align-items-center.gap-2 { gap: 0.3rem !important; }
    .btn-sm { padding: 0.2rem 0.4rem; font-size: 0.75rem; }

    /* Patient search: compact on mobile */
    .patient-search-wrapper { order: 10; }
    #patientSearch { width: 100px !important; font-size: 0.8rem; }
    .patient-search-results { min-width: 260px; left: auto; right: 0; }

    /* Hide less important nav items on small screens */
    .d-none-mobile { display: none !important; }

    /* Toolbar: vertical stack */
    .toolbar-card { padding: 0.5rem; }
    .toolbar-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    .toolbar-group { justify-content: center; }
    .toolbar-group select { max-width: 100% !important; font-size: 0.85rem; }
    .nav-label { min-width: auto; font-size: 0.95rem; }
    .btn-nav { width: 32px; height: 32px; font-size: 0.85rem; }
    .btn-today { font-size: 0.75em; padding: 0.25rem 0.5rem; }
    /* Center info bar: compact stack */
    .center-info-bar {
        flex-direction: column;
        text-align: center;
        gap: 0.25rem;
        padding: 0.5rem;
        font-size: 0.8em;
    }
    .center-info-bar .separator { display: none; }
    .center-info-bar .shift-times {
        margin-left: 0;
        justify-content: center;
    }

    /* Week grid: tighter cells */
    .week-grid-wrapper { border-radius: 8px; }
    .week-grid th, .week-grid td { padding: 0.25rem; }
    .shift-col { width: 55px; min-width: 55px; }
    .day-col { min-width: 80px; }
    .shift-label { font-size: 0.7em; padding: 0.3rem 0.15rem !important; }
    .shift-label strong { font-size: 1em; }
    .day-name { font-size: 0.65em; letter-spacing: 0; }
    .day-num { font-size: 1.1em; }

    /* Patient chips: compact 3-row on mobile */
    .patient-chip {
        font-size: 0.9em;
        padding: 0.4rem 0.5rem;
        border-radius: 6px;
        margin-bottom: 3px;
        border-left-width: 4px;
    }
    .patient-name { font-size: 1em; }
    .chip-status-pill { font-size: 0.65em; padding: 1px 6px; }
    .chip-info { font-size: 0.8em; }
    .druck-badge { font-size: 0.65em; }
    .report-age { font-size: 0.65em; }
    .chip-abe-btn,
    .chip-chat-btn,
    .chip-email-btn { width: 24px; height: 24px; font-size: 0.8em; }

    /* Days-axis: wider columns on mobile so chips have room */
    .day-header-col { width: 60px; min-width: 60px; }
    .shift-header-col { min-width: 140px; }
    .day-label .day-num { font-size: 1em; }
    .day-col { min-width: 110px; }

    /* Day view table: horizontal scroll with sticky first col */
    .day-table { font-size: 0.8em; }
    .day-table th, .day-table td { padding: 0.3rem 0.4rem; white-space: nowrap; }
    .shift-section { padding: 0.75rem; margin-bottom: 0.75rem; }
    .shift-section-header h3 { font-size: 1rem; }


    /* Patient detail: single column */
    .patient-grid { grid-template-columns: 1fr; gap: 0.75rem; }
    .patient-card-header { font-size: 1rem; padding: 0.5rem 0.75rem; }
    .patient-card-body { padding: 0.5rem 0.75rem; }
    .detail-table th { width: 100px; font-size: 0.8em; }
    .detail-table td { font-size: 0.85em; }

    /* Notes */
    .notes-content { font-size: 0.8em; max-height: 300px; padding: 0.75rem; }

    /* Online dropdown */
    .online-dropdown { min-width: 300px !important; }

    /* Footer */
    .footer-brand .row { text-align: center; }
    .footer-brand .col-md-4 { text-align: center !important; }
}

/* ============================================
   Responsive — Small phones (iPhone SE etc)
   ============================================ */
@media (max-width: 375px) {
    #patientSearch { width: 80px !important; }
    .nav-label { font-size: 0.85rem; }
    .shift-col { width: 45px; min-width: 45px; }
    .day-col { min-width: 90px; }
    .patient-chip { font-size: 0.7em; }
}

/* ============================================
   Touch-friendly enhancements
   ============================================ */
@media (hover: none) and (pointer: coarse) {
    /* Larger tap targets on touch devices */
    .patient-chip { min-height: var(--touch-target-mobile); padding: 0.3rem 0.4rem; }
    .btn-nav { width: var(--touch-target-mobile); height: var(--touch-target-mobile); }
    .btn-sm { min-height: 34px; }
    .btn { min-height: var(--touch-target-mobile); }
    .patient-search-item { padding: 0.65rem 0.75rem; }
    .help-nav-link { padding: 0.65rem 1rem; }

    /* Disable hover effects that don't work on touch */
    .patient-chip:hover { transform: none; box-shadow: none; }
    .help-feature-card:hover { transform: none; }
}

/* ============================================
   Dark Theme Overrides — Premium Deep Ocean
   ============================================ */
[data-theme="dark"] .toolbar-card,
[data-theme="dark"] .week-grid-wrapper,
[data-theme="dark"] .stats-section,
[data-theme="dark"] .shift-section,
[data-theme="dark"] .patient-card,
[data-theme="dark"] .help-sidebar,
[data-theme="dark"] .help-feature-card,
[data-theme="dark"] .help-card,
[data-theme="dark"] .help-step {
    background: var(--bg-card);
    border-color: var(--border-color);
    box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .week-grid th,
[data-theme="dark"] .week-grid td {
    border-color: var(--border-light);
}

[data-theme="dark"] .week-grid thead th,
[data-theme="dark"] .shift-label,
[data-theme="dark"] .day-label,
[data-theme="dark"] .stats-header,
[data-theme="dark"] .patient-card-header {
    background: var(--bg-surface);
    color: var(--text-primary);
}

[data-theme="dark"] .patient-chip {
    background: var(--bg-card);
    box-shadow: 0 1px 6px rgba(0,0,0,0.25);
    border-color: var(--border-light);
}

[data-theme="dark"] .patient-chip:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.35);
}

[data-theme="dark"] .patient-chip.status-fest { background: var(--status-green-bg); border-left-color: var(--status-green); }
[data-theme="dark"] .patient-chip.status-co-f { background: var(--status-green-bg); border-left-color: var(--status-green); }
[data-theme="dark"] .patient-chip.status-vorr { background: var(--status-yellow-bg); border-left-color: var(--status-yellow); }
[data-theme="dark"] .patient-chip.status-prov { background: var(--status-orange-bg); border-left-color: var(--status-orange); }
[data-theme="dark"] .patient-chip.status-info { background: var(--status-blue-bg); border-left-color: var(--status-blue); }
[data-theme="dark"] .patient-chip.status-selb { background: var(--status-teal-bg); border-left-color: var(--status-teal); }
[data-theme="dark"] .patient-chip.status-anfr { background: var(--status-gray-bg); border-left-color: #6b7a8d; }
[data-theme="dark"] .patient-chip.status-abge { background: var(--status-red-bg); border-left-color: var(--status-red); }
[data-theme="dark"] .patient-chip.status-co-c { background: var(--status-red-bg); border-left-color: var(--status-red); }
[data-theme="dark"] .patient-chip.status-co-p { background: var(--status-orange-bg); border-left-color: var(--status-orange); }
[data-theme="dark"] .patient-chip.status-co-v { background: var(--status-yellow-bg); border-left-color: var(--status-yellow); }

[data-theme="dark"] .patient-name { color: var(--brand-teal-light); }
[data-theme="dark"] .chip-info { color: var(--text-secondary); }
[data-theme="dark"] .chip-status-pill { opacity: 0.9; }

[data-theme="dark"] .day-num { color: var(--text-primary); }
[data-theme="dark"] .day-name { color: var(--text-muted); }
[data-theme="dark"] .shift-label strong { color: var(--text-primary); }
[data-theme="dark"] .shift-time { color: var(--text-muted); }

[data-theme="dark"] .day-cell { background: transparent; }
[data-theme="dark"] .day-cell:hover { background: var(--bg-card-hover); }
[data-theme="dark"] .today-col,
[data-theme="dark"] .today-cell { background: rgba(94, 212, 245, 0.06); }

[data-theme="dark"] .table { color: var(--text-primary); --bs-table-bg: transparent; }
[data-theme="dark"] .table th { color: var(--text-secondary); background: var(--bg-surface); }
[data-theme="dark"] .table td { border-color: var(--border-light); }
[data-theme="dark"] .table-hover tbody tr:hover { background: var(--bg-card-hover); }

[data-theme="dark"] .center-info-bar { background: linear-gradient(135deg, #0b111e, #162440); }

[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
    background: var(--bg-input);
    color: var(--text-primary);
    border-color: var(--border-color);
}

[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus {
    border-color: var(--brand-teal);
    box-shadow: 0 0 0 3px rgba(0, 180, 216, 0.15);
}

[data-theme="dark"] .form-control::placeholder { color: var(--text-muted); }

[data-theme="dark"] .input-group-text {
    background: var(--bg-surface);
    color: var(--text-muted);
    border-color: var(--border-color);
}

[data-theme="dark"] .modal-content { background: var(--bg-card); color: var(--text-primary); }
[data-theme="dark"] .modal-body { background: var(--bg-card); }
.modal-header-brand { background: var(--brand-dark); border-bottom: 2px solid var(--brand-teal); }
.modal-header-brand .modal-title { color: #fff; }
.modal-header-brand .btn-close { filter: invert(1); }

[data-theme="dark"] .notes-content { background: var(--bg-surface); border-color: var(--border-color); color: var(--text-secondary); }

[data-theme="dark"] .patient-card-header { border-bottom-color: var(--border-color); }
[data-theme="dark"] .patient-card-header .bi { color: var(--brand-teal-light); }
[data-theme="dark"] .patient-card-body { color: var(--text-primary); }
[data-theme="dark"] .detail-table th { color: var(--text-muted); }
[data-theme="dark"] .detail-table td { color: var(--text-primary); }
[data-theme="dark"] .detail-table td a { color: var(--brand-teal-light); }
[data-theme="dark"] .detail-table td code { color: var(--brand-sun); background: rgba(251, 191, 36, 0.1); }

[data-theme="dark"] .stats-total { background: var(--bg-surface); }
[data-theme="dark"] .stats-prev th, [data-theme="dark"] .stats-prev td { color: var(--text-muted) !important; }

[data-theme="dark"] .chat-widget { box-shadow: 0 -4px 30px rgba(0,0,0,0.4); }
[data-theme="dark"] .chat-messages { background: var(--bg-surface); }
[data-theme="dark"] .chat-msg-user { background: rgba(94, 212, 245, 0.08); border-left: 3px solid var(--brand-teal); }
[data-theme="dark"] .chat-msg-bot { background: rgba(61, 214, 140, 0.08); border-left: 3px solid var(--status-green); }
[data-theme="dark"] .chat-msg-head strong { color: var(--brand-teal-light); }
[data-theme="dark"] .chat-msg-body { color: var(--text-primary); }
[data-theme="dark"] .chat-input { background: var(--bg-card); border-color: var(--border-color); }

[data-theme="dark"] .patient-search-results { background: var(--bg-card); border-color: var(--border-color); box-shadow: 0 8px 30px rgba(0,0,0,0.4); }
[data-theme="dark"] .patient-search-item { border-color: var(--border-light); }
[data-theme="dark"] .patient-search-item:hover { background: var(--bg-card-hover); }
[data-theme="dark"] .ps-name { color: var(--brand-teal-light); }
[data-theme="dark"] .ps-meta { color: var(--text-secondary); }

[data-theme="dark"] .online-dropdown { background: var(--bg-card); box-shadow: 0 8px 40px rgba(0,0,0,0.5); }
[data-theme="dark"] .online-sub-header { background: var(--bg-surface); border-color: var(--border-color); color: var(--text-secondary); }

[data-theme="dark"] .footer-brand { background: #080d16; border-top-color: rgba(0, 180, 216, 0.4); }

[data-theme="dark"] .auth-container .card { background: var(--bg-card); box-shadow: 0 8px 40px rgba(0,0,0,0.4); }
[data-theme="dark"] .auth-container .card-body { background: var(--bg-card); }
[data-theme="dark"] .auth-container .card-header { background: linear-gradient(135deg, #080d16, #131b2a); }

/* Login glassmorphism — dark is the default design, so these just ensure consistency */
[data-theme="dark"] .login-form-section .card { background: rgba(24, 34, 52, 0.65); }
[data-theme="dark"] .login-form-section .card-body { background: transparent; }
[data-theme="dark"] .login-form-section .card-header { background: linear-gradient(135deg, rgba(8, 13, 22, 0.8), rgba(19, 27, 42, 0.8)); }
[data-theme="dark"] .login-info-card { background: rgba(24, 34, 52, 0.5); border-color: rgba(255, 255, 255, 0.06); }
[data-theme="dark"] .login-team-member { background: rgba(19, 27, 42, 0.5); }
[data-theme="dark"] .login-restricted { background: rgba(249, 168, 37, 0.06); border-color: rgba(249, 168, 37, 0.15); }

[data-theme="dark"] .treatments-today {
    background: var(--bg-card);
    border-color: rgba(0, 180, 216, 0.12);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .treatment-chip {
    background: rgba(0, 180, 216, 0.04);
    border-color: rgba(0, 180, 216, 0.1);
}

[data-theme="dark"] .treatment-chip:hover {
    background: rgba(0, 180, 216, 0.08);
    border-color: var(--brand-teal);
}

[data-theme="dark"] .alert-info { background: rgba(94, 212, 245, 0.1); color: var(--brand-teal-light); border-color: rgba(94, 212, 245, 0.2); }
[data-theme="dark"] .alert-warning { background: rgba(251, 191, 36, 0.1); color: var(--brand-sun); border-color: rgba(251, 191, 36, 0.2); }
[data-theme="dark"] .alert-secondary { background: var(--bg-surface); color: var(--text-secondary); border-color: var(--border-color); }
[data-theme="dark"] .alert-success { background: rgba(61, 214, 140, 0.1); color: var(--status-green); border-color: rgba(61, 214, 140, 0.2); }
[data-theme="dark"] .alert-danger { background: rgba(248, 113, 113, 0.1); color: var(--status-red); border-color: rgba(248, 113, 113, 0.2); }

[data-theme="dark"] .select-center-page .center-card { background: var(--bg-card); border-color: var(--border-color); }
[data-theme="dark"] .center-card:hover { border-color: var(--brand-teal); box-shadow: 0 4px 24px rgba(0, 180, 216, 0.12); }
[data-theme="dark"] .center-card-body h5 { color: var(--text-primary); }
[data-theme="dark"] .center-card-body p { color: var(--text-secondary); }

[data-theme="dark"] .pdf-preview { background: var(--bg-card); border-color: var(--border-color); }
[data-theme="dark"] .pdf-header { border-color: var(--brand-teal); }

[data-theme="dark"] .help-hero { background: linear-gradient(135deg, #080d16, #151e2e); border-color: var(--border-color); }
[data-theme="dark"] .help-hero h1 { color: var(--text-primary); }
[data-theme="dark"] .help-hero .lead { color: var(--text-secondary); }
[data-theme="dark"] .help-section h2 { color: var(--text-primary); border-color: var(--border-color); }
[data-theme="dark"] .help-nav-link { color: var(--text-secondary); }
[data-theme="dark"] .help-nav-link.active { background: rgba(0, 180, 216, 0.08); color: var(--brand-teal-light); }

[data-theme="dark"] .accordion-button { background: var(--bg-card); color: var(--text-primary); }
[data-theme="dark"] .accordion-button:not(.collapsed) { background: var(--bg-surface); color: var(--brand-teal); }
[data-theme="dark"] .accordion-body { background: var(--bg-card); color: var(--text-secondary); }
[data-theme="dark"] .accordion-item { border-color: var(--border-color); }

/* Dark theme — fix all hardcoded var(--brand-dark) text colors */
[data-theme="dark"] .center-card-body h5,
[data-theme="dark"] .stats-header,
[data-theme="dark"] .day-num,
[data-theme="dark"] .day-label .day-num,
[data-theme="dark"] .shift-section-header h3,
[data-theme="dark"] .chat-msg-head strong,
[data-theme="dark"] .patient-card-header,
[data-theme="dark"] .detail-table td,
[data-theme="dark"] .help-hero h1,
[data-theme="dark"] .help-section h2 { color: var(--text-primary); }

[data-theme="dark"] .center-card-body p,
[data-theme="dark"] .center-card-stats,
[data-theme="dark"] .stats-table th,
[data-theme="dark"] .online-sub-header,
[data-theme="dark"] .chat-msg-head,
[data-theme="dark"] .detail-table th { color: var(--text-secondary); }

/* Dark theme — hardcoded #fff and #f8fafc backgrounds */
[data-theme="dark"] .week-grid-wrapper,
[data-theme="dark"] .center-card { background: var(--bg-card); }

[data-theme="dark"] .patient-chip {
    background: var(--bg-card);
}

[data-theme="dark"] .week-grid thead th,
[data-theme="dark"] .day-table th,
[data-theme="dark"] .online-list table th,
[data-theme="dark"] .shift-label,
[data-theme="dark"] .day-label { background: var(--bg-surface); }

/* Dark theme — hardcoded hover colors */
[data-theme="dark"] .patient-search-item:hover,
[data-theme="dark"] .center-card:hover,
[data-theme="dark"] .day-cell:hover,
[data-theme="dark"] .stats-header:hover { background: var(--bg-card-hover); }

/* Dark theme — text-muted and secondary text fixes */
[data-theme="dark"] .text-muted { color: var(--text-muted) !important; }
[data-theme="dark"] .empty-shift { color: var(--text-muted); }
[data-theme="dark"] .muted { color: var(--text-muted); }

/* Dark theme — links */
[data-theme="dark"] a:not(.btn):not(.nav-link):not(.navbar-brand):not(.patient-search-item):not(.dropdown-item) { color: var(--brand-teal-light); }
[data-theme="dark"] a:not(.btn):hover { color: var(--brand-teal); }

/* Dark theme — Bootstrap component overrides */
[data-theme="dark"] .card { background: var(--bg-card); border-color: var(--border-color); color: var(--text-primary); }
[data-theme="dark"] .card-body { background: var(--bg-card); }
[data-theme="dark"] .dropdown-menu { background: var(--bg-card); border-color: var(--border-color); }
[data-theme="dark"] .dropdown-item { color: var(--text-primary); }
[data-theme="dark"] .dropdown-item:hover { background: var(--bg-card-hover); color: var(--text-primary); }
[data-theme="dark"] .dropdown-divider { border-color: var(--border-color); }
[data-theme="dark"] .list-group-item { background: var(--bg-card); color: var(--text-primary); border-color: var(--border-color); }

/* Dark theme — notes/memo content */
[data-theme="dark"] .notes-content { color: var(--text-primary); }

/* Dark theme buttons */
[data-theme="dark"] .btn-outline-secondary { border-color: var(--border-color); color: var(--text-secondary); }
[data-theme="dark"] .btn-outline-secondary:hover { background: var(--bg-card-hover); color: var(--text-primary); }
[data-theme="dark"] .btn-outline-primary { border-color: var(--brand-teal); color: var(--brand-teal-light); }
[data-theme="dark"] .btn-outline-primary:hover { background: var(--brand-teal); color: #fff; }

/* Dark theme badges */
[data-theme="dark"] .badge.bg-dark { background: var(--bg-surface) !important; }
[data-theme="dark"] .badge.bg-secondary { background: var(--border-color) !important; }
[data-theme="dark"] .badge.bg-info { background: rgba(94, 212, 245, 0.2) !important; color: var(--brand-teal-light) !important; }
[data-theme="dark"] .badge.bg-warning { background: rgba(251, 191, 36, 0.2) !important; color: var(--brand-sun) !important; }
[data-theme="dark"] .badge.bg-light { background: var(--bg-surface) !important; color: var(--text-primary) !important; }
[data-theme="dark"] .text-dark { color: var(--text-primary) !important; }

/* Dark theme scrollbar */
[data-theme="dark"] ::-webkit-scrollbar { width: 8px; height: 8px; }
[data-theme="dark"] ::-webkit-scrollbar-track { background: var(--bg-surface); }
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }
[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: #3a5068; }

/* Dark navbar glow */
[data-theme="dark"] .bg-brand {
    background: linear-gradient(135deg, #080d16, #132240) !important;
    box-shadow: 0 2px 12px rgba(0, 180, 216, 0.08);
}

/* Dark status bar */
[data-theme="dark"] .status-bar { background: #080d16; }
[data-theme="dark"] .office-badge { text-shadow: 0 1px 4px rgba(0,0,0,0.3); }

/* Admin stat cards */
.stat-card {
    background: var(--bs-body-bg, #fff);
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: 0.5rem;
    padding: 1rem;
    text-align: center;
}
.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--brand-teal);
    line-height: 1.2;
}
.stat-label {
    font-size: 0.75rem;
    color: var(--bs-secondary-color, #6c757d);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.25rem;
}
[data-theme="dark"] .stat-card {
    background: #182234;
    border-color: rgba(255,255,255,0.06);
}

/* ============================================
   Office Status — Inline in Contact Card
   ============================================ */
.office-status-inline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding: 0.45rem 0.65rem;
    border-radius: 8px;
    border: 1px solid transparent;
    font-size: 0.82rem;
}

.office-status-icon {
    font-size: 1rem;
    flex-shrink: 0;
    line-height: 1;
}

.office-status-text {
    font-weight: 600;
}

.office-staff-list {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    margin-left: auto;
}

.office-staff-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.15rem 0.5rem;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.15);
    white-space: nowrap;
}

.office-staff-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    animation: live-pulse 2s ease-in-out infinite;
    flex-shrink: 0;
}

/* Color variants */
.office-green {
    background: rgba(46, 204, 113, 0.08);
    border-color: rgba(46, 204, 113, 0.2);
    color: var(--status-green);
}

.office-green .office-staff-chip {
    background: rgba(46, 204, 113, 0.12);
    color: var(--status-green);
}

.office-red {
    background: rgba(231, 76, 60, 0.08);
    border-color: rgba(231, 76, 60, 0.15);
    color: var(--status-red);
}

.office-orange {
    background: rgba(230, 126, 34, 0.08);
    border-color: rgba(230, 126, 34, 0.15);
    color: var(--status-orange);
}

.office-yellow {
    background: rgba(241, 196, 15, 0.08);
    border-color: rgba(241, 196, 15, 0.15);
    color: var(--status-yellow);
}

.office-gray {
    background: rgba(149, 165, 166, 0.08);
    border-color: rgba(149, 165, 166, 0.15);
    color: var(--status-gray);
}

[data-theme="dark"] .office-green {
    background: rgba(61, 214, 140, 0.06);
    border-color: rgba(61, 214, 140, 0.15);
}

[data-theme="dark"] .office-green .office-staff-chip { background: rgba(61, 214, 140, 0.1); }
[data-theme="dark"] .office-red { background: rgba(248, 113, 113, 0.06); border-color: rgba(248, 113, 113, 0.12); color: var(--status-red); }
[data-theme="dark"] .office-orange { background: rgba(245, 158, 11, 0.06); border-color: rgba(245, 158, 11, 0.12); color: var(--status-orange); }
[data-theme="dark"] .office-gray { background: rgba(86, 104, 130, 0.06); border-color: rgba(86, 104, 130, 0.12); color: var(--text-muted); }

@media (max-width: 768px) {
    .office-staff-list { margin-left: 0; width: 100%; }
}

/* ============================================
   Treatments Today — Login Page Map
   ============================================ */
.treatments-today {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-md);
    animation: fadeInUp 0.5s ease-out;
}

.treatments-header {
    padding: 1rem 1.5rem 0.75rem;
    border-bottom: 1px solid var(--border-light);
}

.treatments-title-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.treatments-live-dot {
    width: 8px;
    height: 8px;
    background: var(--status-green);
    border-radius: 50%;
    flex-shrink: 0;
    animation: live-pulse 2s ease-in-out infinite;
    box-shadow: 0 0 6px var(--status-green);
}

@keyframes live-pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 6px var(--status-green); }
    50% { opacity: 0.5; box-shadow: 0 0 2px var(--status-green); }
}

.treatments-title {
    font-family: 'Yanone Kaffeesatz', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

/* SVG Map */
.treatments-map-container {
    position: relative;
    overflow: hidden;
}

.treatments-map-leaflet {
    width: 100%;
    height: 220px;
}

/* Pulsing marker dot */
.map-pulse-marker {
    background: transparent;
    border: none;
}

.map-pulse-marker::before {
    content: '';
    display: block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--brand-teal) 30%, rgba(0, 180, 216, 0.3) 70%, transparent 100%);
    box-shadow: 0 0 8px rgba(0, 180, 216, 0.5), 0 0 20px rgba(0, 180, 216, 0.2);
    animation: mapDotPulse 2.5s ease-in-out infinite;
}

@keyframes mapDotPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.4); opacity: 0.7; }
}

/* Historical marker (last 24 months, not today) */
.map-historical-marker {
    background: transparent;
    border: none;
    cursor: pointer;
}
.map-historical-marker::before {
    content: '';
    display: block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(120, 160, 200, 0.55);
    box-shadow: 0 0 3px rgba(120, 160, 200, 0.6);
    transition: transform 0.15s, background 0.15s;
}
.map-historical-marker:hover::before {
    transform: scale(1.5);
    background: rgba(0, 180, 216, 0.85);
}

/* Leaflet tooltip styling */
.map-tooltip {
    background: var(--bg-card, #182234) !important;
    color: var(--text-primary, #e8edf4) !important;
    border: 1px solid rgba(0, 180, 216, 0.3) !important;
    border-radius: 6px !important;
    padding: 4px 8px !important;
    font-size: 0.78rem !important;
    font-family: 'Open Sans', sans-serif !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
    white-space: nowrap !important;
}

.map-tooltip::before {
    border-right-color: rgba(0, 180, 216, 0.3) !important;
}

/* Hide Leaflet default chrome */
.treatments-map-leaflet .leaflet-control-attribution {
    background: transparent !important;
    font-size: 0.55rem !important;
    color: rgba(255, 255, 255, 0.3) !important;
}

.treatments-map-leaflet .leaflet-control-attribution a {
    color: rgba(255, 255, 255, 0.3) !important;
}

/* Treatment legend — glassmorphic pills */
.treatments-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    justify-content: center;
    padding: 0.75rem 1rem;
}

.treatment-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-primary);
    background: rgba(24, 34, 52, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 180, 216, 0.1);
    white-space: nowrap;
    transition: border-color 0.15s, background 0.15s;
}

.treatment-chip:hover {
    border-color: var(--brand-teal);
    background: rgba(0, 180, 216, 0.08);
}

.treatment-chip-weather {
    color: var(--brand-sun);
    font-size: 0.85em;
    margin-left: 1px;
}

/* Legend chips are anchors to Google Street View — kill default anchor styling */
.treatments-legend .treatment-chip {
    text-decoration: none;
    color: inherit;
}
.treatments-legend .treatment-chip:hover {
    text-decoration: none;
}

/* Light theme overrides */
[data-theme="light"] .login-branding-title {
    color: var(--text-primary);
    text-shadow: none;
}

[data-theme="light"] .login-branding-motto {
    color: var(--text-secondary);
    text-shadow: none;
}

[data-theme="light"] .login-branding-sub {
    color: var(--text-muted);
}

[data-theme="light"] .login-branding-logo {
    border-color: rgba(0, 180, 216, 0.3);
    box-shadow: 0 0 20px rgba(0, 180, 216, 0.1), 0 4px 16px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .login-form-section .card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-color: rgba(0, 180, 216, 0.15);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .login-form-section .card-body { background: transparent; }

[data-theme="light"] .login-form-section .card-header {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(240, 244, 248, 0.9));
    color: var(--text-primary);
}

[data-theme="light"] .login-form-section .card-header h2 { color: var(--text-primary); }

[data-theme="light"] .login-form-section .form-control {
    background: rgba(255, 255, 255, 0.6);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="light"] .login-form-section .input-group-text {
    background: rgba(255, 255, 255, 0.5);
    border-color: var(--border-color);
    color: var(--text-secondary);
}

[data-theme="light"] .login-info-card {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .login-team-member {
    background: rgba(255, 255, 255, 0.5);
}

[data-theme="light"] .login-restricted {
    background: rgba(249, 168, 37, 0.06);
    border-color: rgba(249, 168, 37, 0.2);
}

[data-theme="light"] .treatment-chip {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-color: rgba(0, 180, 216, 0.15);
    color: var(--text-primary);
}

@media (max-width: 768px) {
    .treatments-map-leaflet { height: 180px; }
    .treatments-header { padding: 0.75rem 1rem 0.5rem; }
    .treatments-title { font-size: 1.1rem; }
    .treatments-legend { padding: 0.5rem 0.75rem; gap: 0.25rem; }
    .treatment-chip { font-size: 0.72rem; padding: 0.2rem 0.5rem; }
}

/* ============================================
   PREMIUM ENHANCEMENTS — Deep Ocean Observatory
   Glassmorphism, micro-animations, refined details
   ============================================ */

/* --- Page load fade-in --- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.toolbar-card { animation: fadeInUp 0.4s ease-out; }
.week-grid-wrapper { animation: fadeInUp 0.5s ease-out; }
.week-section-header { animation: fadeIn 0.3s ease-out; }
.welcome-hero { animation: fadeInUp 0.4s ease-out; }
.welcome-card { animation: fadeInUp 0.5s ease-out both; }
.welcome-card:nth-child(2) { animation-delay: 0.06s; }
.welcome-card:nth-child(3) { animation-delay: 0.12s; }
.welcome-card:nth-child(4) { animation-delay: 0.18s; }

/* --- Navbar glass effect --- */
.bg-brand {
    backdrop-filter: blur(12px) saturate(160%);
    -webkit-backdrop-filter: blur(12px) saturate(160%);
}

[data-theme="dark"] .bg-brand {
    background: linear-gradient(135deg, rgba(8, 13, 22, 0.92), rgba(19, 34, 64, 0.92)) !important;
    border-bottom-color: rgba(249, 168, 37, 0.6);
}

[data-theme="light"] .bg-brand {
    background: linear-gradient(135deg, rgba(13, 21, 32, 0.95), rgba(26, 58, 92, 0.95)) !important;
}

/* --- Status bar glassmorphism --- */
.status-bar {
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-bottom: 1px solid rgba(0, 180, 216, 0.12);
}

[data-theme="dark"] .status-bar {
    background: rgba(8, 13, 22, 0.88);
}

[data-theme="light"] .status-bar {
    background: rgba(21, 31, 46, 0.94);
}

.office-badge {
    backdrop-filter: blur(4px);
    background: rgba(0, 180, 216, 0.12);
    border: 1px solid rgba(0, 180, 216, 0.18);
    transition: background 0.3s ease;
}

.status-time {
    font-variant-numeric: tabular-nums;
}

.refresh-progress {
    transition: width 1s linear, background 3s ease;
    box-shadow: 0 0 6px rgba(0, 180, 216, 0.3);
}

.status-refresh-label {
    font-variant-numeric: tabular-nums;
    transition: color 2s ease;
}

/* --- Patient chip enhancements --- */
.patient-chip {
    border: 1px solid rgba(0, 180, 216, 0.06);
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease, border-color 0.2s ease;
    position: relative;
}

.patient-chip::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    box-shadow: 0 0 0 1px rgba(0, 180, 216, 0.2);
}

.patient-chip:hover::after {
    opacity: 1;
}

.patient-chip:hover {
    transform: translateY(-2px) scale(1.005);
    border-color: rgba(0, 180, 216, 0.15);
}

[data-theme="dark"] .patient-chip {
    border: 1px solid rgba(255, 255, 255, 0.04);
}

[data-theme="dark"] .patient-chip:hover {
    border-color: rgba(0, 180, 216, 0.2);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4), 0 0 12px rgba(0, 180, 216, 0.06);
}

/* Patient name subtle glow on hover */
.patient-name {
    transition: color 0.15s ease, text-shadow 0.15s ease;
}

[data-theme="dark"] .patient-chip:hover .patient-name {
    text-shadow: 0 0 12px rgba(94, 212, 245, 0.25);
}

/* --- Serology badge enhancements --- */
.sero-flag {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    cursor: default;
    border: 1px solid transparent;
}

.sero-flag:hover {
    transform: scale(1.15);
    z-index: 1;
}

.sero-ok {
    border-color: rgba(46, 204, 113, 0.2);
}

.sero-old {
    border-color: rgba(251, 191, 36, 0.25);
}

/* Pulse animation for missing serology — draws attention */
@keyframes sero-missing-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.35); }
    50% { box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1); }
}

.sero-missing {
    animation: sero-missing-pulse 2.5s ease-in-out infinite;
    border-color: rgba(231, 76, 60, 0.3);
}

/* --- Report age badge enhancements --- */
.report-age {
    transition: transform 0.15s ease;
}

.report-age:hover {
    transform: scale(1.1);
}

.report-old {
    animation: sero-missing-pulse 2.5s ease-in-out infinite;
}

/* --- Chip action buttons refined --- */
.chip-abe-btn,
.chip-chat-btn,
.chip-email-btn {
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    border-radius: 5px;
}

.chip-abe-btn:hover,
.chip-chat-btn:hover,
.chip-email-btn:hover {
    transform: scale(1.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Dark theme status pill overrides — slightly muted backgrounds */
[data-theme="dark"] .status-pill-green  { background: rgba(61, 214, 140, 0.85); }
[data-theme="dark"] .status-pill-yellow { background: rgba(251, 191, 36, 0.85); color: #1e293b; }
[data-theme="dark"] .status-pill-orange { background: rgba(245, 158, 11, 0.85); }
[data-theme="dark"] .status-pill-blue   { background: rgba(59, 130, 246, 0.85); }
[data-theme="dark"] .status-pill-gray   { background: rgba(100, 116, 139, 0.85); }
[data-theme="dark"] .status-pill-red    { background: rgba(248, 113, 113, 0.85); }
[data-theme="dark"] .status-pill-teal   { background: rgba(94, 212, 245, 0.85); }

[data-theme="dark"] .chip-abe-btn {
    border-color: var(--status-green);
    color: var(--status-green);
}

[data-theme="dark"] .chip-chat-btn {
    background: rgba(94, 212, 245, 0.08);
    border-color: rgba(94, 212, 245, 0.3);
    color: var(--brand-teal-light);
}

[data-theme="dark"] .chip-email-btn {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.12);
    color: var(--text-muted);
}

[data-theme="dark"] .chip-email-alert {
    background: rgba(248, 113, 113, 0.1);
    border-color: rgba(248, 113, 113, 0.4);
    color: var(--status-red);
}

/* --- Calendar grid refinements --- */
.week-grid-wrapper {
    border: 1px solid rgba(0, 180, 216, 0.12);
    transition: box-shadow 0.3s ease;
}

.week-grid-wrapper:hover {
    box-shadow: 0 4px 20px rgba(0, 180, 216, 0.1);
}

.week-section-header {
    position: relative;
    overflow: hidden;
}

.week-section-header::after {
    content: '';
    position: absolute;
    right: -20px;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, rgba(249, 168, 37, 0.08), transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

/* Zebra striping for days-axis rows */
.week-grid-days tbody tr:nth-child(even) .day-cell {
    background: rgba(0, 180, 216, 0.015);
}

[data-theme="dark"] .week-grid-days tbody tr:nth-child(even) .day-cell {
    background: rgba(0, 180, 216, 0.02);
}

/* Day column headers — refined */
.week-grid thead th {
    border-bottom: 2px solid var(--border-color);
    letter-spacing: 0.3px;
}

.day-num {
    transition: color 0.15s ease;
}

.week-grid thead th:hover .day-num {
    color: var(--brand-teal);
}

/* Shift labels — subtle gradient */
.shift-label {
    background: linear-gradient(180deg, var(--bg-surface), rgba(0, 180, 216, 0.02));
}

[data-theme="dark"] .shift-label {
    background: linear-gradient(180deg, var(--bg-surface), rgba(0, 180, 216, 0.03));
}

/* Today column enhanced glow */
.today-col {
    position: relative;
}

[data-theme="dark"] .today-col {
    background: linear-gradient(180deg, rgba(94, 212, 245, 0.08), rgba(94, 212, 245, 0.02));
}

[data-theme="dark"] .today-cell {
    background: linear-gradient(135deg, rgba(94, 212, 245, 0.08), rgba(94, 212, 245, 0.02));
    box-shadow: inset 0 0 20px rgba(94, 212, 245, 0.03);
}

/* --- Druck and DW badge refinements --- */
.druck-badge,
.dw-badge {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    border: 1px solid transparent;
}

.druck-badge:hover,
.dw-badge:hover {
    transform: scale(1.1);
}

[data-theme="dark"] .druck-badge {
    color: #818cf8;
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.15);
}

[data-theme="dark"] .dw-badge {
    color: #34d399;
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.15);
}

/* --- Chat widget glass effect --- */
[data-theme="dark"] .chat-widget {
    background: rgba(24, 34, 52, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(0, 180, 216, 0.1);
    border-bottom: none;
}

/* --- Welcome page card hover --- */
.welcome-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.welcome-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

[data-theme="dark"] .welcome-card:hover {
    border-color: rgba(0, 180, 216, 0.15);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}

.welcome-stat {
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.welcome-stat:hover {
    transform: translateY(-1px);
    border-color: var(--brand-teal);
}

[data-theme="dark"] .welcome-stat {
    background: rgba(0, 180, 216, 0.04);
    border-color: rgba(0, 180, 216, 0.08);
}

/* --- Toolbar card refinement --- */
.toolbar-card {
    border: 1px solid rgba(0, 180, 216, 0.1);
    transition: border-color 0.2s ease;
}

[data-theme="dark"] .toolbar-card {
    background: rgba(24, 34, 52, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.toolbar-card:hover {
    border-color: rgba(0, 180, 216, 0.18);
}

/* --- btn-brand refined glow --- */
.btn-brand {
    position: relative;
    transition: all 0.2s ease;
}

.btn-brand:hover:not(:disabled) {
    box-shadow: 0 4px 16px rgba(0, 180, 216, 0.3), 0 0 0 1px rgba(0, 180, 216, 0.2);
}

/* --- Center cards refined --- */
.center-card {
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.center-card:hover {
    transform: translateY(-3px);
}

[data-theme="dark"] .center-card:hover {
    box-shadow: 0 8px 28px rgba(0, 180, 216, 0.12), 0 0 0 1px rgba(0, 180, 216, 0.15);
}

/* --- Focus states for accessibility --- */
.chip-chat-btn:focus-visible,
.chip-email-btn:focus-visible,
.chip-abe-btn:focus-visible {
    outline: 2px solid var(--brand-teal);
    outline-offset: 2px;
    border-radius: 5px;
}

.patient-name:focus-visible {
    outline: 2px solid var(--brand-teal);
    outline-offset: 1px;
    border-radius: 3px;
}

.btn-nav:focus-visible {
    outline: 2px solid var(--brand-sun);
    outline-offset: 2px;
}

/* --- Mobile: hide non-critical info, keep serology (safety-critical) --- */
@media (max-width: 640px) {
    .druck-badge,
    .dw-badge,
    .report-age {
        display: none !important;
    }
    /* Hide 4th+ chip-info items (hotel) but keep dates/DOB/insurance */
    .chip-info:nth-child(n+4) {
        display: none !important;
    }
    .chip-abe-btn {
        display: none;
    }
    /* Toolbar: hide button labels, compact padding */
    .toolbar-card .btn .btn-label { display: none; }
    .toolbar-card .btn { padding: 0.35rem 0.5rem; }
    /* Compact status bar: show only office badge + session timer */
    .status-bar { font-size: 11px; height: 32px; }
    .status-bar-inner { height: 32px; font-size: 11px; }
    .status-time { display: none; }
    .status-separator:first-of-type { display: none; }
}

/* --- Reduced motion preference --- */
@media (prefers-reduced-motion: reduce) {
    .login-branding,
    .login-form-section,
    .login-info-card,
    .treatments-legend,
    .login-signoff,
    .login-visitor-badge,
    .patient-chip,
    .welcome-card,
    .toolbar-card,
    .week-grid-wrapper,
    .welcome-hero,
    .week-section-header,
    .center-card,
    .sero-missing,
    .chip-email-alert,
    .report-old {
        animation: none !important;
        transition: none !important;
    }
    .refresh-progress {
        transition: width 0.1s linear !important;
    }
    /* Catch-all for any new component that ships with a transition or
       animation. Per-component opt-outs above stay for documentation;
       this clause covers the long tail (mobile-opt 2026-04-28). The
       cap-of-0.01ms keeps state transitions instant without breaking
       anything that polls for `transitionend`. */
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ============================================
   UI Polish — Toast Notifications
   ============================================ */
.toast-container {
    position: fixed;
    top: 50px;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}

.dc-toast {
    pointer-events: auto;
    min-width: 280px;
    max-width: 420px;
    padding: 0.65rem 1rem;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    backdrop-filter: blur(16px) saturate(1.6);
    -webkit-backdrop-filter: blur(16px) saturate(1.6);
    box-shadow: 0 8px 32px rgba(0,0,0,0.18), 0 1px 4px rgba(0,0,0,0.1);
    transform: translateX(120%);
    opacity: 0;
    animation: toastSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.dc-toast.toast-out {
    animation: toastSlideOut 0.3s ease-in forwards;
}

.dc-toast-icon {
    font-size: 1.1em;
    flex-shrink: 0;
}

.dc-toast-msg {
    flex: 1;
    line-height: 1.35;
}

.dc-toast-close {
    background: none;
    border: none;
    opacity: 0.5;
    cursor: pointer;
    padding: 0;
    font-size: 0.9em;
    flex-shrink: 0;
    transition: opacity 0.15s;
}

.dc-toast-close:hover { opacity: 1; }

.dc-toast-info {
    background: rgba(0, 180, 216, 0.12);
    border: 1px solid rgba(0, 180, 216, 0.25);
    color: var(--text-primary);
}
.dc-toast-info .dc-toast-icon { color: var(--brand-teal); }

.dc-toast-success {
    background: rgba(46, 204, 113, 0.12);
    border: 1px solid rgba(46, 204, 113, 0.25);
    color: var(--text-primary);
}
.dc-toast-success .dc-toast-icon { color: var(--status-green); }

.dc-toast-error {
    background: rgba(231, 76, 60, 0.12);
    border: 1px solid rgba(231, 76, 60, 0.3);
    color: var(--text-primary);
}
.dc-toast-error .dc-toast-icon { color: var(--status-red); }

.dc-toast-warn {
    background: rgba(241, 196, 15, 0.12);
    border: 1px solid rgba(241, 196, 15, 0.25);
    color: var(--text-primary);
}
.dc-toast-warn .dc-toast-icon { color: var(--status-yellow); }

[data-theme="dark"] .dc-toast {
    box-shadow: 0 8px 40px rgba(0,0,0,0.45), 0 1px 4px rgba(0,0,0,0.3);
}
[data-theme="dark"] .dc-toast-close { color: var(--text-secondary); }

@keyframes toastSlideIn {
    to { transform: translateX(0); opacity: 1; }
}

@keyframes toastSlideOut {
    to { transform: translateX(120%); opacity: 0; }
}

/* ============================================
   UI Polish — Loading States
   ============================================ */

/* Skeleton shimmer for loading placeholders */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-surface) 25%,
        var(--bg-card-hover) 50%,
        var(--bg-surface) 75%
    );
    background-size: 200% 100%;
    animation: skeletonShimmer 1.8s ease-in-out infinite;
    border-radius: 6px;
}

@keyframes skeletonShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-line {
    height: 0.75rem;
    margin-bottom: 0.5rem;
    border-radius: 4px;
}

.skeleton-line.w-75 { width: 75%; }
.skeleton-line.w-50 { width: 50%; }
.skeleton-line.w-90 { width: 90%; }

/* Patient search loading spinner */
.search-loading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    color: var(--text-muted);
    font-size: 0.85em;
}

.search-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid var(--border-color);
    border-top-color: var(--brand-teal);
    border-radius: 50%;
    animation: searchSpin 0.6s linear infinite;
}

@keyframes searchSpin {
    to { transform: rotate(360deg); }
}

/* Chart skeleton placeholder */
.chart-skeleton {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 200px;
    padding: 1rem 1.5rem;
}

.chart-skeleton-bar {
    flex: 1;
    border-radius: 4px 4px 0 0;
    background: linear-gradient(
        90deg,
        var(--bg-surface) 25%,
        var(--bg-card-hover) 50%,
        var(--bg-surface) 75%
    );
    background-size: 200% 100%;
    animation: skeletonShimmer 1.8s ease-in-out infinite;
}

/* ============================================
   UI Polish — Character Counter
   ============================================ */
.char-counter-wrap {
    position: relative;
}

.char-counter {
    position: absolute;
    bottom: 4px;
    right: 8px;
    font-size: 0.65em;
    color: var(--text-muted);
    pointer-events: none;
    transition: color 0.2s ease;
    font-family: 'Yanone Kaffeesatz', monospace;
    letter-spacing: 0.5px;
}

.char-counter.warn {
    color: var(--status-orange);
}

.char-counter.danger {
    color: var(--status-red);
    font-weight: 700;
}

/* Chat input with counter */
.chat-input {
    position: relative;
    flex-wrap: wrap;
}

.chat-char-counter {
    font-size: 11px;
    color: var(--text-muted);
    text-align: right;
    padding: 2px 8px 0;
    display: block;
    width: 100%;
}

.chat-char-counter.char-warn { color: var(--status-orange); }
.chat-char-counter.char-danger { color: var(--status-red); font-weight: 600; }

.chat-msg-head small {
    font-size: 13px;
}

/* ============================================
   UI Polish — Enhanced Status Bar
   ============================================ */
.status-bar {
    background: linear-gradient(90deg, var(--brand-darker) 0%, rgba(21, 30, 46, 0.95) 100%);
    border-bottom: 1px solid rgba(0, 180, 216, 0.08);
}

[data-theme="dark"] .status-bar {
    background: linear-gradient(90deg, rgba(11, 17, 30, 0.98) 0%, rgba(21, 30, 46, 0.95) 100%);
    border-bottom: 1px solid rgba(0, 180, 216, 0.06);
}

.office-badge {
    transition: background 0.4s ease, transform 0.15s ease;
}

.office-badge:hover {
    transform: scale(1.03);
}

/* Subtle separator between status bar sections */
.status-separator {
    width: 1px;
    height: 12px;
    background: rgba(255,255,255,0.1);
    flex-shrink: 0;
}

/* Enhanced session progress glow at low time */
.refresh-progress.urgent {
    box-shadow: 0 0 8px rgba(231, 76, 60, 0.4);
}

/* ============================================
   UI Polish — Micro-interactions
   ============================================ */

/* Smooth fade for flash alerts */
.alert {
    animation: alertFadeIn 0.3s ease-out;
}

@keyframes alertFadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Search results fade in */
.patient-search-results.show {
    animation: searchDropIn 0.2s ease-out;
}

@keyframes searchDropIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Chat message entrance */
.chat-msg {
    animation: chatMsgIn 0.25s ease-out;
}

@keyframes chatMsgIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Online dropdown smooth entry */
.dropdown-menu.show {
    animation: dropdownFadeIn 0.2s ease-out;
}

@keyframes dropdownFadeIn {
    from { opacity: 0; transform: translateY(-6px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Navbar button hover glow */
.navbar .btn-outline-light:hover,
.navbar .btn-outline-warning:hover {
    box-shadow: 0 0 12px rgba(0, 180, 216, 0.15);
}

/* Patient search input focus glow */
#patientSearch:focus {
    box-shadow: 0 0 0 2px rgba(0, 180, 216, 0.2);
    border-color: rgba(0, 180, 216, 0.4) !important;
}

/* Smooth badge count transitions */
.badge {
    transition: background 0.2s ease, transform 0.15s ease;
}

/* Calendar day column hover highlight */
.day-col:hover {
    background: rgba(0, 180, 216, 0.02);
}

[data-theme="dark"] .day-col:hover {
    background: rgba(0, 180, 216, 0.03);
}

/* ============================================
   Navbar Hamburger Menu — Mobile Responsive
   ============================================ */
.nav-primary-btn { min-width: 36px; min-height: 36px; font-size: 1em; position: relative; }
.chat-unread-dot { position: absolute; top: 2px; right: 2px; width: 8px; height: 8px; background: var(--status-green); border-radius: 50%; border: 2px solid var(--brand-darkest); }
.nav-menu-label { display: none; }
.nav-menu-item-wrap { display: contents; }

@media (max-width: 767.98px) {
    .navbar { position: relative; }
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-surface);
        border-bottom: 1px solid var(--border-color);
        padding: 0.5rem 0;
        z-index: 1050;
        flex-direction: column;
    }
    .nav-menu.show { display: flex; }
    .nav-menu-item {
        display: flex !important;
        align-items: center;
        padding: 0.65rem 1rem;
        border: none !important;
        border-radius: 0 !important;
        text-align: left;
        min-height: 44px;
        color: var(--text-secondary);
        width: 100%;
        justify-content: flex-start;
    }
    .nav-menu-item:hover { background: var(--bg-card-hover); color: var(--text-primary); }
    .nav-menu-label { display: inline; }
    .nav-menu-user {
        display: flex;
        align-items: center;
        padding: 0.75rem 1rem;
        border-bottom: 1px solid var(--border-light);
        color: var(--text-primary);
        font-weight: 600;
    }
    .nav-menu-item-wrap { display: flex; flex-direction: column; }
    .nav-menu-logout { color: var(--bs-danger, #dc3545) !important; border-color: var(--bs-danger, #dc3545) !important; }
    #patientSearch { width: 120px; }
}

@media (min-width: 768px) {
    .nav-menu { display: flex !important; align-items: center; gap: 0.35rem; }
    .nav-menu-user { display: none !important; }
    #patientSearch { width: 160px; }
}

/* --- Status color legend --- */
.status-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 8px 16px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-light);
    border-radius: 8px;
    font-size: 0.85em;
    margin-bottom: 0.75rem;
}
.legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--text-secondary);
}
.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    flex-shrink: 0;
}

/* --- Today pill highlight --- */
.today-col .day-num, .today-cell .day-num {
    background: var(--brand-teal);
    color: white !important;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 700;
}

/* --- Sticky first column on day view --- */
.day-table th:first-child,
.day-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    background: var(--bg-card);
}

/* --- Print: clean output --- */
@media print {
    .status-bar,
    .chat-widget,
    #staleAlert,
    .toolbar-group:last-child,
    .chip-chat-btn,
    .chip-email-btn {
        display: none !important;
    }
    .patient-chip {
        break-inside: avoid;
        box-shadow: none;
    }
}

/* ── Desktop readability: scale up tabbed page fonts ────────── */
@media (min-width: 992px) {
    /* Welcome-NG panels */
    .welng-stage {
        font-size: 1.05rem;   /* base bump from 1rem → 1.05rem */
    }
    .welng-hero-title {
        font-size: 1.8rem;    /* was 1.4rem × 1.3 */
    }
    .welng-hero-meta {
        font-size: 1rem;      /* was 0.85rem */
    }
    .welng-stat-value {
        font-size: 2.4rem;    /* was 1.8rem × 1.33 */
    }
    .welng-stat-label {
        font-size: 0.85rem;   /* was 0.7rem */
    }
    .welng-card-header {
        font-size: 1.05rem;   /* was 0.85rem */
    }
    .welng-ops-tile {
        font-size: 1rem;      /* was 0.85rem */
        padding: 0.85rem 1.1rem;
    }
    .welng-ops-value {
        font-size: 1.5rem;    /* was 1.2rem */
    }
    .welng-phone-card {
        font-size: 1rem;      /* was 0.85rem */
        padding: 0.75rem 1rem;
    }
    .welng-phone-name {
        font-size: 1.05rem;   /* was 0.9rem */
    }
    .welng-center-chip {
        font-size: 0.9rem;    /* was 0.8rem */
    }
    .welng-section-label {
        font-size: 0.95rem;   /* was 0.8rem */
    }

    /* Tables inside welcome-ng panels — bigger on desktop */
    .welng-panel table,
    .welng-panel .table {
        font-size: 1rem !important;   /* override inline 0.88rem */
    }

    /* Tables inside admin panels */
    .admin-panel table,
    .admin-panel .table {
        font-size: 1rem !important;
    }

    /* Tables inside patient panels */
    .patient-panel table,
    .patient-panel .table {
        font-size: 1rem !important;
    }

    /* Tables inside activity baseline panels */
    .abl-panel table,
    .abl-panel .table {
        font-size: 1rem !important;
    }

    /* Chart footer tables in activity baseline */
    .abl-chart-footer table {
        font-size: 0.92rem !important;
    }
}

/* ── Large desktop (1200px+): aggressive scaling for tabbed pages ─ */
@media (min-width: 1200px) {
    /* Admin page */
    .admin-tab { font-size: 1rem; padding: 0.65rem 1rem; }
    .admin-card { font-size: 1.1rem; padding: 1.5rem 2rem; }
    .admin-panel table,
    .admin-panel .table {
        font-size: 1.15rem !important;
    }
    .admin-panel th,
    .admin-panel td {
        padding: 0.6rem 0.8rem !important;
    }

    /* Patient detail */
    .patient-tab { font-size: 1rem; padding: 0.65rem 1rem; }
    .patient-card-glass { font-size: 1.1rem; padding: 1.5rem 2rem; }
    .patient-panel table,
    .patient-panel .table {
        font-size: 1.15rem !important;
    }
    .patient-panel .detail-table td,
    .patient-panel .detail-table th {
        font-size: 1.15rem !important;
        padding: 0.6rem 0.85rem !important;
    }

    /* Activity baseline */
    .abl-tab { font-size: 1rem; padding: 0.65rem 1rem; }
    .abl-card { font-size: 1.1rem; padding: 1.5rem 2rem; }
    .abl-chart-footer table {
        font-size: 1.05rem !important;
    }
}

/* ============================================
   Clinic welcome page — /auth/welcome for role='clinic'
   Shipped 2026-04-24 (CLINIC_WELCOME_V2).  Matches the new
   /auth/login typographic tone: 1440px max, 3rem hero title,
   generous vertical rhythm, brand palette.
   ============================================ */

.welcome-clinic-page {
    max-width: 1440px;
    margin: 0 auto;
    padding: 1.5rem 2rem 3rem;
}

.welcome-clinic-hero {
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.welcome-clinic-hero__title {
    font-family: 'Yanone Kaffeesatz', sans-serif;
    font-size: 3rem;
    font-weight: 700;
    line-height: 1.1;
    color: #fff;
    margin: 0 0 0.5rem;
    letter-spacing: -0.01em;
    text-shadow: 0 2px 12px rgba(0, 180, 216, 0.15), 0 1px 4px rgba(0, 0, 0, 0.3);
}
.welcome-clinic-hero__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.9rem;
    font-size: 1rem;
    color: var(--text-secondary);
}
.welcome-clinic-hero__email { opacity: 0.9; }
.welcome-clinic-hero__last { opacity: 0.75; font-size: 0.95rem; }

/* Personal-context line under the hero — "Last login: …, from DE
   172.22.x.x, Chrome · macOS, 3 logins this month". Deliberately
   calm (opacity 0.72) so it reads as context, not as a stat wall. */
.welcome-clinic-hero__session {
    margin-top: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem 0.7rem;
    font-size: 0.92rem;
    color: var(--text-secondary);
    opacity: 0.78;
}
.welcome-clinic-hero__last-label { font-weight: 500; }
.welcome-clinic-hero__last-value {
    color: #fff;
    opacity: 0.92;
}
.welcome-clinic-hero__dot { opacity: 0.4; padding: 0 0.15rem; }
.welcome-clinic-hero__ip {
    font-family: 'SFMono-Regular', ui-monospace, monospace;
    font-size: 0.85em;
    padding: 0.05rem 0.35rem;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.06);
}

.role-chip {
    display: inline-block;
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.role-chip--clinic { background: rgba(232, 112, 42, 0.2); color: #f0a672; border: 1px solid rgba(232, 112, 42, 0.35); }
.role-chip--staff  { background: rgba(0, 180, 216, 0.2);  color: #58cde1; border: 1px solid rgba(0, 180, 216, 0.35); }
.role-chip--admin  { background: rgba(250, 204, 21, 0.2); color: #f5d066; border: 1px solid rgba(250, 204, 21, 0.4); }

.welcome-clinic-section {
    margin-bottom: 2.5rem;
}
.welcome-clinic-section__title {
    font-family: 'Fraunces', Georgia, serif;
    font-size: 1.75rem;
    font-weight: 500;
    color: #fff;
    margin: 0 0 1.25rem;
    line-height: 1.2;
}

.welcome-clinic-empty {
    padding: 1.5rem 1.75rem;
    border-radius: 12px;
    background: rgba(24, 34, 52, 0.5);
    border: 1px dashed rgba(255, 255, 255, 0.12);
    font-size: 1.05rem;
    color: var(--text-secondary);
}

/* Centre cards — grid that auto-fits so 1, 2, 3, or 4 centres look
   right without per-count rules. */
.centre-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 1.25rem;
}

.centre-card {
    position: relative;
    background: rgba(24, 34, 52, 0.6);
    border: 1px solid rgba(0, 180, 216, 0.12);
    border-radius: 14px;
    padding: 1.5rem 1.6rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s ease, border-color 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.centre-card:hover {
    transform: translateY(-2px);
    border-color: rgba(0, 180, 216, 0.3);
}
.centre-card--stale {
    border-color: rgba(232, 112, 42, 0.35);
    background: linear-gradient(
        to bottom,
        rgba(232, 112, 42, 0.08),
        rgba(24, 34, 52, 0.6) 40%
    );
}
.centre-card__stale-banner {
    margin: -0.25rem -0.25rem 0.25rem;
    padding: 0.55rem 0.9rem;
    border-radius: 8px;
    background: rgba(232, 112, 42, 0.15);
    color: #f0a672;
    font-size: 0.85rem;
    font-weight: 600;
}

.centre-card__header { display: flex; flex-direction: column; gap: 0.2rem; }
.centre-card__name {
    font-family: 'Fraunces', Georgia, serif;
    font-size: 1.35rem;
    font-weight: 500;
    color: #fff;
    margin: 0;
    line-height: 1.25;
}
.centre-card__sub {
    font-size: 0.95rem;
    color: var(--text-secondary);
    opacity: 0.85;
}

.centre-card__stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.6rem;
    padding: 0.75rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.centre-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    text-align: center;
}
.centre-stat__value {
    font-family: 'Yanone Kaffeesatz', sans-serif;
    font-size: 1.65rem;
    font-weight: 700;
    line-height: 1;
    color: var(--brand-teal);
}
.centre-stat__label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    opacity: 0.75;
}

.centre-card__arrivals {
    border-top: 1px dashed rgba(255, 255, 255, 0.08);
    padding-top: 0.85rem;
    margin-top: -0.25rem;
}
.centre-card__arrivals-title {
    font-family: 'Fraunces', Georgia, serif;
    font-size: 0.95rem;
    font-weight: 500;
    margin: 0 0 0.5rem;
    color: #fff;
}
.centre-card__arrivals-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.arrival-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.5rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.03);
    font-size: 0.9rem;
}
.arrival-row:hover { background: rgba(0, 180, 216, 0.08); }
.arrival-row__name { color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.arrival-row__dates {
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-family: 'SFMono-Regular', ui-monospace, monospace;
    white-space: nowrap;
}
.arrival-row__upload {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.9rem;
    height: 1.9rem;
    border-radius: 50%;
    background: rgba(232, 112, 42, 0.15);
    color: #f0a672;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}
.arrival-row__upload:hover {
    background: #e8702a;
    color: #fff;
}

.centre-card__actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.centre-card__actions-primary {
    display: flex; gap: 0.5rem; flex-wrap: wrap;
}
.centre-card__actions .btn-brand {
    background: var(--brand-teal);
    border: none;
    color: #fff;
    font-weight: 600;
    padding: 0.55rem 1rem;
    border-radius: 8px;
}
.centre-card__actions .btn-brand:hover { background: var(--brand-teal-dark); color: #fff; }
.centre-card__actions .btn-outline-primary {
    border-color: var(--brand-teal); color: var(--brand-teal);
    padding: 0.55rem 0.9rem; border-radius: 8px; font-weight: 500;
}
.centre-card__actions .btn-outline-primary:hover {
    background: rgba(0,180,216,0.1); color: var(--brand-teal);
}
.centre-card__public-link {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-decoration: none;
    opacity: 0.85;
}
.centre-card__public-link:hover { opacity: 1; color: var(--brand-teal); }

/* "What we expect you to own" framing strip. */
.framing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.25rem;
}
.framing-card {
    display: block;
    background: rgba(24, 34, 52, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 1.5rem 1.6rem 1.75rem;
    color: inherit;
    text-decoration: none;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.framing-card:hover {
    transform: translateY(-2px);
    border-color: rgba(232, 112, 42, 0.35);
    background: rgba(232, 112, 42, 0.05);
    color: inherit;
}
.framing-card__num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 50%;
    background: rgba(232, 112, 42, 0.2);
    border: 1px solid rgba(232, 112, 42, 0.4);
    color: #f0a672;
    font-family: 'Fraunces', Georgia, serif;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
}
.framing-card__title {
    font-family: 'Fraunces', Georgia, serif;
    font-size: 1.3rem;
    font-weight: 500;
    color: #fff;
    margin: 0 0 0.5rem;
    line-height: 1.25;
}
.framing-card__body {
    font-size: 1rem;
    color: var(--text-secondary);
    margin: 0 0 0.9rem;
    line-height: 1.55;
}
.framing-card__cta {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--brand-teal);
    font-weight: 600;
    font-size: 0.95rem;
}

.welcome-clinic-section--support .support-block {
    max-width: 820px;
}

/* --- Communications card (crm_channel_activity + crm_messages) --- */
.comms-card {
    background: rgba(24, 34, 52, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 1.5rem 1.75rem;
}
.comms-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.comms-stat { display: flex; flex-direction: column; gap: 0.2rem; }
.comms-stat__value {
    font-family: 'Yanone Kaffeesatz', sans-serif;
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--brand-teal);
    line-height: 1;
}
.comms-stat__label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    opacity: 0.75;
}

.comms-list {
    list-style: none;
    margin: 0;
    padding: 0.5rem 0 0;
}
.comms-row {
    display: flex;
    gap: 0.9rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.comms-row:last-child { border-bottom: 0; }
.comms-row__dir {
    flex: 0 0 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
}
.comms-row--inbound  .comms-row__dir {
    background: rgba(0, 180, 216, 0.15);
    color: #58cde1;
}
.comms-row--outbound .comms-row__dir {
    background: rgba(232, 112, 42, 0.15);
    color: #f0a672;
}
.comms-row__body { flex: 1; min-width: 0; }
.comms-row__subject {
    font-size: 0.98rem;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.comms-row__meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
    opacity: 0.75;
    margin-top: 0.15rem;
}
.comms-row__gmail {
    color: var(--brand-teal);
    text-decoration: none;
}
.comms-row__gmail:hover { text-decoration: underline; }

@media (max-width: 768px) {
    .welcome-clinic-page { padding: 1rem 1rem 2rem; }
    .welcome-clinic-hero__title { font-size: 2rem; }
    .welcome-clinic-section__title { font-size: 1.4rem; }
    .centre-card__stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
