/* ============================================
   Design Tokens — Phoenix Design System
   Light Mode (default)
   ============================================ */
:root, [data-theme="light"] {
    /* Brand */
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --primary-glow: rgba(37, 99, 235, 0.1);
    --accent: #7c3aed;
    --accent-glow: rgba(124, 58, 237, 0.08);

    /* Canvas */
    --bg: #f1f5f9;
    --bg-elevated: #ffffff;
    --sidebar-bg: #0f172a;
    --sidebar-text: #f1f5f9;
    --card-bg: #ffffff;
    --card-bg-solid: #ffffff;
    --card-border: #e2e8f0;
    --border: #e2e8f0;
    --border-strong: #cbd5e1;

    /* Text */
    --text: #1e293b;
    --text-muted: #64748b;
    --text-bright: #0f172a;

    /* Semantic */
    --success: #16a34a;
    --success-muted: rgba(22, 163, 74, 0.08);
    --warning: #d97706;
    --warning-muted: rgba(217, 119, 6, 0.08);
    --danger: #dc2626;
    --danger-muted: rgba(220, 38, 38, 0.06);
    --info: #0284c7;

    /* Gray scale */
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 8px 24px rgba(0, 0, 0, 0.1), 0 4px 8px rgba(0, 0, 0, 0.06);
    --shadow-glow-primary: 0 0 0 3px rgba(37, 99, 235, 0.12);
    --shadow-glow-success: 0 0 0 3px rgba(22, 163, 74, 0.1);
    --shadow-glow-danger: 0 0 0 3px rgba(220, 38, 38, 0.1);

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;

    /* Sidebar */
    --sidebar-active-bg: rgba(37, 99, 235, 0.15);
    --sidebar-active-border: var(--primary-light);
    --sidebar-hover-bg: rgba(255, 255, 255, 0.08);
    --sidebar-section-text: rgba(255, 255, 255, 0.7);

    /* Glass */
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(0, 0, 0, 0.06);
    --glass-blur: blur(12px);

    /* Badge */
    --badge-success-bg: #dcfce7; --badge-success-text: #166534; --badge-success-border: #bbf7d0;
    --badge-warning-bg: #fef3c7; --badge-warning-text: #92400e; --badge-warning-border: #fde68a;
    --badge-danger-bg: #fee2e2; --badge-danger-text: #991b1b; --badge-danger-border: #fecaca;
    --badge-info-bg: #dbeafe; --badge-info-text: #1e40af; --badge-info-border: #bfdbfe;
    --badge-secondary-bg: #f1f5f9; --badge-secondary-text: #475569; --badge-secondary-border: #e2e8f0;

    /* Alert */
    --alert-success-bg: #f0fdf4; --alert-success-text: #166534; --alert-success-border: #bbf7d0;
    --alert-danger-bg: #fef2f2; --alert-danger-text: #991b1b; --alert-danger-border: #fecaca;
    --alert-info-bg: #eff6ff; --alert-info-text: #1e40af; --alert-info-border: #bfdbfe;
    --alert-warning-bg: #fffbeb; --alert-warning-text: #92400e; --alert-warning-border: #fde68a;

    /* Backgrounds */
    --bg-secondary: #f1f5f9;
    --bg-primary: #ffffff;

    /* Input */
    --input-bg: #ffffff;
    --input-text: #1e293b;

    /* Table */
    --table-header-bg: #f8fafc;
    --table-hover: #f1f5f9;
    --table-stripe: rgba(0, 0, 0, 0.02);
}

/* ============================================
   Dark Mode
   ============================================ */
