:root {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --bg-elevated: #282e36;
    --bg-hover: #30363d;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;
    --text-link: #58a6ff;
    --accent-primary: #238636;
    --accent-secondary: #1f6feb;
    --accent-highlight: #388bfd;
    --border-primary: #30363d;
    --border-secondary: #21262d;
    --border-accent: #388bfd;
    --severity-critical: #ff4757;
    --severity-high: #ffa502;
    --severity-medium: #00e5ff;
    --severity-low: #1de9b6;
    --agency-fda: #1d4ed8;
    --agency-ema: #0369a1;
    --agency-ages: #dc2626;
    --agency-hc: #b91c1c;
    --agency-mhra: #6d28d9;
    --agency-bfarm: #059669;
    --agency-ansm: #7c3aed;
    --cat-drug: #3b82f6;
    --cat-device: #10b981;
    --cat-biologic: #8b5cf6;
    --cat-other: #6b7280;
    --font-sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'IBM Plex Mono', 'Consolas', monospace;
    --font-serif: 'Crimson Pro', 'Georgia', serif;
    --sidebar-width: 260px;
    --header-height: 56px;
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: var(--font-sans); background: var(--bg-primary); color: var(--text-primary); line-height: 1.5; min-height: 100vh; overflow-x: hidden; }
.app-container { display: flex; min-height: 100vh; }

.sidebar { width: var(--sidebar-width); background: var(--bg-secondary); border-right: 1px solid var(--border-primary); display: flex; flex-direction: column; position: fixed; top: 0; left: 0; height: 100vh; z-index: 100; transition: transform var(--transition-normal); }
.sidebar.collapsed { transform: translateX(-100%); }
.sidebar-header { padding: 16px 20px; border-bottom: 1px solid var(--border-primary); display: flex; align-items: center; gap: 12px; }
.logo { width: 32px; height: 32px; background: linear-gradient(135deg, var(--accent-secondary), var(--accent-highlight)); border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.logo svg { width: 20px; height: 20px; stroke: white; }
.brand-text { font-size: 14px; font-weight: 600; color: var(--text-primary); letter-spacing: -0.02em; }
.brand-sub { font-size: 11px; color: var(--text-muted); font-weight: 400; }
.nav-container { flex: 1; overflow-y: auto; padding: 12px 0; }
.nav-section { margin-bottom: 8px; }
.nav-section-title { padding: 8px 20px; font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 8px 20px; color: var(--text-secondary); cursor: pointer; transition: all var(--transition-fast); position: relative; }
.nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-item.active { background: var(--bg-tertiary); color: var(--text-primary); }
.nav-item.active::before { content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 3px; height: 24px; background: var(--accent-secondary); border-radius: 0 2px 2px 0; }
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; stroke-width: 1.5; }
.nav-item-badge { margin-left: auto; font-size: 11px; font-weight: 500; padding: 2px 6px; border-radius: 10px; background: var(--bg-elevated); color: var(--text-secondary); }
.nav-item-badge.critical { background: var(--severity-critical); color: white; }
.category-indicator { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.category-indicator.drug { background: var(--cat-drug); }
.category-indicator.device { background: var(--cat-device); }
.category-indicator.biologic { background: var(--cat-biologic); }
.category-indicator.other { background: var(--cat-other); }
.agency-toggle { display: flex; align-items: center; gap: 10px; padding: 6px 20px; cursor: pointer; transition: all var(--transition-fast); }
.agency-toggle:hover { background: var(--bg-hover); }
.agency-toggle input[type="checkbox"] { appearance: none; width: 16px; height: 16px; border: 1px solid var(--border-primary); border-radius: 4px; background: var(--bg-tertiary); cursor: pointer; position: relative; transition: all var(--transition-fast); }
.agency-toggle input[type="checkbox"]:checked { background: var(--accent-secondary); border-color: var(--accent-secondary); }
.agency-toggle input[type="checkbox"]:checked::after { content: ''; position: absolute; left: 5px; top: 2px; width: 4px; height: 8px; border: solid white; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.agency-label { font-size: 13px; color: var(--text-secondary); display: flex; align-items: center; gap: 8px; }
.agency-dot { width: 6px; height: 6px; border-radius: 50%; }
.agency-count { margin-left: auto; font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); }
.admin-badge { font-size: 9px; font-weight: 600; padding: 2px 5px; border-radius: 4px; background: var(--severity-high); color: white; text-transform: uppercase; letter-spacing: 0.03em; }
.admin-feature { display: none; }
.admin-feature.visible { display: flex; }
.sidebar-footer { padding: 12px 16px; border-top: 1px solid var(--border-primary); background: var(--bg-tertiary); }
.user-info { display: flex; align-items: center; gap: 10px; }
.user-avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, var(--accent-secondary), var(--accent-primary)); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; color: white; }
.user-details { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 500; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: var(--text-muted); }
.logout-btn { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 6px; border-radius: 4px; transition: all var(--transition-fast); }
.logout-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.logout-btn svg { width: 16px; height: 16px; }

.main-content { flex: 1; margin-left: var(--sidebar-width); min-height: 100vh; display: flex; flex-direction: column; transition: margin-left var(--transition-normal); }
.main-content.expanded { margin-left: 0; }
.header { height: var(--header-height); background: var(--bg-secondary); border-bottom: 1px solid var(--border-primary); display: flex; align-items: center; justify-content: space-between; padding: 0 24px; position: sticky; top: 0; z-index: 50; }
.header-left { display: flex; align-items: center; gap: 16px; }
.sidebar-toggle { background: none; border: none; color: var(--text-secondary); cursor: pointer; padding: 8px; border-radius: 6px; transition: all var(--transition-fast); display: flex; align-items: center; justify-content: center; }
.sidebar-toggle:hover { background: var(--bg-hover); color: var(--text-primary); }
.sidebar-toggle svg { width: 20px; height: 20px; }
.page-title { font-size: 16px; font-weight: 600; color: var(--text-primary); }
.header-right { display: flex; align-items: center; gap: 12px; }
.search-box { position: relative; }
.search-input { background: var(--bg-tertiary); border: 1px solid var(--border-primary); border-radius: 6px; padding: 8px 12px 8px 36px; font-size: 13px; color: var(--text-primary); width: 280px; transition: all var(--transition-fast); }
.search-input:focus { outline: none; border-color: var(--accent-secondary); box-shadow: 0 0 0 3px rgba(56, 139, 253, 0.1); }
.search-input::placeholder { color: var(--text-muted); }
.search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-muted); }
.header-btn { background: none; border: none; color: var(--text-secondary); cursor: pointer; padding: 8px; border-radius: 6px; transition: all var(--transition-fast); position: relative; }
.header-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.header-btn svg { width: 20px; height: 20px; }
.notification-dot { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; background: var(--severity-critical); border-radius: 50%; border: 2px solid var(--bg-secondary); }
.content { flex: 1; padding: 24px; }

