/* ═══════════════════════════════════════════════════════════════
   Design Tokens
═══════════════════════════════════════════════════════════════ */
:root {
    --sidebar-w:        260px;
    --sidebar-collapsed-w: 62px;
    --sidebar-bg:       #3d1010;
    --sidebar-hdr-bg:   #2a0a0a;
    --sidebar-text:     #d4a0a0;
    --sidebar-hover-bg: rgba(255,255,255,0.06);
    --sidebar-active-bg:rgba(239,68,68,0.18);
    --sidebar-active:   #f87171;

    --accent:           #ef4444;
    --accent-hover:     #dc2626;
    --accent-light:     rgba(239,68,68,0.1);

    --header-h:         62px;
    --header-bg:        #ffffff;

    --content-bg:       #fef2f2;
    --card-bg:          #ffffff;
    --card-shadow:      0 2px 14px rgba(180,0,0,0.06);
    --card-radius:      14px;

    --text-primary:     #1c0707;
    --text-secondary:   #7f3535;
    --text-muted:       #c08080;
    --border:           rgba(200,0,0,0.08);

    --ease:             0.22s ease;
}

/* ═══════════════════════════════════════════════════════════════
   Reset & Base
═══════════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }

body {
    margin: 0;
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--content-bg);
}

/* ═══════════════════════════════════════════════════════════════
   Sidebar — always fixed, full viewport height
═══════════════════════════════════════════════════════════════ */
.sidebar {
    position: fixed;
    left: 0; top: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    z-index: 1001;
    transition: width var(--ease);
    overflow: hidden;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    height: var(--header-h);
    padding: 0 20px;
    background: var(--sidebar-hdr-bg);
    border-bottom: 1px solid rgba(255,255,255,0.04);
    flex-shrink: 0;
}

.sidebar-logo {
    width: 36px; height: 36px;
    background: var(--accent);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    font-size: 16px; color: #fff;
}

.sidebar-brand-text {
    font-size: 15px; font-weight: 700;
    color: #fff; letter-spacing: 0.3px;
    white-space: nowrap;
}

/* User block */
.sidebar-user {
    display: flex; align-items: center; gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
}

.user-avatar-sm {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #f87171);
    color: #fff; font-size: 13px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; letter-spacing: 0.5px;
}

.sidebar-user-info { overflow: hidden; }

.sidebar-username {
    font-size: 13px; font-weight: 600; color: #e2e8f0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.sidebar-user-role { font-size: 11px; color: var(--sidebar-text); margin-top: 2px; }

/* Nav */
.sidebar-nav {
    flex: 1; overflow-y: auto; padding: 12px 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.08) transparent;
}
.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.nav-label {
    font-size: 10px; font-weight: 700; letter-spacing: 1.3px;
    color: rgba(220,120,120,0.7);
    padding: 12px 20px 4px; margin: 0;
}

.sidebar-nav ul { list-style: none; margin: 0; padding: 0; }

.nav-link-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 20px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 13.5px; font-weight: 500;
    border-left: 3px solid transparent;
    transition: background var(--ease), color var(--ease), border-color var(--ease);
    white-space: nowrap;
}

.nav-link-item i { font-size: 16px; width: 18px; text-align: center; flex-shrink: 0; }

.nav-link-item:hover {
    background: var(--sidebar-hover-bg); color: #fff; text-decoration: none;
}

.nav-link-item.active {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-active);
    border-left-color: var(--sidebar-active);
    text-decoration: none;
}

.sidebar-footer {
    padding: 10px 0;
    border-top: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
}

.signout-link:hover {
    background: rgba(248,113,113,0.1) !important;
    color: #fc8181 !important;
}

