/* ============================================
   Title Curative Analysis - Themed (Dark/Light)
   ============================================ */

:root,
body[data-theme="dark"] {
    --bg-primary: #0f1419;
    --bg-secondary: #1a1f2e;
    --bg-tertiary: #242b3d;
    --bg-card: #1e2433;
    --bg-hover: #2a3347;
    
    --text-primary: #e7eaf0;
    --text-secondary: #9ca3b4;
    --text-muted: #6b7280;
    
    --accent-blue: #3b82f6;
    --accent-blue-hover: #2563eb;
    --accent-green: #10b981;
    --accent-yellow: #f59e0b;
    --accent-red: #ef4444;
    --accent-purple: #8b5cf6;
    
    --border-color: #2d3548;
    --border-light: #374151;
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
}

body[data-theme="light"] {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --bg-card: #ffffff;
    --bg-hover: #e2e8f0;
    
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    --accent-blue: #2563eb;
    --accent-blue-hover: #1d4ed8;
    --accent-green: #059669;
    --accent-yellow: #d97706;
    --accent-red: #dc2626;
    --accent-purple: #7c3aed;
    
    --border-color: #e2e8f0;
    --border-light: #cbd5e1;
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
}

:root {
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 0px;
    --header-height: 64px;
    --border-radius: 8px;
    --border-radius-lg: 12px;
    
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-sidebar: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

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

/* ============================================
   Sidebar
   ============================================ */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: transform var(--transition-sidebar), width var(--transition-sidebar);
    overflow: hidden;
}

.sidebar.collapsed {
    transform: translateX(calc(-1 * var(--sidebar-width)));
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
    opacity: 0;
    transition: opacity var(--transition-sidebar);
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

.sidebar-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 65px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-img {
    height: 36px;
    width: auto;
    object-fit: contain;
}

/* Logo: white on transparent (invert-rmbg). Dark mode: use as-is. Light mode: invert so it’s visible. */
body[data-theme="dark"] .logo-img {
    filter: none;
}

body[data-theme="light"] .logo-img {
    filter: invert(1);
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Sidebar edge toggle - lives on the right edge of sidebar, clicks to collapse */
.sidebar-edge-toggle {
    position: fixed;
    top: 50%;
    left: var(--sidebar-width);
    transform: translateY(-50%) translateX(-50%);
    width: 28px;
    height: 64px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-left: none;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    z-index: 101;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: left var(--transition-sidebar), background var(--transition-fast), color var(--transition-fast);
}

.sidebar-edge-toggle:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.sidebar-edge-toggle .arrow-expanded { display: block; }
.sidebar-edge-toggle .arrow-collapsed { display: none; }

body.sidebar-collapsed .sidebar-edge-toggle {
    left: 14px;
    border-left: 1px solid var(--border-color);
}

body.sidebar-collapsed .sidebar-edge-toggle .arrow-expanded { display: none; }
body.sidebar-collapsed .sidebar-edge-toggle .arrow-collapsed { display: block; }

/* Theme toggle button - align with header buttons */
.theme-toggle-btn {
    position: relative;
    z-index: 1;
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    padding: 10px;
    min-height: 44px;
    min-width: 44px;
    border-radius: var(--border-radius);
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle-btn:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.theme-toggle-btn svg {
    pointer-events: none;
}

.theme-toggle-btn .icon-moon {
    display: none;
}

body[data-theme="light"] .theme-toggle-btn .icon-sun {
    display: none;
}

body[data-theme="light"] .theme-toggle-btn .icon-moon {
    display: block;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--border-radius);
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--accent-blue);
    color: white;
}

.nav-item svg {
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
}

.sidebar-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 12px;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent-blue);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    flex-shrink: 0;
}