[data-theme="dark"] {
    --bg: #0c0f1a;
    --bg-elevated: #111827;
    --card-bg: #161b2e;
    --card-bg-solid: #161b2e;
    --card-border: rgba(255, 255, 255, 0.08);
    --border: rgba(255, 255, 255, 0.1);
    --border-strong: rgba(255, 255, 255, 0.16);

    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --text-bright: #f8fafc;

    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #38bdf8;

    --gray-50: #1e293b;
    --gray-100: #1e293b;
    --gray-200: #334155;
    --gray-300: #475569;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.45);
    --shadow-xl: 0 8px 30px rgba(0, 0, 0, 0.5);
    --shadow-glow-primary: 0 0 20px rgba(59, 130, 246, 0.2);

    --glass-bg: rgba(22, 27, 46, 0.75);
    --glass-blur: blur(16px);

    --badge-success-bg: rgba(34, 197, 94, 0.15); --badge-success-text: #4ade80; --badge-success-border: rgba(34, 197, 94, 0.25);
    --badge-warning-bg: rgba(245, 158, 11, 0.15); --badge-warning-text: #fbbf24; --badge-warning-border: rgba(245, 158, 11, 0.25);
    --badge-danger-bg: rgba(239, 68, 68, 0.15); --badge-danger-text: #f87171; --badge-danger-border: rgba(239, 68, 68, 0.25);
    --badge-info-bg: rgba(59, 130, 246, 0.15); --badge-info-text: #60a5fa; --badge-info-border: rgba(59, 130, 246, 0.25);
    --badge-secondary-bg: rgba(255, 255, 255, 0.06); --badge-secondary-text: #94a3b8; --badge-secondary-border: rgba(255, 255, 255, 0.1);

    --alert-success-bg: rgba(34, 197, 94, 0.08); --alert-success-text: #4ade80; --alert-success-border: rgba(34, 197, 94, 0.2);
    --alert-danger-bg: rgba(239, 68, 68, 0.08); --alert-danger-text: #f87171; --alert-danger-border: rgba(239, 68, 68, 0.2);
    --alert-info-bg: rgba(59, 130, 246, 0.08); --alert-info-text: #60a5fa; --alert-info-border: rgba(59, 130, 246, 0.2);
    --alert-warning-bg: rgba(245, 158, 11, 0.08); --alert-warning-text: #fbbf24; --alert-warning-border: rgba(245, 158, 11, 0.2);

    --bg-secondary: #1e293b;
    --bg-primary: #111827;

    --input-bg: rgba(255, 255, 255, 0.05);
    --input-text: #e2e8f0;

    --table-header-bg: rgba(255, 255, 255, 0.03);
    --table-hover: rgba(255, 255, 255, 0.03);
    --table-stripe: rgba(255, 255, 255, 0.02);
}

/* ============================================
   Reset & Base
   ============================================ */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   Layout
   ============================================ */
.admin-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 240px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    padding: 1rem 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    border-right: 1px solid rgba(255, 255, 255, 0.04);
}

.sidebar-header {
    padding: 1.25rem 1.5rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-header h2 { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.01em; }
.sidebar-header .subtitle { font-size: 0.65rem; opacity: 0.75; text-transform: uppercase; letter-spacing: 0.1em; margin-top: 0.125rem; }

.nav-menu {
    list-style: none;
    padding: 0.5rem 0;
}

.nav-section {
    padding: 0.875rem 1.5rem 0.375rem;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--sidebar-section-text);
}

.nav-menu li a {
    display: flex;
    align-items: center;
    padding: 0.625rem 1.5rem;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.875rem;
    transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
    border-left: 3px solid transparent;
    padding-left: calc(1.5rem - 3px);
}

.nav-menu li a:visited {
    color: var(--sidebar-text);
}

.nav-menu li a:hover {
    background: var(--sidebar-hover-bg);
    color: #fff;
}

.nav-menu li a.active {
    background: var(--sidebar-active-bg);
    color: #fff;
    border-left-color: var(--sidebar-active-border);
    font-weight: 500;
}

.nav-icon {
    display: inline-flex;
    width: 20px;
    font-size: 0.9rem;
    margin-right: 0.625rem;
    opacity: 0.9;
    flex-shrink: 0;
}

.nav-menu li a.active .nav-icon,
.nav-menu li a:hover .nav-icon {
    opacity: 1;
}

.nav-menu .divider {
    height: 1px;
    background: rgba(255,255,255,0.08);
    margin: 0.5rem 1.5rem;
}

.content {
    flex: 1;
    margin-left: 240px;
    padding: 1.75rem 2rem;
    min-height: 100vh;
    background: var(--bg);
}

/* ============================================
   Page Header
   ============================================ */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.page-header h1 { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.025em; color: var(--text-bright); }

.page-back {
    display: inline-block;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
    transition: color var(--transition-fast);
}
.page-back:hover { color: var(--primary); }

