/**
 * VotoLibre Admin - Sistema de Gestión Electoral
 * Hoja de estilos principal con soporte para tema claro/oscuro
 */

/* ============================================
   CSS Variables & Theme System
   ============================================ */

:root {
    --vl-primary: #FECE1A;
    --vl-primary-hover: #e5b916;
    --vl-primary-light: rgba(254, 206, 26, 0.15);
    --vl-dark: #181A1C;
    --vl-dark-lighter: #232628;
    --vl-dark-border: #2d3033;
    --status-uploaded: #3498db;
    --status-processing: #f39c12;
    --status-published: #27ae60;
    --status-attested: #9b59b6;
    --status-incident: #e74c3c;
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    --border-radius-sm: 6px;
    --border-radius-md: 10px;
    --border-radius-lg: 16px;
    --border-radius-xl: 24px;
    --sidebar-width: 280px;
    --sidebar-collapsed-width: 72px;
    --font-display: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

[data-theme="dark"] {
    --bg-primary: #0f1012;
    --bg-secondary: #181A1C;
    --bg-tertiary: #232628;
    --bg-card: #1e2023;
    --bg-hover: #2a2d31;
    --bg-input: #232628;
    --text-primary: #ffffff;
    --text-secondary: #a0a4a8;
    --text-tertiary: #6b7075;
    --text-accent: var(--vl-primary);
    --border-color: #2d3033;
    --border-light: rgba(255, 255, 255, 0.06);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(254, 206, 26, 0.15);
    --overlay: rgba(0, 0, 0, 0.7);
}

[data-theme="light"] {
    --bg-primary: #f5f7fa;
    --bg-secondary: #ffffff;
    --bg-tertiary: #eef1f5;
    --bg-card: #ffffff;
    --bg-hover: #f0f2f5;
    --bg-input: #f5f7fa;
    --text-primary: #181A1C;
    --text-secondary: #5a5f65;
    --text-tertiary: #8a9099;
    --text-accent: #c9a000;
    --border-color: #e0e4e8;
    --border-light: rgba(0, 0, 0, 0.06);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.12);
    --shadow-glow: 0 0 30px rgba(254, 206, 26, 0.25);
    --overlay: rgba(255, 255, 255, 0.8);
}

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: var(--font-body); background: var(--bg-primary); color: var(--text-primary); line-height: 1.6; min-height: 100vh; overflow-x: hidden; transition: background var(--transition-normal), color var(--transition-normal); }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }

.app-container { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar { width: var(--sidebar-width); height: 100vh; position: fixed; left: 0; top: 0; background: var(--bg-secondary); border-right: 1px solid var(--border-color); display: flex; flex-direction: column; transition: width var(--transition-normal); z-index: 1000; overflow: hidden; }
.sidebar.collapsed { width: var(--sidebar-collapsed-width); }
.sidebar-header { padding: 20px; border-bottom: 1px solid var(--border-color); display: flex; align-items: center; gap: 12px; min-height: 72px; }
.logo-icon { width: 40px; height: 40px; background: linear-gradient(135deg, var(--vl-primary), #e5b916); border-radius: var(--border-radius-md); display: flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: var(--shadow-glow); }
.logo-icon svg { width: 24px; height: 24px; color: var(--vl-dark); }
.logo-text { display: flex; flex-direction: column; overflow: hidden; white-space: nowrap; }
.logo-text .brand { font-family: var(--font-display); font-size: 18px; font-weight: 700; color: var(--text-primary); line-height: 1.2; }
.logo-text .subtitle { font-size: 11px; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 1px; }
.sidebar.collapsed .logo-text { opacity: 0; width: 0; }

.sidebar-search { padding: 16px 20px; }
.search-input-wrapper { position: relative; }
.search-input-wrapper input { width: 100%; padding: 10px 12px 10px 40px; background: var(--bg-tertiary); border: 1px solid var(--border-color); border-radius: var(--border-radius-md); color: var(--text-primary); font-size: 14px; transition: all var(--transition-fast); }
.search-input-wrapper input:focus { outline: none; border-color: var(--vl-primary); box-shadow: 0 0 0 3px var(--vl-primary-light); }
.search-input-wrapper input::placeholder { color: var(--text-tertiary); }
.search-input-wrapper svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--text-tertiary); }
.sidebar.collapsed .sidebar-search { padding: 16px 12px; }
.sidebar.collapsed .search-input-wrapper input { padding: 10px; text-indent: -9999px; }
.sidebar.collapsed .search-input-wrapper svg { left: 50%; transform: translate(-50%, -50%); }

.sidebar-nav { flex: 1; padding: 8px 12px; overflow-y: auto; }
.nav-section { margin-bottom: 24px; }
.nav-section-title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 1.2px; color: var(--text-tertiary); padding: 8px 12px; margin-bottom: 4px; }
.sidebar.collapsed .nav-section-title { opacity: 0; height: 0; padding: 0; margin: 0; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--border-radius-md); color: var(--text-secondary); text-decoration: none; font-size: 14px; font-weight: 500; transition: all var(--transition-fast); cursor: pointer; position: relative; margin-bottom: 2px; }
.nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-item.active { background: var(--vl-primary-light); color: var(--vl-primary); }
.nav-item.active::before { content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 3px; height: 24px; background: var(--vl-primary); border-radius: 0 3px 3px 0; }
.nav-item svg { width: 20px; height: 20px; flex-shrink: 0; }
.nav-item .nav-text { white-space: nowrap; overflow: hidden; }
.nav-item .badge { margin-left: auto; background: var(--status-incident); color: white; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 10px; min-width: 20px; text-align: center; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 12px; }
.sidebar.collapsed .nav-text, .sidebar.collapsed .badge { display: none; }