.filter-bar { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 24px; padding: 16px; background: var(--bg-secondary); border: 1px solid var(--border-primary); border-radius: 8px; align-items: flex-end; }
.filter-group { display: flex; flex-direction: column; gap: 6px; }
.filter-label { font-size: 11px; font-weight: 500; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; }
.filter-select { background: var(--bg-tertiary); border: 1px solid var(--border-primary); border-radius: 6px; padding: 8px 32px 8px 12px; font-size: 13px; color: var(--text-primary); cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b949e' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; min-width: 140px; transition: all var(--transition-fast); }
.filter-select:hover { border-color: var(--text-muted); }
.filter-select:focus { outline: none; border-color: var(--accent-secondary); }
.filter-divider { width: 1px; height: 32px; background: var(--border-primary); margin: 0 4px; align-self: flex-end; margin-bottom: 4px; }
.filter-actions { display: flex; gap: 8px; margin-left: auto; align-items: flex-end; }
.filter-save-toggle { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-secondary); cursor: pointer; padding: 6px 8px; border-radius: 6px; white-space: nowrap; user-select: none; margin-bottom: 4px; }
.filter-save-toggle:hover { color: var(--text-primary); background: var(--bg-tertiary); }
.filter-save-toggle input[type="checkbox"] { accent-color: var(--accent-secondary); cursor: pointer; }
.lang-select { background: var(--bg-tertiary, #161b22); color: var(--text-primary, #e6edf3); border: 1px solid var(--border-primary, #30363d); border-radius: 6px; padding: 5px 8px; font-size: 12px; font-weight: 500; cursor: pointer; font-family: var(--font-sans); }
.lang-select:hover { border-color: var(--accent-secondary); }
.chart-toggles { display: flex; gap: 12px; align-items: center; }
.chart-toggle-label { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-secondary); cursor: pointer; user-select: none; }
.chart-toggle-label:hover { color: var(--text-primary); }
.chart-toggle-label input[type="checkbox"] { accent-color: var(--accent-secondary); cursor: pointer; }
.chart-card.chart-hidden { display: none; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 16px; font-size: 13px; font-weight: 500; border-radius: 6px; cursor: pointer; transition: all var(--transition-fast); border: none; font-family: var(--font-sans); }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--accent-secondary); color: white; }
.btn-primary:hover { background: var(--accent-highlight); }
.btn-secondary { background: var(--bg-tertiary); border: 1px solid var(--border-primary); color: var(--text-primary); }
.btn-secondary:hover { background: var(--bg-hover); border-color: var(--text-muted); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--bg-secondary); border: 1px solid var(--border-primary); border-radius: 8px; padding: 12px 16px; transition: all var(--transition-fast); }
.stat-card:hover { border-color: var(--border-accent); }
.stat-card-clickable { cursor: pointer; }
.stat-card-clickable:hover { border-color: var(--accent-secondary); box-shadow: 0 0 0 1px var(--accent-secondary); }
.stat-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.stat-label { font-size: 12px; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.03em; }
.stat-icon { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.stat-icon svg { width: 18px; height: 18px; }
.stat-icon.total { background: rgba(56, 139, 253, 0.1); color: var(--accent-secondary); }
.stat-icon.critical { background: rgba(248, 81, 73, 0.1); color: var(--severity-critical); }
.stat-icon.agencies { background: rgba(35, 134, 54, 0.1); color: var(--accent-primary); }
.stat-icon.recent { background: rgba(210, 153, 34, 0.1); color: var(--severity-medium); }
.stat-value { font-size: 22px; font-weight: 600; color: var(--text-primary); line-height: 1.2; font-family: var(--font-mono); }
.stat-change { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.stat-change.positive { color: var(--accent-primary); }
.stat-change.negative { color: var(--severity-critical); }

.charts-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-bottom: 24px; }
.charts-grid.charts-one { grid-template-columns: 1fr; }
.charts-grid.charts-three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 1024px) { .charts-grid.charts-three { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 1200px) { .charts-grid { grid-template-columns: 1fr; } .charts-grid.charts-three { grid-template-columns: 1fr; } }
.chart-card { background: var(--bg-secondary); border: 1px solid var(--border-primary); border-radius: 8px; padding: 20px; }
.chart-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.chart-title { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.chart-container { position: relative; height: 220px; }

.events-section { background: var(--bg-secondary); border: 1px solid var(--border-primary); border-radius: 8px; overflow: hidden; }
.events-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border-primary); }
.events-title { font-size: 14px; font-weight: 600; color: var(--text-primary); display: flex; align-items: center; gap: 8px; }
.events-count { font-size: 12px; font-weight: 500; color: var(--text-muted); background: var(--bg-tertiary); padding: 2px 8px; border-radius: 10px; }
.events-actions { display: flex; gap: 8px; }
.table-wrapper { overflow-x: auto; }
.events-table { width: 100%; border-collapse: collapse; }
.events-table th { padding: 12px 16px; text-align: left; font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; background: var(--bg-tertiary); border-bottom: 1px solid var(--border-primary); white-space: nowrap; position: sticky; top: 0; }
.events-table th.sortable { cursor: pointer; user-select: none; }
.events-table th.sortable:hover { color: var(--text-secondary); }
.events-table td { padding: 12px 16px; font-size: 13px; color: var(--text-primary); border-bottom: 1px solid var(--border-secondary); vertical-align: middle; }
.events-table tr:hover { background: var(--bg-hover); }
.events-table tr.selected { background: rgba(56, 139, 253, 0.1); }
.checkbox-cell { width: 40px; }
.event-checkbox { appearance: none; width: 16px; height: 16px; border: 1px solid var(--border-primary); border-radius: 4px; background: var(--bg-tertiary); cursor: pointer; position: relative; transition: all var(--transition-fast); }
.event-checkbox:checked { background: var(--accent-secondary); border-color: var(--accent-secondary); }
.event-checkbox:checked::after { content: ''; position: absolute; left: 5px; top: 2px; width: 4px; height: 8px; border: solid white; border-width: 0 2px 2px 0; transform: rotate(45deg); }

.severity-badge { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.02em; }
.severity-badge.critical { background: rgba(248, 81, 73, 0.15); color: var(--severity-critical); }
.severity-badge.high { background: rgba(219, 109, 40, 0.15); color: var(--severity-high); }
.severity-badge.medium { background: rgba(210, 153, 34, 0.15); color: var(--severity-medium); }
.severity-badge.low { background: rgba(35, 134, 54, 0.15); color: var(--severity-low); }
.category-badge { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border-radius: 4px; font-size: 11px; font-weight: 500; background: var(--bg-tertiary); color: var(--text-secondary); }
.category-badge .cat-dot { width: 6px; height: 6px; border-radius: 50%; }
.category-badge.drug .cat-dot { background: var(--cat-drug); }
.category-badge.medical_device .cat-dot { background: var(--cat-device); }
.category-badge.biologic .cat-dot { background: var(--cat-biologic); }
.category-badge.other .cat-dot { background: var(--cat-other); }
.agency-badge { display: inline-flex; align-items: center; padding: 4px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.02em; }
.agency-badge.fda { background: rgba(29, 78, 216, 0.15); color: var(--agency-fda); }
.agency-badge.ema { background: rgba(3, 105, 161, 0.15); color: var(--agency-ema); }
.agency-badge.ages { background: rgba(220, 38, 38, 0.15); color: var(--agency-ages); }
.agency-badge.hc, .agency-badge.healthcanada { background: rgba(185, 28, 28, 0.15); color: var(--agency-hc); }
.agency-badge.mhra { background: rgba(109, 40, 217, 0.15); color: var(--agency-mhra); }
.agency-badge.bfarm { background: rgba(5, 150, 105, 0.15); color: var(--agency-bfarm); }
.agency-badge.ansm { background: rgba(124, 58, 237, 0.15); color: var(--agency-ansm); }

.event-title { max-width: 300px; }
.event-title-text { display: block; font-weight: 500; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; transition: color var(--transition-fast); }
.event-title-text:hover { color: var(--text-link); }
.event-product { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.date-cell { white-space: nowrap; font-family: var(--font-mono); font-size: 12px; color: var(--text-secondary); }
.action-btn { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 4px; border-radius: 4px; transition: all var(--transition-fast); }
.action-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.action-btn svg { width: 16px; height: 16px; }

.pagination { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-top: 1px solid var(--border-primary); }
.pagination-info { font-size: 13px; color: var(--text-muted); }
.pagination-controls { display: flex; align-items: center; gap: 4px; }
.page-btn { background: none; border: 1px solid var(--border-primary); color: var(--text-secondary); padding: 6px 10px; border-radius: 4px; font-size: 13px; cursor: pointer; transition: all var(--transition-fast); }
.page-btn:hover:not(:disabled) { background: var(--bg-hover); border-color: var(--text-muted); color: var(--text-primary); }
.page-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.page-btn.active { background: var(--accent-secondary); border-color: var(--accent-secondary); color: white; }

.modal-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; z-index: 1000; opacity: 0; visibility: hidden; transition: all var(--transition-normal); }
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal { background: var(--bg-secondary); border: 1px solid var(--border-primary); border-radius: 12px; width: 90%; max-width: 800px; max-height: 90vh; display: flex; flex-direction: column; transform: scale(0.95); transition: transform var(--transition-normal); }
.modal-overlay.active .modal { transform: scale(1); }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--border-primary); }
.modal-title { font-size: 18px; font-weight: 600; color: var(--text-primary); }
.modal-close { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 8px; border-radius: 6px; transition: all var(--transition-fast); }
.modal-close:hover { background: var(--bg-hover); color: var(--text-primary); }
.modal-close svg { width: 20px; height: 20px; }
.modal-body { padding: 24px; overflow-y: auto; flex: 1; }
.modal-footer { display: flex; justify-content: flex-end; gap: 12px; padding: 16px 24px; border-top: 1px solid var(--border-primary); }

