:root {
  --bg: #0a0a0a;
  --bg-panel: rgba(12, 12, 12, 0.92);
  --bg-surface: rgba(22, 22, 22, 0.95);
  --bg-elevated: rgba(30, 30, 30, 0.95);
  --bg-input: rgba(8, 8, 8, 0.9);
  --text: #e8e8e8;
  --text-dim: #8a8a8a;
  --text-bright: #ffffff;
  --accent: #c41818;
  --accent-glow: #e82020;
  --accent-soft: rgba(196, 24, 24, 0.15);
  --green: #38b764;
  --green-soft: rgba(56, 183, 100, 0.15);
  --yellow: #d4a934;
  --yellow-soft: rgba(212, 169, 52, 0.15);
  --blue: #3a7bd5;
  --blue-soft: rgba(58, 123, 213, 0.15);
  --red: #c41818;
  --red-soft: rgba(196, 24, 24, 0.15);
  --border: rgba(255, 255, 255, 0.06);
  --border-accent: rgba(196, 24, 24, 0.3);
  --radius: 6px;
  --radius-lg: 10px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 8px 48px rgba(0, 0, 0, 0.8);
  --font: 'Inter', 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Consolas', monospace;
  --font-display: 'Bebas Neue', 'Oswald', sans-serif;
  --transition: 140ms ease;
}

@font-face {
  font-family: 'Inter';
  src: local('Inter');
  font-display: swap;
}

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

body {
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  user-select: none;
  overflow: hidden;
}

/* ── Panels ─────────────────────────────────────────────────────────────────── */

.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  gap: 8px;
}

.panel-header h2 {
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 400;
  color: var(--text-bright);
}

.panel-body {
  padding: 12px 14px;
}

.panel-footer {
  padding: 8px 14px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

/* ── Buttons ────────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 6px 14px;
  font-family: var(--font);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  filter: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-glow) 100%);
  color: #fff;
  border-color: var(--accent);
}

.btn-primary:hover { filter: brightness(1.15); }

.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  border-color: var(--border);
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--border-accent);
  background: var(--accent-soft);
}

.btn-danger {
  background: var(--red-soft);
  color: #ff6b6b;
  border-color: rgba(196, 24, 24, 0.4);
}

.btn-success {
  background: var(--green-soft);
  color: #6bdb8b;
  border-color: rgba(56, 183, 100, 0.4);
}

.btn-sm { padding: 4px 8px; font-size: 10px; }
.btn-lg { padding: 10px 20px; font-size: 13px; }

.btn-icon {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: var(--radius);
}

/* ── Inputs ──────────────────────────────────────────────────────────────────── */

.input, select, textarea {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 7px 10px;
  font-family: var(--font);
  font-size: 12px;
  color: var(--text);
  outline: none;
  transition: border-color var(--transition);
  width: 100%;
}

.input:focus, select:focus, textarea:focus {
  border-color: var(--border-accent);
}

.input::placeholder { color: var(--text-dim); }

.form-group { margin-bottom: 10px; }

.form-label {
  display: block;
  margin-bottom: 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* ── Badges / Pills ──────────────────────────────────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.badge-red { background: var(--red-soft); color: #ff6b6b; border: 1px solid rgba(196,24,24,0.3); }
.badge-green { background: var(--green-soft); color: #6bdb8b; border: 1px solid rgba(56,183,100,0.3); }
.badge-yellow { background: var(--yellow-soft); color: #f0c850; border: 1px solid rgba(212,169,52,0.3); }
.badge-blue { background: var(--blue-soft); color: #70a8f0; border: 1px solid rgba(58,123,213,0.3); }
.badge-neutral { background: rgba(100,100,100,0.15); color: var(--text-dim); border: 1px solid rgba(100,100,100,0.2); }

/* ── Progress bars ────────────────────────────────────────────────────────────── */

.progress {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 300ms ease;
}

.progress-red .progress-fill { background: linear-gradient(90deg, #8f0808, var(--accent-glow)); }
.progress-green .progress-fill { background: linear-gradient(90deg, #1a6b35, var(--green)); }
.progress-yellow .progress-fill { background: linear-gradient(90deg, #8b6b14, var(--yellow)); }
.progress-blue .progress-fill { background: linear-gradient(90deg, #1a3d7a, var(--blue)); }

/* ── Tabs ──────────────────────────────────────────────────────────────────── */

.tab-bar {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  padding: 0 14px;
}

.tab {
  padding: 8px 14px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dim);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}

.tab:hover { color: var(--text); }
.tab.active { color: var(--accent-glow); border-bottom-color: var(--accent-glow); }

/* ── Tables ─────────────────────────────────────────────────────────────────── */

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

.table th {
  text-align: left;
  padding: 6px 10px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
}

.table td {
  padding: 8px 10px;
  font-size: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}

.table tr:hover td { background: rgba(255,255,255,0.02); }

/* ── Scrollbar ──────────────────────────────────────────────────────────────── */

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ── Utility ────────────────────────────────────────────────────────────────── */

.text-dim { color: var(--text-dim); }
.text-bright { color: var(--text-bright); }
.text-accent { color: var(--accent-glow); }
.text-green { color: var(--green); }
.text-yellow { color: var(--yellow); }
.text-red { color: var(--red); }
.text-mono { font-family: var(--font-mono); }
.text-display { font-family: var(--font-display); letter-spacing: 0.06em; text-transform: uppercase; }
.text-xs { font-size: 10px; }
.text-sm { font-size: 11px; }
.text-lg { font-size: 15px; }
.text-xl { font-size: 20px; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.grid { display: grid; }
.grow { flex: 1; }
.shrink-0 { flex-shrink: 0; }
.w-full { width: 100%; }
.hidden { display: none; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Animations ─────────────────────────────────────────────────────────────── */

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideRight { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: translateX(0); } }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }

.anim-fade { animation: fadeIn 200ms ease; }
.anim-slide-up { animation: slideUp 250ms ease; }
.anim-slide-right { animation: slideRight 250ms ease; }
.anim-pulse { animation: pulse 2s ease infinite; }