.sidebar-footer { padding: 16px; border-top: 1px solid var(--border-color); }
.user-menu { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: var(--border-radius-md); cursor: pointer; transition: background var(--transition-fast); }
.user-menu:hover { background: var(--bg-hover); }
.user-avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--vl-primary), #e5b916); display: flex; align-items: center; justify-content: center; font-weight: 600; color: var(--vl-dark); font-size: 14px; flex-shrink: 0; }
.user-info { overflow: hidden; }
.user-name { font-size: 14px; font-weight: 600; color: var(--text-primary); white-space: nowrap; }
.user-role { font-size: 12px; color: var(--text-tertiary); }
.sidebar.collapsed .user-info { display: none; }

.sidebar-toggle { position: absolute; right: -14px; top: 28px; width: 28px; height: 28px; background: var(--vl-primary); border: none; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-md); z-index: 1001; transition: transform var(--transition-fast); }
.sidebar-toggle:hover { transform: scale(1.1); }
.sidebar-toggle svg { width: 16px; height: 16px; color: var(--vl-dark); transition: transform var(--transition-normal); }
.sidebar.collapsed .sidebar-toggle svg { transform: rotate(180deg); }

/* Main Content */
.main-content { flex: 1; margin-left: var(--sidebar-width); transition: margin-left var(--transition-normal); min-height: 100vh; display: flex; flex-direction: column; }
.sidebar.collapsed ~ .main-content { margin-left: var(--sidebar-collapsed-width); }

.main-header { position: sticky; top: 0; background: var(--bg-secondary); border-bottom: 1px solid var(--border-color); padding: 16px 32px; display: flex; align-items: center; justify-content: space-between; z-index: 100; backdrop-filter: blur(10px); }
.header-title { display: flex; align-items: center; gap: 16px; }
.header-title h1 { font-family: var(--font-display); font-size: 24px; font-weight: 700; }
.header-actions { display: flex; align-items: center; gap: 12px; }

.theme-toggle, .notification-btn { width: 44px; height: 44px; border-radius: var(--border-radius-md); background: var(--bg-tertiary); border: 1px solid var(--border-color); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all var(--transition-fast); }
.theme-toggle:hover, .notification-btn:hover { background: var(--bg-hover); border-color: var(--vl-primary); }
.theme-toggle svg, .notification-btn svg { width: 20px; height: 20px; color: var(--text-secondary); }
.theme-toggle .sun-icon { display: none; }
.theme-toggle .moon-icon { display: block; }
[data-theme="light"] .theme-toggle .sun-icon { display: block; }
[data-theme="light"] .theme-toggle .moon-icon { display: none; }
.notification-btn { position: relative; }
.notification-btn .badge { position: absolute; top: 6px; right: 6px; width: 18px; height: 18px; background: var(--status-incident); color: white; font-size: 10px; font-weight: 700; border-radius: 50%; display: flex; align-items: center; justify-content: center; }