/* ─── Collapsed state (desktop icon-only) ─── */
body.sidebar-collapsed .sidebar                { width: var(--sidebar-collapsed-w); }
body.sidebar-collapsed .main-wrapper           { margin-left: var(--sidebar-collapsed-w); }
body.sidebar-collapsed .top-header             { left: var(--sidebar-collapsed-w); }
body.sidebar-collapsed .sidebar-brand-text,
body.sidebar-collapsed .sidebar-user-info,
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .nav-link-item span     { display: none; }
body.sidebar-collapsed .sidebar-user           { justify-content: center; padding: 16px 12px; }
body.sidebar-collapsed .user-avatar-sm         { margin: 0; }
body.sidebar-collapsed .nav-link-item          { justify-content: center; padding: 12px; border-left: none; }
body.sidebar-collapsed .sidebar-header         { justify-content: center; padding: 0 12px; }
body.sidebar-collapsed .sidebar-logo           { margin: 0; }

/* ═══════════════════════════════════════════════════════════════
   Main Wrapper — offset left by sidebar, offset top by header
═══════════════════════════════════════════════════════════════ */
.main-wrapper {
    margin-left: var(--sidebar-w);
    padding-top: var(--header-h);
    min-height: 100vh;
    width: calc(100% - var(--sidebar-w));
    display: flex; flex-direction: column;
    transition: margin-left var(--ease), width var(--ease);
}

/* ═══════════════════════════════════════════════════════════════
   Top Header — fixed, always visible, spans content area
═══════════════════════════════════════════════════════════════ */
.top-header {
    position: fixed;
    top: 0;
    left: var(--sidebar-w);
    right: 0;
    height: var(--header-h);
    background: var(--header-bg);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 28px;
    z-index: 999;
    box-shadow: 0 1px 0 var(--border);
    transition: left var(--ease);
}

.header-left  { display: flex; align-items: center; gap: 14px; }
.header-right { display: flex; align-items: center; gap: 12px; }

.sidebar-toggle-btn {
    background: none; border: none; cursor: pointer;
    color: var(--text-secondary);
    font-size: 22px; padding: 6px 8px;
    border-radius: 8px; line-height: 1;
    transition: background var(--ease), color var(--ease);
}
.sidebar-toggle-btn:hover { background: var(--accent-light); color: var(--accent); }

.header-page-title { font-size: 16px; font-weight: 700; color: var(--text-primary); }

.header-user-pill {
    display: flex; align-items: center; gap: 9px;
    background: #f4f6fb; border-radius: 40px;
    padding: 4px 14px 4px 4px; cursor: default;
}

.header-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #f87171);
    color: #fff; font-size: 12px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    letter-spacing: 0.5px;
}

.header-username { font-size: 13px; font-weight: 500; color: var(--text-primary); }

/* ═══════════════════════════════════════════════════════════════
   Page Content — full width, fills remaining height
═══════════════════════════════════════════════════════════════ */
.page-content {
    flex: 1;
    width: 100%;
    padding: 28px 32px;
    box-sizing: border-box;
}

/* Every direct child card of page-content stretches full width */
.page-content > * { width: 100%; box-sizing: border-box; }

/* ═══════════════════════════════════════════════════════════════
   Mobile Sidebar Overlay
═══════════════════════════════════════════════════════════════ */
.sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1000;
}
body.sidebar-open .sidebar-overlay { display: block; }

/* ═══════════════════════════════════════════════════════════════
   Auth Screen
═══════════════════════════════════════════════════════════════ */
.auth-wrapper {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #5c1a1a 0%, #7f2020 100%);
    padding: 24px;
}

.auth-card {
    background: #fff; border-radius: 20px;
    padding: 48px 40px; width: 100%; max-width: 420px;
    text-align: center;
    box-shadow: 0 24px 64px rgba(0,0,0,0.28);
}