/* ============================================
   Cards
   ============================================ */
.card {
    background: var(--card-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: box-shadow var(--transition-base), border-color var(--transition-base), transform var(--transition-base);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--border-strong);
}

.grid > .card {
    margin-bottom: 0;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.card-header h3 { font-size: 1.1rem; font-weight: 600; }

.card-nested {
    background: var(--gray-50);
    border-radius: 6px;
    padding: 1rem;
}

/* ============================================
   Tables
   ============================================ */
table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    text-align: left;
    padding: 0.75rem;
    border-bottom: 1px solid var(--border);
}

th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--table-header-bg);
    border-bottom-color: var(--border-strong);
}

tr { transition: background var(--transition-fast); }
tr:hover { background: var(--table-hover); }
tr.clickable { cursor: pointer; }
tr.clickable:hover { background: var(--table-hover); }

.detail-table th {
    width: 40%;
    background: transparent;
    text-transform: none;
    letter-spacing: normal;
    font-weight: 500;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.btn-primary { background: var(--primary); color: white; border: 1px solid transparent; }
.btn-primary:hover { background: var(--primary-dark); box-shadow: var(--shadow-glow-primary); }
.btn-secondary { background: rgba(255, 255, 255, 0.06); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: rgba(255, 255, 255, 0.1); border-color: var(--border-strong); }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { opacity: 0.9; }
.btn-warning { background: var(--warning); color: white; }
.btn-warning:hover { opacity: 0.9; }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { opacity: 0.9; }
.btn-sm { padding: 0.375rem 0.75rem; font-size: 0.8rem; }

/* ============================================
   Forms
   ============================================ */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.375rem;
    font-weight: 500;
    font-size: 0.875rem;
}

