*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0f1117;
  --card: #1a1d27;
  --border: #2a2d3a;
  --text: #e8eaf0;
  --muted: #6b7280;
  --accent: #6366f1;
  --accent-hover: #4f52d1;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --sidebar-w: 220px;
}

body { background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif; font-size: 14px; display: flex; min-height: 100vh; }

.sidebar { width: var(--sidebar-w); background: var(--card); border-right: 1px solid var(--border); padding: 24px 0; display: flex; flex-direction: column; position: fixed; top: 0; left: 0; height: 100vh; z-index: 10; }
.sidebar-logo { padding: 0 20px 24px; font-size: 15px; font-weight: 700; color: var(--text); border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.sidebar-logo span { color: var(--accent); }
.sidebar a { display: flex; align-items: center; gap: 10px; padding: 10px 20px; color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 500; transition: all 0.15s; }
.sidebar a:hover, .sidebar a.active { color: var(--text); background: rgba(255,255,255,0.04); }
.sidebar a.active { border-right: 2px solid var(--accent); color: var(--accent); }
.sidebar-icon { font-size: 16px; width: 20px; text-align: center; }

.main { margin-left: var(--sidebar-w); flex: 1; padding: 32px; }
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.page-title { font-size: 20px; font-weight: 700; }
.page-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }

.card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; }
.card-body { padding: 20px; }

.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 28px; }
.metric-card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 20px; }
.metric-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.metric-value { font-size: 28px; font-weight: 700; margin-top: 6px; }
.metric-value.high { color: var(--success); }
.metric-value.medium { color: var(--warning); }
.metric-value.low { color: var(--muted); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 12px 14px; font-size: 13px; border-bottom: 1px solid rgba(42,45,58,0.5); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.02); }

.badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 9999px; font-size: 11px; font-weight: 600; letter-spacing: 0.02em; white-space: nowrap; }
.badge-high    { background: rgba(16,185,129,0.15); color: #10b981; }
.badge-medium  { background: rgba(245,158,11,0.15);  color: #f59e0b; }
.badge-low     { background: rgba(107,114,128,0.15); color: #9ca3af; }
.badge-pending { background: rgba(99,102,241,0.12);  color: #818cf8; }
.badge-enriched{ background: rgba(16,185,129,0.12);  color: #34d399; }
.badge-tech    { background: rgba(99,102,241,0.1);   color: #a5b4fc; }

.score-bar { display: flex; align-items: center; gap: 8px; }
.score-track { flex: 1; height: 4px; background: var(--border); border-radius: 2px; min-width: 60px; }
.score-fill  { height: 100%; border-radius: 2px; }
.score-fill.high   { background: var(--success); }
.score-fill.medium { background: var(--warning); }
.score-fill.low    { background: var(--muted); }

button, .btn { cursor: pointer; border: none; border-radius: 6px; font-size: 13px; font-weight: 500; padding: 8px 16px; transition: all 0.15s; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.btn-primary   { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--card); border: 1px solid var(--border); color: var(--text); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn-danger    { background: rgba(239,68,68,0.15); color: var(--danger); }
.btn-sm        { padding: 5px 10px; font-size: 12px; }
.btn-ghost     { background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); background: rgba(255,255,255,0.05); }

input, select, textarea { background: var(--card); border: 1px solid var(--border); color: var(--text); border-radius: 6px; padding: 8px 12px; font-size: 13px; outline: none; width: 100%; font-family: inherit; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
label { font-size: 12px; color: var(--muted); font-weight: 500; margin-bottom: 4px; display: block; }
.form-group { margin-bottom: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.filters { display: flex; gap: 10px; align-items: center; margin-bottom: 20px; flex-wrap: wrap; }
.filters input, .filters select { width: auto; }

.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 100; display: none; align-items: center; justify-content: center; }
.modal-backdrop.open { display: flex; }
.modal { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 28px; width: 100%; max-width: 600px; max-height: 90vh; overflow-y: auto; }
.modal-title { font-size: 16px; font-weight: 700; margin-bottom: 20px; }

.detail-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; margin-bottom: 8px; }

#toast { position: fixed; bottom: 24px; right: 24px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast-item { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 12px 16px; font-size: 13px; max-width: 300px; animation: slideIn 0.2s ease; }
.toast-item.success { border-left: 3px solid var(--success); }
.toast-item.error   { border-left: 3px solid var(--danger); }
@keyframes slideIn { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

.progress-bar { height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; margin: 8px 0; }
.progress-fill { height: 100%; background: var(--accent); border-radius: 2px; transition: width 0.3s; }

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