.auth-logo {
    width: 64px; height: 64px; border-radius: 18px;
    background: linear-gradient(135deg, var(--accent), #f87171);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 20px; font-size: 28px; color: #fff;
}

.auth-title { font-size: 24px; font-weight: 700; color: var(--text-primary); margin-bottom: 6px; }
.auth-subtitle { font-size: 13px; color: var(--text-secondary); margin-bottom: 28px; }

.auth-description {
    font-size: 14px; color: var(--text-secondary);
    margin-bottom: 24px; line-height: 1.6;
}

.btn-signin {
    display: inline-flex; align-items: center; gap: 10px; justify-content: center;
    width: 100%; padding: 13px 24px;
    background: var(--accent); color: #fff;
    border-radius: 10px; font-size: 14px; font-weight: 600;
    text-decoration: none; border: none;
    transition: background var(--ease), transform var(--ease);
}
.btn-signin:hover {
    background: var(--accent-hover); color: #fff;
    text-decoration: none; transform: translateY(-1px);
}

/* ═══════════════════════════════════════════════════════════════
   Utility Card — always full width
═══════════════════════════════════════════════════════════════ */
.ui-card {
    width: 100%;
    background: var(--card-bg); border-radius: var(--card-radius);
    box-shadow: var(--card-shadow); border: 1px solid var(--border); padding: 24px;
}

/* ═══════════════════════════════════════════════════════════════
   Welcome Banner — full width
═══════════════════════════════════════════════════════════════ */
.welcome-banner {
    width: 100%;
    background: linear-gradient(135deg, #5c1a1a 0%, #7f2020 55%, #991f1f 100%);
    border-radius: var(--card-radius);
    padding: 30px 32px; color: #fff;
    margin-bottom: 24px;
    display: flex; align-items: center; justify-content: space-between; gap: 24px;
    flex-wrap: wrap;
    overflow: hidden; position: relative;
}
.welcome-banner::before {
    content: ''; position: absolute;
    top: -50px; right: -30px;
    width: 180px; height: 180px; border-radius: 50%;
    background: rgba(239,68,68,0.12);
}
.welcome-banner::after {
    content: ''; position: absolute;
    bottom: -60px; right: 120px;
    width: 130px; height: 130px; border-radius: 50%;
    background: rgba(248,113,113,0.1);
}

.welcome-greeting { font-size: 20px; font-weight: 700; margin-bottom: 5px; }
.welcome-subtitle { font-size: 13px; opacity: 0.65; }

.quick-actions { display: flex; gap: 10px; flex-wrap: wrap; position: relative; z-index: 1; }

.quick-action-btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 9px 18px; border-radius: 8px;
    font-size: 13px; font-weight: 600; text-decoration: none;
    transition: all var(--ease);
}
.quick-action-btn.primary { background: var(--accent); color: #fff; }
.quick-action-btn.primary:hover {
    background: var(--accent-hover); color: #fff;
    text-decoration: none; transform: translateY(-1px);
}
.quick-action-btn.ghost {
    background: rgba(255,255,255,0.1); color: #fff;
    border: 1px solid rgba(255,255,255,0.2);
}
.quick-action-btn.ghost:hover {
    background: rgba(255,255,255,0.18); color: #fff;
    text-decoration: none; transform: translateY(-1px);
}

/* ─── Stat Cards — full-width grid ─── */
.stat-cards {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px; margin-bottom: 24px;
}

.stat-card {
    background: var(--card-bg); border-radius: var(--card-radius);
    box-shadow: var(--card-shadow); border: 1px solid var(--border);
    padding: 20px 22px;
    display: flex; align-items: center; gap: 16px;
}

.stat-icon {
    width: 46px; height: 46px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; flex-shrink: 0;
}
.stat-icon.blue   { background: var(--accent-light);  color: var(--accent); }
.stat-icon.purple { background: rgba(248,113,113,0.1);  color: #f87171; }
.stat-icon.green  { background: rgba(16,185,129,0.1);  color: #10b981; }
.stat-icon.orange { background: rgba(245,158,11,0.1);  color: #f59e0b; }

.stat-label { font-size: 11px; color: var(--text-secondary); margin-bottom: 3px; font-weight: 500; }
.stat-value { font-size: 17px; font-weight: 700; color: var(--text-primary); line-height: 1; }

/* Section Header */
.section-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 18px; }
.section-title  { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.section-subtitle { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

/* Nav Shortcuts — 3-column row, full width */
.shortcuts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    width: 100%;
}

.nav-shortcut {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 16px; border-radius: 10px;
    background: #fff5f5;
    text-decoration: none;
    transition: background var(--ease), transform var(--ease);
    border: 1px solid var(--border);
    height: 100%;
}
.nav-shortcut:hover { background: #fee2e2; transform: translateY(-1px); text-decoration: none; }

.nav-shortcut-icon {
    width: 42px; height: 42px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; flex-shrink: 0;
}
.nav-shortcut-icon.blue   { background: var(--accent-light);  color: var(--accent); }
.nav-shortcut-icon.purple { background: rgba(248,113,113,0.1);  color: #f87171; }
.nav-shortcut-icon.green  { background: rgba(16,185,129,0.1);  color: #10b981; }

.nav-shortcut-title { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.nav-shortcut-desc  { font-size: 11.5px; color: var(--text-secondary); margin-top: 2px; }

/* ═══════════════════════════════════════════════════════════════
   Workspace Tabs
═══════════════════════════════════════════════════════════════ */
.ws-tab-nav {
    position: relative;
    display: inline-flex;
    gap: 4px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 6px;
    margin-bottom: 24px;
    box-shadow: var(--card-shadow);
}

.ws-tab-btn {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 22px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: color var(--ease);
    white-space: nowrap;
    font-family: inherit;
}
.ws-tab-btn:hover:not(.active) {
    color: var(--text-primary);
    background: var(--accent-light);
}
.ws-tab-btn.active { color: #fff; }
.ws-tab-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.ws-tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    background: rgba(255,255,255,0.25);
    color: inherit;
    transition: background var(--ease), color var(--ease);
}
.ws-tab-btn:not(.active) .ws-tab-badge {
    background: var(--accent-light);
    color: var(--accent);
}

/* Animated sliding indicator pill */
.ws-tab-indicator {
    position: absolute;
    top: 6px;
    bottom: 6px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--accent), #f87171);
    box-shadow: 0 2px 10px rgba(239,68,68,0.35);
    transition: left 0.25s cubic-bezier(.4,0,.2,1),
                width 0.25s cubic-bezier(.4,0,.2,1);
    pointer-events: none;
    z-index: 0;
}

.ws-tab-panel { width: 100%; }

/* ═══════════════════════════════════════════════════════════════
   Reports Search Bar
═══════════════════════════════════════════════════════════════ */
.reports-search-bar {
    display: none; /* shown by JS after data loads */
    position: relative;
    margin-bottom: 20px;
}
.reports-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 15px;
    pointer-events: none;
}
.reports-search-input {
    width: 100%;
    padding: 10px 40px 10px 40px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--text-primary);
    font-size: 13.5px;
    outline: none;
    transition: border-color 0.15s;
    box-sizing: border-box;
}
.reports-search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}
.reports-search-input::placeholder { color: var(--text-muted); }
.reports-search-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 13px;
    padding: 4px 6px;
    border-radius: 4px;
    line-height: 1;
}
.reports-search-clear:hover { color: var(--accent); background: var(--accent-light); }

/* ═══════════════════════════════════════════════════════════════
   Reports Grid — full width
═══════════════════════════════════════════════════════════════ */
.reports-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.report-card-new {
    background: var(--card-bg); border-radius: var(--card-radius);
    box-shadow: var(--card-shadow); border: 1px solid var(--border);
    text-decoration: none; display: block;
    overflow: hidden;
    transition: transform var(--ease), box-shadow var(--ease);
}
.report-card-new:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    text-decoration: none;
}

.report-card-header {
    height: 90px;
    background: linear-gradient(135deg, #5c1a1a, #7f2020);
    display: flex; align-items: center; justify-content: center;
    font-size: 30px; position: relative; overflow: hidden;
}
.report-card-header::before {
    content: ''; position: absolute;
    top: -15px; right: -15px;
    width: 70px; height: 70px; border-radius: 50%;
    background: rgba(239,68,68,0.2);
}

.report-card-body { padding: 18px 20px; }
.report-card-title { font-size: 14px; font-weight: 700; color: var(--text-primary); margin-bottom: 5px; }
.report-card-id {
    font-size: 10.5px; color: var(--text-muted);
    font-family: 'Consolas', 'Monaco', monospace;
    word-break: break-all;
}

.report-card-footer {
    padding: 12px 20px; background: #fff8f8;
    border-top: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
}
.view-report-link {
    font-size: 12.5px; font-weight: 600;
    color: var(--accent); text-decoration: none;
    display: flex; align-items: center; gap: 5px;
}
.view-report-link:hover { color: var(--accent-hover); text-decoration: none; }

/* State Containers */
.state-container {
    width: 100%; text-align: center; padding: 80px 24px;
    background: var(--card-bg); border-radius: var(--card-radius);
    box-shadow: var(--card-shadow); border: 1px solid var(--border);
}
.state-icon { font-size: 48px; color: var(--text-muted); margin-bottom: 14px; }
.state-text { font-size: 15px; font-weight: 600; color: var(--text-secondary); margin-bottom: 4px; }
.state-subtext { font-size: 12.5px; color: var(--text-muted); }

.spinner-ring {
    width: 38px; height: 38px;
    border: 3px solid #fee2e2; border-top-color: var(--accent);
    border-radius: 50%; animation: spin 0.75s linear infinite;
    margin: 0 auto 14px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.error-inline {
    width: 100%;
    background: #fef2f2; border: 1px solid #fecaca;
    border-radius: 10px; padding: 14px 18px;
    color: #b91c1c; font-size: 13px;
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 20px;
}

/* ═══════════════════════════════════════════════════════════════
   Report Viewer — full width, fills vertical space
═══════════════════════════════════════════════════════════════ */
.report-viewer-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px; flex-wrap: wrap; gap: 12px;
    width: 100%;
}

.report-viewer-name {
    font-size: 16px; font-weight: 700; color: var(--text-primary);
    display: flex; align-items: center; gap: 8px;
}

.report-viewer-wrapper {
    width: 100%;
    background: var(--card-bg);
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: width var(--ease), border-radius var(--ease);
}

#report-container {
    width: 100%;
    height: calc(100vh - var(--header-h) - 120px);
    min-height: 480px;
    background: #fff5f5;
    transition: height var(--ease);
    resize: vertical;
    overflow: hidden;
}

/* Resize handle hint at the bottom of the wrapper */
.report-viewer-wrapper::after {
    content: '';
    display: block;
    height: 6px;
    background: linear-gradient(to bottom, transparent, rgba(0,0,0,0.04));
    cursor: ns-resize;
}

/* Report page — remove horizontal padding so viewer spans full content width */
.report-page .page-content {
    padding: 16px 0 0;
}

/* Keep the header padded */
.report-page .report-viewer-header {
    padding: 0 20px 16px;
}

/* Edge-to-edge: no radius when sidebar is expanded (desktop) */
@media (min-width: 768px) {
    .report-viewer-wrapper {
        border-left: none;
        border-right: none;
        border-radius: 0;
    }
}

/* View Full Page button */
.btn-fullpage {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 7px 16px;
    font-size: 13px; font-weight: 600;
    color: var(--accent);
    background: var(--accent-light);
    border: 1.5px solid var(--accent);
    border-radius: 8px;
    cursor: pointer;
    transition: background var(--ease), color var(--ease);
    white-space: nowrap;
    margin-left: auto;
}
.btn-fullpage:hover {
    background: var(--accent);
    color: #fff;
}

/* Full-page report modal */
.report-modal {
    display: none;
    position: fixed; inset: 0;
    z-index: 2000;
    background: rgba(10,14,30,0.72);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    align-items: stretch;
    justify-content: stretch;
}
.report-modal.is-open { display: flex; }

.report-modal-inner {
    display: flex; flex-direction: column;
    width: 100%; height: 100%;
    background: var(--content-bg);
}

.report-modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 24px;
    height: var(--header-h);
    background: var(--header-bg);
    box-shadow: 0 1px 0 var(--border);
    flex-shrink: 0;
}

.report-modal-title {
    display: flex; align-items: center; gap: 10px;
    font-size: 15px; font-weight: 700; color: var(--text-primary);
}

.report-modal-close {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px;
    border: none; background: transparent;
    font-size: 18px; color: var(--text-secondary);
    border-radius: 8px; cursor: pointer;
    transition: background var(--ease), color var(--ease);
}
.report-modal-close:hover { background: rgba(0,0,0,0.06); color: var(--text-primary); }

.report-modal-container {
    flex: 1;
    width: 100%;
    background: #fff5f5;
}

/* ═══════════════════════════════════════════════════════════════
   Data Tables — full width
═══════════════════════════════════════════════════════════════ */
.data-table-wrapper {
    width: 100%;
    background: var(--card-bg); border-radius: var(--card-radius);
    box-shadow: var(--card-shadow); border: 1px solid var(--border);
    overflow: hidden;
}

.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }

.data-table thead th {
    background: #fff5f5; padding: 12px 20px;
    font-size: 10.5px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.9px; color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
}

.data-table tbody td {
    padding: 12px 20px; border-bottom: 1px solid #fee2e2;
    vertical-align: top;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: #fff8f8; }

.key-col { width: 28%; font-weight: 600; color: var(--text-secondary); }
.val-col { font-family: 'Consolas', 'Monaco', monospace; font-size: 12.5px; word-break: break-all; }

/* ═══════════════════════════════════════════════════════════════
   Page Header
═══════════════════════════════════════════════════════════════ */
.page-header { width: 100%; margin-bottom: 22px; }
.page-header-title { font-size: 19px; font-weight: 700; color: var(--text-primary); margin-bottom: 3px; }
.page-header-desc  { font-size: 13px; color: var(--text-secondary); }

/* ═══════════════════════════════════════════════════════════════
   Back Button
═══════════════════════════════════════════════════════════════ */
.back-btn {
    display: inline-flex; align-items: center; gap: 7px;
    font-size: 13px; font-weight: 500;
    color: var(--text-secondary); text-decoration: none;
    padding: 7px 14px; border-radius: 8px;
    background: var(--card-bg); border: 1px solid var(--border);
    box-shadow: var(--card-shadow);
    transition: all var(--ease);
}
.back-btn:hover {
    background: var(--accent-light); color: var(--accent);
    border-color: var(--accent); text-decoration: none;
}

/* ═══════════════════════════════════════════════════════════════
   Error Card
═══════════════════════════════════════════════════════════════ */
.error-card {
    width: 100%;
    background: var(--card-bg); border-radius: var(--card-radius);
    box-shadow: var(--card-shadow); border: 1px solid var(--border);
    padding: 56px 40px; text-align: center;
}
.error-icon { font-size: 44px; color: #fc8181; margin-bottom: 14px; }
.error-title { font-size: 18px; font-weight: 700; color: var(--text-primary); margin-bottom: 8px; }
.error-stack {
    text-align: left; background: #fef2f2;
    border: 1px solid #fecaca; border-radius: 8px;
    padding: 14px; font-size: 11px; font-family: monospace;
    color: #7f1d1d; overflow-x: auto; margin: 16px 0;
}

/* ═══════════════════════════════════════════════════════════════
   Bootstrap overrides — kill container max-width
═══════════════════════════════════════════════════════════════ */
.page-content .container,
.page-content .container-fluid,
.page-content .container-lg,
.page-content .container-xl {
    max-width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    width: 100% !important;
}

/* ═══════════════════════════════════════════════════════════════
   Responsive
═══════════════════════════════════════════════════════════════ */
@media (max-width: 1199px) {
    .stat-cards { grid-template-columns: repeat(2, 1fr); }
    .shortcuts-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 767px) {
    .sidebar { transform: translateX(-100%); transition: transform var(--ease); }
    body.sidebar-open .sidebar { transform: translateX(0); }
    .main-wrapper { margin-left: 0 !important; width: 100% !important; }
    .top-header { left: 0 !important; }
    .page-content { padding: 18px 16px; }
    .stat-cards { grid-template-columns: 1fr 1fr; }
    .shortcuts-grid { grid-template-columns: 1fr; }
    .welcome-banner { flex-direction: column; align-items: flex-start; }
    #report-container { height: calc(100vh - var(--header-h) - 160px); }
}

@media (max-width: 480px) {
    .stat-cards { grid-template-columns: 1fr; }
    .auth-card  { padding: 32px 22px; }
    .reports-grid { grid-template-columns: 1fr; }
}