.form-control {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    background: var(--input-bg);
    color: var(--input-text);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

select.form-control { cursor: pointer; }

.form-select {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.875rem;
    background: var(--card-bg);
    color: var(--text);
    cursor: pointer;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-select-sm {
    padding: 0.375rem 0.625rem;
    font-size: 0.8rem;
}

/* ============================================
   Badges
   ============================================ */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.2;
}

.badge-success { background: var(--badge-success-bg); color: var(--badge-success-text); border: 1px solid var(--badge-success-border); }
.badge-warning { background: var(--badge-warning-bg); color: var(--badge-warning-text); border: 1px solid var(--badge-warning-border); }
.badge-danger { background: var(--badge-danger-bg); color: var(--badge-danger-text); border: 1px solid var(--badge-danger-border); }
.badge-info { background: var(--badge-info-bg); color: var(--badge-info-text); border: 1px solid var(--badge-info-border); }
.badge-secondary { background: var(--badge-secondary-bg); color: var(--badge-secondary-text); border: 1px solid var(--badge-secondary-border); }
.badge-primary { background: var(--badge-info-bg); color: var(--badge-info-text); border: 1px solid var(--badge-info-border); }
.badge-lg { font-size: 0.875rem; padding: 0.375rem 0.75rem; }

/* ============================================
   Tabs
   ============================================ */
.tabs {
    display: flex;
    gap: 0.25rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.5rem;
}

.tab {
    padding: 0.625rem 1.25rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.8125rem;
    letter-spacing: 0.01em;
    transition: all var(--transition-fast);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.tab:hover { color: var(--text); background: rgba(255, 255, 255, 0.03); }
.tab.active {
    color: var(--primary-light);
    border-bottom-color: var(--primary);
    background: rgba(59, 130, 246, 0.06);
}

/* ============================================
   Grid
   ============================================ */
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ============================================
   Alerts
   ============================================ */
.alert {
    padding: 0.875rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    line-height: 1.5;
}

.alert-success { background: var(--alert-success-bg); color: var(--alert-success-text); border: 1px solid var(--alert-success-border); }
.alert-danger { background: var(--alert-danger-bg); color: var(--alert-danger-text); border: 1px solid var(--alert-danger-border); }
.alert-info { background: var(--alert-info-bg); color: var(--alert-info-text); border: 1px solid var(--alert-info-border); }
.alert-warning { background: var(--alert-warning-bg); color: var(--alert-warning-text); border: 1px solid var(--alert-warning-border); }

/* ============================================
   Loading
   ============================================ */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--text-muted);
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2rem 3rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.loading-spinner::before {
    content: '';
    width: 24px;
    height: 24px;
    border: 2.5px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    flex-shrink: 0;
}

.loading-spinner::after {
    content: '';
    display: block;
    width: 100%;
    max-width: 600px;
    height: 80px;
    margin-top: 0.5rem;
    background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite ease-in-out;
    border-radius: 8px;
    opacity: 0.6;
}

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

/* Friendly error messages — override alert-danger */
.alert-danger {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(220, 53, 69, 0.06);
    border: 1px solid rgba(220, 53, 69, 0.2);
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.8125rem;
    color: var(--text);
    line-height: 1.6;
}

/* ============================================
   Modals
   ============================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn var(--transition-fast) ease;
    overflow-y: auto;
    padding: 2rem;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 10px;
    box-shadow: var(--shadow-xl);
    padding: 1.5rem;
    animation: slideUp var(--transition-base) ease;
    max-height: 90vh;
    overflow-y: auto;
    margin: 0;
}

.modal-sm { width: 90vw; max-width: 400px; }
.modal-md { width: 90vw; max-width: 500px; }
.modal-lg { width: 90vw; max-width: 550px; }
.modal-xl { width: 90vw; max-width: 800px; }
.modal-fullpage { width: 96vw; max-width: 96vw; height: 94vh; max-height: 94vh; }

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    display: inline-block;
}
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: var(--gray-300, #d1d5db);
    transition: var(--transition-fast);
    border-radius: 24px;
}
.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: var(--transition-fast);
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle-switch input:checked + .toggle-slider {
    background-color: var(--primary, #2563eb);
}
.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

/* Inline editable */
.inline-editable {
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: background-color var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.inline-editable:hover {
    background-color: var(--gray-100, #f3f4f6);
}
.inline-editable .edit-icon {
    opacity: 0;
    font-size: 0.75rem;
    color: var(--gray-400);
    transition: opacity var(--transition-fast);
}
.inline-editable:hover .edit-icon {
    opacity: 1;
}
.inline-edit-input {
    padding: 0.25rem 0.5rem;
    font-size: inherit;
    border: 1px solid var(--primary, #2563eb);
    border-radius: 4px;
    outline: none;
}

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

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

/* ============================================
   Metrics
   ============================================ */
.metric-value {
    font-size: 2rem;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.metric-value-sm {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.metric-label {
    color: var(--text-muted);
    font-size: 0.8125rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.metric-delta {
    font-size: 0.8125rem;
    margin-top: 0.25rem;
}

/* ============================================
   Code Block
   ============================================ */
.code-block {
    background: var(--gray-900);
    color: #e2e8f0;
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    max-height: 200px;
    overflow-y: auto;
    font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
    font-size: 0.8125rem;
    line-height: 1.5;
}

/* ============================================
   Section Divider
   ============================================ */
.section-divider {
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    margin-top: 1rem;
}

/* ============================================
   Utility Classes
   ============================================ */
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-primary { color: var(--primary); }
.text-center { text-align: center; }

.font-mono { font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace; }
.font-semibold { font-weight: 600; }
.select-all { user-select: all; }

.flex { display: flex; }
.flex-row { display: flex; align-items: center; gap: 0.5rem; }
.flex-row-wrap { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }

.m-4 { margin: 1rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mb-4 { margin-bottom: 1rem; }
.ml-2 { margin-left: 0.5rem; }
.mr-1 { margin-right: 0.25rem; }

.p-4 { padding: 1rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }

.w-select-sm { width: 120px; }
.w-select-md { width: 150px; }
.max-w-sm { max-width: 300px; }

.truncate {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ============================================
   Searchable Select
   ============================================ */
.searchable-select-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1100;
}

.searchable-select {
    position: relative;
    width: 100%;
}

.searchable-select.open {
    z-index: 1110;
}

.searchable-select-input {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    min-height: 38px;
}

.searchable-select-input.focused {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.searchable-select-search {
    border: none;
    outline: none;
    background: transparent;
    width: 100%;
    font-size: 0.875rem;
    color: var(--text);
    padding: 0;
}

.searchable-select-display {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.searchable-select-display.placeholder {
    color: var(--text-muted);
}

.searchable-select-arrow {
    font-size: 0.625rem;
    color: var(--text-muted);
    margin-left: 0.5rem;
    flex-shrink: 0;
}

.searchable-select-sm .searchable-select-input {
    min-height: 30px;
    font-size: 0.8125rem;
    padding: 0.25rem 0.5rem;
}

.searchable-select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 280px;
    overflow-y: auto;
    background: var(--card-bg-solid);
    border: 1px solid var(--border-strong);
    border-top: none;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    box-shadow: var(--shadow-xl);
    z-index: 1120;
}

.searchable-select-group-header {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.025em;
    background: var(--gray-50);
    position: sticky;
    top: 0;
}

.searchable-select-option {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    cursor: pointer;
}

.searchable-select-option:hover,
.searchable-select-option.highlighted {
    background: rgba(59, 130, 246, 0.08);
}

.searchable-select-option.selected {
    background: rgba(59, 130, 246, 0.12);
    color: var(--primary-light);
    font-weight: 500;
}

.searchable-select-empty {
    padding: 1rem 0.75rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    text-align: center;
}

/* Schema Tree for Custom Reports */
.schema-tree-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 1rem;
    min-height: 300px;
}
.schema-tree-panel {
    max-height: 600px;
    overflow-y: auto;
    padding: 0.5rem;
}
.schema-tree details {
    margin-left: 1.25rem;
}
.schema-tree > details {
    margin-left: 0;
}
.schema-tree summary {
    cursor: pointer;
    padding: 0.35rem 0.5rem;
    border-radius: 4px;
    font-weight: 500;
    user-select: none;
    list-style: none;
}
.schema-tree summary:hover {
    background: var(--gray-100);
}
.schema-tree summary::before {
    content: '\25B6 ';
    font-size: 0.65em;
    margin-right: 0.35rem;
    display: inline-block;
    transition: transform var(--transition-fast);
}
.schema-tree details[open] > summary::before {
    content: '\25BC ';
}
.schema-tree .column-list {
    padding: 0.15rem 0 0.25rem 1.5rem;
}
.schema-tree .column-item {
    display: block;
    padding: 0.12rem 0;
    cursor: pointer;
    font-weight: 400;
    font-size: 0.85rem;
}
.schema-tree .column-item:hover {
    color: var(--primary);
}
.schema-tree .fk-label {
    font-size: 0.7rem;
    color: var(--gray-500);
    margin-left: 0.35rem;
    font-weight: 400;
}
.schema-tree .table-badge {
    font-size: 0.65rem;
    background: var(--gray-200);
    color: var(--gray-600);
    padding: 0.05rem 0.4rem;
    border-radius: 3px;
    margin-left: 0.35rem;
    font-weight: 400;
}
.selected-fields-panel {
    border-left: 2px solid var(--gray-200);
    padding: 0.75rem;
    max-height: 600px;
    overflow-y: auto;
    background: var(--gray-50);
    border-radius: 0 6px 6px 0;
}
.selected-field-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    margin-bottom: 0.15rem;
    font-size: 0.8rem;
}
.selected-field-item:hover {
    background: var(--gray-100);
}
.selected-field-item .remove-btn {
    cursor: pointer;
    color: var(--red-500);
    font-size: 1rem;
    border: none;
    background: none;
    padding: 0 0.3rem;
    line-height: 1;
    font-weight: bold;
}
.selected-field-item .remove-btn:hover {
    color: var(--red-700);
}

/* ============================================
   Operator Help Tooltip
   ============================================ */
.operator-help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--surface-alt, #333);
    color: var(--text-muted, #999);
    font-size: 0.65rem;
    font-weight: 700;
    cursor: help;
    position: relative;
    vertical-align: middle;
    margin-left: 4px;
    border: 1px solid var(--border, #555);
}
.operator-help-icon:hover {
    background: var(--primary, #2563eb);
    color: #fff;
    border-color: var(--primary, #2563eb);
}
.operator-help-icon .operator-help-tooltip {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 8px;
    background: var(--bg-elevated, #1e1e2e);
    border: 1px solid var(--border, #444);
    border-radius: 8px;
    padding: 12px 14px;
    width: 300px;
    z-index: 1000;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
.operator-help-icon:hover .operator-help-tooltip {
    display: block;
}
.operator-help-tooltip .operator-help-title {
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--primary, #2563eb);
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border, #444);
}
.operator-help-tooltip .operator-help-row {
    font-size: 0.75rem;
    padding: 2px 0;
    color: var(--text-muted, #ccc);
    white-space: nowrap;
}
.operator-help-tooltip .operator-help-row code {
    display: inline-block;
    min-width: 90px;
    color: var(--green-500, #22c55e);
    font-weight: 600;
    font-size: 0.7rem;
}

/* Slide-out panel */
.slide-panel-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 999;
}
.slide-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 380px;
    height: 100vh;
    background: var(--bg-primary, #0f0f23);
    border-left: 1px solid var(--border, #2a2a4a);
    z-index: 1000;
    transition: right 0.25s ease;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}
.slide-panel.open {
    right: 0;
}
.slide-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border, #2a2a4a);
}
.slide-panel-header h3 {
    margin: 0;
}
.slide-panel-body {
    padding: 1.25rem;
}
.slide-panel-body .form-group {
    margin-bottom: 1rem;
}
.slide-panel-body .form-group label {
    margin-bottom: 0.25rem;
    display: block;
}

/* Progress bar */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-secondary, #1a1a2e);
    border-radius: 4px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}
.progress-success { background: var(--success, #22c55e); }
.progress-warning { background: var(--warning, #f59e0b); }
.progress-danger { background: var(--danger, #ef4444); }

/* Text extra small */
.text-xs { font-size: 0.7rem; }

@media (max-width: 768px) {
    .slide-panel { width: 100%; right: -100%; }
}

/* ============================================
   Availability Schedule Grid
   ============================================ */
.schedule-day-tabs {
    display: flex;
    gap: 2px;
    margin-bottom: 0.75rem;
}

.schedule-day-tab {
    flex: 1;
    padding: 0.375rem 0.25rem;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    background: var(--card-bg);
    transition: background var(--transition-fast), color var(--transition-fast);
}

.schedule-day-tab:hover { background: var(--gray-100); }
.schedule-day-tab.active { background: var(--primary); color: white; border-color: var(--primary); }
.schedule-day-tab .schedule-day-dot {
    display: block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin: 2px auto 0;
    background: var(--success);
}

.schedule-hours {
    max-height: 360px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 6px;
}

.schedule-hour-row {
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.schedule-hour-row:last-child { border-bottom: none; }

.schedule-hour-label {
    width: 58px;
    min-width: 58px;
    padding: 0 0.5rem;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.schedule-cells {
    display: flex;
    flex: 1;
    gap: 2px;
    padding: 2px;
}

.schedule-cell {
    flex: 1;
    height: 22px;
    border-radius: 3px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.1s;
    background: var(--card-bg);
}

.schedule-cell:hover { background: var(--gray-100); }
.schedule-cell.active { background: var(--success); border-color: var(--success); }
.schedule-cell.active:hover { background: #16a34a; }

/* ============================================
   Universal Filters
   ============================================ */
.uf-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 1.25rem;
    align-items: flex-end;
    backdrop-filter: var(--glass-blur);
    position: relative;
    z-index: 50;
}
.uf-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.uf-label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--gray-500);
    margin: 0;
}
.uf-input {
    padding: 0.3rem 0.5rem;
    font-size: 0.8125rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--input-bg);
    color: var(--input-text);
    height: 32px;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.uf-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.uf-presets {
    display: flex;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
}
.uf-preset {
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 500;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
    border-right: 1px solid var(--border);
}
.uf-preset:last-child { border-right: none; }
.uf-preset:hover { background: rgba(255, 255, 255, 0.06); color: var(--text); }
.uf-preset.active {
    background: var(--primary);
    color: white;
    font-weight: 600;
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.3);
}
.uf-checkbox {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    cursor: pointer;
    margin: 0;
}
.uf-checkbox input { accent-color: var(--primary); }
.uf-bar .searchable-select { font-size: 0.8125rem; }
.uf-bar .searchable-select-input { padding: 0.25rem 0.5rem; min-height: 32px; border-radius: 6px; }

/* ============================================
   Report Intelligence Blocks
   ============================================ */
.intel-alert {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.8125rem;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.intel-alert-critical {
    background: rgba(239, 68, 68, 0.06);
    border: 1px solid rgba(239, 68, 68, 0.25);
}
.intel-alert-warning {
    background: rgba(245, 158, 11, 0.06);
    border: 1px solid rgba(245, 158, 11, 0.25);
}
.intel-alert-success {
    background: rgba(34, 197, 94, 0.06);
    border: 1px solid rgba(34, 197, 94, 0.25);
}
.intel-insight {
    padding: 0.75rem 1rem;
    border-left: 3px solid var(--primary);
    background: var(--gray-50);
    border-radius: 0 8px 8px 0;
    margin-top: 1rem;
    font-size: 0.8125rem;
    line-height: 1.6;
}
.intel-opportunity {
    padding: 0.75rem 1rem;
    border-left: 3px solid var(--success);
    background: rgba(34, 197, 94, 0.04);
    border-radius: 0 8px 8px 0;
    margin-top: 0.75rem;
    font-size: 0.8125rem;
}
.intel-root-cause {
    padding: 0.75rem 1rem;
    border-left: 3px solid var(--warning);
    background: rgba(245, 158, 11, 0.04);
    border-radius: 0 8px 8px 0;
    margin-top: 0.75rem;
    font-size: 0.8125rem;
}
.intel-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
    font-size: 0.7rem;
}
.intel-links a {
    color: var(--primary);
    text-decoration: none;
    padding: 0.15rem 0.5rem;
    background: rgba(37, 99, 235, 0.06);
    border-radius: 4px;
    transition: background var(--transition-fast);
}
.intel-links a:hover { background: rgba(37, 99, 235, 0.12); }

/* ============================================
   KPI Card Enhancements
   ============================================ */
.kpi-grid {
    display: grid;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.kpi-grid-3 { grid-template-columns: repeat(3, 1fr); }
.kpi-grid-4 { grid-template-columns: repeat(4, 1fr); }
.kpi-grid-5 { grid-template-columns: repeat(5, 1fr); }
.kpi-grid-6 { grid-template-columns: repeat(6, 1fr); }

.kpi-card {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    border: 1px solid var(--border);
    border-left: 3px solid var(--gray-300);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition-fast), transform var(--transition-fast);
}
.kpi-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}
.kpi-card.kpi-primary { border-left-color: var(--primary); }
.kpi-card.kpi-success { border-left-color: var(--success); }
.kpi-card.kpi-warning { border-left-color: var(--warning); }
.kpi-card.kpi-danger { border-left-color: var(--danger); }
.kpi-card.kpi-gold { border-left-color: #d97706; }
.kpi-card.kpi-purple { border-left-color: #8b5cf6; }

.kpi-card .kpi-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--gray-500);
    margin-bottom: 0.25rem;
}
.kpi-card .kpi-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
}
.kpi-card .kpi-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}
.kpi-card .kpi-delta {
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.15rem;
}
.kpi-card .kpi-delta.up { color: var(--success); }
.kpi-card .kpi-delta.down { color: var(--danger); }
.kpi-card .kpi-delta.flat { color: var(--text-muted); }

/* ============================================
   Report Tables Enhanced
   ============================================ */
.report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}
.report-table thead th {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gray-500);
    padding: 0.625rem 0.75rem;
    border-bottom: 2px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--card-bg);
    z-index: 2;
}
.report-table tbody td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
}
.report-table tbody tr { transition: background var(--transition-fast); }
.report-table tbody tr:hover { background: var(--gray-50); }
.report-table tbody tr.clickable { cursor: pointer; }
.report-table tbody tr.highlight-watch { background: #fefce8; }
.report-table tbody tr.highlight-danger { background: rgba(239, 68, 68, 0.04); }
.report-table tbody tr.drill-expanded { font-weight: 600; background: var(--gray-50); }
.report-table tbody tr.drill-content { background: var(--gray-50); }
.report-table tbody tr.drill-content td { padding: 1rem 1.25rem; }
.report-table tfoot td {
    font-weight: 700;
    padding: 0.75rem;
    border-top: 2px solid var(--border);
}

/* ============================================
   Page Header Enhanced
   ============================================ */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}
/* h1 styling defined at line 290 using --text-bright (theme-aware) */
.page-header .page-subtitle {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 0.125rem;
}
.page-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.page-actions .auto-refresh-label {
    font-size: 0.65rem;
    color: var(--gray-400);
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* ============================================
   Health Badges
   ============================================ */
.health-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.6875rem;
    font-weight: 600;
}
.health-a { background: #dcfce7; color: #166534; }
.health-b { background: #dbeafe; color: #1e40af; }
.health-c { background: #fef3c7; color: #92400e; }
.health-at-risk { background: #fee2e2; color: #991b1b; }

.risk-badge { font-size: 0.6875rem; font-weight: 600; padding: 0.2rem 0.5rem; border-radius: 4px; }
.risk-low { background: #dcfce7; color: #166534; }
.risk-medium { background: #fef3c7; color: #92400e; }
.risk-high { background: #fee2e2; color: #991b1b; }

/* ============================================
   Sparkline Bars
   ============================================ */
.sparkline {
    display: flex;
    align-items: flex-end;
    gap: 1px;
    height: 24px;
}
.sparkline-bar {
    flex: 1;
    min-width: 3px;
    border-radius: 1px 1px 0 0;
    background: var(--primary);
    transition: height var(--transition-fast);
}

/* ============================================
   Percentile Pills
   ============================================ */
.percentile-pill {
    display: inline-block;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.percentile-top10 { background: #dcfce7; color: #166534; }
.percentile-top25 { background: #d1fae5; color: #065f46; }
.percentile-above { background: #dbeafe; color: #1e40af; }
.percentile-below { background: #fef3c7; color: #92400e; }
.percentile-bottom { background: #fee2e2; color: #991b1b; }

/* ============================================
   Loading Skeletons
   ============================================ */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
.skeleton {
    background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite ease-in-out;
    border-radius: 6px;
}
.skeleton-card {
    height: 90px;
    border-radius: 8px;
}
.skeleton-row {
    height: 16px;
    margin-bottom: 0.5rem;
    border-radius: 4px;
}
.skeleton-row:nth-child(odd) { width: 80%; }
.skeleton-row:nth-child(even) { width: 60%; }
.skeleton-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.skeleton-table {
    padding: 1rem;
}

/* ============================================
   Empty States
   ============================================ */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    text-align: center;
    color: var(--text-muted);
}
.empty-state-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    opacity: 0.4;
}
.empty-state-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
}
.empty-state-message {
    font-size: 0.8125rem;
    max-width: 400px;
    line-height: 1.6;
    margin-bottom: 1rem;
}
.empty-state-actions {
    display: flex;
    gap: 0.5rem;
}

/* ============================================
   Data Freshness
   ============================================ */
.freshness-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.6875rem;
    color: var(--text-muted);
    padding: 0.2rem 0.5rem;
    background: var(--gray-50);
    border: 1px solid var(--border);
    border-radius: 4px;
}
.freshness-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
    animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    .sidebar, .page-header button, .page-header .btn,
    .tabs, .uf-bar, .cross-links, .freshness-indicator,
    nav, .sidebar-select, .search-box, .view-controls {
        display: none !important;
    }
    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
    }
    .card {
        break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
    .page-header {
        border-bottom: 2px solid #333;
        padding-bottom: 0.5rem;
        margin-bottom: 1rem;
    }
    .page-header h1 { font-size: 1.2rem; }
    body { font-size: 11pt; }
    table { font-size: 9pt; }
    .metric-value { font-size: 1.2rem; }
    @page { margin: 1.5cm; }
}

/* ============================================
   Friendly Error Messages
   ============================================ */
.error-friendly {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(220, 53, 69, 0.06);
    border: 1px solid rgba(220, 53, 69, 0.2);
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.8125rem;
    color: var(--text);
}
.error-friendly-icon {
    font-size: 1.25rem;
    color: var(--danger);
    flex-shrink: 0;
}
.error-friendly-actions {
    margin-top: 0.5rem;
    display: flex;
    gap: 0.5rem;
}
