:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --neutral-50: #f9fafb;
    --neutral-100: #f3f4f6;
    --neutral-200: #e5e7eb;
    --neutral-300: #d1d5db;
    --neutral-400: #9ca3af;
    --neutral-500: #6b7280;
    --neutral-600: #4b5563;
    --neutral-700: #374151;
    --neutral-800: #1f2937;
    --neutral-900: #111827;
    --bg-body: #f0f4f8;
    --bg-card: #ffffff;
    --bg-sidebar: #1e293b;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
    --sidebar-width: 260px;
}

[data-theme="dark"] {
    --bg-body: #0f172a;
    --bg-card: #1e293b;
    --bg-sidebar: #0f172a;
    --bg-input: #0f172a;
    --bg-table-stripe: #243044;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: #334155;
    --neutral-100: #1e293b;
    --neutral-200: #334155;
    --neutral-300: #475569;
    --shadow: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.4);
    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    margin: 0;
    transition: var(--transition);
}
body.modal-open { overflow: hidden; }

#toastContainer.toast-container {
    position: fixed !important;
    right: 1.25rem !important;
    bottom: 5.75rem !important;
    z-index: 2200 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.6rem !important;
    width: min(24rem, calc(100vw - 2rem));
    margin: 0 !important;
    padding: 0 !important;
    pointer-events: none;
}
.app-toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    padding: 0.85rem 0.95rem;
    border-radius: 0.85rem;
    color: #fff;
    font-size: 0.9rem;
    line-height: 1.4;
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.28);
    animation: toastIn 0.28s ease;
}
.app-toast.is-leaving {
    animation: toastOut 0.2s ease forwards;
}
.app-toast-icon {
    flex: 0 0 auto;
    width: 1.7rem;
    height: 1.7rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
}
.app-toast-body { flex: 1 1 auto; padding-top: 0.1rem; }
.app-toast-close {
    flex: 0 0 auto;
    width: 1.6rem;
    height: 1.6rem;
    border: 0;
    border-radius: 0.4rem;
    background: transparent;
    color: inherit;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.8;
}
.app-toast-close:hover { opacity: 1; background: rgba(255, 255, 255, 0.12); }
.app-toast-success { background: linear-gradient(135deg, #059669, #10b981); }
.app-toast-error { background: linear-gradient(135deg, #dc2626, #ef4444); }
.app-toast-warning { background: linear-gradient(135deg, #d97706, #f59e0b); color: #1f2937; }
.app-toast-info { background: linear-gradient(135deg, #1d4ed8, #2563eb); }
@keyframes toastIn {
    from { opacity: 0; transform: translateY(10px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(8px); }
}

.app-wrapper { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-logo { font-size: 1.75rem; color: var(--primary); }
.sidebar-title { font-size: 1.25rem; font-weight: 700; }

.sidebar-nav { list-style: none; padding: 1rem 0; margin: 0; flex: 1; }
.sidebar-nav li { margin: 0.25rem 0.75rem; }
.sidebar-nav .nav-link {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.75rem 1rem; color: rgba(255,255,255,0.7);
    text-decoration: none; border-radius: 0.5rem;
    transition: var(--transition);
}
.sidebar-nav .nav-link:hover, .sidebar-nav .nav-link.active {
    background: rgba(37,99,235,0.2); color: #fff;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}
.user-info { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; }
.user-name { display: block; font-weight: 600; }
.user-role { display: block; opacity: 0.7; font-size: 0.75rem; }

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.top-bar {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.page-title { font-size: 1.25rem; font-weight: 600; margin: 0; flex: 0 1 auto; white-space: nowrap; }
.sidebar-toggle { color: var(--text-primary); font-size: 1.25rem; }

.content-area { padding: 1.5rem; flex: 1; }

.login-page {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1e293b 0%, #2563eb 100%);
}

.login-container { width: 100%; max-width: 420px; padding: 1rem; }
.login-card {
    background: var(--bg-card);
    border-radius: 1rem;
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
}
.login-card a { color: var(--primary); }

.login-header { text-align: center; margin-bottom: 2rem; }
.login-icon { font-size: 3rem; color: var(--primary); margin-bottom: 0.5rem; }
.demo-accounts { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: center; }
.login-theme {
    display: flex;
    justify-content: center;
    margin-top: 1.25rem;
}
.login-credit {
    margin: 1.25rem 0 0;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    font-size: 0.75rem;
    line-height: 1.4;
    color: var(--text-secondary);
}

.stat-card {
    position: relative;
    overflow: hidden;
    background: var(--bg-card);
    border-radius: 1rem;
    padding: 1.2rem 1.25rem 1.2rem 1.35rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
    animation: statCardIn 0.45s ease both;
}
.stat-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--stat-accent, var(--primary));
}
.stat-card::after {
    content: "";
    position: absolute;
    top: -40%;
    right: -30%;
    width: 8rem;
    height: 8rem;
    border-radius: 50%;
    background: var(--stat-accent, var(--primary));
    opacity: 0.08;
    pointer-events: none;
    transition: transform 0.35s ease, opacity 0.35s ease;
}
.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.12);
}
.stat-card:hover::after { transform: scale(1.25); opacity: 0.14; }
.stat-card .stat-icon {
    width: 48px; height: 48px; border-radius: 0.85rem;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; margin-bottom: 0.75rem;
    background: var(--stat-wash, rgba(37,99,235,0.1));
    color: var(--stat-accent, var(--primary));
    transition: transform 0.25s ease;
}
.stat-card:hover .stat-icon { transform: scale(1.08) rotate(-6deg); }
.stat-card .stat-value { font-size: 1.8rem; font-weight: 800; line-height: 1; letter-spacing: -0.03em; }
.stat-card .stat-label { color: var(--text-secondary); font-size: 0.85rem; margin-top: 0.3rem; font-weight: 600; }
.stat-card.tone-blue,
.stat-card:has(.icon-blue) { --stat-accent: #2563eb; --stat-wash: rgba(37,99,235,0.14); background: linear-gradient(145deg, rgba(37,99,235,0.08), var(--bg-card) 55%); border-color: rgba(37,99,235,0.2); }
.stat-card.tone-green,
.stat-card:has(.icon-green) { --stat-accent: #059669; --stat-wash: rgba(16,185,129,0.16); background: linear-gradient(145deg, rgba(16,185,129,0.1), var(--bg-card) 55%); border-color: rgba(16,185,129,0.22); }
.stat-card.tone-amber,
.stat-card:has(.icon-amber) { --stat-accent: #d97706; --stat-wash: rgba(245,158,11,0.18); background: linear-gradient(145deg, rgba(245,158,11,0.12), var(--bg-card) 55%); border-color: rgba(245,158,11,0.28); }
.stat-card.tone-red,
.stat-card:has(.icon-red) { --stat-accent: #dc2626; --stat-wash: rgba(239,68,68,0.16); background: linear-gradient(145deg, rgba(239,68,68,0.1), var(--bg-card) 55%); border-color: rgba(239,68,68,0.25); }
.row > [class*="col-"]:nth-child(1) .stat-card { animation-delay: 0.04s; }
.row > [class*="col-"]:nth-child(2) .stat-card { animation-delay: 0.08s; }
.row > [class*="col-"]:nth-child(3) .stat-card { animation-delay: 0.12s; }
.row > [class*="col-"]:nth-child(4) .stat-card { animation-delay: 0.16s; }
.row > [class*="col-"]:nth-child(5) .stat-card { animation-delay: 0.2s; }
.row > [class*="col-"]:nth-child(6) .stat-card { animation-delay: 0.24s; }
.row > [class*="col-"]:nth-child(7) .stat-card { animation-delay: 0.28s; }
@keyframes statCardIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.icon-blue { background: rgba(37,99,235,0.1); color: var(--primary); }
.icon-green { background: rgba(16,185,129,0.1); color: var(--success); }
.icon-amber { background: rgba(245,158,11,0.1); color: var(--warning); }
.icon-red { background: rgba(239,68,68,0.1); color: var(--danger); }

.chart-card {
    background: var(--bg-card);
    border-radius: 0.75rem;
    padding: 1.25rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}
.chart-card h5 { font-size: 0.95rem; font-weight: 600; margin-bottom: 1rem; }
.chart-container { position: relative; height: 280px; }

.request-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 1rem;
    transition: var(--transition);
}
.request-card:hover { box-shadow: var(--shadow-lg); border-color: var(--primary); }
.request-card.urgent-highlight { border-left: 4px solid var(--danger); }
.card-header-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem; }
.request-id { font-weight: 600; }
.card-body-row .detail { font-size: 0.875rem; margin-bottom: 0.25rem; color: var(--text-secondary); }
.card-body-row .detail strong { color: var(--text-primary); }
.card-actions { display: flex; gap: 0.5rem; margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid var(--border-color); }

.badge-stat { background: var(--danger) !important; color: #fff; }
.badge-urgent { background: var(--warning) !important; color: #fff; }
.badge-routine { background: var(--neutral-400) !important; color: #fff; }
.badge-pending { background: #6366f1 !important; color: #fff; }
.badge-progress { background: var(--primary) !important; color: #fff; }
.badge-completed { background: var(--success) !important; color: #fff; }
.badge-cancelled { background: var(--neutral-500) !important; color: #fff; }

.ai-score {
    display: inline-block; padding: 0.15rem 0.5rem;
    border-radius: 1rem; font-weight: 600; font-size: 0.8rem;
    background: rgba(37,99,235,0.15); color: var(--primary);
}

.ai-narrative {
    background: linear-gradient(135deg, rgba(37,99,235,0.05), rgba(16,185,129,0.05));
    border: 1px solid rgba(37,99,235,0.2);
    border-radius: 0.75rem;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.form-steps { display: flex; gap: 0; margin-bottom: 2rem; }
.form-step {
    flex: 1; text-align: center; padding: 0.75rem;
    background: var(--neutral-100); border-bottom: 3px solid var(--neutral-300);
    font-size: 0.85rem; font-weight: 500; color: var(--text-secondary);
    transition: var(--transition);
}
.form-step.active { border-bottom-color: var(--primary); color: var(--primary); background: rgba(37,99,235,0.05); }
.form-step.completed { border-bottom-color: var(--success); color: var(--success); }

.form-panel { display: none; }
.form-panel.active { display: block; animation: fadeIn 0.3s ease; }

.stain-suggestion {
    padding: 0.5rem 0.75rem; border-radius: 0.5rem;
    background: rgba(37,99,235,0.08); border: 1px solid rgba(37,99,235,0.2);
    margin-bottom: 0.5rem; cursor: pointer; transition: var(--transition);
    display: flex; justify-content: space-between; align-items: center;
}
.stain-suggestion:hover { background: rgba(37,99,235,0.15); }

.timeline { position: relative; padding-left: 2rem; }
.timeline::before {
    content: ''; position: absolute; left: 0.5rem; top: 0; bottom: 0;
    width: 2px; background: var(--border-color);
}
.timeline-item { position: relative; margin-bottom: 1.25rem; }
.timeline-item::before {
    content: ''; position: absolute; left: -1.65rem; top: 0.25rem;
    width: 10px; height: 10px; border-radius: 50%;
    background: var(--primary); border: 2px solid var(--bg-card);
}

.timeline-special::before { background: #14b8a6; }
.timeline-special .timeline-item::before { background: #0d9488; }
.timeline-ihc::before { background: #3b82f6; }
.timeline-ihc .timeline-item::before { background: #2563eb; }

.timeline-card-header.timeline-special {
    border-left: 4px solid #0d9488;
    padding-left: calc(1rem - 4px);
}
.timeline-card-header.timeline-ihc {
    border-left: 4px solid #2563eb;
    padding-left: calc(1rem - 4px);
}
.timeline-stain-label {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-secondary);
    margin-bottom: 0.15rem;
}
.timeline-stain-list .badge { font-weight: 500; }

.chat-widget { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 1050; }
.chat-toggle {
    width: 56px; height: 56px; border-radius: 50%;
    background: var(--primary); color: #fff; border: none;
    font-size: 1.5rem; cursor: pointer;
    box-shadow: var(--shadow-lg); transition: var(--transition);
}
.chat-toggle:hover { transform: scale(1.1); background: var(--primary-dark); }
.chat-panel {
    display: none; position: absolute; bottom: 70px; right: 0;
    width: 350px; height: 450px;
    background: var(--bg-card); border-radius: 1rem;
    box-shadow: var(--shadow-lg); border: 1px solid var(--border-color);
    flex-direction: column; overflow: hidden;
}
.chat-panel.open { display: flex; }
.chat-header {
    background: var(--primary); color: #fff;
    padding: 0.75rem 1rem; display: flex;
    align-items: center; justify-content: space-between;
    font-weight: 600;
}
.chat-header-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.chat-msg.typing {
    opacity: 0.75;
    font-style: italic;
}
.chat-messages { flex: 1; overflow-y: auto; padding: 1rem; }
.chat-msg { padding: 0.5rem 0.75rem; border-radius: 0.75rem; margin-bottom: 0.5rem; font-size: 0.875rem; max-width: 85%; }
.chat-msg.bot { background: var(--neutral-100); margin-right: auto; }
.chat-msg.user { background: var(--primary); color: #fff; margin-left: auto; }
.chat-input { display: flex; gap: 0.5rem; padding: 0.75rem; border-top: 1px solid var(--border-color); }
.chat-advisory {
    margin: 0;
    padding: 0.4rem 0.85rem;
    font-size: 0.72rem;
    color: var(--text-secondary);
    background: var(--bg-body);
    border-bottom: 1px solid var(--border-color);
}

.heatmap-grid { display: grid; grid-template-columns: auto repeat(24, 1fr); gap: 2px; font-size: 0.65rem; }
.heatmap-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.heatmap-table {
    width: 100%;
    min-width: 42rem;
    border-collapse: separate;
    border-spacing: 2px;
    font-size: 0.65rem;
}
.heatmap-table th,
.heatmap-table td { text-align: center; padding: 0; font-weight: 500; color: var(--text-secondary); }
.heatmap-table .heatmap-cell { min-width: 0.9rem; height: 1.15rem; aspect-ratio: auto; }
.heatmap-cell { aspect-ratio: 1; border-radius: 2px; min-width: 12px; }
.heatmap-label { display: flex; align-items: center; padding-right: 4px; color: var(--text-secondary); }

.fade-in { animation: fadeIn 0.4s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.spinner-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.3);
    display: flex; align-items: center; justify-content: center; z-index: 9999;
}

.filters-bar {
    background: var(--bg-card); border-radius: 0.75rem;
    padding: 1rem; margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

.filter-tab-panel {
    margin-bottom: 1rem;
    border-radius: 1.1rem;
    padding: 0.85rem 0.9rem 0.95rem;
    border: 1px solid var(--border-color);
}

.filter-tab-panel-category {
    background:
        linear-gradient(135deg, rgba(8, 145, 178, 0.14), rgba(37, 99, 235, 0.12)),
        var(--bg-card);
    border-color: color-mix(in srgb, #0891b2 28%, var(--border-color));
    box-shadow: 0 8px 22px rgba(8, 145, 178, 0.08);
}

.filter-tab-panel-pathologist {
    background:
        linear-gradient(135deg, rgba(5, 150, 105, 0.12), rgba(124, 58, 237, 0.10)),
        var(--bg-card);
    border-color: color-mix(in srgb, #059669 26%, var(--border-color));
    box-shadow: 0 8px 22px rgba(5, 150, 105, 0.08);
}

.filter-tab-panel-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 0.55rem;
    padding-left: 0.15rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.filter-tab-panel-category .filter-tab-panel-label {
    color: #0e7490;
}

.filter-tab-panel-pathologist .filter-tab-panel-label {
    color: #047857;
}

.path-filter-tabs,
.stain-category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0.45rem;
    background: color-mix(in srgb, #fff 55%, transparent);
    border: 1px solid color-mix(in srgb, var(--border-color) 70%, transparent);
    border-radius: 0.9rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.path-filter-tab,
.stain-category-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.95rem;
    border-radius: 0.75rem;
    border: 1px solid transparent;
    background: transparent;
    font-size: 0.84rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    color: var(--text-secondary);
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.stain-category-tab i {
    width: 1.65rem;
    height: 1.65rem;
    border-radius: 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    background: color-mix(in srgb, var(--category-color, var(--primary)) 12%, transparent);
    color: var(--category-color, var(--primary));
    transition: background 0.2s ease, color 0.2s ease;
}

.stain-category-tab-special { --category-color: #0891b2; }
.stain-category-tab-ihc { --category-color: #2563eb; }

.path-filter-tab {
    --path-color: var(--primary);
    color: color-mix(in srgb, var(--path-color) 72%, var(--text-secondary));
}

.path-filter-tab::before {
    content: '';
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 999px;
    background: var(--path-color);
    opacity: 0.55;
    flex-shrink: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.path-filter-tab:hover,
.stain-category-tab:hover {
    color: var(--category-color, var(--path-color, var(--primary)));
    background: color-mix(in srgb, var(--category-color, var(--path-color, var(--primary))) 8%, var(--bg-card));
    transform: translateY(-1px);
}

.path-filter-tab:hover::before {
    opacity: 0.85;
}

.path-filter-tab.active,
.stain-category-tab.active {
    background: var(--bg-card);
    color: var(--category-color, var(--path-color, var(--primary)));
    border-color: color-mix(in srgb, var(--category-color, var(--path-color, var(--primary))) 22%, var(--border-color));
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 6px 18px color-mix(in srgb, var(--category-color, var(--path-color, var(--primary))) 12%, transparent);
}

.path-filter-tab.active::before {
    opacity: 1;
    transform: scale(1.15);
}

.stain-category-tab.active i {
    background: var(--category-color, var(--primary));
    color: #fff;
}

.path-filter-counts,
.stain-category-count {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--category-color, var(--path-color, var(--primary))) 10%, var(--bg-card));
    color: color-mix(in srgb, var(--category-color, var(--path-color, var(--primary))) 80%, var(--text-secondary));
}

.path-filter-tab.active .path-filter-counts,
.stain-category-tab.active .stain-category-count {
    background: color-mix(in srgb, var(--category-color, var(--path-color, var(--primary))) 14%, var(--bg-card));
    color: var(--category-color, var(--path-color, var(--primary)));
}

.workload-period-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1rem 1.1rem;
    height: 100%;
}

.workload-period-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
    color: var(--text-primary);
}

.workload-period-head span {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.workload-period-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.workload-period-stats strong {
    display: block;
    font-size: 1.35rem;
    line-height: 1.1;
    color: var(--text-primary);
}

.workload-period-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    margin-bottom: 0.2rem;
}

.workload-label-special,
.workload-col-special {
    color: #0891b2;
}

.workload-label-ihc,
.workload-col-ihc {
    color: #2563eb;
}

.workload-table .workload-group-head {
    background: rgba(37, 99, 235, 0.08);
    border-bottom: 1px solid var(--border-color);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.workload-table .workload-path-col {
    min-width: 10rem;
    white-space: nowrap;
}

.workload-table thead th {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.workload-table tbody tr:nth-child(even) {
    background: rgba(148, 163, 184, 0.06);
}

.workload-total-row th {
    background: rgba(37, 99, 235, 0.08);
    border-top: 2px solid var(--border-color);
}

[data-theme="dark"] .workload-period-card {
    background: var(--bg-card);
    border-color: var(--border-color);
}

[data-theme="dark"] .workload-table .workload-group-head,
[data-theme="dark"] .workload-total-row th {
    background: rgba(37, 99, 235, 0.15);
}

.queue-table .priority-stat { background: rgba(239,68,68,0.08); }
.queue-table .priority-urgent { background: rgba(245,158,11,0.08); }

.report-content {
    background: var(--bg-card); border-radius: 0.75rem;
    padding: 2rem; border: 1px solid var(--border-color);
    white-space: pre-wrap; line-height: 1.7;
}

.draft-box {
    background: var(--neutral-100);
    border: 1px solid var(--border-color);
}

.batch-bar {
    display: none; position: sticky; bottom: 0;
    background: var(--bg-card); border-top: 2px solid var(--primary);
    padding: 0.75rem 1rem; gap: 0.75rem; align-items: center;
    flex-wrap: wrap;
    z-index: 50; box-shadow: 0 -4px 12px rgba(0,0,0,0.1);
}
.batch-bar-divider {
    width: 1px;
    align-self: stretch;
    min-height: 1.75rem;
    background: var(--border-color);
    margin: 0 0.25rem;
}
.label-printer-select { min-width: 11rem; max-width: 16rem; }

.btn-print-labels {
    --bs-btn-bg: #0891b2;
    --bs-btn-border-color: #0891b2;
    --bs-btn-hover-bg: #0e7490;
    --bs-btn-hover-border-color: #0e7490;
    --bs-btn-active-bg: #155e75;
    --bs-btn-active-border-color: #155e75;
    --bs-btn-color: #fff;
    --bs-btn-hover-color: #fff;
    --bs-btn-active-color: #fff;
    background-color: #0891b2;
    border-color: #0891b2;
    color: #fff;
}

.btn-print-labels:hover,
.btn-print-labels:focus {
    background-color: #0e7490;
    border-color: #0e7490;
    color: #fff;
}

/* Stain tag multi-select */
.stain-tag-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.stain-filter-btn {
    border: 2px solid transparent;
    cursor: pointer;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.stain-filter-btn:hover {
    transform: translateY(-1px);
}

.stain-filter-btn.stain-filter-active {
    box-shadow: 0 0 0 2px var(--bg-card), 0 0 0 4px rgba(255, 255, 255, 0.85);
}

.stain-filter-btn.stain-tag-special.stain-filter-active {
    box-shadow: 0 0 0 2px var(--bg-card), 0 0 0 4px #14b8a6;
}

.stain-filter-btn.stain-tag-ihc.stain-filter-active {
    box-shadow: 0 0 0 2px var(--bg-card), 0 0 0 4px #3b82f6;
}

.stain-picker-combobox {
    position: relative;
}

.stain-suggestion-list {
    position: absolute;
    z-index: 80;
    top: calc(100% + 0.25rem);
    left: 0;
    right: 0;
    max-height: 180px;
    overflow-y: auto;
    margin: 0;
    padding: 0.35rem 0;
    list-style: none;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
}

.stain-suggestion-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.85rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-primary);
    border-left: 3px solid transparent;
}

.stain-suggestion-item.stain-tag-special {
    border-left-color: #14b8a6;
}

.stain-suggestion-item.stain-tag-ihc {
    border-left-color: #3b82f6;
}

.stain-suggestion-item:hover {
    background: var(--neutral-100);
}

.stain-suggestion-empty,
.stain-suggestion-more {
    padding: 0.65rem 0.85rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-style: italic;
}

.stain-tags-field .form-label {
    margin-bottom: 0.35rem;
}

.stain-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    min-height: 52px;
    padding: 0.65rem 0.75rem;
    border: 1px dashed var(--border-color);
    border-radius: 0.5rem;
    background: var(--neutral-100);
}

.stain-tags-placeholder {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-style: italic;
}

.stain-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.2;
    color: #fff;
    white-space: nowrap;
}

.stain-tag-static {
    cursor: default;
    font-size: 0.75rem;
    opacity: 0.95;
}

.stain-tag-special {
    background: linear-gradient(135deg, #0d9488, #14b8a6);
    box-shadow: 0 1px 2px rgba(13, 148, 136, 0.35);
}

.stain-tag-ihc {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    box-shadow: 0 1px 2px rgba(37, 99, 235, 0.35);
}

.stain-tag-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    margin-left: 0.15rem;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s ease;
}

.stain-tag-remove:hover {
    background: rgba(255, 255, 255, 0.45);
}

.confirm-table td .stain-tag {
    margin: 0.15rem 0.25rem 0.15rem 0;
}

.selected-stain-summary {
    padding: 0.5rem 0.75rem;
    background: rgba(37, 99, 235, 0.08);
    border-radius: 0.5rem;
    border: 1px solid rgba(37, 99, 235, 0.2);
    color: var(--text-primary);
}

.confirm-table th {
    color: var(--text-secondary);
    vertical-align: top;
}

.batch-stains-list .list-group-item {
    background: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-primary);
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .chat-panel { width: calc(100vw - 2rem); right: -0.5rem; }
    .form-steps { flex-direction: column; }
}

@media print {
    .sidebar, .top-bar, .chat-widget, .filters-bar { display: none !important; }
    .main-content { margin-left: 0; }
}

/* Panel cards (Bootstrap card replacements) */
.panel-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    box-shadow: var(--shadow);
    overflow: hidden;
}
.panel-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    background: transparent;
}
.panel-card-header h5 { color: var(--text-primary); margin: 0; }
.panel-card-body { padding: 1.25rem; }

.admin-tabs .nav-tabs {
    border-bottom: 2px solid var(--border-color, #dee2e6);
    gap: 0.25rem;
}

.admin-tabs .nav-link {
    color: var(--text-muted, #6c757d);
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    padding: 0.75rem 1rem;
    font-weight: 600;
    font-size: 0.875rem;
}

.admin-tabs .nav-link:hover {
    color: var(--primary);
    border-bottom-color: rgba(var(--bs-primary-rgb, 13, 110, 253), 0.35);
}

.admin-tabs .nav-link.active {
    color: var(--primary);
    background: transparent;
    border-bottom-color: var(--primary);
}

.admin-tabs .nav-link i {
    margin-right: 0.35rem;
}

.stain-catalogue-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.stain-catalogue-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
}
.stain-category-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-left: auto;
}
.stain-category-toolbar .stain-category-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    border: 2px solid transparent;
    font-weight: 600;
    font-size: 0.82rem;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.12);
}
.stain-category-panel[hidden] { display: none !important; }

.stain-category-toolbar .stain-category-btn-special {
    --bs-btn-bg: #0891b2;
    --bs-btn-border-color: #0891b2;
    --bs-btn-hover-bg: #0e7490;
    --bs-btn-hover-border-color: #0e7490;
    --bs-btn-active-bg: #155e75;
    --bs-btn-active-border-color: #155e75;
    --bs-btn-color: #fff;
    --bs-btn-hover-color: #fff;
    --bs-btn-active-color: #fff;
    background-color: #0891b2 !important;
    border-color: #0891b2 !important;
    color: #fff !important;
}

.stain-category-toolbar .stain-category-btn-special:hover,
.stain-category-toolbar .stain-category-btn-special:focus {
    background-color: #0e7490 !important;
    border-color: #0e7490 !important;
    color: #fff !important;
}

.stain-category-toolbar .stain-category-btn-ihc {
    --bs-btn-bg: #2563eb;
    --bs-btn-border-color: #2563eb;
    --bs-btn-hover-bg: #1d4ed8;
    --bs-btn-hover-border-color: #1d4ed8;
    --bs-btn-active-bg: #1e40af;
    --bs-btn-active-border-color: #1e40af;
    background-color: #2563eb !important;
    border-color: #2563eb !important;
    color: #fff !important;
}

.stain-category-toolbar .stain-category-btn-ihc:hover,
.stain-category-toolbar .stain-category-btn-ihc:focus {
    background-color: #1d4ed8 !important;
    border-color: #1d4ed8 !important;
    color: #fff !important;
}

.stain-category-toolbar .stain-category-btn.is-active {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.35), 0 4px 14px rgba(15, 23, 42, 0.18);
}
.stain-category-toolbar .stain-category-btn-special.is-active {
    border-color: #67e8f9 !important;
}
.stain-category-toolbar .stain-category-btn-ihc.is-active {
    border-color: #93c5fd !important;
}

.stain-category-btn-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.65rem;
    padding: 0.12rem 0.5rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.22);
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.2;
}

.stain-category-panel .table thead th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-secondary);
    background: transparent;
}

.stain-category-empty {
    padding: 1rem 1.15rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ---- Dark mode: Bootstrap & component overrides ---- */
[data-theme="dark"] .card,
[data-theme="dark"] .panel-card {
    background: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .card-header,
[data-theme="dark"] .panel-card-header {
    background: rgba(0,0,0,0.15);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .card-body,
[data-theme="dark"] .panel-card-body {
    color: var(--text-primary);
}

[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select,
[data-theme="dark"] .input-group-text {
    background-color: var(--bg-input);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus {
    background-color: var(--bg-input);
    border-color: var(--primary);
    color: var(--text-primary);
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.25);
}

[data-theme="dark"] .form-control::placeholder {
    color: var(--text-muted);
}

[data-theme="dark"] .form-label,
[data-theme="dark"] .form-check-label {
    color: var(--text-primary);
}

[data-theme="dark"] .table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--text-primary);
    --bs-table-border-color: var(--border-color);
    --bs-table-striped-bg: var(--bg-table-stripe);
    --bs-table-striped-color: var(--text-primary);
    --bs-table-hover-bg: rgba(37, 99, 235, 0.08);
    --bs-table-hover-color: var(--text-primary);
    color: var(--text-primary);
}

[data-theme="dark"] .table thead th {
    background: rgba(0,0,0,0.2);
    color: var(--text-secondary);
    border-color: var(--border-color);
}

[data-theme="dark"] .table td,
[data-theme="dark"] .table th {
    border-color: var(--border-color);
}

[data-theme="dark"] .queue-table .priority-stat {
    background: rgba(239, 68, 68, 0.12);
}

[data-theme="dark"] .queue-table .priority-urgent {
    background: rgba(245, 158, 11, 0.12);
}

[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,
[data-theme="dark"] .dropdown-item:focus {
    background: rgba(37, 99, 235, 0.15);
    color: var(--text-primary);
}

[data-theme="dark"] .pagination .page-link {
    background: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .pagination .page-item.active .page-link {
    background: var(--primary);
    border-color: var(--primary);
}

[data-theme="dark"] .pagination .page-item.disabled .page-link {
    background: var(--bg-card);
    color: var(--text-muted);
}

[data-theme="dark"] .text-muted {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .draft-box,
[data-theme="dark"] .bg-light {
    background-color: var(--neutral-100) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] pre {
    color: var(--text-primary);
}

[data-theme="dark"] .ai-narrative {
    background: linear-gradient(135deg, rgba(37,99,235,0.12), rgba(16,185,129,0.08));
    border-color: rgba(37,99,235,0.3);
    color: var(--text-primary);
}

[data-theme="dark"] .form-step {
    background: var(--neutral-100);
    border-bottom-color: var(--neutral-300);
    color: var(--text-secondary);
}

[data-theme="dark"] .form-step.active {
    background: rgba(37,99,235,0.12);
    color: var(--primary);
}

[data-theme="dark"] .stain-suggestion {
    background: rgba(37,99,235,0.12);
    border-color: rgba(37,99,235,0.3);
    color: var(--text-primary);
}

[data-theme="dark"] .stain-suggestion small {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .chat-msg.bot {
    background: var(--neutral-200);
    color: var(--text-primary);
}

[data-theme="dark"] .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

[data-theme="dark"] .btn-link,
[data-theme="dark"] .sidebar-toggle {
    color: var(--text-primary);
}

[data-theme="dark"] .btn-outline-primary {
    color: #60a5fa;
    border-color: #60a5fa;
}

[data-theme="dark"] .btn-outline-primary:hover {
    background: var(--primary);
    color: #fff;
}

[data-theme="dark"] .btn-outline-secondary {
    color: var(--text-secondary);
    border-color: var(--border-color);
}

[data-theme="dark"] .btn-outline-secondary:hover {
    background: var(--neutral-200);
    color: var(--text-primary);
}

[data-theme="dark"] .alert-warning {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.4);
    color: #fcd34d;
}

[data-theme="dark"] .alert-info {
    background: rgba(37, 99, 235, 0.15);
    border-color: rgba(37, 99, 235, 0.4);
    color: #93c5fd;
}

[data-theme="dark"] .alert-danger {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.4);
    color: #fca5a5;
}

[data-theme="dark"] .alert-success {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.4);
    color: #6ee7b7;
}

[data-theme="dark"] .report-content:not(:has(.ai-report)) {
    background: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .batch-bar {
    background: var(--bg-card);
    box-shadow: 0 -4px 12px rgba(0,0,0,0.3);
}

[data-theme="dark"] .theme-toggle .form-check-input {
    background-color: var(--neutral-200);
    border-color: var(--border-color);
}

[data-theme="dark"] .theme-toggle .form-check-input:checked {
    background-color: var(--primary);
}

/* DataTables dark mode */
[data-theme="dark"] .dataTables_wrapper .dataTables_length,
[data-theme="dark"] .dataTables_wrapper .dataTables_filter,
[data-theme="dark"] .dataTables_wrapper .dataTables_info,
[data-theme="dark"] .dataTables_wrapper .dataTables_paginate {
    color: var(--text-secondary);
}

[data-theme="dark"] .dataTables_wrapper .dataTables_filter input,
[data-theme="dark"] .dataTables_wrapper .dataTables_length select {
    background: var(--bg-input);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] table.dataTable thead th {
    border-bottom-color: var(--border-color) !important;
}

[data-theme="dark"] table.dataTable.no-footer {
    border-bottom-color: var(--border-color);
}

[data-theme="dark"] .card.border-0.shadow-sm {
    background: var(--bg-card) !important;
    box-shadow: var(--shadow) !important;
}

[data-theme="dark"] code {
    color: #f472b6;
    background: rgba(0,0,0,0.3);
    padding: 0.1em 0.35em;
    border-radius: 0.25rem;
}

[data-theme="dark"] .filter-tab-panel-category {
    background:
        linear-gradient(135deg, rgba(8, 145, 178, 0.22), rgba(37, 99, 235, 0.16)),
        var(--bg-card);
}

[data-theme="dark"] .filter-tab-panel-pathologist {
    background:
        linear-gradient(135deg, rgba(5, 150, 105, 0.18), rgba(124, 58, 237, 0.14)),
        var(--bg-card);
}

[data-theme="dark"] .filter-tab-panel-category .filter-tab-panel-label {
    color: #5eead4;
}

[data-theme="dark"] .filter-tab-panel-pathologist .filter-tab-panel-label {
    color: #6ee7b7;
}

[data-theme="dark"] .path-filter-tabs,
[data-theme="dark"] .stain-category-tabs {
    background: color-mix(in srgb, var(--neutral-200) 70%, var(--bg-card));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

[data-theme="dark"] .path-filter-tab.active,
[data-theme="dark"] .stain-category-tab.active {
    background: color-mix(in srgb, var(--bg-card) 92%, #fff 8%);
}

[data-theme="dark"] .stain-category-btn[aria-expanded="true"] {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.12), 0 4px 14px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .stain-category-toolbar .stain-category-btn-special {
    background-color: #0891b2 !important;
    border-color: #0891b2 !important;
    color: #fff !important;
}

[data-theme="dark"] .stain-category-toolbar .stain-category-btn-ihc {
    background-color: #2563eb !important;
    border-color: #2563eb !important;
    color: #fff !important;
}

[data-theme="dark"] .login-card {
    background: var(--bg-card);
}

[data-theme="dark"] .login-card .text-muted {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] h1, [data-theme="dark"] h2, [data-theme="dark"] h3,
[data-theme="dark"] h4, [data-theme="dark"] h5, [data-theme="dark"] h6 {
    color: var(--text-primary);
}

[data-theme="dark"] .chart-card h5,
[data-theme="dark"] .page-title {
    color: var(--text-primary);
}

[data-theme="dark"] .stat-card .stat-value {
    color: var(--text-primary);
}

[data-theme="dark"] .request-id,
[data-theme="dark"] .card-body-row .detail strong {
    color: var(--text-primary);
}

[data-theme="dark"] .ai-score {
    background: rgba(37, 99, 235, 0.25);
    color: #93c5fd;
}

[data-theme="dark"] .badge-routine {
    background: var(--neutral-500) !important;
}

[data-theme="dark"] .stain-tags-container {
    background: rgba(0, 0, 0, 0.2);
    border-color: var(--border-color);
}

[data-theme="dark"] .stain-tag-special {
    background: linear-gradient(135deg, #0f766e, #0d9488);
}

[data-theme="dark"] .stain-tag-ihc {
    background: linear-gradient(135deg, #1d4ed8, #2563eb);
}

[data-theme="dark"] .selected-stain-summary {
    background: rgba(37, 99, 235, 0.15);
    border-color: rgba(37, 99, 235, 0.35);
}

[data-theme="dark"] .list-group-item.active {
    background: var(--primary);
    border-color: var(--primary);
}

[data-theme="dark"] .batch-stains-list .list-group-item:not(.active):hover {
    background: rgba(37, 99, 235, 0.1);
}

[data-theme="dark"] a:not(.btn):not(.nav-link):not(.alert-link) {
    color: #60a5fa;
}

[data-theme="dark"] .alert-link {
    color: #93c5fd;
}

/* ---- New Request (single-page) ---- */
.nr-page {
    max-width: 1120px;
    margin: 0 auto;
}

.content-area:has(.nr-compact) {
    padding: 0.85rem 1rem 0.75rem;
}

.nr-compact.nr-page {
    max-height: calc(100vh - 4.25rem);
    overflow: visible;
}

.nr-hero {
    margin-bottom: 0.75rem;
}

.nr-compact .nr-hero {
    margin-bottom: 0.55rem;
}

.nr-eyebrow {
    margin: 0 0 0.2rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--primary);
}

.nr-hero h1 {
    margin: 0;
    font-size: clamp(1.25rem, 2vw, 1.55rem);
    font-weight: 750;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.nr-lede {
    margin: 0;
    max-width: 40rem;
    color: var(--text-secondary);
    font-size: 0.98rem;
    line-height: 1.5;
}

.nr-errors { margin-bottom: 0.65rem; }

.nr-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 0.85rem;
    align-items: start;
}

.nr-main {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    min-width: 0;
}

.nr-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0.85rem;
    padding: 0.85rem 1rem;
    box-shadow: var(--shadow);
    overflow: visible;
}

.nr-section-stains {
    position: relative;
    z-index: 2;
}

.nr-section-head {
    display: flex;
    gap: 0.65rem;
    align-items: center;
    margin-bottom: 0.65rem;
}

.nr-section-num {
    flex: 0 0 auto;
    width: 1.85rem;
    height: 1.85rem;
    border-radius: 0.55rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: var(--primary);
    background: rgba(37, 99, 235, 0.1);
}

.nr-section-head h2 {
    margin: 0;
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--text-primary);
}

.nr-section-head p {
    margin: 0;
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.nr-case-row {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 0.75rem;
    align-items: end;
}

.nr-field {
    margin-bottom: 0.75rem;
}

.nr-field label,
.nr-label {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
}

.nr-input {
    border-radius: 0.65rem;
    min-height: 2.35rem;
    border-color: var(--border-color);
    box-shadow: none;
}

.nr-comments {
    min-height: 2.5rem;
    resize: none;
    padding-top: 0.45rem;
    padding-bottom: 0.45rem;
}

.nr-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.nr-priority {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.4rem;
}

.nr-priority-btn {
    appearance: none;
    border: 1px solid var(--border-color);
    background: var(--neutral-100);
    border-radius: 0.65rem;
    padding: 0.55rem 0.45rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease;
    color: var(--text-primary);
}

.nr-priority-btn i {
    display: block;
    font-size: 0.78rem;
    margin-bottom: 0.2rem;
    opacity: 0.85;
}
.nr-priority-btn.active i { opacity: 1; }
.nr-priority-btn.nr-priority-stat i { color: var(--danger); }

.nr-priority-btn strong {
    display: block;
    font-size: 0.84rem;
    margin-bottom: 0;
}

.nr-priority-btn small {
    display: none;
}

.nr-priority-btn:hover {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--primary) 40%, var(--border-color));
}

.nr-priority-btn.active {
    background: rgba(37, 99, 235, 0.1);
    border-color: var(--primary);
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.25);
}

.nr-priority-btn.nr-priority-stat.active {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--danger);
    box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.25);
}

.nr-filters {
    margin-bottom: 0.55rem;
    gap: 0.4rem;
}

.nr-filter-hint {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

.nr-tags {
    min-height: 2.4rem;
    max-height: 4.5rem;
    overflow-y: auto;
    border-radius: 0.7rem;
    padding: 0.45rem;
}

.nr-stain-summary {
    margin-top: 0.45rem;
}

.nr-aside {
    position: sticky;
    top: 0.75rem;
}

.nr-summary {
    background:
        radial-gradient(120% 80% at 100% 0%, rgba(37, 99, 235, 0.12), transparent 55%),
        var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0.85rem;
    padding: 0.9rem;
    box-shadow: var(--shadow-lg);
}

.nr-summary h3 {
    margin: 0 0 0.65rem;
    font-size: 0.98rem;
    font-weight: 750;
    color: var(--text-primary);
}

.nr-summary-hint {
    margin: 0 0 0.75rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.nr-summary-list {
    margin: 0 0 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.nr-summary-list > div {
    padding-bottom: 0.55rem;
    border-bottom: 1px solid var(--border-color);
}

.nr-summary-list > div:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.nr-summary-list dt {
    margin: 0 0 0.2rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.nr-summary-list dd {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    word-break: break-word;
}

.nr-summary-stains {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    font-weight: 500;
}

.nr-summary-notes {
    font-weight: 500;
    color: var(--text-secondary);
    white-space: pre-wrap;
}

.nr-summary-notes:not(.is-empty) {
    color: var(--text-primary);
}

.nr-submit {
    width: 100%;
    border-radius: 0.8rem;
    padding: 0.75rem 1rem;
    font-weight: 700;
}

.nr-cancel {
    display: block;
    margin-top: 0.75rem;
    text-align: center;
    font-size: 0.88rem;
    color: var(--text-secondary);
    text-decoration: none;
}

.nr-cancel:hover {
    color: var(--primary);
}

.nr-success {
    display: flex;
    gap: 1.1rem;
    align-items: flex-start;
    max-width: 720px;
    margin: 0.5rem auto;
    padding: 1.5rem;
    background: var(--bg-card);
    border: 1px solid color-mix(in srgb, var(--success) 35%, var(--border-color));
    border-radius: 1rem;
    box-shadow: var(--shadow);
}

.nr-success-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    font-size: 1.25rem;
    flex: 0 0 auto;
}

.nr-success h2 {
    margin: 0 0 0.35rem;
    font-size: 1.35rem;
}

.nr-success p { margin: 0 0 0.75rem; color: var(--text-secondary); }
.nr-muted { font-size: 0.85rem; color: var(--text-secondary); }

.nr-success-ids {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.85rem;
}

.nr-success-ids a {
    display: inline-flex;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.12);
    color: var(--primary);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.85rem;
}

.nr-success-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

@media (max-width: 960px) {
    .nr-layout {
        grid-template-columns: 1fr;
    }

    .nr-aside {
        position: static;
        order: -1;
    }

    .nr-case-row {
        grid-template-columns: 1fr;
    }

    .nr-compact.nr-page {
        max-height: none;
    }
}

@media (max-width: 640px) {
    .nr-priority {
        grid-template-columns: 1fr;
    }

    .nr-section {
        padding: 0.85rem;
    }
}

[data-theme="dark"] .nr-section,
[data-theme="dark"] .nr-summary,
[data-theme="dark"] .nr-success {
    background: var(--bg-card);
    border-color: var(--border-color);
}

[data-theme="dark"] .nr-summary {
    background:
        radial-gradient(120% 80% at 100% 0%, rgba(37, 99, 235, 0.18), transparent 55%),
        var(--bg-card);
}

[data-theme="dark"] .nr-priority-btn {
    background: var(--bg-input, #0f172a);
}

[data-theme="dark"] .nr-priority-btn.active {
    background: rgba(37, 99, 235, 0.2);
}

[data-theme="dark"] .nr-priority-btn.nr-priority-stat.active {
    background: rgba(239, 68, 68, 0.18);
}

[data-theme="dark"] .nr-section-num {
    background: rgba(37, 99, 235, 0.2);
}

/* ---- Lab notifications ---- */
.lab-notify {
    position: relative;
    margin-right: 0.5rem;
}

.lab-notify-btn {
    position: relative;
    width: 2.4rem;
    height: 2.4rem;
    border: 1px solid var(--border-color);
    border-radius: 0.7rem;
    background: var(--bg-card);
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.lab-notify-badge {
    position: absolute;
    top: -0.35rem;
    right: -0.35rem;
    min-width: 1.15rem;
    height: 1.15rem;
    padding: 0 0.3rem;
    border-radius: 999px;
    background: var(--danger);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.lab-notify-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 0.45rem);
    width: min(22rem, 85vw);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0.9rem;
    box-shadow: var(--shadow-lg);
    z-index: 1200;
    overflow: hidden;
}

.lab-notify-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0.9rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.86rem;
}

.lab-notify-list {
    max-height: 18rem;
    overflow: auto;
}

.lab-notify-item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.7rem 0.9rem;
    text-decoration: none;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
}

.lab-notify-item:hover {
    background: rgba(37, 99, 235, 0.08);
}

.lab-notify-item.priority-stat {
    border-left: 3px solid var(--danger);
}

.lab-notify-item.priority-urgent {
    border-left: 3px solid var(--warning);
}

.lab-notify-case {
    font-weight: 700;
    font-size: 0.9rem;
}

.lab-notify-meta,
.lab-notify-path,
.lab-notify-empty {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.lab-notify-empty {
    padding: 1rem 0.9rem;
}

/* ——— Design system (Phase 1+) ——— */

.sidebar-nav .nav-section {
    list-style: none;
    padding: 0.85rem 1.25rem 0.25rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
}

.sidebar-nav .nav-link.nav-sub {
    padding-left: 2.15rem;
    font-size: 0.88rem;
    opacity: 0.92;
}

.sidebar-nav .nav-link:focus-visible,
.btn:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible,
.nr-priority-btn:focus-visible,
.quick-stain-btn:focus-visible,
.page-link:focus-visible,
.stat-card-link:focus-visible,
.queue-tabs a:focus-visible,
.mobile-priority-strip a:focus-visible,
.chat-toggle:focus-visible,
.lab-notify-btn:focus-visible,
.sidebar-toggle:focus-visible,
.global-search-item:focus-visible,
a:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.global-search {
    position: relative;
    flex: 1 1 16rem;
    max-width: 28rem;
    min-width: 10rem;
}

.global-search-icon {
    position: absolute;
    left: 0.7rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 0.8rem;
    pointer-events: none;
}

.global-search input {
    padding-left: 2rem;
    background: var(--bg-body);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.global-search-results {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 0.35rem);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0.6rem;
    box-shadow: var(--shadow-lg);
    z-index: 1300;
    max-height: 20rem;
    overflow: auto;
}

.global-search-item {
    display: block;
    padding: 0.55rem 0.8rem;
    text-decoration: none;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
}

.global-search-item.is-active,
.global-search-item:hover,
.global-search-item:focus {
    background: rgba(37, 99, 235, 0.08);
}

.global-search-item strong { display: block; font-size: 0.88rem; }
.global-search-item span { font-size: 0.75rem; color: var(--text-secondary); }

.theme-switch {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    border-radius: 999px;
    background: var(--bg-body);
    border: 1px solid var(--border-color);
}
.theme-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.theme-icon-btn:hover {
    color: var(--text-primary);
    background: rgba(148, 163, 184, 0.18);
}
.theme-icon-btn.is-active {
    color: #fff;
    background: var(--primary);
    box-shadow: 0 1px 4px rgba(37, 99, 235, 0.35);
}
.theme-icon-btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
[data-theme="dark"] .theme-switch {
    background: rgba(15, 23, 42, 0.55);
    border-color: var(--border-color);
}
[data-theme="dark"] .theme-icon-btn.is-active {
    background: #3b82f6;
}

.ui-activity {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.ui-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.3;
    vertical-align: middle;
}

.ui-chip .ui-chip-text { text-transform: uppercase; }
.ui-chip.is-compact { padding: 0.1rem 0.4rem; font-size: 0.68rem; }
.chip-stat { background: #fef2f2; color: #b91c1c; }
.chip-urgent { background: #fffbeb; color: #b45309; }
.chip-tat-risk { background: #fff7ed; color: #c2410c; }
.chip-routine { background: #f1f5f9; color: #334155; }
.chip-tat-green { background: #ecfdf5; color: #047857; }
.chip-tat-amber { background: #fffbeb; color: #b45309; }
.chip-tat-red { background: #fef2f2; color: #b91c1c; }

[data-theme="dark"] .chip-stat { background: rgba(239, 68, 68, 0.18); color: #fca5a5; }
[data-theme="dark"] .chip-urgent { background: rgba(245, 158, 11, 0.18); color: #fcd34d; }
[data-theme="dark"] .chip-tat-risk { background: rgba(234, 88, 12, 0.22); color: #fdba74; }
[data-theme="dark"] .chip-routine { background: rgba(148, 163, 184, 0.18); color: #cbd5e1; }
[data-theme="dark"] .chip-tat-green { background: rgba(16, 185, 129, 0.18); color: #6ee7b7; }
[data-theme="dark"] .chip-tat-amber { background: rgba(245, 158, 11, 0.18); color: #fcd34d; }
[data-theme="dark"] .chip-tat-red { background: rgba(239, 68, 68, 0.18); color: #fca5a5; }

.tat-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.ui-empty {
    text-align: center;
    padding: 2.5rem 1.25rem;
    color: var(--text-secondary);
}

.ui-empty-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    color: var(--primary);
}

.ui-empty-title { font-size: 1.1rem; color: var(--text-primary); margin: 0 0 0.35rem; }
.ui-empty-copy { margin: 0 auto 1rem; max-width: 28rem; }

.ui-skeleton-line {
    height: 0.7rem;
    background: linear-gradient(90deg, var(--border-color), transparent, var(--border-color));
    border-radius: 0.25rem;
    margin-bottom: 0.5rem;
    animation: uiPulse 1.2s ease-in-out infinite;
}

.ui-skeleton-line.short { width: 40%; }
@keyframes uiPulse { 50% { opacity: 0.45; } }

.stat-card-link { text-decoration: none; color: inherit; display: block; }
.stat-card-link:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.stat-hint { font-size: 0.72rem; color: var(--text-secondary); margin-top: 0.2rem; }

.ops-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 1rem; }
@media (max-width: 991px) { .ops-grid { grid-template-columns: 1fr; } }

.attention-list { list-style: none; padding: 0; margin: 0; }
.attention-list li {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--border-color);
    align-items: center;
}
.attention-list a { color: var(--text-primary); text-decoration: none; font-weight: 600; }
.attention-list a:hover { color: var(--primary); }

.workflow-timeline {
    list-style: none;
    padding: 0;
    margin: 0;
    border-left: 2px solid var(--border-color);
}

.workflow-step {
    position: relative;
    padding: 0 0 1.1rem 1.15rem;
}

.workflow-dot {
    position: absolute;
    left: -0.4rem;
    top: 0.2rem;
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 50%;
    background: var(--border-color);
}

.workflow-step.is-done .workflow-dot { background: var(--success); }
.workflow-step.is-current .workflow-dot { background: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25); }
.workflow-label { font-weight: 600; display: block; }
.workflow-when { font-size: 0.75rem; color: var(--text-secondary); }

.queue-tabs { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1rem; }
.queue-tabs a {
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    text-decoration: none;
    color: var(--text-primary);
    font-size: 0.82rem;
    font-weight: 600;
}
.queue-tabs a.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.queue-tab-count {
    display: inline-block;
    min-width: 1.1rem;
    margin-left: 0.25rem;
    font-weight: 700;
    opacity: 0.85;
}

.quick-stain-row { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.75rem; align-items: center; }
.quick-stain-btn {
    border: 1px dashed var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    border-radius: 999px;
    padding: 0.25rem 0.7rem;
    font-size: 0.8rem;
    font-weight: 600;
}
.quick-stain-btn:hover, .quick-stain-btn.active { border-style: solid; border-color: var(--primary); color: var(--primary); }
.quick-stain-fav {
    margin-left: 0.25rem;
    color: var(--text-secondary);
    cursor: pointer;
}
.quick-stain-fav.is-fav { color: #d97706; }
.again-stain-row { padding-top: 0.15rem; }

.case-lookup {
    margin-top: 0.5rem;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.6rem;
    background: var(--bg-body);
    font-size: 0.85rem;
}
.case-lookup-item + .case-lookup-item {
    margin-top: 0.65rem;
    padding-top: 0.65rem;
    border-top: 1px solid var(--border-color);
}
.case-lookup-use {
    appearance: none;
    border: 0;
    background: none;
    padding: 0;
    font-weight: 700;
    color: var(--primary);
    text-decoration: underline;
    cursor: pointer;
}
.case-lookup-links a { font-weight: 600; }

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    gap: 1rem;
}

.audit-list { list-style: none; padding: 0; margin: 0; }
.audit-list li {
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--border-color);
}
.audit-list strong { display: block; }
.audit-list small { color: var(--text-secondary); }
.audit-status-change { display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; margin-bottom: 0.2rem; }
.audit-arrow { color: var(--text-secondary); font-weight: 700; }

.ai-score-panel {
    border: 1px solid var(--border-color);
    border-radius: 0.6rem;
    padding: 0.85rem;
    background: var(--bg-body);
}
.ai-score-head { display: flex; align-items: center; gap: 0.45rem; margin-bottom: 0.35rem; }
.ai-score-note, .ai-score-reason { font-size: 0.8rem; color: var(--text-secondary); }

.label-job-row.failed { background: rgba(239, 68, 68, 0.06); }

.ui-inline-spinner { display: inline-flex; align-items: center; color: var(--text-secondary); font-size: 0.85rem; }

.nr-draft-bar { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.75rem; }

@media (max-width: 768px) {
    .top-bar { flex-wrap: wrap; }
    .global-search { order: 3; flex: 1 1 100%; max-width: none; }
    .page-title { flex: 1; }
    .priority-queue-table th:nth-child(1),
    .priority-queue-table td:nth-child(1),
    .priority-queue-table th:nth-child(4),
    .priority-queue-table td:nth-child(4),
    .priority-queue-table th:nth-child(5),
    .priority-queue-table td:nth-child(5),
    .priority-queue-table th:nth-child(6),
    .priority-queue-table td:nth-child(6) { display: none; }
    .mobile-only-actions { display: flex; gap: 0.35rem; }
}

@media (min-width: 769px) {
    .mobile-priority-strip { display: none; }
}

.mobile-priority-strip {
    display: flex;
    gap: 0.5rem;
    overflow: auto;
    margin-bottom: 1rem;
}
.mobile-priority-strip a {
    flex: 0 0 auto;
    padding: 0.5rem 0.8rem;
    border-radius: 0.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.8rem;
}
.mobile-priority-strip a.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.skip-link {
    position: absolute;
    left: 0.75rem;
    top: -3.5rem;
    z-index: 2100;
    padding: 0.5rem 0.85rem;
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    border-radius: 0.35rem;
    text-decoration: none;
}
.skip-link:focus,
.skip-link:focus-visible {
    top: 0.75rem;
    color: #fff;
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.sidebar-backdrop {
    display: none;
}

@media (max-width: 768px) {
    body.sidebar-open .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.45);
        z-index: 999;
    }
    .mobile-priority-strip a {
        min-height: 2.75rem;
        display: inline-flex;
        align-items: center;
    }
    .all-requests-table th:nth-child(4),
    .all-requests-table td:nth-child(4),
    .all-requests-table th:nth-child(5),
    .all-requests-table td:nth-child(5),
    .all-requests-table th:nth-child(10),
    .all-requests-table td:nth-child(10) { display: none; }
    .batch-bar { padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px)); }
    .filters-bar .form-select,
    .filters-bar .form-control { min-height: 2.5rem; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .fade-in,
    .ui-skeleton-line,
    .chat-toggle,
    .stat-card,
    .stat-card-link,
    .app-toast,
    .stain-filter-btn {
        animation: none !important;
        transition: none !important;
        transform: none !important;
    }
}

.btn-outline-warning {
    border-color: #d97706;
    color: #b45309;
    background: transparent;
}
.btn-outline-warning:hover {
    background: #d97706;
    border-color: #d97706;
    color: #fff;
}
@media (max-width: 768px) {
    .stain-catalogue-head { flex-direction: column; }
    .stain-category-toolbar { margin-left: 0; width: 100%; }
    .stain-category-toolbar .stain-category-btn { flex: 1 1 auto; }
}



