* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  color: #171A20;
  background: #F5F6F8;
}
.mono { font-family: 'IBM Plex Mono', monospace; }
.muted { color: #8A909C; }

.app { display: flex; height: 100vh; width: 100%; overflow: hidden; }

/* ---------- sidebar ---------- */
.sidebar {
  width: 250px;
  flex: 0 0 250px;
  background: #fff;
  border-right: 1px solid #E6E8EC;
  display: flex;
  flex-direction: column;
}
.brand { padding: 20px 18px 14px; display: flex; align-items: center; gap: 11px; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 8px; background: #171A20;
  display: flex; align-items: center; justify-content: center; flex: 0 0 32px;
}
.brand-name { font-size: 14px; font-weight: 600; letter-spacing: -.01em; line-height: 1.1; }
.brand-sub { font-size: 11px; color: #8A909C; line-height: 1.1; }

.nav { flex: 1; overflow-y: auto; padding: 10px 12px; }
.nav-label {
  font-size: 10px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase;
  color: #A2A8B4; margin: 6px 6px 7px;
}
.nav-item {
  width: 100%; display: flex; align-items: center; gap: 11px; padding: 9px 10px;
  margin-bottom: 2px; border: 0; background: transparent; border-radius: 8px; cursor: pointer;
  font-family: inherit; text-align: left; transition: background .13s;
}
.nav-item:hover { background: #F5F6F8; }
.nav-item.active { background: #171A20; }
.nav-item.active .nav-item-label, .nav-item.active .nav-item-type { color: #fff; }
.nav-item.active .nav-item-type { color: #C2C7D0; }
.nav-dot { width: 8px; height: 8px; border-radius: 3px; flex: 0 0 8px; }
.nav-item-label { display: block; font-size: 13px; font-weight: 500; letter-spacing: -.01em; }
.nav-item-type { display: block; font-size: 10.5px; color: #9AA0AC; margin-top: 1px; }
.nav-badge {
  font-family: 'IBM Plex Mono', monospace; font-size: 11.5px; font-weight: 500;
  padding: 2px 7px; border-radius: 20px; background: #F1F2F5; color: #565C68;
}
.nav-item.active .nav-badge { background: rgba(255,255,255,.15); color: #fff; }

.sidebar-footer {
  padding: 12px 18px; border-top: 1px solid #EEF0F3; font-size: 11px; color: #8A909C;
}

/* ---------- main ---------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.header {
  flex: 0 0 auto; padding: 18px 28px 16px; border-bottom: 1px solid #E9EBEE; background: #fff;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.header h1 { margin: 0; font-size: 19px; font-weight: 600; letter-spacing: -.02em; }
.header p { margin: 3px 0 0; font-size: 12.5px; }

.content { flex: 1; overflow-y: auto; padding: 24px 28px 40px; max-width: 1180px; }

.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat-card { background: #fff; border: 1px solid #E6E8EC; border-radius: 13px; padding: 16px 17px; }
.stat-card-label { font-size: 12px; color: #8A909C; font-weight: 500; }
.stat-card-value {
  font-family: 'IBM Plex Mono', monospace; font-size: 31px; font-weight: 600;
  letter-spacing: -.02em; line-height: 1; margin-top: 9px;
}

.panel { background: #fff; border: 1px solid #E6E8EC; border-radius: 13px; padding: 18px; margin-top: 14px; }
.panel-title { font-size: 13px; font-weight: 600; margin-bottom: 12px; }

.source-row { display: flex; align-items: center; gap: 14px; margin-bottom: 13px; }
.source-row:last-child { margin-bottom: 0; }
.source-row-name { flex: 0 0 150px; display: flex; align-items: center; gap: 9px; font-size: 12.5px; font-weight: 500; }
.source-row-bar { flex: 1; height: 26px; display: flex; background: #F3F4F6; border-radius: 6px; overflow: hidden; }
.source-row-total { flex: 0 0 42px; text-align: right; font-family: 'IBM Plex Mono', monospace; font-size: 13px; font-weight: 600; }
.source-row-scan { flex: 0 0 130px; text-align: right; font-size: 11px; color: #9AA0AC; white-space: nowrap; }
.empty-note { font-size: 12.5px; color: #9AA0AC; }

.issues-toolbar { display: flex; align-items: center; gap: 12px; margin: 18px 0 0; flex-wrap: wrap; }
.chip-row { display: flex; gap: 6px; }
.chip {
  font-family: inherit; font-size: 12px; font-weight: 500; padding: 6px 12px; border-radius: 8px;
  cursor: pointer; display: flex; align-items: center; gap: 7px; border: 1px solid #E1E4E9;
  background: #fff; color: #565C68; transition: all .13s;
}
.chip.active { background: #171A20; color: #fff; border-color: #171A20; }
.chip .count { font-family: 'IBM Plex Mono', monospace; font-weight: 600; }
.search {
  flex: 1; min-width: 220px; border: 1px solid #E1E4E9; border-radius: 8px; padding: 7px 11px;
  font-family: inherit; font-size: 12.5px; background: #fff; color: #171A20; outline: 0;
}

.issues-table { padding: 0; overflow: hidden; }
.row-head, .issue-row {
  display: grid; grid-template-columns: 96px 1fr 220px 130px 96px 30px; gap: 0; align-items: center;
}
.row-head {
  padding: 10px 18px; border-bottom: 1px solid #EEF0F3; font-size: 10.5px; font-weight: 600;
  color: #9AA0AC; text-transform: uppercase; letter-spacing: .04em;
}
.issue-row {
  width: 100%; padding: 12px 18px; border: 0; border-bottom: 1px solid #F1F2F5; background: #fff;
  cursor: pointer; font-family: inherit; text-align: left;
}
.issue-row:hover { background: #FAFBFC; }
.sev-badge {
  font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em;
  padding: 3px 8px; border-radius: 5px; display: inline-block;
}
.issue-title { font-size: 13px; font-weight: 500; padding-right: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.issue-loc {
  font-family: 'IBM Plex Mono', monospace; font-size: 11.5px; color: #565C68; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; padding-right: 10px;
}
.issue-rule { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: #9AA0AC; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.issue-first-seen { font-size: 11.5px; color: #9AA0AC; }
.chevron { transition: transform .15s; }
.chevron.open { transform: rotate(90deg); }

.issue-detail { border-bottom: 1px solid #F1F2F5; background: #FBFBFC; padding: 4px 18px 18px; }
.issue-detail p { margin: 8px 0 0; font-size: 12.5px; line-height: 1.5; color: #3D424B; }
.issue-detail .label { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: #9AA0AC; margin-top: 14px; }
.issue-detail a { color: #1570EF; }
.no-issues { padding: 44px; text-align: center; color: #9AA0AC; font-size: 13px; }

/* severity palette */
.sev-critical { background: #FEF2F2; color: #B42318; }
.sev-high { background: #FFF7ED; color: #C2410C; }
.sev-medium { background: #FFFBEB; color: #B45309; }
.sev-low { background: #EFF6FF; color: #1D4ED8; }
.dot-critical { background: #DC2626; }
.dot-high { background: #EA580C; }
.dot-medium { background: #D97706; }
.dot-low { background: #2563EB; }
.seg-critical { background: #DC2626; }
.seg-high { background: #EA580C; }
.seg-medium { background: #D97706; }
.seg-low { background: #2563EB; }