.page-content { flex: 1; padding: 32px; }

/* Stats */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin-bottom: 32px; }
.stat-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--border-radius-lg); padding: 24px; transition: all var(--transition-fast); }
.stat-card:hover { border-color: var(--vl-primary); box-shadow: var(--shadow-glow); }
.stat-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.stat-card-icon { width: 48px; height: 48px; border-radius: var(--border-radius-md); display: flex; align-items: center; justify-content: center; }
.stat-card-icon.primary { background: var(--vl-primary-light); color: var(--vl-primary); }
.stat-card-icon.success { background: rgba(39, 174, 96, 0.15); color: var(--status-published); }
.stat-card-icon.warning { background: rgba(243, 156, 18, 0.15); color: var(--status-processing); }
.stat-card-icon.danger { background: rgba(231, 76, 60, 0.15); color: var(--status-incident); }
.stat-card-icon svg { width: 24px; height: 24px; }
.stat-card-value { font-family: var(--font-display); font-size: 36px; font-weight: 800; margin-bottom: 4px; line-height: 1; }
.stat-card-label { font-size: 14px; color: var(--text-secondary); }

/* Upload */
.upload-section, .files-section { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--border-radius-lg); margin-bottom: 32px; }
.upload-section { padding: 32px; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.section-title { font-family: var(--font-display); font-size: 20px; font-weight: 700; }
.section-subtitle { font-size: 14px; color: var(--text-secondary); margin-top: 4px; }

.upload-zone { border: 2px dashed var(--border-color); border-radius: var(--border-radius-lg); padding: 60px 40px; text-align: center; transition: all var(--transition-fast); cursor: pointer; position: relative; overflow: hidden; }
.upload-zone::before { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, var(--vl-primary-light), transparent); opacity: 0; transition: opacity var(--transition-normal); }
.upload-zone:hover, .upload-zone.drag-over { border-color: var(--vl-primary); background: var(--bg-hover); }
.upload-zone:hover::before, .upload-zone.drag-over::before { opacity: 1; }
.upload-zone.drag-over { transform: scale(1.01); }
.upload-icon { width: 80px; height: 80px; margin: 0 auto 24px; background: var(--vl-primary-light); border-radius: 50%; display: flex; align-items: center; justify-content: center; position: relative; z-index: 1; }
.upload-icon svg { width: 40px; height: 40px; color: var(--vl-primary); }
.upload-text { position: relative; z-index: 1; }
.upload-text h3 { font-family: var(--font-display); font-size: 20px; font-weight: 600; margin-bottom: 8px; }
.upload-text p { color: var(--text-secondary); margin-bottom: 20px; }
.upload-text .highlight { color: var(--vl-primary); font-weight: 600; }
.upload-restrictions { display: flex; align-items: center; justify-content: center; gap: 24px; font-size: 13px; color: var(--text-tertiary); }
.upload-restrictions span { display: flex; align-items: center; gap: 6px; }
.upload-restrictions svg { width: 16px; height: 16px; }
.upload-input { display: none; }

.upload-progress { margin-top: 24px; display: none; }
.upload-progress.active { display: block; }
.progress-item { background: var(--bg-tertiary); border-radius: var(--border-radius-md); padding: 16px; margin-bottom: 12px; }
.progress-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.progress-file-info { display: flex; align-items: center; gap: 12px; }
.progress-file-icon { width: 40px; height: 40px; background: var(--vl-primary-light); border-radius: var(--border-radius-sm); display: flex; align-items: center; justify-content: center; }
.progress-file-icon svg { width: 20px; height: 20px; color: var(--vl-primary); }
.progress-file-name { font-weight: 600; font-size: 14px; }
.progress-file-size { font-size: 12px; color: var(--text-tertiary); }
.progress-percentage { font-family: var(--font-mono); font-size: 14px; font-weight: 600; color: var(--vl-primary); }
.progress-bar-container { height: 6px; background: var(--bg-hover); border-radius: 3px; overflow: hidden; }
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--vl-primary), #e5b916); border-radius: 3px; transition: width var(--transition-fast); }