.report-options { display: grid; gap: 16px; }
.report-option { display: flex; align-items: flex-start; gap: 12px; padding: 16px; background: var(--bg-tertiary); border: 1px solid var(--border-primary); border-radius: 8px; cursor: pointer; transition: all var(--transition-fast); }
.report-option:hover { border-color: var(--accent-secondary); }
.report-option.selected { border-color: var(--accent-secondary); background: rgba(56, 139, 253, 0.05); }
.report-option input[type="radio"] { appearance: none; width: 18px; height: 18px; border: 2px solid var(--border-primary); border-radius: 50%; margin-top: 2px; position: relative; cursor: pointer; flex-shrink: 0; }
.report-option input[type="radio"]:checked { border-color: var(--accent-secondary); }
.report-option input[type="radio"]:checked::after { content: ''; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 8px; height: 8px; background: var(--accent-secondary); border-radius: 50%; }
.report-option-content { flex: 1; }
.report-option-title { font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
.report-option-desc { font-size: 13px; color: var(--text-muted); }
.selected-items-section { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border-primary); }
.selected-items-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.selected-items-title { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.selected-count { font-size: 12px; color: var(--text-muted); background: var(--bg-tertiary); padding: 2px 8px; border-radius: 10px; }
.selected-items-list { max-height: 200px; overflow-y: auto; border: 1px solid var(--border-primary); border-radius: 6px; }
.selected-item { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-bottom: 1px solid var(--border-secondary); }
.selected-item:last-child { border-bottom: none; }
.selected-item-title { font-size: 13px; color: var(--text-primary); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-right: 12px; }
.selected-item-remove { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 4px; border-radius: 4px; transition: all var(--transition-fast); }
.selected-item-remove:hover { background: rgba(248, 81, 73, 0.1); color: var(--severity-critical); }

.event-detail { display: grid; gap: 20px; }
.detail-row { display: grid; grid-template-columns: 140px 1fr; gap: 12px; }
.detail-label { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; }
.detail-value { font-size: 14px; color: var(--text-primary); }
.detail-description { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border-primary); }
.detail-description-label { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 8px; }
.detail-description-text { font-size: 14px; color: var(--text-secondary); line-height: 1.6; }

