/* =========================================
   EDR PoC macOS — Shared Design System
   ========================================= */
:root {
  --bg: #0a0e14;
  --card: #141922;
  --card2: #1a2030;
  --border: #252d3a;
  --border2: #2d3748;
  --text: #e2e8f0;
  --text2: #8892a4;
  --accent: #60a5fa;
  --accent2: #818cf8;
  --green: #34d399;
  --red: #f87171;
  --orange: #fbbf24;
  --purple: #a78bfa;
  --yellow: #fbbf24;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 2px 8px rgba(0,0,0,.3);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.4);
  --transition: .2s ease;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* =========================================
   NAVBAR
   ========================================= */
.navbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  background: rgba(20, 25, 34, .85);
}

.nav-brand {
  font-size: 16px;
  font-weight: 700;
  margin-right: 32px;
  white-space: nowrap;
  color: var(--text);
  text-decoration: none;
}
.nav-brand span { color: var(--accent); }

.nav-links {
  display: flex;
  gap: 2px;
  flex: 1;
}

.nav-link {
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text2);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  position: relative;
}
.nav-link:hover {
  color: var(--text);
  background: rgba(96, 165, 250, .08);
}
.nav-link.active {
  color: var(--accent);
  background: rgba(96, 165, 250, .12);
}

.nav-right {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-left: auto;
}

/* =========================================
   SYSINFO BAR (override)
   ========================================= */
.sysinfo-bar {
  background: var(--card) !important;
  border-bottom: 1px solid var(--border) !important;
  padding: 5px 24px !important;
  font-size: 11px !important;
}

/* =========================================
   BUTTONS
   ========================================= */
.btn {
  padding: 7px 16px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text2);
  transition: all var(--transition);
  white-space: nowrap;
}
.btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(96, 165, 250, .08);
}
.btn-primary {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}
.btn-primary:hover {
  background: #4d94f8;
  border-color: #4d94f8;
  color: var(--bg);
}
.btn-danger {
  color: var(--red);
  border-color: rgba(248, 113, 113, .4);
}
.btn-danger:hover {
  background: rgba(248, 113, 113, .1);
  border-color: var(--red);
}
.btn-success {
  color: var(--green);
  border-color: rgba(52, 211, 153, .4);
}
.btn-success:hover {
  background: rgba(52, 211, 153, .1);
  border-color: var(--green);
}
.btn-warn {
  color: var(--orange);
  border-color: rgba(251, 191, 36, .4);
}
.btn-warn:hover {
  background: rgba(251, 191, 36, .1);
  border-color: var(--orange);
}
.btn-sm { padding: 4px 10px; font-size: 11px; }
.btn-xs { padding: 2px 8px; font-size: 10px; }

/* =========================================
   CARDS
   ========================================= */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.card:hover { border-color: var(--border2); }
.card-interactive:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(96, 165, 250, .1);
}

/* =========================================
   STAT CARDS
   ========================================= */
.stats-grid {
  display: grid;
  gap: 12px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  text-align: center;
}
.stat-card .stat-num {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.2;
}
.stat-card .stat-label {
  font-size: 11px;
  color: var(--text2);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: .5px;
}

/* =========================================
   BADGES
   ========================================= */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.badge-high { background: rgba(248, 113, 113, .15); color: var(--red); }
.badge-medium { background: rgba(251, 191, 36, .15); color: var(--orange); }
.badge-low { background: rgba(52, 211, 153, .15); color: var(--green); }
.badge-accent { background: rgba(96, 165, 250, .12); color: var(--accent); }
.badge-purple { background: rgba(167, 139, 250, .12); color: var(--purple); }
.badge-n0 { background: rgba(52, 211, 153, .12); color: var(--green); }
.badge-n1 { background: rgba(251, 191, 36, .12); color: var(--orange); }
.badge-n2 { background: rgba(248, 113, 113, .12); color: var(--red); }
.badge-detected { background: rgba(248, 113, 113, .15); color: var(--red); }
.badge-partial { background: rgba(251, 191, 36, .15); color: var(--orange); }
.badge-not_detected { background: rgba(52, 211, 153, .15); color: var(--green); }

/* =========================================
   FILTER PILLS
   ========================================= */
.pill-group {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.pill {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text2);
  transition: all var(--transition);
}
.pill:hover { border-color: var(--accent); color: var(--text); }
.pill.active { background: rgba(96, 165, 250, .12); border-color: var(--accent); color: var(--accent); }
.pill.active-high { background: rgba(248, 113, 113, .1); border-color: var(--red); color: var(--red); }
.pill.active-med { background: rgba(251, 191, 36, .1); border-color: var(--orange); color: var(--orange); }
.pill.active-low { background: rgba(52, 211, 153, .1); border-color: var(--green); color: var(--green); }

/* =========================================
   INPUTS
   ========================================= */
input[type="text"], input[type="number"], select {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: border-color var(--transition);
}
input[type="text"]:focus, input[type="number"]:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(96, 165, 250, .15);
}
input[type="checkbox"] { accent-color: var(--accent); }

/* =========================================
   CODE / MONO
   ========================================= */
.mono { font-family: "SF Mono", "Fira Code", Menlo, Monaco, monospace; }
.code-block {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-family: "SF Mono", "Fira Code", Menlo, monospace;
  font-size: 11px;
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

/* =========================================
   PROGRESS BARS
   ========================================= */
.progress {
  height: 8px;
  background: var(--bg);
  border-radius: 4px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width .4s ease;
}
.progress-lg { height: 28px; border: 1px solid var(--border); border-radius: var(--radius-sm); position: relative; }
.progress-lg .progress-fill { border-radius: 5px; }
.progress-lg .progress-text {
  position: absolute; top: 0; left: 0; right: 0;
  height: 28px; line-height: 28px;
  text-align: center;
  font-size: 12px; font-weight: 700; color: var(--text);
}

/* =========================================
   TOAST
   ========================================= */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--card);
  border: 1px solid var(--green);
  border-radius: var(--radius);
  padding: 12px 24px;
  color: var(--green);
  font-size: 13px;
  z-index: 300;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .3s, transform .3s;
  pointer-events: none;
  box-shadow: var(--shadow-lg);
}
.toast.show { opacity: 1; transform: translateY(0); }

/* =========================================
   EMPTY STATE
   ========================================= */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text2);
}
.empty-state h3 {
  font-size: 16px;
  color: var(--text);
  margin-bottom: 8px;
}

/* =========================================
   ANIMATIONS
   ========================================= */
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .4; } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }

.animate-in { animation: fadeIn .3s ease; }
.loading-spinner {
  display: inline-block; width: 14px; height: 14px;
  border: 2px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .6s linear infinite;
}

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 1024px) {
  .navbar { padding: 0 16px; }
  .nav-brand { margin-right: 16px; font-size: 14px; }
  .nav-link { padding: 6px 10px; font-size: 12px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr) !important; }
}

@media (max-width: 768px) {
  .navbar { height: auto; flex-wrap: wrap; padding: 10px 16px; gap: 8px; }
  .nav-links { order: 3; width: 100%; overflow-x: auto; padding-bottom: 4px; }
  .nav-right { gap: 6px; }
  .stats-grid { grid-template-columns: 1fr !important; }
  .content { padding: 16px !important; }
  .card { padding: 14px; }
}

/* =========================================
   SCROLLBAR
   ========================================= */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--border2); }

/* =========================================
   SELECTION
   ========================================= */
::selection { background: rgba(96, 165, 250, .25); }