/* Files Table */
.files-section { overflow: hidden; }
.files-header { padding: 24px; border-bottom: 1px solid var(--border-color); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.files-filters { display: flex; gap: 12px; flex-wrap: wrap; }
.filter-btn { padding: 8px 16px; border-radius: var(--border-radius-md); background: transparent; border: 1px solid var(--border-color); color: var(--text-secondary); font-size: 13px; font-weight: 500; cursor: pointer; transition: all var(--transition-fast); }
.filter-btn:hover, .filter-btn.active { background: var(--vl-primary-light); border-color: var(--vl-primary); color: var(--vl-primary); }

.files-table { width: 100%; border-collapse: collapse; }
.files-table thead { background: var(--bg-tertiary); }
.files-table th { padding: 14px 20px; text-align: left; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-tertiary); border-bottom: 1px solid var(--border-color); }
.files-table td { padding: 16px 20px; border-bottom: 1px solid var(--border-light); font-size: 14px; }
.files-table tbody tr { transition: background var(--transition-fast); }
.files-table tbody tr:hover { background: var(--bg-hover); }
.file-name-cell { display: flex; align-items: center; gap: 12px; }
.file-icon { width: 40px; height: 40px; background: var(--vl-primary-light); border-radius: var(--border-radius-sm); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.file-icon svg { width: 20px; height: 20px; color: var(--vl-primary); }
.file-name { font-weight: 600; }
.file-code { font-size: 12px; color: var(--text-tertiary); font-family: var(--font-mono); }

.status-badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.status-badge.uploaded { background: rgba(52, 152, 219, 0.15); color: var(--status-uploaded); }
.status-badge.processing { background: rgba(243, 156, 18, 0.15); color: var(--status-processing); }
.status-badge.published { background: rgba(39, 174, 96, 0.15); color: var(--status-published); }
.status-badge.attested { background: rgba(155, 89, 182, 0.15); color: var(--status-attested); }
.status-badge.incident { background: rgba(231, 76, 60, 0.15); color: var(--status-incident); }
.status-badge svg { width: 14px; height: 14px; }

.action-btn { width: 36px; height: 36px; border-radius: var(--border-radius-sm); background: transparent; border: 1px solid var(--border-color); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: all var(--transition-fast); margin-right: 8px; }
.action-btn:hover { background: var(--bg-hover); border-color: var(--vl-primary); }
.action-btn svg { width: 16px; height: 16px; color: var(--text-secondary); }
.action-btn:hover svg { color: var(--vl-primary); }

.empty-state { text-align: center; padding: 60px 40px; }
.empty-state svg { width: 80px; height: 80px; color: var(--text-tertiary); margin-bottom: 16px; opacity: 0.5; }
.empty-state h3 { font-size: 18px; margin-bottom: 8px; }
.empty-state p { color: var(--text-secondary); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 24px; border-radius: var(--border-radius-md); font-size: 14px; font-weight: 600; cursor: pointer; transition: all var(--transition-fast); border: none; text-decoration: none; }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--vl-primary); color: var(--vl-dark); }
.btn-primary:hover { background: var(--vl-primary-hover); box-shadow: var(--shadow-glow); }
.btn-secondary { background: var(--bg-tertiary); color: var(--text-primary); border: 1px solid var(--border-color); }
.btn-secondary:hover { background: var(--bg-hover); border-color: var(--vl-primary); }
.btn-danger { background: rgba(231, 76, 60, 0.15); color: var(--status-incident); }
.btn-danger:hover { background: var(--status-incident); color: white; }