.report-preview { background: white; color: #1a1a1a; padding: 48px; border-radius: 4px; font-family: var(--font-serif); line-height: 1.6; max-height: 600px; overflow-y: auto; }
.report-preview h1 { font-size: 24px; font-weight: 600; text-align: center; margin-bottom: 8px; font-family: var(--font-serif); }
.report-preview .report-subtitle { font-size: 14px; text-align: center; color: #666; margin-bottom: 32px; }
.report-preview .report-meta { font-size: 12px; text-align: center; color: #888; margin-bottom: 32px; font-family: var(--font-sans); }
.report-preview hr { border: none; border-top: 1px solid #ddd; margin: 24px 0; }
.report-preview h2 { font-size: 16px; font-weight: 600; margin: 24px 0 12px; font-family: var(--font-serif); }
.report-preview h3 { font-size: 14px; font-weight: 600; margin: 16px 0 8px; font-family: var(--font-serif); }
.report-preview p { margin-bottom: 12px; text-align: justify; hyphens: auto; }
.report-preview table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 12px; font-family: var(--font-sans); }
.report-preview table th, .report-preview table td { padding: 8px 12px; text-align: left; border: 1px solid #ddd; }
.report-preview table th { background: #f5f5f5; font-weight: 600; }
.report-preview .stat-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 24px 0; }
.report-preview .stat-box { text-align: center; padding: 16px; background: #f9f9f9; border: 1px solid #eee; }
.report-preview .stat-box .number { font-size: 28px; font-weight: 600; color: #1a1a1a; font-family: var(--font-mono); }
.report-preview .stat-box .label { font-size: 11px; color: #666; text-transform: uppercase; letter-spacing: 0.05em; font-family: var(--font-sans); }

.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 1100; display: flex; flex-direction: column; gap: 8px; }
.toast { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--bg-elevated); border: 1px solid var(--border-primary); border-radius: 8px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); animation: slideIn 0.3s ease; }
@keyframes slideIn { from { opacity: 0; transform: translateX(100%); } to { opacity: 1; transform: translateX(0); } }
.toast.success { border-left: 3px solid var(--accent-primary); }
.toast.error { border-left: 3px solid var(--severity-critical); }
.toast.info { border-left: 3px solid var(--accent-secondary); }
.toast-icon { width: 20px; height: 20px; }
.toast-message { font-size: 13px; color: var(--text-primary); }
.loading { display: flex; align-items: center; justify-content: center; padding: 48px; }
.spinner { width: 32px; height: 32px; border: 3px solid var(--border-primary); border-top-color: var(--accent-secondary); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 64px 24px; text-align: center; }
.empty-state svg { width: 64px; height: 64px; color: var(--text-muted); margin-bottom: 16px; }
.empty-state-title { font-size: 16px; font-weight: 600; color: var(--text-primary); margin-bottom: 8px; }
.empty-state-desc { font-size: 14px; color: var(--text-muted); }

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .filter-bar { flex-direction: column; }
    .filter-select { width: 100%; }
    .search-input { width: 100%; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .modal { width: 95%; max-height: 95vh; }
    .report-preview .stat-summary { grid-template-columns: repeat(2, 1fr); }
}

/* FIXES: Description in table and action buttons */
.event-desc { display: block; font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 300px; margin-top: 2px; }
.actions-cell { white-space: nowrap; }
.actions-cell .action-btn { display: inline-flex; margin-right: 4px; }
.actions-cell a.action-btn { text-decoration: none; color: var(--text-muted); }
.actions-cell a.action-btn:hover { color: var(--text-link); background: var(--bg-hover); }

/* Additional styles for dashboard.html compatibility */
.header-actions { display: flex; align-items: center; gap: 12px; }
.header-title { font-size: 18px; font-weight: 600; color: var(--text-primary); }
.btn-reset { background: var(--bg-tertiary); color: var(--text-secondary); border: 1px solid var(--border-primary); padding: 8px 16px; border-radius: 6px; cursor: pointer; font-size: 13px; transition: all var(--transition-fast); }
.btn-reset:hover { background: var(--bg-hover); color: var(--text-primary); }
.btn-report { background: var(--accent-secondary); color: white; border: none; padding: 8px 16px; border-radius: 6px; cursor: pointer; font-size: 13px; transition: all var(--transition-fast); }
.btn-report:hover { background: var(--accent-highlight); }
.loading-cell { text-align: center; padding: 48px; color: var(--text-muted); font-size: 14px; }
.events-count span { font-weight: 600; }
.selected-count { font-size: 13px; color: var(--text-muted); padding: 4px 12px; background: var(--bg-tertiary); border-radius: 4px; }
.checkbox-col { width: 40px; text-align: center; }
.checkbox-col input { cursor: pointer; }

/* 4-chart grid layout */
.charts-grid.charts-four { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 1200px) { .charts-grid.charts-four { grid-template-columns: 1fr; } }

/* Clickable filter elements */
.clickable { cursor: pointer; transition: all 0.2s ease; }
.clickable:hover { opacity: 0.8; transform: scale(1.02); text-decoration: underline; }
.agency-badge.clickable:hover, .severity-badge.clickable:hover, .category-badge.clickable:hover { box-shadow: 0 0 8px currentColor; }

/* Additional category colors */
.category-indicator.food { background: #f59e0b; }
.category-indicator.tobacco { background: #78716c; }
.category-indicator.cosmetic { background: #ec4899; }
.category-indicator.veterinary { background: #14b8a6; }
.category-badge.food .cat-dot { background: #f59e0b; }
.category-badge.tobacco .cat-dot { background: #78716c; }
.category-badge.cosmetic .cat-dot { background: #ec4899; }
.category-badge.veterinary .cat-dot { background: #14b8a6; }

/* ============================================
   RESPONSIVE & MOBILE FIXES - v7 (Jan 25, 2026)
   ============================================ */

/* Force charts to respect container bounds */
.chart-container {
    position: relative;
    height: 220px;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.chart-container canvas {
    max-width: 100% !important;
    width: 100% !important;
}

/* Main content max-width for consistent layout */
.content-wrapper {
    max-width: 100%;
    width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

/* Ensure main-content doesn't overflow */
.main-content {
    max-width: 100vw;
    overflow-x: hidden;
}

.main-content.expanded {
    max-width: 100vw;
}

/* Stats grid responsive */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    width: 100%;
}

/* Charts grid ensure proper sizing */
.charts-grid {
    width: 100%;
    max-width: 100%;
}

.chart-card {
    min-width: 0; /* Prevent flex item overflow */
    overflow: hidden;
}

/* Mobile menu toggle button */
.mobile-menu-btn {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 200;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--accent-secondary);
    border: none;
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    align-items: center;
    justify-content: center;
}

.mobile-menu-btn svg {
    width: 24px;
    height: 24px;
}

/* Mobile overlay for sidebar */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

/* Watchlist styles */
.watchlist-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.watchlist-btn:hover {
    color: #f59e0b;
    background: var(--bg-hover);
}

.watchlist-btn.active {
    color: #f59e0b;
}

.watchlist-btn.active svg {
    fill: #f59e0b;
}

.watchlist-count {
    background: #f59e0b;
    color: #000;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 8px;
}

/* Watchlist panel in sidebar */
.watchlist-section {
    padding: 12px 16px;
    border-top: 1px solid var(--border-primary);
}

.watchlist-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.watchlist-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.watchlist-items {
    max-height: 200px;
    overflow-y: auto;
}

.watchlist-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px;
    border-radius: 6px;
    margin-bottom: 4px;
    background: var(--bg-tertiary);
    font-size: 12px;
}

.watchlist-item:hover {
    background: var(--bg-hover);
}

.watchlist-item-name {
    color: var(--text-primary);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.watchlist-item-type {
    font-size: 10px;
    color: var(--text-muted);
    padding: 2px 6px;
    background: var(--bg-primary);
    border-radius: 4px;
    margin-left: 8px;
}

.watchlist-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px;
    margin-left: 4px;
    opacity: 0;
    transition: opacity 0.2s;
}

.watchlist-item:hover .watchlist-remove {
    opacity: 1;
}

.watchlist-remove:hover {
    color: #ef4444;
}

.watchlist-empty {
    color: var(--text-muted);
    font-size: 12px;
    text-align: center;
    padding: 16px 8px;
}

/* Enhanced table checkbox styling */
.checkbox-col input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent-secondary);
    cursor: pointer;
}

/* ============================================
   TABLET BREAKPOINT (1024px)
   ============================================ */
@media (max-width: 1024px) {
    .charts-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .charts-grid.charts-three,
    .charts-grid.charts-four {
        grid-template-columns: 1fr 1fr;
    }
    
    .filter-bar {
        flex-wrap: wrap;
    }
    
    .filter-group {
        flex: 1 1 calc(50% - 12px);
        min-width: 140px;
    }
    
    .filter-actions {
        width: 100%;
        margin-left: 0;
        margin-top: 8px;
        justify-content: flex-end;
    }
}

/* ============================================
   MOBILE BREAKPOINT (768px) - ENHANCED
   ============================================ */
@media (max-width: 768px) {
    /* Show mobile menu button */
    .mobile-menu-btn {
        display: flex;
    }
    
    .sidebar-overlay {
        display: block;
    }
    
    /* Sidebar mobile behavior */
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
        max-width: 85vw;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    /* Main content full width on mobile */
    .main-content {
        margin-left: 0 !important;
        padding: 16px;
        padding-bottom: 80px; /* Space for mobile menu button */
    }
    
    /* Header adjustments */
    .content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .header-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    /* Filter bar mobile */
    .filter-bar {
        flex-direction: column;
        padding: 12px;
        gap: 10px;
        background: var(--bg-secondary) !important;
    }
    
    .filter-group {
        width: 100%;
        flex: none;
    }
    
    .filter-select {
        width: 100%;
        padding: 12px 32px 12px 12px;
        font-size: 14px;
        background-color: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
    }
    
    .search-input {
        width: 100%;
        padding: 12px;
        font-size: 14px;
    }
    
    .filter-divider {
        display: none;
    }
    
    .filter-actions {
        width: 100%;
        margin-left: 0;
        flex-direction: row;
        justify-content: stretch;
    }
    
    .filter-actions button {
        flex: 1;
    }
    
    /* Charts single column on mobile */
    .charts-grid,
    .charts-grid.charts-three,
    .charts-grid.charts-four {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .chart-card {
        padding: 16px;
    }
    
    .chart-container {
        height: 180px;
    }
    
    /* Stats grid 2 columns on mobile */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .stat-card {
        padding: 12px;
    }
    
    /* Events table mobile */
    .events-section {
        margin: 0 -16px;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    
    .events-table {
        font-size: 13px;
    }
    
    .events-table th,
    .events-table td {
        padding: 10px 8px;
    }
    
    /* Hide less important columns on mobile */
    .events-table th:nth-child(4),
    .events-table td:nth-child(4),
    .events-table th:nth-child(5),
    .events-table td:nth-child(5) {
        display: none;
    }
    
    .event-title {
        max-width: 180px;
    }
    
    /* Checkbox column */
    .checkbox-col {
        width: 32px;
        padding: 8px 4px !important;
    }
    
    .checkbox-col input[type="checkbox"] {
        width: 18px;
        height: 18px;
    }
    
    /* Modal mobile */
    .modal {
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }
    
    .modal-body {
        padding: 16px;
    }
    
    /* Pagination mobile */
    .pagination {
        flex-wrap: wrap;
        gap: 8px;
        justify-content: center;
    }
    
    .pagination button {
        padding: 8px 12px;
    }
}

/* ============================================
   SMALL MOBILE (480px)
   ============================================ */
@media (max-width: 480px) {
    .main-content {
        padding: 12px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    .stat-card {
        padding: 10px;
    }
    
    .stat-value {
        font-size: 20px;
    }
    
    .stat-label {
        font-size: 10px;
    }
    
    .header-title {
        font-size: 16px;
    }
    
    .chart-container {
        height: 160px;
    }
    
    .event-title {
        max-width: 140px;
    }
    
    /* Stack action buttons */
    .actions-cell {
        white-space: normal;
    }
    
    .actions-cell .action-btn {
        margin-bottom: 4px;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .sidebar,
    .mobile-menu-btn,
    .filter-bar,
    .pagination,
    .checkbox-col {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
    }
    
    .chart-container {
        height: 150px;
    }
}

/* ============================================
   ENHANCED CATEGORY COLORS - HIGH CONTRAST v7
   ============================================ */
:root {
    --cat-drug: #3b82f6;       /* Blue */
    --cat-device: #8b5cf6;     /* Purple */
    --cat-biologic: #ec4899;   /* Pink */
    --cat-food: #f59e0b;       /* Amber */
    --cat-cosmetic: #06b6d4;   /* Cyan */
    --cat-tobacco: #78716c;    /* Stone */
    --cat-veterinary: #22c55e; /* Green */
    --cat-other: #6b7280;      /* Gray */
}

.category-indicator.drug, .category-badge.drug .cat-dot { background: var(--cat-drug) !important; }
.category-indicator.device, .category-indicator.medical_device, 
.category-badge.device .cat-dot, .category-badge.medical_device .cat-dot { background: var(--cat-device) !important; }
.category-indicator.biologic, .category-badge.biologic .cat-dot { background: var(--cat-biologic) !important; }
.category-indicator.food, .category-badge.food .cat-dot { background: var(--cat-food) !important; }
.category-indicator.cosmetic, .category-badge.cosmetic .cat-dot { background: var(--cat-cosmetic) !important; }
.category-indicator.tobacco, .category-badge.tobacco .cat-dot { background: var(--cat-tobacco) !important; }
.category-indicator.veterinary, .category-badge.veterinary .cat-dot { background: var(--cat-veterinary) !important; }
.category-indicator.other, .category-badge.other .cat-dot { background: var(--cat-other) !important; }

/* ============================================
   CLEANER FILTER BAR - PILL STYLE
   ============================================ */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    margin-bottom: 20px;
    align-items: center;
}

.filter-bar.collapsed {
    padding: 8px 16px;
}

.filter-bar.collapsed .filter-groups {
    display: none;
}

.filter-toggle-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 6px;
    transition: all 0.2s;
}

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

.filter-toggle-btn svg {
    width: 14px;
    height: 14px;
    transition: transform 0.2s;
}

.filter-bar.collapsed .filter-toggle-btn svg {
    transform: rotate(-90deg);
}

.filter-groups {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1;
    align-items: center;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-group.inline {
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.filter-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.filter-select {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: 20px;
    padding: 6px 28px 6px 12px;
    font-size: 12px;
    color: var(--text-primary);
    cursor: pointer;
    min-width: 120px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%238b949e' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    transition: all 0.2s;
}

.filter-select:hover {
    border-color: var(--accent-secondary);
}

.filter-select:focus {
    outline: none;
    border-color: var(--accent-secondary);
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
}

.filter-select.active {
    background-color: var(--accent-secondary);
    color: white;
    border-color: var(--accent-secondary);
}

.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-left: 8px;
}

.filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--accent-secondary);
    color: white;
    padding: 4px 8px 4px 10px;
    border-radius: 16px;
    font-size: 11px;
    font-weight: 500;
}

.filter-pill-remove {
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    transition: all 0.2s;
}

.filter-pill-remove:hover {
    background: rgba(255,255,255,0.2);
    color: white;
}

/* Quick filter buttons */
.quick-filters {
    display: flex;
    gap: 6px;
    margin-left: auto;
}

.quick-filter-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 11px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
}

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

.quick-filter-btn.active {
    background: var(--accent-secondary);
    color: white;
    border-color: var(--accent-secondary);
}

/* ============================================
   CHARTS TOGGLE
   ============================================ */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.section-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

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

.section-toggle svg {
    width: 14px;
    height: 14px;
}

.charts-section {
    transition: all 0.3s ease;
}

.charts-section.hidden {
    display: none;
}

.charts-collapsed-msg {
    display: none;
    padding: 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    background: var(--bg-secondary);
    border: 1px dashed var(--border-primary);
    border-radius: 8px;
    margin-bottom: 20px;
}

.charts-section.hidden + .charts-collapsed-msg {
    display: block;
}

/* ============================================
   MOBILE BUTTON FORCE DISPLAY (OVERRIDE)
   ============================================ */
@media screen and (max-width: 768px) {
    .mobile-menu-btn {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
}

/* Also add a tablet breakpoint for sidebar */
@media screen and (max-width: 1024px) and (min-width: 769px) {
    .sidebar {
        width: 220px;
    }
    .main-content {
        margin-left: 220px;
    }
    :root {
        --sidebar-width: 220px;
    }
}

/* ============================================
   WATCHLIST MODAL STYLES
   ============================================ */
.watchlist-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.watchlist-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.watchlist-modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.watchlist-modal-overlay.active .watchlist-modal {
    transform: scale(1);
}

.watchlist-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-primary);
}

.watchlist-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.watchlist-modal-title svg {
    color: #f59e0b;
}

.watchlist-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}

.watchlist-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-primary);
    padding-bottom: 12px;
}

.watchlist-tab {
    background: none;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

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

.watchlist-tab.active {
    background: var(--accent-secondary);
    color: white;
}

.watchlist-tab-count {
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 11px;
    margin-left: 6px;
}

.watchlist-tab.active .watchlist-tab-count {
    background: rgba(255,255,255,0.2);
}

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

.watchlist-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    transition: all 0.2s;
}

.watchlist-list-item:hover {
    background: var(--bg-hover);
}

.watchlist-list-item-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.watchlist-list-item-info {
    flex: 1;
    min-width: 0;
}

.watchlist-list-item-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.watchlist-list-item-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.watchlist-list-item-actions {
    display: flex;
    gap: 4px;
}

.watchlist-list-item-btn {
    background: none;
    border: none;
    padding: 6px;
    border-radius: 4px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

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

.watchlist-list-item-btn.delete:hover {
    color: #ef4444;
}

.watchlist-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.watchlist-empty-state svg {
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.watchlist-empty-state p {
    font-size: 14px;
}

.watchlist-modal-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border-primary);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* ============================================
   TABLE OVERFLOW FIXES - v7.1
   ============================================ */
.events-table {
    table-layout: fixed;
    width: 100%;
}

.events-table th,
.events-table td {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 12px 8px;
}

/* Column widths */
.events-table th:nth-child(1),
.events-table td:nth-child(1) { width: 40px; } /* Checkbox */

.events-table th:nth-child(2),
.events-table td:nth-child(2) { width: 100px; } /* Date */

.events-table th:nth-child(3),
.events-table td:nth-child(3) { width: 100px; } /* Agency */

.events-table th:nth-child(4),
.events-table td:nth-child(4) { width: auto; min-width: 200px; max-width: 350px; } /* Title */

.events-table th:nth-child(5),
.events-table td:nth-child(5) { width: 120px; } /* Category */

.events-table th:nth-child(6),
.events-table td:nth-child(6) { width: 90px; } /* Severity */

.events-table th:nth-child(7),
.events-table td:nth-child(7) { width: 120px; } /* Type */

.events-table th:nth-child(8),
.events-table td:nth-child(8) { width: 70px; } /* Actions */

.event-title {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.event-title-text {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.event-desc {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ============================================
   FILTER MODAL STYLES
   ============================================ */
.filter-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.filter-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.filter-modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.filter-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-primary);
}

.filter-modal-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.filter-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}

.filter-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-checkbox-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-checkbox-item:hover {
    background: var(--bg-hover);
}

.filter-checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-secondary);
    cursor: pointer;
}

.filter-checkbox-item label {
    flex: 1;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-checkbox-item .filter-count {
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg-primary);
    padding: 2px 8px;
    border-radius: 10px;
}

.filter-modal-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border-primary);
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.filter-modal-footer .btn-select-all {
    background: none;
    border: none;
    color: var(--text-link);
    font-size: 13px;
    cursor: pointer;
    padding: 8px;
}

.filter-modal-footer .btn-select-all:hover {
    text-decoration: underline;
}

/* Category color indicators in filter modal */
.category-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.category-dot.drug { background: #3b82f6; }
.category-dot.medical_device { background: #8b5cf6; }
.category-dot.biologic { background: #ec4899; }
.category-dot.food { background: #f59e0b; }
.category-dot.cosmetic { background: #06b6d4; }
.category-dot.tobacco { background: #78716c; }
.category-dot.veterinary { background: #22c55e; }
.category-dot.other { background: #6b7280; }

/* ============================================
   MOBILE FIXES v7.1.2 - Comprehensive
   ============================================ */

@media (max-width: 768px) {
    /* Force horizontal scroll on table container */
    .table-section,
    .events-section,
    #eventsTable,
    .data-table-container {
        width: 100% !important;
        overflow-x: auto !important;
        overflow-y: visible !important;
        -webkit-overflow-scrolling: touch !important;
        display: block !important;
        position: relative !important;
    }
    
    .data-table {
        min-width: 850px !important;
        width: max-content !important;
        table-layout: auto !important;
    }
    
    /* Visible scrollbar for table */
    .table-section::-webkit-scrollbar,
    #eventsTable::-webkit-scrollbar {
        height: 10px !important;
        display: block !important;
        -webkit-appearance: none;
    }
    
    .table-section::-webkit-scrollbar-track,
    #eventsTable::-webkit-scrollbar-track {
        background: #374151 !important;
        border-radius: 5px;
    }
    
    .table-section::-webkit-scrollbar-thumb,
    #eventsTable::-webkit-scrollbar-thumb {
        background: #8b5cf6 !important;
        border-radius: 5px;
        min-width: 50px;
    }
    
    /* Prevent parent from blocking scroll */
    .main-content,
    .content,
    body {
        overflow-x: hidden !important;
    }
    
    /* Touch-friendly table cells */
    .data-table th,
    .data-table td {
        padding: 14px 10px !important;
        font-size: 13px !important;
    }
    
    /* Touch-friendly buttons */
    .action-btn,
    .page-btn,
    button {
        min-height: 44px !important;
        min-width: 44px !important;
    }
    
    /* Filter bar mobile */
    .filter-bar {
        flex-direction: column !important;
        gap: 12px !important;
    }
    
    .filter-group {
        width: 100% !important;
    }
    
    .filter-select {
        width: 100% !important;
        min-height: 48px !important;
        font-size: 16px !important; /* Prevents iOS zoom */
    }
    
    /* Charts mobile */
    .charts-grid {
        grid-template-columns: 1fr !important;
    }
    
    .chart-card {
        min-height: 250px !important;
    }
    
    /* Trend controls mobile */
    .trend-controls {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 10px !important;
    }
    
    .trend-controls > div {
        width: 100% !important;
        justify-content: space-between !important;
    }
    
    .trend-controls button {
        flex: 1 !important;
        min-height: 44px !important;
        padding: 12px 8px !important;
    }
    
    .trend-controls select {
        width: 100% !important;
        min-height: 48px !important;
        font-size: 16px !important;
    }
    
    /* Header mobile */
    .header {
        flex-wrap: wrap !important;
        padding: 10px !important;
        gap: 10px !important;
    }
    
    .header-left {
        width: 100% !important;
    }
    
    .header-right {
        width: 100% !important;
        justify-content: space-between !important;
    }
    
    .search-box {
        flex: 1 !important;
    }
    
    .search-input {
        font-size: 16px !important; /* Prevents iOS zoom */
    }
    
    .header-btn {
        min-width: 44px !important;
        min-height: 44px !important;
    }
    
    /* Stats cards mobile */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }
    
    .stat-card {
        padding: 12px !important;
    }
}

/* Notification Modal Mobile */
@media (max-width: 768px) {
    #notifModal {
        padding: 10px !important;
        align-items: flex-start !important;
        padding-top: 20px !important;
    }
    
    #notifModal > div {
        max-width: 100% !important;
        width: 100% !important;
        max-height: calc(100vh - 40px) !important;
        border-radius: 12px !important;
    }
    
    #notifModal input[type="checkbox"] {
        min-width: 28px !important;
        min-height: 28px !important;
        width: 28px !important;
        height: 28px !important;
        -webkit-appearance: checkbox !important;
        appearance: checkbox !important;
    }
    
    #notifModal label {
        padding: 12px 0 !important;
        display: flex !important;
        align-items: center !important;
        gap: 12px !important;
    }
    
    #notifModal input[type="email"],
    #notifModal input[type="text"],
    #notifModal select {
        font-size: 16px !important;
        min-height: 48px !important;
        padding: 14px !important;
    }
    
    #notifModal button {
        min-height: 48px !important;
        font-size: 16px !important;
    }
    
    #notifAgencies {
        grid-template-columns: 1fr !important;
    }
    
    #notifAgencies label {
        padding: 14px 0 !important;
        border-bottom: 1px solid #374151;
    }
}