.sidebar-user-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.sidebar-user-name {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-logout-link {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.15s;
}

.sidebar-logout-link:hover {
    color: var(--accent-red, #ef4444);
}

body.sidebar-collapsed .sidebar-user-info {
    justify-content: center;
}

body.sidebar-collapsed .sidebar-user-details {
    display: none;
}

.version-info {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ============================================
   Main Content
   ============================================ */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left var(--transition-sidebar);
    /* Prevent sidebar edge toggle from overlapping content */
    padding-left: 20px;
}

body.sidebar-collapsed .main-content {
    margin-left: 0;
    padding-left: 30px;
}

.top-header {
    height: var(--header-height);
    padding: 0 32px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.content-area {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
}

/* ============================================
   Breadcrumbs
   ============================================ */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    margin-bottom: 24px;
    color: var(--text-muted);
}

.breadcrumb a {
    color: var(--accent-blue);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.breadcrumb a:hover {
    color: var(--accent-blue-hover);
    text-decoration: underline;
}

.breadcrumb-sep {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.breadcrumb-current {
    color: var(--text-secondary);
    font-weight: 500;
}

/* ============================================
   Cards
   ============================================ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 24px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
}

/* ============================================
   KPI Cards
   ============================================ */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.kpi-card.blue::before { background: var(--accent-blue); }
.kpi-card.green::before { background: var(--accent-green); }
.kpi-card.yellow::before { background: var(--accent-yellow); }
.kpi-card.purple::before { background: var(--accent-purple); }

.kpi-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kpi-value {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
}

.kpi-card.blue .kpi-value { color: var(--accent-blue); }
.kpi-card.green .kpi-value { color: var(--accent-green); }
.kpi-card.yellow .kpi-value { color: var(--accent-yellow); }
.kpi-card.purple .kpi-value { color: var(--accent-purple); }

.kpi-subtext {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.kpi-note {
    background: var(--bg-tertiary);
    border-radius: var(--border-radius);
    padding: 12px 16px;
    margin-bottom: 24px;
    border-left: 3px solid var(--accent-yellow);
}

.kpi-note small {
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ============================================
   Upload Area
   ============================================ */

/* Results page - Split layout (PDF left, analysis data right) */
.results-split-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    min-height: calc(100vh - 180px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
}

.results-pdf-panel {
    display: flex;
    flex-direction: column;
    background: var(--bg-tertiary);
    border-right: 1px solid var(--border-color);
}

.pdf-viewer-header {
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    font-size: 0.9rem;
}

.pdf-viewer-iframe {
    flex: 1;
    width: 100%;
    min-height: 600px;
    border: none;
    background: #525659;
}

.results-data-panel {
    overflow-y: auto;
    padding: 24px;
}

/* When split layout is used, adjust spacing */
.results-split-layout .kpi-grid {
    margin-bottom: 20px;
}

.results-split-layout .executive-summary {
    margin-bottom: 20px;
}

/* New Analysis - Two column layout */
.new-analysis-layout {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 48px;
    align-items: start;
    max-width: 1400px;
    margin: 0 auto;
}

.intro-section {
    position: sticky;
    top: 80px;
}

.intro-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.intro-lead {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.intro-content {
    font-size: 0.9rem;
    line-height: 1.65;
}

.intro-content h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 20px 0 12px 0;
}

.intro-content h3:first-child {
    margin-top: 0;
}

.intro-content ul {
    margin: 0 0 8px 0;
    padding-left: 20px;
}

.intro-content li {
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.intro-content strong {
    color: var(--text-primary);
}

.upload-section {
    margin-bottom: 32px;
}

.upload-area {
    border: 2px dashed var(--border-light);
    border-radius: var(--border-radius-lg);
    padding: 48px;
    text-align: center;
    transition: all var(--transition-normal);
    cursor: pointer;
    background: var(--bg-tertiary);
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.1);
}

.upload-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    color: var(--text-muted);
}

.upload-text {
    font-size: 1.125rem;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.upload-hint {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.upload-input {
    display: none;
}

/* File Preview */
.file-preview {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius);
    margin-top: 16px;
}

.file-icon {
    width: 48px;
    height: 48px;
    background: var(--accent-blue);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.file-info { flex: 1; }
.file-name { font-weight: 500; margin-bottom: 4px; }
.file-size { font-size: 0.875rem; color: var(--text-muted); }

.file-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--border-radius);
    transition: all var(--transition-fast);
}

.file-remove:hover {
    background: var(--bg-hover);
    color: var(--accent-red);
}

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

.btn-primary {
    background: var(--accent-blue);
    color: white;
}

.btn-primary:hover { background: var(--accent-blue-hover); }

.btn-primary:disabled {
    background: var(--bg-tertiary);
    color: var(--text-muted);
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover { background: var(--bg-hover); }

.btn-success { background: var(--accent-green); color: white; }
.btn-success:hover { background: #059669; }

.btn-danger { background: var(--accent-red); color: white; }
.btn-danger:hover { background: #dc2626; }

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: none;
    padding: 8px 12px;
}
.btn-ghost:hover { color: var(--text-primary); background: var(--bg-hover); }

.btn-sm { padding: 6px 12px; font-size: 0.75rem; }
.btn-lg { padding: 16px 32px; font-size: 1rem; }

/* ============================================
   Form Elements
   ============================================ */
.form-group { margin-bottom: 20px; }

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-input,
.form-select {
    width: 100%;
    padding: 12px 16px;
    font-size: 0.875rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.form-select { cursor: pointer; }

/* Search Input */
.search-input-wrap {
    position: relative;
    flex: 1;
    min-width: 180px;
    max-width: 320px;
}

.search-input-wrap svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.search-input-wrap input {
    width: 100%;
    padding: 10px 12px 10px 36px;
    font-size: 0.85rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.search-input-wrap input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.search-input-wrap input::placeholder {
    color: var(--text-muted);
}

/* Checkbox */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.checkbox-input {
    width: 20px;
    height: 20px;
    accent-color: var(--accent-blue);
}

/* ============================================
   Progress Bar
   ============================================ */
.progress-container { margin: 24px 0; }

.progress-bar {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
    border-radius: 4px;
    transition: width var(--transition-normal);
}

.progress-text {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* ============================================
   Tables
   ============================================ */
.table-container {
    overflow-x: auto;
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background: var(--bg-tertiary);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    position: sticky;
    top: 0;
    z-index: 2;
}

.data-table tbody tr {
    transition: background var(--transition-fast);
}

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

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr.exception-row {
    cursor: pointer;
}

/* ============================================
   Exception Detail Panel
   ============================================ */
.exception-detail-row td {
    padding: 0 !important;
    border-bottom: 1px solid var(--border-color);
}

.exception-detail-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, padding 0.35s ease;
    background: var(--bg-tertiary);
}

.exception-detail-panel.open {
    max-height: 600px;
    padding: 0;
}

.exception-detail-inner {
    padding: 20px 24px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.detail-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-field-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.detail-field-value {
    font-size: 0.875rem;
    color: var(--text-primary);
    line-height: 1.5;
}

.detail-field-full {
    grid-column: 1 / -1;
}

/* ============================================
   Priority Badges
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-critical { background: rgba(239, 68, 68, 0.2); color: var(--accent-red); }
.badge-high { background: rgba(245, 158, 11, 0.2); color: var(--accent-yellow); }
.badge-medium { background: rgba(59, 130, 246, 0.2); color: var(--accent-blue); }
.badge-low { background: rgba(16, 185, 129, 0.2); color: var(--accent-green); }

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: var(--border-radius);
}

.status-active { background: rgba(16, 185, 129, 0.15); color: var(--accent-green); }
.status-expired { background: rgba(239, 68, 68, 0.15); color: var(--accent-red); }
.status-unknown { background: rgba(107, 114, 128, 0.15); color: var(--text-muted); }
.status-perpetual { background: rgba(139, 92, 246, 0.15); color: var(--accent-purple); }
.status-open { background: rgba(245, 158, 11, 0.15); color: var(--accent-yellow); }
.status-closed { background: rgba(16, 185, 129, 0.15); color: var(--accent-green); }
.status-omit { background: rgba(139, 92, 246, 0.15); color: var(--accent-purple); }

/* Analysis status badges for history page */
.status-badge-completed {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-badge-processing {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-blue);
    border: 1px solid rgba(59, 130, 246, 0.3);
    animation: pulse-badge 2s ease-in-out infinite;
}

.status-badge-failed {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-badge-pending {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-yellow);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

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

/* ============================================
   Priority Distribution Bar
   ============================================ */
.priority-distribution {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.priority-bar-track {
    display: flex;
    height: 14px;
    border-radius: 7px;
    overflow: hidden;
    background: var(--bg-tertiary);
    margin-bottom: 12px;
}

.priority-bar-segment {
    height: 100%;
    transition: width 0.5s ease;
    min-width: 0;
}

.priority-bar-segment.critical { background: var(--accent-red); }
.priority-bar-segment.high { background: var(--accent-yellow); }
.priority-bar-segment.medium { background: var(--accent-blue); }
.priority-bar-segment.low { background: var(--accent-green); }

.priority-legend {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.priority-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.priority-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.priority-legend-dot.critical { background: var(--accent-red); }
.priority-legend-dot.high { background: var(--accent-yellow); }
.priority-legend-dot.medium { background: var(--accent-blue); }
.priority-legend-dot.low { background: var(--accent-green); }

/* ============================================
   Executive Summary
   ============================================ */
.executive-summary {
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-tertiary) 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 32px;
    margin-bottom: 32px;
}

.summary-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.summary-icon {
    width: 48px;
    height: 48px;
    background: var(--accent-blue);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.summary-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.summary-item {
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
}

.summary-item-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.summary-item-value {
    font-size: 1rem;
    color: var(--text-primary);
}

/* ============================================
   History Cards
   ============================================ */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all var(--transition-fast);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.history-card:hover {
    border-color: var(--accent-blue);
    background: var(--bg-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.history-icon {
    width: 48px;
    height: 48px;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-blue);
    flex-shrink: 0;
}

.history-info { flex: 1; min-width: 0; }

.history-title {
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.history-stats {
    display: flex;
    gap: 24px;
    text-align: right;
    flex-shrink: 0;
}

.history-stat {
    display: flex;
    flex-direction: column;
}

.history-stat-value {
    font-size: 1.25rem;
    font-weight: 600;
}

.history-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.history-priority-dots {
    display: flex;
    gap: 4px;
    margin-top: 6px;
}

.history-priority-dot {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.history-priority-dot.critical {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
}

.history-priority-dot.high {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-yellow);
}

.history-priority-dot.medium {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-blue);
}

.history-priority-dot.low {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
}

/* ============================================
   Loading States
   ============================================ */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 20, 25, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-content { text-align: center; }

.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

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

.loading-text { font-size: 1.125rem; color: var(--text-primary); margin-bottom: 8px; }
.loading-subtext { font-size: 0.875rem; color: var(--text-muted); }

/* ============================================
   Alerts
   ============================================ */
.alert {
    padding: 16px 20px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.alert-success { background: rgba(16, 185, 129, 0.15); border: 1px solid rgba(16, 185, 129, 0.3); color: var(--accent-green); }
.alert-error { background: rgba(239, 68, 68, 0.15); border: 1px solid rgba(239, 68, 68, 0.3); color: var(--accent-red); }
.alert-warning { background: rgba(245, 158, 11, 0.15); border: 1px solid rgba(245, 158, 11, 0.3); color: var(--accent-yellow); }

/* ============================================
   Toast Notifications
   ============================================ */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column-reverse;
    gap: 8px;
}

.toast {
    padding: 14px 20px;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    font-weight: 500;
    color: white;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 280px;
    max-width: 420px;
    animation: toast-in 0.3s ease forwards;
    cursor: pointer;
}

.toast.removing {
    animation: toast-out 0.3s ease forwards;
}

.toast-success { background: #059669; }
.toast-error { background: #dc2626; }
.toast-info { background: var(--accent-blue); }

@keyframes toast-in {
    from { opacity: 0; transform: translateY(16px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toast-out {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to { opacity: 0; transform: translateY(16px) scale(0.95); }
}

/* ============================================
   Empty State
   ============================================ */
.empty-state {
    text-align: center;
    padding: 64px 32px;
}

.empty-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    color: var(--text-muted);
}

.empty-title { font-size: 1.25rem; font-weight: 600; margin-bottom: 8px; }
.empty-text { color: var(--text-muted); margin-bottom: 24px; }

/* ============================================
   Tabs
   ============================================ */
.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 24px;
    overflow-x: auto;
}

.tab {
    padding: 12px 20px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.tab:hover { color: var(--text-primary); }

.tab.active { color: var(--accent-blue); }

.tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-blue);
}

/* ============================================
   Options Panel
   ============================================ */
.options-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    margin-bottom: 24px;
}

.options-title { font-size: 1rem; font-weight: 600; margin-bottom: 20px; }

.options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

/* Action Bar */
.action-bar {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    margin-top: 24px;
}

/* ============================================
   Expandable Text
   ============================================ */
.expandable-text { position: relative; }
.text-preview, .text-full { line-height: 1.5; }
.text-full { white-space: pre-wrap; word-break: break-word; }

.expand-btn {
    background: none;
    border: none;
    color: var(--accent-blue);
    font-size: 0.75rem;
    cursor: pointer;
    padding: 2px 0;
    margin-top: 4px;
    display: block;
}

.expand-btn:hover { text-decoration: underline; }

/* Confidence */
.confidence-text {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 36px;
    text-align: right;
}

/* ============================================
   Filter Row
   ============================================ */
.filter-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

#filterInfo {
    font-size: 0.875rem;
    color: var(--text-muted);
    padding: 8px 0;
}

/* ============================================
   Schedule Cards
   ============================================ */
.schedule-card {
    background: var(--bg-tertiary);
    padding: 20px;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
    cursor: pointer;
    user-select: none;
}

.schedule-card:hover {
    border-color: var(--accent-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.schedule-card-active {
    border-color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.1);
}

.schedule-name { font-size: 1.25rem; font-weight: 700; color: var(--accent-blue); }
.schedule-count { color: var(--text-primary); font-weight: 500; margin-top: 4px; }
.schedule-refs { color: var(--text-muted); font-size: 0.75rem; }

.schedule-badge {
    display: inline-block;
    margin-top: 8px;
    padding: 4px 8px;
    background: var(--accent-blue);
    color: white;
    font-size: 0.7rem;
    border-radius: 4px;
    font-weight: 600;
}

.schedule-info {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-top: 8px;
    font-style: italic;
}

/* Schedule Items */
.info-section {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.info-header { margin-bottom: 24px; }
.info-header h3 { font-size: 1.125rem; font-weight: 600; margin-bottom: 8px; }

.schedule-items-section { margin-bottom: 24px; }

.schedule-section-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.schedule-items-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.schedule-item {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius);
    font-size: 0.875rem;
}

.item-number { font-weight: 600; color: var(--accent-blue); min-width: 24px; }
.item-desc { color: var(--text-secondary); line-height: 1.5; }

/* ============================================
   Documents Tab
   ============================================ */
.doc-legend {
    display: flex;
    gap: 16px;
    font-size: 0.75rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
}

.legend-dot { width: 10px; height: 10px; border-radius: 50%; }
.dot-success { background: var(--accent-green); }
.dot-partial { background: var(--accent-yellow); }
.dot-failed { background: var(--accent-red); }

.doc-row-success { }
.doc-row-partial { background: rgba(245, 158, 11, 0.05); }
.doc-row-failed { background: rgba(239, 68, 68, 0.05); }

.doc-name { font-weight: 500; }

.doc-error {
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.doc-linked-exceptions {
    margin-top: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.doc-exc-badge {
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-blue);
}

.ocr-method {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.method-cache { background: rgba(139, 92, 246, 0.15); color: var(--accent-purple); }
.method-pymupdf { background: rgba(59, 130, 246, 0.15); color: var(--accent-blue); }
.method-tesseract { background: rgba(245, 158, 11, 0.15); color: var(--accent-yellow); }
.method-tesseract_low_quality { background: rgba(239, 68, 68, 0.15); color: var(--accent-red); }
.method-gpt_vision { background: rgba(16, 185, 129, 0.15); color: var(--accent-green); }
.method-dpt2 { background: rgba(16, 185, 129, 0.2); color: #059669; }
.method-failed { background: rgba(239, 68, 68, 0.15); color: var(--accent-red); }

.quality-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 100px;
}

.quality-bar > div:first-child {
    flex: 1;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}

.quality-fill {
    height: 100%;
    border-radius: 3px;
    transition: width var(--transition-normal);
}

.quality-high { background: var(--accent-green); }
.quality-medium { background: var(--accent-yellow); }
.quality-low { background: var(--accent-red); }

.quality-text { font-size: 0.75rem; font-weight: 600; color: var(--text-primary); min-width: 32px; }

.badge-doc-success {
    background: rgba(16, 185, 129, 0.2); color: var(--accent-green);
    display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px;
    font-size: 0.75rem; font-weight: 600; border-radius: 9999px;
}

.badge-doc-partial {
    background: rgba(245, 158, 11, 0.2); color: var(--accent-yellow);
    display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px;
    font-size: 0.75rem; font-weight: 600; border-radius: 9999px;
}

.badge-doc-failed {
    background: rgba(239, 68, 68, 0.2); color: var(--accent-red);
    display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px;
    font-size: 0.75rem; font-weight: 600; border-radius: 9999px;
}

.ocr-method-legend {
    margin-top: 16px;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.ocr-method-legend span { color: var(--text-secondary); }

/* ============================================
   Settings Page
   ============================================ */
.model-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 16px;
}

.model-info-card {
    background: var(--bg-tertiary);
    padding: 16px;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.model-info-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.model-info-value { font-size: 1rem; font-weight: 600; color: var(--text-primary); }
.model-info-value.active { color: var(--accent-green); }
.model-info-value.inactive { color: var(--text-muted); }

/* Rules Upload */
.rules-upload-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.rules-upload-section h3 { font-size: 1rem; font-weight: 600; margin-bottom: 12px; }

.rules-current {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius);
    margin-bottom: 16px;
}

.rules-icon {
    width: 40px; height: 40px;
    background: var(--accent-green);
    border-radius: var(--border-radius);
    display: flex; align-items: center; justify-content: center; color: white;
}

.rules-info { flex: 1; }
.rules-name { font-weight: 500; }
.rules-meta { font-size: 0.75rem; color: var(--text-muted); }

/* ============================================
   Progress Visualization - Pipeline Style
   ============================================ */
.analysis-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 20, 25, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.progress-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 48px;
    max-width: 500px;
    width: 90%;
    text-align: center;
}

.progress-card-pipeline {
    max-width: 640px;
    width: 95%;
    text-align: left;
    padding: 28px 32px;
}

.progress-pipeline-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.progress-pipeline-header .progress-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.progress-meta {
    display: flex;
    align-items: center;
    gap: 16px;
}

.progress-timer {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.progress-percent-badge {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent-blue);
    padding: 4px 10px;
    background: rgba(59, 130, 246, 0.15);
    border-radius: 6px;
}

.progress-pipeline-steps {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    margin-bottom: 20px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.pipeline-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 1;
}

.pipeline-step .step-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    border: 2px solid var(--border-color);
    background: var(--bg-tertiary);
}

.pipeline-step .step-icon svg {
    width: 16px;
    height: 16px;
}

.pipeline-step .step-label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.pipeline-step.complete .step-icon {
    background: rgba(16, 185, 129, 0.15);
    border-color: var(--accent-green);
    color: var(--accent-green);
}

.pipeline-step.complete .step-label {
    color: var(--accent-green);
}

.pipeline-step.active .step-icon {
    background: rgba(59, 130, 246, 0.2);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
    position: relative;
}

.pipeline-step.active .step-icon svg {
    display: none;
}

.pipeline-step.active .step-icon::after {
    content: '';
    display: block;
    width: 14px;
    height: 14px;
    margin: 0 auto;
    border: 2px solid transparent;
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.pipeline-step.active .step-label {
    color: var(--accent-blue);
    font-weight: 700;
}

.progress-current-op {
    margin-bottom: 12px;
}

.progress-current-op .current-op-text {
    font-size: 0.9rem;
    color: var(--accent-blue);
    font-weight: 500;
}

.progress-bar-container {
    background: var(--bg-tertiary);
    border-radius: 8px;
    height: 10px;
    overflow: hidden;
    margin-bottom: 6px;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
    border-radius: 8px;
    transition: width 0.3s ease;
}

.progress-bar-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.progress-pct-inline {
    font-weight: 600;
    color: var(--accent-blue);
}

.progress-live-log {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.live-log-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.live-log-content {
    max-height: 160px;
    overflow-y: auto;
    padding: 12px;
    font-size: 0.8rem;
    font-family: ui-monospace, 'SF Mono', Consolas, monospace;
    line-height: 1.5;
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.2);
}

.live-log-content .log-entry {
    padding: 4px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.live-log-content .log-entry:last-child {
    border-bottom: none;
}

.live-log-content .log-time {
    color: var(--text-muted);
    margin-right: 8px;
}

.progress-icon {
    width: 80px; height: 80px;
    margin: 0 auto 24px;
    position: relative;
}

.progress-spinner {
    width: 100%; height: 100%;
    border: 4px solid var(--border-color);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.progress-percent {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent-blue);
}

.progress-title { font-size: 1.5rem; font-weight: 600; margin-bottom: 8px; }
.progress-step { color: var(--text-secondary); margin-bottom: 24px; }

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1200px) {
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .options-grid { grid-template-columns: 1fr; }
    .summary-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(calc(-1 * var(--sidebar-width)));
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    body.sidebar-collapsed .sidebar-edge-toggle,
    .sidebar-edge-toggle {
        left: 0;
    }

    .main-content {
        margin-left: 0 !important;
        padding-left: 40px !important;
    }

    .top-header { padding: 0 16px; }
    .content-area { padding: 16px; }

    .new-analysis-layout {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .intro-section {
        position: static;
    }

    .results-split-layout {
        grid-template-columns: 1fr;
    }

    .results-pdf-panel {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        min-height: 400px;
    }

    .pdf-viewer-iframe {
        min-height: 400px;
    }

    .results-data-panel {
        padding: 16px;
    }

    .kpi-grid { grid-template-columns: 1fr; }
    .summary-grid { grid-template-columns: 1fr; }
    .model-info-grid { grid-template-columns: 1fr; }

    .history-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .history-stats { width: 100%; justify-content: space-between; }

    .filter-row {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-row .form-select,
    .search-input-wrap {
        width: 100% !important;
        max-width: none;
    }

    .exception-detail-inner {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   Scrollbar
   ============================================ */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ============================================
   Utility Classes
   ============================================ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--accent-green); }
.text-warning { color: var(--accent-yellow); }
.text-danger { color: var(--accent-red); }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.hidden { display: none !important; }

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ============================================
   Print Stylesheet
   ============================================ */
@media print {
    body {
        background: white !important;
        color: #111 !important;
        font-size: 11pt;
    }

    .sidebar,
    .sidebar-overlay,
    .sidebar-toggle-btn,
    .top-header,
    .toast-container,
    .analysis-progress,
    .btn,
    .action-bar,
    .filter-row,
    .search-input-wrap,
    .tabs {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
    }

    .content-area {
        padding: 0 !important;
    }

    .card,
    .kpi-card,
    .executive-summary {
        border: 1px solid #ccc !important;
        background: white !important;
        box-shadow: none !important;
        break-inside: avoid;
    }

    .tab-content {
        display: block !important;
    }

    .tab-content.hidden {
        display: block !important;
    }

    .kpi-value,
    .summary-item-value {
        color: #111 !important;
    }

    .badge {
        border: 1px solid currentColor;
    }

    .data-table th {
        background: #f3f4f6 !important;
        color: #111 !important;
    }

    .data-table td {
        color: #333 !important;
    }

    a { color: #111 !important; text-decoration: none !important; }
}