/* Login Page */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg-primary); padding: 20px; position: relative; overflow: hidden; }
.login-page::before { content: ''; position: absolute; width: 600px; height: 600px; background: radial-gradient(circle, var(--vl-primary-light), transparent 70%); top: -200px; right: -200px; pointer-events: none; }
.login-page::after { content: ''; position: absolute; width: 400px; height: 400px; background: radial-gradient(circle, var(--vl-primary-light), transparent 70%); bottom: -100px; left: -100px; pointer-events: none; }
.login-container { width: 100%; max-width: 440px; position: relative; z-index: 1; }
.login-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--border-radius-xl); padding: 48px 40px; box-shadow: var(--shadow-lg); }
.login-header { text-align: center; margin-bottom: 40px; }
.login-logo { width: 72px; height: 72px; background: linear-gradient(135deg, var(--vl-primary), #e5b916); border-radius: var(--border-radius-lg); display: flex; align-items: center; justify-content: center; margin: 0 auto 24px; box-shadow: var(--shadow-glow); }
.login-logo svg { width: 40px; height: 40px; color: var(--vl-dark); }
.login-header h1 { font-family: var(--font-display); font-size: 28px; font-weight: 800; margin-bottom: 8px; }
.login-header p { color: var(--text-secondary); font-size: 15px; }

.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 8px; color: var(--text-secondary); }
.form-input-wrapper { position: relative; }
.form-input-wrapper svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--text-tertiary); }
.form-input { width: 100%; padding: 14px 16px 14px 48px; background: var(--bg-input); border: 1px solid var(--border-color); border-radius: var(--border-radius-md); color: var(--text-primary); font-size: 15px; transition: all var(--transition-fast); }
.form-input:focus { outline: none; border-color: var(--vl-primary); box-shadow: 0 0 0 4px var(--vl-primary-light); }
.form-input::placeholder { color: var(--text-tertiary); }
.password-toggle { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; padding: 4px; }
.password-toggle svg { position: static; transform: none; color: var(--text-tertiary); transition: color var(--transition-fast); }
.password-toggle:hover svg { color: var(--text-secondary); }
.form-options { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.remember-me { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.remember-me input { width: 18px; height: 18px; accent-color: var(--vl-primary); }
.remember-me span { font-size: 14px; color: var(--text-secondary); }
.login-btn { width: 100%; padding: 16px; font-size: 16px; }
.login-footer { text-align: center; margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--border-color); }
.login-footer p { font-size: 13px; color: var(--text-tertiary); }
.login-footer a { color: var(--vl-primary); text-decoration: none; }

.error-message { background: rgba(231, 76, 60, 0.1); border: 1px solid rgba(231, 76, 60, 0.3); color: var(--status-incident); padding: 12px 16px; border-radius: var(--border-radius-md); font-size: 14px; margin-bottom: 20px; display: none; }
.error-message.show { display: flex; align-items: center; gap: 10px; }
.error-message svg { width: 20px; height: 20px; flex-shrink: 0; }

/* Toast */
.toast-container { position: fixed; top: 24px; right: 24px; z-index: 3000; display: flex; flex-direction: column; gap: 12px; }
.toast { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--border-radius-md); padding: 16px 20px; display: flex; align-items: center; gap: 12px; min-width: 320px; box-shadow: var(--shadow-lg); transform: translateX(120%); transition: transform var(--transition-normal); }
.toast.show { transform: translateX(0); }
.toast-icon { width: 24px; height: 24px; flex-shrink: 0; }
.toast.success .toast-icon { color: var(--status-published); }
.toast.error .toast-icon { color: var(--status-incident); }
.toast.warning .toast-icon { color: var(--status-processing); }
.toast.info .toast-icon { color: var(--status-uploaded); }
.toast-content { flex: 1; }
.toast-title { font-weight: 600; font-size: 14px; margin-bottom: 2px; }
.toast-message { font-size: 13px; color: var(--text-secondary); }
.toast-close { background: none; border: none; cursor: pointer; padding: 4px; }
.toast-close svg { width: 18px; height: 18px; color: var(--text-tertiary); }

/* Responsive */
@media (max-width: 1024px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.mobile-open { transform: translateX(0); }
    .main-content { margin-left: 0 !important; }
    .mobile-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 999; }
    .mobile-overlay.active { display: block; }
}
@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .main-header { padding: 16px 20px; }
    .page-content { padding: 20px; }
    .stats-grid { grid-template-columns: 1fr; }
    .upload-zone { padding: 40px 20px; }
    .login-card { padding: 32px 24px; }
    .files-table th:nth-child(3), .files-table td:nth-child(3),
    .files-table th:nth-child(4), .files-table td:nth-child(4) { display: none; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Animations */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.animate-fade-in { animation: fadeIn 0.3s ease forwards; }
.animate-slide-up { animation: slideUp 0.4s ease forwards; }
.animate-spin { animation: spin 1s linear infinite; }
.spinner { width: 24px; height: 24px; border: 3px solid var(--border-color); border-top-color: var(--vl-primary); border-radius: 50%; animation: spin 0.8s linear infinite; }


/* ============================================
   New Sections Styles
   ============================================ */

.page-section { padding: 32px; }
.section-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--border-radius-lg); padding: 24px; }