/* Ensure touch events work */
* {
    -webkit-tap-highlight-color: rgba(139, 92, 246, 0.3);
}

button, a, label, .clickable, [onclick] {
    cursor: pointer;
    touch-action: manipulation;
}

/* FIX: Ensure sidebar overlay doesn't block when inactive */
.sidebar-overlay {
    pointer-events: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

.sidebar-overlay.active {
    pointer-events: auto !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Ensure main content is always interactive */
.main-content,
.content,
.table-section,
.data-table,
.chart-card,
.filter-bar {
    pointer-events: auto !important;
    position: relative;
    z-index: 1;
}

/* Header should be above content but below modals */
.header {
    z-index: 50 !important;
    pointer-events: auto !important;
}

/* Ensure buttons and interactive elements work */
@media (max-width: 768px) {
    button,
    a,
    input,
    select,
    label,
    .clickable,
    [onclick],
    .header-btn,
    .action-btn,
    .page-btn,
    .nav-item,
    .agency-toggle {
        pointer-events: auto !important;
        position: relative;
        z-index: 10;
    }
    
    /* Mobile menu button must be on top */
    .mobile-menu-btn {
        z-index: 201 !important;
        pointer-events: auto !important;
    }
}

/* ============================================
   SIDEBAR GROUPS v7.3 — Regional + Category
   ============================================ */
.sidebar-group-header {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}
.sidebar-group-header:hover { color: var(--text-primary); }
.chevron-icon { transition: transform var(--transition-fast); }
.chevron-icon.collapsed { transform: rotate(-90deg); }
.sidebar-group-body { overflow: hidden; transition: max-height 0.3s ease; }
.sidebar-group-body.collapsed { max-height: 0 !important; overflow: hidden; }
.sidebar-region-header,
.sidebar-catgroup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 16px 6px 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
    transition: color var(--transition-fast);
}
.sidebar-region-header:hover,
.sidebar-catgroup-header:hover { color: var(--text-secondary); }
.sidebar-region-header .region-toggle,
.sidebar-catgroup-header .group-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
}
.sidebar-region-header .region-count,
.sidebar-catgroup-header .group-count {
    font-size: 10px;
    font-weight: 500;
    padding: 1px 5px;
    border-radius: 8px;
    background: var(--bg-elevated);
    color: var(--text-secondary);
}
.region-chevron {
    width: 10px;
    height: 10px;
    transition: transform var(--transition-fast);
}
.region-chevron.collapsed { transform: rotate(-90deg); }
.sidebar-region-items,
.sidebar-catgroup-items {
    overflow: hidden;
    transition: max-height 0.25s ease;
}
.sidebar-region-items.collapsed,
.sidebar-catgroup-items.collapsed { max-height: 0 !important; overflow: hidden; }
.sidebar-region-items .nav-item,
.sidebar-catgroup-items .nav-item {
    padding-left: 32px;
    font-size: 12.5px;
}
.sidebar-region-items .agency-dot,
.sidebar-catgroup-items .category-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
    flex-shrink: 0;
}
.sidebar-region-items .nav-item .agency-count,
.sidebar-catgroup-items .nav-item .cat-count {
    margin-left: auto;
    font-size: 10px;
    padding: 1px 5px;
    border-radius: 8px;
    background: var(--bg-elevated);
    color: var(--text-secondary);
}
.region-select-all {
    font-size: 10px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all var(--transition-fast);
}
.region-select-all:hover {
    color: var(--text-link);
    background: var(--bg-hover);
}


/* ==========================================
   SURVEILLANCE MODULE STYLES
   Version: 1.0 | Date: 2026-02-24
   ========================================== */

/* Surveillance Modal Overlay */
.surveillance-modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.7);
    z-index: 2000;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
    overflow-y: auto;
}
.surveillance-modal-overlay.active {
    display: flex;
}
.surveillance-modal {
    background: var(--bg-primary, #0f1923);
    border: 1px solid var(--border-color, #1e3048);
    border-radius: 12px;
    width: 100%;
    max-width: 1100px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.surv-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color, #1e3048);
}
.surv-modal-header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    color: var(--text-primary, #e2e8f0);
    margin: 0;
}
.surv-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
}

/* Tabs */
.surv-tabs {
    display: flex;
    gap: 2px;
    padding: 0 24px;
    border-bottom: 1px solid var(--border-color, #1e3048);
    background: rgba(0,0,0,0.2);
}
.surv-tab-btn {
    padding: 10px 18px;
    border: none;
    background: transparent;
    color: var(--text-secondary, #94a3b8);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}
.surv-tab-btn:hover { color: var(--text-primary, #e2e8f0); }
.surv-tab-btn.active {
    color: var(--accent-primary, #4361ee);
    border-bottom-color: var(--accent-primary, #4361ee);
}
.surv-tab-content { display: none; }
.surv-tab-content.active { display: block; }

/* Stats Grid */
.surv-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.surv-stat-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-color, #1e3048);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.surv-stat-clickable { cursor: pointer; }
.surv-stat-clickable:hover { border-color: var(--accent-secondary, #3b82f6); box-shadow: 0 0 0 1px var(--accent-secondary, #3b82f6); }
.surv-stat-icon {
    width: 44px; height: 44px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}
.surv-stat-value { font-size: 28px; font-weight: 700; color: var(--text-primary, #e2e8f0); }
.surv-stat-label { font-size: 12px; color: var(--text-secondary, #94a3b8); margin-top: 4px; }

/* Subject List */
.surv-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.surv-list-count { font-size: 14px; color: var(--text-secondary, #94a3b8); }
.surv-list-actions { display: flex; gap: 8px; }

/* Buttons */
.surv-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}
.surv-btn-primary { background: var(--accent-primary, #4361ee); color: white; }
.surv-btn-primary:hover { background: #3451de; }
.surv-btn-secondary { background: rgba(255,255,255,0.08); color: var(--text-primary, #e2e8f0); border: 1px solid var(--border-color, #1e3048); }
.surv-btn-secondary:hover { background: rgba(255,255,255,0.12); }
.surv-btn-accent { background: #10b981; color: white; }
.surv-btn-accent:hover { background: #059669; }
.surv-btn-icon {
    padding: 6px; border: none; background: transparent;
    color: var(--text-secondary, #94a3b8); cursor: pointer;
    border-radius: 4px; transition: all 0.2s;
}
.surv-btn-icon:hover { background: rgba(255,255,255,0.08); color: var(--text-primary, #e2e8f0); }
.surv-btn-danger:hover { color: #ef4444 !important; }

/* Table */
.surv-subjects-table { overflow-x: auto; }
.surv-subjects-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.surv-subjects-table th {
    text-align: left;
    padding: 10px 12px;
    color: var(--text-secondary, #94a3b8);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color, #1e3048);
}
.surv-subjects-table td {
    padding: 10px 12px;
    color: var(--text-primary, #e2e8f0);
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.surv-subjects-table tr:hover { background: rgba(255,255,255,0.03); }
.surv-inactive { opacity: 0.5; }
.surv-subject-name { font-weight: 600; }
.surv-keywords { font-size: 11px; color: var(--text-secondary, #94a3b8); max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.surv-actions-cell { display: flex; gap: 2px; }

/* Status Badge */
.surv-status-badge {
    font-size: 11px; padding: 2px 8px; border-radius: 10px; font-weight: 500;
}
.surv-status-badge.active { background: rgba(16,185,129,0.15); color: #10b981; }
.surv-status-badge.inactive { background: rgba(148,163,184,0.15); color: #94a3b8; }

/* Severity Badge */
.surv-severity-badge {
    font-size: 10px; padding: 2px 8px; border-radius: 10px; font-weight: 600; text-transform: uppercase;
}
.surv-severity-critical { background: rgba(239,68,68,0.15); color: #ef4444; }
.surv-severity-high { background: rgba(245,158,11,0.15); color: #f59e0b; }
.surv-severity-medium { background: rgba(59,130,246,0.15); color: #3b82f6; }
.surv-severity-low { background: rgba(16,185,129,0.15); color: #10b981; }

/* Nav Badge */
.nav-badge {
    background: var(--accent-primary, #4361ee);
    color: white;
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 8px;
    font-weight: 600;
    margin-left: auto;
}

/* Match Items */
.surv-match-item {
    padding: 12px 16px;
    border: 1px solid var(--border-color, #1e3048);
    border-radius: 8px;
    margin-bottom: 8px;
    transition: background 0.2s;
}
.surv-match-item:hover { background: rgba(255,255,255,0.03); }
.surv-match-header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.surv-match-subject { font-weight: 600; color: var(--accent-primary, #4361ee); font-size: 12px; }
.surv-match-type-badge { font-size: 10px; padding: 1px 6px; border-radius: 8px; background: rgba(255,255,255,0.08); color: var(--text-secondary, #94a3b8); }
.surv-match-title { font-size: 13px; color: var(--text-primary, #e2e8f0); line-height: 1.4; }
.surv-match-meta { display: flex; gap: 12px; margin-top: 6px; font-size: 11px; color: var(--text-secondary, #94a3b8); }
.surv-matches-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.surv-badge-sm { font-size: 11px; background: rgba(67,97,238,0.15); color: #4361ee; padding: 2px 8px; border-radius: 8px; font-weight: 500; margin-left: 8px; }

/* Form */
.surv-form { max-width: 700px; }
.surv-form h3 { margin: 0 0 16px; color: var(--text-primary, #e2e8f0); }
.surv-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.surv-form-full { grid-column: 1 / -1; }
.surv-form-group label { display: block; font-size: 12px; font-weight: 600; color: var(--text-secondary, #94a3b8); margin-bottom: 4px; }
.surv-form-group small { font-size: 11px; color: var(--text-secondary, #94a3b8); opacity: 0.7; }
.surv-input {
    width: 100%; padding: 8px 12px; border: 1px solid var(--border-color, #1e3048);
    background: rgba(0,0,0,0.3); color: var(--text-primary, #e2e8f0);
    border-radius: 6px; font-size: 13px; outline: none; transition: border-color 0.2s;
}
.surv-input:focus { border-color: var(--accent-primary, #4361ee); }
.surv-textarea { resize: vertical; font-family: inherit; }
.surv-bulk-textarea { font-family: 'IBM Plex Mono', monospace; font-size: 12px; }
.surv-form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }
.surv-form-help { font-size: 12px; color: var(--text-secondary, #94a3b8); line-height: 1.5; margin-bottom: 12px; }
.surv-form-help code { background: rgba(0,0,0,0.3); padding: 1px 6px; border-radius: 3px; font-size: 11px; }
.surv-footer-actions { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border-color, #1e3048); display: flex; justify-content: flex-end; }

/* Empty State */
.surv-empty {
    text-align: center; padding: 40px 20px; color: var(--text-secondary, #94a3b8);
}

/* ==========================================
   REPORTING UPGRADE STYLES
   ========================================== */

.report-upgrade-section { margin: 16px 0; }
.report-upgrade-wrapper { display: flex; flex-direction: column; gap: 14px; }

.report-section-card {
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border-color, #1e3048);
    border-radius: 8px;
    padding: 14px 18px;
}
.report-section-title {
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; font-weight: 600;
    color: var(--text-primary, #e2e8f0);
    margin: 0 0 10px 0;
}

.report-date-row {
    display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap;
}
.report-date-group { display: flex; flex-direction: column; gap: 4px; }
.report-date-group label { font-size: 11px; color: var(--text-secondary, #94a3b8); }
.report-input {
    padding: 6px 10px; border: 1px solid var(--border-color, #1e3048);
    background: rgba(0,0,0,0.3); color: var(--text-primary, #e2e8f0);
    border-radius: 5px; font-size: 12px;
}
.report-date-presets { display: flex; gap: 4px; }
.report-preset-btn {
    padding: 5px 10px; border: 1px solid var(--border-color, #1e3048);
    background: transparent; color: var(--text-secondary, #94a3b8);
    border-radius: 4px; font-size: 11px; cursor: pointer; transition: all 0.2s;
}
.report-preset-btn:hover, .report-preset-btn.active {
    background: var(--accent-primary, #4361ee); color: white; border-color: var(--accent-primary, #4361ee);
}

.report-checkbox-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.report-sections-grid { grid-template-columns: 1fr 1fr; }
.report-checkbox-label {
    display: flex; align-items: center; gap: 8px;
    padding: 5px 8px; border-radius: 5px;
    font-size: 12px; color: var(--text-primary, #e2e8f0);
    cursor: pointer; transition: background 0.2s;
}
.report-checkbox-label:hover { background: rgba(255,255,255,0.04); }
.report-checkbox-label input[type="checkbox"] {
    width: 14px; height: 14px; accent-color: var(--accent-primary, #4361ee);
}
.report-checkbox-label small {
    display: block; font-size: 10px; color: var(--text-secondary, #94a3b8); margin-top: 1px; grid-column: 2;
}
.report-checkbox-label span { line-height: 1.2; }

.report-textarea-group { margin-bottom: 10px; }
.report-textarea-group label { display: block; font-size: 11px; color: var(--text-secondary, #94a3b8); margin-bottom: 4px; }
.report-textarea {
    width: 100%; padding: 8px 10px; border: 1px solid var(--border-color, #1e3048);
    background: rgba(0,0,0,0.3); color: var(--text-primary, #e2e8f0);
    border-radius: 5px; font-size: 12px; font-family: inherit; resize: vertical;
}

/* Report Preview Styles */
.report-page { margin-bottom: 20px; padding-bottom: 20px; }
.report-cover { text-align: center; padding: 60px 30px; }
.report-confidential { color: #ef4444; font-size: 11px; letter-spacing: 3px; text-transform: uppercase; }
.report-main-title { font-size: 24px; margin: 30px 0 8px; color: #1a1a2e; }
.report-company-name { font-size: 16px; color: #4361ee; margin-bottom: 30px; }
.report-cover-meta { font-size: 12px; color: #666; line-height: 2; }
.report-cover-classification { font-size: 11px; color: #999; margin-top: 40px; border-top: 1px solid #eee; padding-top: 15px; }
.report-page-break { border-bottom: 2px dashed rgba(255,255,255,0.1); margin: 20px 0; }
.report-section-header { font-size: 16px; color: var(--text-primary, #e2e8f0); border-bottom: 2px solid var(--accent-primary, #4361ee); padding-bottom: 6px; margin: 20px 0 12px; }
.report-sub-header { font-size: 13px; color: var(--text-primary, #e2e8f0); margin: 14px 0 6px; }
.report-text { font-size: 12px; color: var(--text-secondary, #94a3b8); line-height: 1.7; margin-bottom: 10px; }
.report-exec-kpis { display: flex; gap: 14px; margin: 14px 0; }
.report-kpi { background: rgba(255,255,255,0.05); padding: 12px 16px; border-radius: 8px; text-align: center; flex: 1; border: 1px solid var(--border-color, #1e3048); }
.report-kpi-value { font-size: 22px; font-weight: 700; color: var(--text-primary, #e2e8f0); }
.report-kpi-critical .report-kpi-value { color: #ef4444; }
.report-kpi-label { font-size: 11px; color: var(--text-secondary, #94a3b8); margin-top: 4px; }
.report-chart-container { margin: 14px 0; padding: 12px; background: rgba(255,255,255,0.03); border-radius: 8px; }
.report-chart-container h4 { font-size: 12px; color: var(--text-secondary, #94a3b8); margin: 0 0 8px; }
.report-chart-img { max-width: 100%; height: auto; border-radius: 4px; }
.report-custom-notes { background: rgba(67,97,238,0.08); border-left: 3px solid #4361ee; padding: 12px 16px; margin: 12px 0; border-radius: 0 6px 6px 0; }
.report-custom-notes h4 { font-size: 12px; margin: 0 0 6px; color: #4361ee; }
.report-custom-notes p { font-size: 12px; color: var(--text-primary, #e2e8f0); margin: 0; }
.report-recommendations ul { padding-left: 20px; }
.report-recommendations li { font-size: 12px; color: var(--text-secondary, #94a3b8); line-height: 1.8; }
.report-disclaimer { background: rgba(255,255,255,0.03); padding: 16px; border-left: 3px solid var(--border-color, #1e3048); font-size: 11px; border-radius: 0 6px 6px 0; }
.report-disclaimer p { color: var(--text-secondary, #94a3b8); line-height: 1.6; margin-bottom: 8px; }
.report-disclaimer-date { font-size: 10px; color: var(--text-secondary, #94a3b8); opacity: 0.6; margin-top: 12px; }
.report-toc { padding: 10px 0; }
.report-toc-item { padding: 6px 0; border-bottom: 1px dotted rgba(255,255,255,0.08); font-size: 13px; color: var(--text-primary, #e2e8f0); }
.report-global-footer { text-align: center; font-size: 10px; color: var(--text-secondary, #94a3b8); padding: 10px 0; border-top: 1px solid var(--border-color, #1e3048); margin-top: 20px; opacity: 0.6; }
.report-logo { max-width: 160px; max-height: 60px; margin-bottom: 20px; }


/* ==========================================
   ARCHIVE TAB STYLES
   ========================================== */
.surv-archive-header {
    margin-bottom: 16px;
}
.surv-archive-controls {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}
.surv-archive-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.surv-archive-item {
    background: var(--bg-secondary, rgba(255,255,255,0.05));
    border: 1px solid var(--border-color, rgba(255,255,255,0.1));
    border-radius: 8px;
    padding: 12px 16px;
    transition: border-color 0.2s;
}
.surv-archive-item:hover {
    border-color: var(--accent-color, #3b82f6);
}
.surv-archive-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}
.surv-archive-item-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary, #fff);
    flex: 1;
}
.surv-archive-item-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}
.surv-archive-item-url {
    margin-top: 4px;
    font-size: 12px;
}
.surv-archive-item-url a {
    color: var(--accent-color, #3b82f6);
    text-decoration: none;
    word-break: break-all;
}
.surv-archive-item-url a:hover {
    text-decoration: underline;
}
.surv-archive-item-meta {
    font-size: 12px;
    color: var(--text-secondary, #94a3b8);
    margin-top: 4px;
}
.surv-archive-item-notes {
    font-size: 13px;
    color: var(--text-secondary, #94a3b8);
    margin-top: 6px;
    padding: 8px;
    background: rgba(0,0,0,0.15);
    border-radius: 4px;
    white-space: pre-wrap;
}
.surv-archive-item-footer {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    flex-wrap: wrap;
}
.surv-tag {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    background: rgba(59,130,246,0.15);
    color: #60a5fa;
    border-radius: 12px;
    font-weight: 500;
}
.surv-archive-date {
    font-size: 11px;
    color: var(--text-tertiary, #64748b);
    margin-left: auto;
}
.surv-btn-sm {
    background: none;
    border: 1px solid var(--border-color, rgba(255,255,255,0.1));
    border-radius: 4px;
    padding: 2px 6px;
    cursor: pointer;
    font-size: 12px;
    color: var(--text-secondary, #94a3b8);
    transition: all 0.2s;
}
.surv-btn-sm:hover {
    background: rgba(255,255,255,0.1);
    color: var(--text-primary, #fff);
}
.surv-btn-sm.surv-btn-danger:hover {
    background: rgba(239,68,68,0.15);
    color: #ef4444;
    border-color: #ef4444;
}
.surv-form-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}
.surv-form-modal {
    background: var(--bg-primary, #1a1d23);
    border: 1px solid var(--border-color, rgba(255,255,255,0.1));
    border-radius: 12px;
    padding: 24px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}
.surv-form-modal h3 {
    margin: 0 0 16px;
    font-size: 18px;
}
.surv-form-group {
    margin-bottom: 12px;
}
.surv-form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary, #94a3b8);
    margin-bottom: 4px;
    text-transform: uppercase;
}
.surv-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
}
.archive-btn {
    opacity: 0.5;
    transition: opacity 0.2s;
}
.archive-btn:hover {
    opacity: 1;
    color: #8b5cf6 !important;
}