/* Queue */
.queue-list { display: flex; flex-direction: column; gap: 12px; }
.queue-item { display: flex; align-items: center; justify-content: space-between; padding: 16px; background: var(--bg-tertiary); border-radius: var(--border-radius-md); gap: 16px; flex-wrap: wrap; }
.queue-item-info { display: flex; align-items: center; gap: 16px; flex: 1; min-width: 200px; }
.queue-item-icon { width: 48px; height: 48px; background: var(--vl-primary-light); border-radius: var(--border-radius-md); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.queue-item-icon svg { width: 24px; height: 24px; color: var(--vl-primary); }
.queue-item-name { font-weight: 600; margin-bottom: 4px; }
.queue-item-meta { display: flex; gap: 16px; font-size: 13px; color: var(--text-tertiary); flex-wrap: wrap; }
.queue-item-meta span { white-space: nowrap; }
.status-select { padding: 8px 12px; border-radius: var(--border-radius-md); border: 1px solid var(--border-color); background: var(--bg-input); color: var(--text-primary); font-size: 14px; cursor: pointer; }
.status-select:focus { outline: none; border-color: var(--vl-primary); }

/* Incidents */
.incidents-list { display: flex; flex-direction: column; gap: 12px; }
.incident-item { display: flex; align-items: center; padding: 16px; background: rgba(231, 76, 60, 0.1); border: 1px solid rgba(231, 76, 60, 0.3); border-radius: var(--border-radius-md); gap: 16px; flex-wrap: wrap; }
.incident-icon { width: 48px; height: 48px; background: rgba(231, 76, 60, 0.2); border-radius: var(--border-radius-md); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.incident-icon svg { width: 24px; height: 24px; color: var(--status-incident); }
.incident-details { flex: 1; min-width: 200px; }
.incident-name { font-weight: 600; margin-bottom: 4px; }
.incident-meta { display: flex; gap: 16px; font-size: 13px; color: var(--text-tertiary); flex-wrap: wrap; }
.incident-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Logs */
.logs-list { display: flex; flex-direction: column; gap: 8px; }
.log-item { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--bg-tertiary); border-radius: var(--border-radius-md); font-size: 14px; flex-wrap: wrap; gap: 8px; }
.log-action { font-weight: 500; }
.log-details { display: flex; gap: 12px; color: var(--text-tertiary); font-size: 13px; }
.log-time { color: var(--text-tertiary); font-size: 12px; font-family: var(--font-mono); }

/* Settings */
.settings-content { display: flex; flex-direction: column; gap: 24px; }
.settings-group { padding: 20px; background: var(--bg-tertiary); border-radius: var(--border-radius-md); }
.settings-group h3 { font-size: 16px; font-weight: 600; margin-bottom: 16px; color: var(--vl-primary); }
.settings-item { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--border-light); }
.settings-item:last-child { border-bottom: none; }
.settings-item label { color: var(--text-secondary); }

/* Loading & Empty States */
.loading-state { text-align: center; padding: 40px; color: var(--text-tertiary); }
.loading-state .spinner { margin: 0 auto 12px; }
.error-state { text-align: center; padding: 40px; color: var(--status-incident); }
.empty-state.success svg { color: var(--status-published); }

/* Responsive */
@media (max-width: 768px) {
    .queue-item, .incident-item { flex-direction: column; align-items: flex-start; }
    .queue-item-actions, .incident-actions { width: 100%; }
    .status-select { width: 100%; }
}
/* Queue Processing Styles */
.processing-indicator { display: flex; align-items: center; gap: 8px; color: var(--status-processing); font-size: 14px; }
.progress-mini { width: 120px; height: 6px; background: var(--bg-hover); border-radius: 3px; overflow: hidden; margin-top: 8px; }
.progress-mini .progress-bar { height: 100%; background: linear-gradient(90deg, var(--vl-primary), #e5b916); transition: width 0.3s; }
.btn-warning { background: rgba(243, 156, 18, 0.15); color: var(--status-processing); }
.btn-warning:hover { background: var(--status-processing); color: white; }
.queue-item[data-status="processing"] { border-left: 3px solid var(--status-processing); }
.queue-item[data-status="attested"] { border-left: 3px solid var(--status-attested); }
.queue-item[data-status="incident"] { border-left: 3px solid var(--status-incident); }
.queue-item[data-status="published"] { border-left: 3px solid var(--status-published); }
