@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:ital,wght@0,400;0,500;0,600;0,700;1,400&family=IBM+Plex+Sans:wght@400;500;600&display=swap');

/* ── TOKENS ─────────────────────────────────────────────────────── */
:root {
  /* Surfaces */
  --bg:   #08080b;
  --bg1:  #0d0d11;
  --bg2:  #111116;
  --bg3:  #16161c;
  --bg4:  #1c1c24;

  /* Text */
  --t1:   #e8e8f0;
  --t2:   #9898aa;
  --t3:   #56566a;
  --t4:   #38384a;

  /* Borders */
  --b1:   rgba(255,255,255,0.07);
  --b2:   rgba(255,255,255,0.12);
  --b3:   rgba(255,255,255,0.20);

  /* Accent: amber */
  --a:      #f59e0b;
  --a-dim:  rgba(245,158,11,0.14);
  --a-glow: rgba(245,158,11,0.06);

  /* Severity */
  --c-crit:    #ef4444;  --c-crit-bg: rgba(239,68,68,0.12);
  --c-high:    #f97316;  --c-high-bg: rgba(249,115,22,0.12);
  --c-med:     #f59e0b;  --c-med-bg:  rgba(245,158,11,0.12);
  --c-low:     #22c55e;  --c-low-bg:  rgba(34,197,94,0.12);
  --c-info:    #60a5fa;  --c-info-bg: rgba(96,165,250,0.10);

  /* Typography */
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --sans: 'IBM Plex Sans', system-ui, sans-serif;

  /* Radii */
  --r:    2px;
  --r-sm: 1px;
  --r-lg: 4px;

  /* Layout */
  --sidenav-w: 220px;
  --topbar-h:   48px;
  --act-w:     276px;

  /* Shadow */
  --shadow: 0 4px 24px rgba(0,0,0,0.4);

  /* ── Backwards-compat aliases (old token names used by existing HTML/JS) */
  --surface:   var(--bg3);
  --surface2:  var(--bg4);
  --border:    var(--b1);
  --border2:   var(--b2);
  --accent:    var(--a);
  --accent2:   var(--a);
  --accent3:   var(--a);
  --text:      var(--t1);
  --text2:     var(--t2);
  --text3:     var(--t3);
  --green:     var(--c-low);
  --red:       var(--c-crit);
  --orange:    var(--c-high);
  --yellow:    var(--c-med);
  --blue:      var(--c-info);
  --radius:    var(--r-lg);
  --radius-sm: var(--r);
  --radius-lg: var(--r-lg);
}

/* ── Light mode ──────────────────────────────────────────────────── */
[data-theme="light"] {
  --bg:  #f8f8fa;  --bg1: #ffffff;  --bg2: #f2f2f6;  --bg3: #eaeaef;  --bg4: #e0e0e8;
  --t1:  #0d0d14;  --t2:  #44445a;  --t3:  #888899;  --t4:  #b8b8cc;
  --b1:  rgba(0,0,0,0.07);
  --b2:  rgba(0,0,0,0.12);
  --b3:  rgba(0,0,0,0.20);
  --a-dim:    rgba(245,158,11,0.10);
  --a-glow:   rgba(245,158,11,0.04);
  --c-crit-bg: rgba(239,68,68,0.08);
  --c-high-bg: rgba(249,115,22,0.08);
  --c-med-bg:  rgba(245,158,11,0.08);
  --c-low-bg:  rgba(34,197,94,0.08);
  --c-info-bg: rgba(96,165,250,0.08);
  --shadow:    0 2px 12px rgba(0,0,0,0.10);
}

/* ── RESET ───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--t1);
  font-family: var(--mono);
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.5;
  overflow: hidden;
}
button  { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--a); color: #000; }

*::-webkit-scrollbar { width: 6px; height: 6px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--b2); border-radius: 0; }
*::-webkit-scrollbar-thumb:hover { background: var(--b3); }

/* ── SHELL — CSS Grid ────────────────────────────────────────────── */
body {
  display: grid;
  grid-template-columns: var(--sidenav-w) 1fr;
  grid-template-rows: var(--topbar-h) 1fr;
}
/* fixed overlays don't participate in grid */
#loading-overlay { position: fixed; }
.modal-overlay   { position: fixed; }
.toast-container { position: fixed; }
#login-screen    { position: fixed; }

.sidenav {
  grid-row: 1 / 3;
  grid-column: 1;
  background: var(--bg1);
  border-right: 1px solid var(--b1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100vh;
}
.topbar {
  grid-row: 1;
  grid-column: 2;
  background: var(--bg);
  border-bottom: 1px solid var(--b1);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
  height: var(--topbar-h);
}
.workarea {
  grid-row: 2;
  grid-column: 2;
  display: grid;
  grid-template-columns: 1fr var(--act-w);
  min-height: 0;
  overflow: hidden;
}
.workarea.no-activity { grid-template-columns: 1fr; }
.main {
  overflow: auto;
  padding: 22px 28px 80px;
  min-height: 0;
}
.activity-col {
  border-left: 1px solid var(--b1);
  background: var(--bg1);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

/* ── SIDENAV internals ───────────────────────────────────────────── */
.brand {
  height: var(--topbar-h);
  border-bottom: 1px solid var(--b1);
  display: flex;
  align-items: center;
  padding: 0 14px;
  flex-shrink: 0;
}
.brand-wordmark {
  font-size: 13px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--t1);
}
.brand-tag {
  font-size: 9px; color: var(--t3); letter-spacing: 0.08em;
  background: var(--bg3); border: 1px solid var(--b1);
  padding: 1px 5px; margin-left: 8px; border-radius: var(--r-sm);
}
/* logo image in brand */
.brand-logo-img { width: 22px; height: 22px; object-fit: contain; margin-right: 8px; }

.nav-project {
  border-bottom: 1px solid var(--b1);
  padding: 10px 14px; cursor: pointer; flex-shrink: 0;
  transition: background 0.08s;
}
.nav-project:hover { background: var(--bg2); }
.nav-project-path {
  font-size: 10px; color: var(--t3);
  letter-spacing: 0.06em; margin-bottom: 5px;
}
.nav-project-name {
  font-size: 12px; font-weight: 600; color: var(--t1);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nav-project-target {
  font-size: 10px; color: var(--t3); margin-top: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nav-project-bar { margin-top: 8px; height: 2px; background: var(--b1); }
.nav-project-bar-fill { height: 100%; background: var(--a); transition: width 0.6s; }

/* nav-project logo (same as sidenav-project-logo-wrap in old code) */
.nav-project-logo-wrap { display: flex; justify-content: center; margin-bottom: 9px; }
.nav-project-logo {
  max-height: 34px; max-width: 100%; object-fit: contain;
  border-radius: var(--r); padding: 5px 10px;
}
.nav-project-logo--light { background: #ffffff; border: 1px solid rgba(0,0,0,.09); }
.nav-project-logo--dark  { background: #1e1e1e; border: 1px solid rgba(255,255,255,.08); }

.nav-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 8px 0; }
.nav-group-label {
  font-size: 9px; font-weight: 600; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--t4);
  padding: 10px 14px 3px;
}
.nav-item {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 14px; font-size: 12px; color: var(--t2);
  cursor: pointer; border-left: 2px solid transparent;
  transition: background 0.08s, color 0.08s;
  white-space: nowrap; text-decoration: none;
}
.nav-item svg { flex-shrink: 0; opacity: 0.6; transition: opacity 0.08s; }
.nav-item:hover { background: var(--bg2); color: var(--t1); border-left-color: var(--b2); }
.nav-item:hover svg { opacity: 0.9; }
.nav-item.active { background: var(--a-dim); color: var(--t1); border-left-color: var(--a); }
.nav-item.active svg { opacity: 1; }
.nav-item-label { flex: 1; }
.nav-item-count { font-size: 10px; color: var(--t3); font-variant-numeric: tabular-nums; }
.nav-item.active .nav-item-count { color: var(--a); }
.nav-divider { height: 1px; background: var(--b1); margin: 6px 14px; }

.nav-foot {
  border-top: 1px solid var(--b1); padding: 10px 14px;
  display: flex; align-items: center; gap: 9px; flex-shrink: 0;
}
.nav-foot-avatar {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--bg3); border: 1px solid var(--b2);
  display: grid; place-items: center;
  font-size: 10px; font-weight: 700; color: var(--t2); flex-shrink: 0;
}
.nav-foot-name { font-size: 12px; font-weight: 500; color: var(--t1); }
.nav-foot-role { font-size: 10px; color: var(--t3); margin-top: 1px; }

/* back-link / user pill inside nav-foot */
.nav-back-link {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 14px; font-size: 10px; color: var(--t3);
  border-bottom: 1px solid var(--b1); flex-shrink: 0;
  transition: color .15s, background .15s;
}
.nav-back-link:hover { color: var(--t1); background: var(--bg2); }

/* progress inside nav-project */
.nav-progress {
  display: flex; align-items: center; gap: 7px; margin-top: 6px;
}
.nav-progress-bar {
  flex: 1; height: 2px; background: var(--b1); overflow: hidden;
}
.nav-progress-fill {
  height: 100%; background: var(--a); transition: width .4s;
}
.nav-progress-pct { font-size: 10px; color: var(--t3); flex-shrink: 0; }

/* ── TOPBAR internals ────────────────────────────────────────────── */
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--t3); }
.crumbs .sep { opacity: 0.5; }
.crumbs .cur { color: var(--t1); font-weight: 500; }

.searchbar {
  display: flex; align-items: center; gap: 6px;
  background: var(--bg2); border: 1px solid var(--b1);
  padding: 4px 10px; width: 240px; border-radius: var(--r);
}
.searchbar input { background: none; border: none; outline: none; font-size: 11px; flex: 1; color: var(--t1); }
.searchbar input::placeholder { color: var(--t3); }

/* search-wrap / search-input — old class names, still used in renderTopbar */
.search-wrap { position: relative; }
.search-input {
  background: var(--bg2); border: 1px solid var(--b1);
  border-radius: var(--r); padding: 4px 10px 4px 28px;
  color: var(--t1); font-size: 11px; width: 210px; outline: none;
  transition: border-color .15s;
}
.search-input:focus { border-color: var(--b2); }
.search-input::placeholder { color: var(--t3); }
.search-icon { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: var(--t3); font-size: 11px; pointer-events: none; }

.icon-btn {
  width: 28px; height: 28px; border-radius: var(--r);
  display: grid; place-items: center;
  color: var(--t3); transition: background 0.1s, color 0.1s;
}
.icon-btn:hover { background: var(--bg2); color: var(--t1); }

/* online presence */
.online-avatars { display: flex; align-items: center; gap: 0; }
.online-dot { position: relative; }
.avatar-sm {
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 700; color: #fff; flex-shrink: 0; line-height: 1;
  border: 1px solid var(--bg); margin-left: -3px; overflow: hidden;
}
.avatar-sm:first-child { margin-left: 0; }
.online-count { font-size: 10px; color: var(--t3); margin-left: 8px; }
.live-badge {
  width: 6px; height: 6px; border-radius: 50%; background: var(--c-low);
  animation: livePulse 2s ease-in-out infinite; flex-shrink: 0;
}
@keyframes livePulse { 0%,100%{opacity:1;box-shadow:0 0 0 0 rgba(34,197,94,.4)} 50%{opacity:.7;box-shadow:0 0 0 4px rgba(34,197,94,0)} }

/* user pill */
.user-pill {
  display: flex; align-items: center; gap: 7px;
  background: var(--bg2); border: 1px solid var(--b1);
  border-radius: var(--r); padding: 3px 10px 3px 4px;
  cursor: pointer; transition: border-color .15s; position: relative;
  font-size: 11px;
}
.user-pill:hover { border-color: var(--b2); }
.user-dropdown {
  position: absolute; top: calc(100% + 6px); right: 0;
  background: var(--bg2); border: 1px solid var(--b2);
  border-radius: var(--r-lg); padding: 4px;
  min-width: 160px; display: none;
  box-shadow: var(--shadow); z-index: 200;
}
.user-dropdown.open { display: block; }
.dropdown-item {
  display: block; width: 100%; padding: 6px 10px;
  background: none; border: none; color: var(--t2);
  font-size: 12px; text-align: left; border-radius: var(--r);
  transition: background .1s, color .1s; cursor: pointer; font-family: inherit;
}
.dropdown-item:hover { background: var(--bg3); color: var(--t1); }
.dropdown-item.danger:hover { background: var(--c-crit-bg); color: var(--c-crit); }

/* ── BUTTONS ─────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px;
  border: 1px solid var(--b2);
  background: var(--bg3); color: var(--t2);
  font-size: 11px; font-weight: 500; border-radius: var(--r);
  transition: background 0.1s, color 0.1s, border-color 0.1s;
  letter-spacing: 0.01em; font-family: var(--mono); cursor: pointer;
}
.btn:hover { background: var(--bg4); color: var(--t1); border-color: var(--b3); }
.btn-prim {
  background: var(--a); color: #000; border-color: var(--a); font-weight: 600;
}
.btn-prim:hover { background: #fbbf24; border-color: #fbbf24; color: #000; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--t3); }
.btn-ghost:hover { background: var(--bg2); color: var(--t1); border-color: transparent; }
.btn-danger { background: var(--c-crit-bg); border-color: var(--c-crit); color: var(--c-crit); }

/* old button class aliases — still used in HTML templates */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center;
  width: 100%; background: var(--a); border: none; border-radius: var(--r);
  padding: 10px; color: #000; font-size: 13px; font-weight: 700;
  transition: background .15s; margin-top: 6px; cursor: pointer;
}
.btn-primary:hover { background: #fbbf24; }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.btn-secondary {
  background: var(--bg3); border: 1px solid var(--b2);
  border-radius: var(--r); padding: 7px 16px;
  color: var(--t2); font-size: 12px; font-weight: 500;
  transition: border-color .15s, color .15s; cursor: pointer;
}
.btn-secondary:hover { border-color: var(--b3); color: var(--t1); }
.btn-accent {
  background: var(--a-dim); border: 1px solid rgba(245,158,11,.3);
  border-radius: var(--r); padding: 6px 14px;
  color: var(--a); font-size: 12px; font-weight: 700;
  transition: background .15s; display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
}
.btn-accent:hover { background: rgba(245,158,11,.2); border-color: var(--a); }
.btn-save {
  background: var(--a); border: none; border-radius: var(--r);
  padding: 8px 16px; color: #000; font-size: 12px; font-weight: 700;
  transition: background .15s; cursor: pointer;
}
.btn-save:hover { background: #fbbf24; }
.btn-save:disabled { opacity: .5; cursor: not-allowed; }
.btn-icon {
  background: var(--bg3); border: 1px solid var(--b1);
  border-radius: var(--r-sm); padding: 3px 7px;
  font-size: 11px; color: var(--t3); transition: all .15s; cursor: pointer;
}
.btn-icon:hover { border-color: var(--b2); color: var(--t2); }
.btn-icon.edit:hover   { border-color: var(--c-info); color: var(--c-info); }
.btn-icon.delete:hover { border-color: var(--c-crit); color: var(--c-crit); }
.ai-btn {
  background: var(--a-dim); border: 1px solid rgba(245,158,11,.25);
  border-radius: var(--r-sm); padding: 2px 8px; font-size: 10px; font-weight: 600;
  color: var(--a); cursor: pointer; transition: all .15s;
  display: inline-flex; align-items: center; gap: 4px;
}
.ai-btn:hover { background: rgba(245,158,11,.2); border-color: var(--a); }
.ai-btn:disabled { opacity: .5; cursor: not-allowed; }
.ai-btn.loading { opacity: .7; }
.btn-remove {
  background: var(--c-crit-bg); border: 1px solid rgba(239,68,68,.2);
  border-radius: var(--r-sm); padding: 4px 7px; color: var(--c-crit); font-size: 11px; cursor: pointer;
}
.btn-add-row {
  background: none; border: 1px dashed var(--b2); border-radius: var(--r);
  padding: 5px 12px; color: var(--t3); font-size: 11px;
  width: 100%; transition: border-color .15s, color .15s; text-align: center; cursor: pointer;
}
.btn-add-row:hover { border-color: var(--a); color: var(--a); }

/* ── PAGE HEADER ─────────────────────────────────────────────────── */
.page-head {
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: 24px;
  margin-bottom: 20px; padding-bottom: 14px;
  border-bottom: 1px solid var(--b1);
}
.page-eyebrow {
  font-size: 9px; color: var(--t3);
  letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 5px;
}
.page-title {
  font-size: 18px; font-weight: 700;
  letter-spacing: -0.01em; line-height: 1.15; color: var(--t1);
}
.page-sub { font-size: 11px; color: var(--t3); margin-top: 4px; }
.page-actions { display: flex; gap: 5px; align-items: center; flex-shrink: 0; padding-top: 2px; }

/* old page header aliases */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 20px; gap: 16px;
}
.page-subtitle { font-size: 12px; color: var(--t3); margin-top: 2px; }

/* ── STAT ROW ────────────────────────────────────────────────────── */
.stat-row {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--b1); border-radius: var(--r);
  background: var(--bg1); margin-bottom: 16px; overflow: hidden;
}
.stat-cell {
  padding: 14px 16px; border-right: 1px solid var(--b1); position: relative;
}
.stat-cell:last-child { border-right: none; }
.stat-label {
  font-size: 9px; color: var(--t3);
  letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 6px;
}
.stat-val {
  font-size: 22px; font-weight: 700;
  letter-spacing: -0.02em; line-height: 1;
  font-variant-numeric: tabular-nums; color: var(--t1);
}
.stat-sub { font-size: 10px; color: var(--t3); margin-top: 6px; display: flex; align-items: center; gap: 6px; }
.stat-accent { color: var(--a); }
.stat-crit   { color: var(--c-crit); }
.stat-bar { position: absolute; bottom: 0; left: 0; right: 0; height: 2px; }
.stat-bar-fill { height: 100%; background: var(--a); transition: width 0.6s; }
.stat-bar-fill.crit { background: var(--c-crit); }
.stat-bar-fill.high { background: var(--c-high); }
.stat-bar-fill.low  { background: var(--c-low); }

/* old stat card — still used by dashboard.js render functions */
.stats-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin-bottom: 16px; }
.stat-card {
  background: var(--bg2); border: 1px solid var(--b1);
  border-radius: var(--r); padding: 14px; position: relative; overflow: hidden;
}
.stat-card::before { content:''; position:absolute; top:0; left:0; right:0; height:2px; }
.stat-card.green::before  { background: var(--c-low); }
.stat-card.red::before    { background: var(--c-crit); }
.stat-card.orange::before { background: var(--c-high); }
.stat-card.purple::before { background: var(--a); }
.stat-value { font-size: 26px; font-weight: 700; line-height: 1; margin-bottom: 4px; }
.stat-card.green .stat-value  { color: var(--c-low); }
.stat-card.red .stat-value    { color: var(--c-crit); }
.stat-card.orange .stat-value { color: var(--c-high); }
.stat-card.purple .stat-value { color: var(--a); }

/* ── SECTION ─────────────────────────────────────────────────────── */
.section {
  background: var(--bg1); border: 1px solid var(--b1);
  border-radius: var(--r); overflow: hidden; margin-bottom: 12px;
}
.section-head {
  padding: 9px 14px; border-bottom: 1px solid var(--b1);
  display: flex; align-items: center;
  justify-content: space-between; gap: 12px; background: var(--bg2);
}
.section-title {
  font-size: 10px; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--t2);
  display: flex; align-items: center; gap: 8px;
}
.section-count {
  font-size: 10px; color: var(--t3);
  background: var(--bg3); border: 1px solid var(--b1);
  border-radius: var(--r-sm); padding: 0 5px;
}
.section-body { padding: 14px; }
.section-body.bare { padding: 0; }

/* ── TABLE ───────────────────────────────────────────────────────── */
.tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.tbl th {
  text-align: left; padding: 7px 14px;
  font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--t3); font-weight: 600;
  border-bottom: 1px solid var(--b1); background: var(--bg2); white-space: nowrap;
}
.tbl td { padding: 9px 14px; border-bottom: 1px solid var(--b1); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr.click { cursor: pointer; transition: background 0.08s; }
.tbl tr.click:hover td { background: var(--bg2); }
.tbl tr.sel td { background: var(--a-glow); }
.tbl .mono { font-family: var(--mono); font-size: 11px; color: var(--t3); }
.tbl .num  { font-variant-numeric: tabular-nums; text-align: right; }
.tbl .trunc { max-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tbl .fw   { font-weight: 600; color: var(--t1); }

/* ── SEVERITY BADGES ─────────────────────────────────────────────── */
.sev {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 9px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 2px 6px; border-radius: var(--r-sm);
  white-space: nowrap; line-height: 1.4; font-family: var(--mono);
}
.sev.critical { color: var(--c-crit); background: var(--c-crit-bg); border: 1px solid rgba(239,68,68,0.2); }
.sev.high     { color: var(--c-high); background: var(--c-high-bg); border: 1px solid rgba(249,115,22,0.2); }
.sev.medium   { color: var(--c-med);  background: var(--c-med-bg);  border: 1px solid rgba(245,158,11,0.2); }
.sev.low      { color: var(--c-low);  background: var(--c-low-bg);  border: 1px solid rgba(34,197,94,0.2); }
.sev.info     { color: var(--c-info); background: var(--c-info-bg); border: 1px solid rgba(96,165,250,0.2); }

/* old sev-badge — still used by views until migrated */
.sev-badge {
  font-family: var(--mono); font-size: 9px; font-weight: 700;
  padding: 2px 6px; border-radius: var(--r-sm); text-transform: uppercase;
  letter-spacing: .06em; white-space: nowrap; display: inline-block;
}
.sev-critical { color: var(--c-crit); background: var(--c-crit-bg); border: 1px solid rgba(239,68,68,.2); }
.sev-high     { color: var(--c-high); background: var(--c-high-bg); border: 1px solid rgba(249,115,22,.2); }
.sev-medium   { color: var(--c-med);  background: var(--c-med-bg);  border: 1px solid rgba(245,158,11,.2); }
.sev-low      { color: var(--c-low);  background: var(--c-low-bg);  border: 1px solid rgba(34,197,94,.2); }
.sev-info     { color: var(--c-info); background: var(--c-info-bg); border: 1px solid rgba(96,165,250,.2); }

/* ── STATUS ──────────────────────────────────────────────────────── */
.status {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10px; font-family: var(--mono); color: var(--t3); letter-spacing: 0.04em;
}
.status .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--t4); flex-shrink: 0; }
.status.open        .dot { background: var(--a); }
.status.in_progress .dot { background: var(--c-high); }
.status.resolved    .dot { background: var(--c-low); }
.status.open        { color: var(--t2); }
.status.in_progress { color: var(--t2); }
.status.resolved    { color: var(--t3); }
/* target statuses */
.status.active      .dot { background: var(--c-info); }
.status.active      { color: var(--c-info); }
.status.completed   .dot { background: var(--c-low); }
.status.completed   { color: var(--c-low); }
.status.out-of-scope .dot { background: var(--t4); }
.status.out-of-scope { color: var(--t3); }
/* vuln drawer statuses */
.status.done .dot   { background: var(--c-low); }
.status.done        { color: var(--c-low); }
.status.fail .dot   { background: var(--c-crit); }
.status.fail        { color: var(--c-crit); }

/* old status-pill aliases */
.status-open        { color: var(--a); border: 1px solid rgba(245,158,11,.3); border-radius: var(--r-sm); padding: 1px 6px; font-size: 10px; }
.status-in_progress { color: var(--c-med); border: 1px solid rgba(245,158,11,.3); border-radius: var(--r-sm); padding: 1px 6px; font-size: 10px; }
.status-resolved    { color: var(--c-low); border: 1px solid rgba(34,197,94,.3); border-radius: var(--r-sm); padding: 1px 6px; font-size: 10px; }

/* ── SEVERITY BARS ───────────────────────────────────────────────── */
.sev-bars { display: flex; flex-direction: column; gap: 8px; }
.sev-bar-row { display: grid; grid-template-columns: 70px 1fr 30px; gap: 10px; align-items: center; }
.sev-bar-name { font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--t3); }
.sev-bar-track { height: 4px; background: var(--bg3); overflow: hidden; position: relative; }
.sev-bar-fill { position: absolute; inset: 0 auto 0 0; transition: width 0.6s cubic-bezier(.22,1,.36,1); }
.sev-bar-fill.critical { background: var(--c-crit); }
.sev-bar-fill.high     { background: var(--c-high); }
.sev-bar-fill.medium   { background: var(--c-med); }
.sev-bar-fill.low      { background: var(--c-low); }
.sev-bar-fill.info     { background: var(--c-info); }
.sev-bar-count { font-size: 11px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }

/* old sev-breakdown used in dashboard */
.sev-breakdown { display: flex; flex-direction: column; gap: 7px; }
.sev-row { display: flex; align-items: center; gap: 8px; }
.sev-bar-wrap { flex: 1; height: 5px; background: var(--b1); overflow: hidden; }
.sev-bar { height: 100%; transition: width .4s ease; min-width: 3px; }
.sev-bar-critical { background: var(--c-crit); }
.sev-bar-high     { background: var(--c-high); }
.sev-bar-medium   { background: var(--c-med); }
.sev-bar-low      { background: var(--c-low); }
.sev-bar-info     { background: var(--c-info); }

/* ── PROGRESS BAR ────────────────────────────────────────────────── */
.pbar { height: 3px; background: var(--bg3); overflow: hidden; }
.pbar > div { height: 100%; background: var(--a); transition: width 0.6s; }
.pbar.green > div { background: var(--c-low); }
.pbar.thin { height: 2px; }

/* old progress styles */
.progress-section { background: var(--bg2); border: 1px solid var(--b1); border-radius: var(--r); padding: 14px; margin-bottom: 10px; }
.progress-label-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 7px; }
.progress-label { font-size: 11px; color: var(--t3); text-transform: uppercase; letter-spacing: .1em; }
.progress-pct { font-size: 13px; font-weight: 700; color: var(--c-low); }
.progress-bar { height: 4px; background: var(--b1); overflow: hidden; }
.progress-bar-fill { height: 100%; background: var(--c-low); transition: width .5s ease; }
.progress-bar-mini { width: 50px; height: 3px; background: var(--b1); overflow: hidden; }
.progress-bar-mini-fill { height: 100%; background: var(--c-low); transition: width .3s; }
.progress-pill {
  background: var(--bg2); border: 1px solid var(--b1); border-radius: var(--r);
  padding: 4px 10px; font-size: 11px; color: var(--t2);
  display: flex; align-items: center; gap: 6px;
}

/* ── RISK MATRIX ─────────────────────────────────────────────────── */
.matrix {
  display: grid; grid-template-columns: 30px repeat(5, 1fr);
  grid-template-rows: repeat(5, 1fr) 28px; gap: 3px;
  background: var(--bg1); padding: 16px;
  border: 1px solid var(--b1); border-radius: var(--r); aspect-ratio: 1.1;
}
.matrix-cell {
  border-radius: var(--r-sm); position: relative;
  display: grid; place-items: center;
  cursor: pointer; transition: transform 0.15s, filter 0.15s; overflow: hidden;
}
.matrix-cell:hover { transform: scale(1.04); filter: brightness(1.15); z-index: 2; }
.mc1 { background: rgba(96,165,250,0.10); }
.mc2 { background: rgba(34,197,94,0.12); }
.mc3 { background: rgba(245,158,11,0.14); }
.mc4 { background: rgba(249,115,22,0.18); }
.mc5 { background: rgba(239,68,68,0.22); }
.matrix-cell-n { font-size: 20px; font-weight: 700; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; color: var(--t1); line-height: 1; }
.matrix-cell.empty .matrix-cell-n { opacity: 0.15; font-size: 13px; }
.matrix-cell-overlay {
  position: absolute; inset: 0; display: flex; flex-wrap: wrap;
  align-content: center; justify-content: center; gap: 3px;
  padding: 6px; opacity: 0; transition: opacity 0.15s;
  background: rgba(0,0,0,0.7); color: var(--t1);
}
.matrix-cell:hover .matrix-cell-overlay { opacity: 1; }
.matrix-ax { font-size: 9px; color: var(--t3); letter-spacing: 0.06em; text-transform: uppercase; display: grid; place-items: center; text-align: center; }
.matrix-ax.y { writing-mode: vertical-rl; transform: rotate(180deg); }

/* ── ACTIVITY FEED ───────────────────────────────────────────────── */
.act-head {
  padding: 10px 14px; border-bottom: 1px solid var(--b1);
  display: flex; align-items: center;
  justify-content: space-between; flex-shrink: 0;
}
.act-head-title {
  font-size: 10px; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--t2);
  display: flex; align-items: center; gap: 7px;
}
.live-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--c-low);
  position: relative; flex-shrink: 0;
}
.live-dot::after {
  content: ''; position: absolute; inset: -3px;
  border-radius: 50%; border: 1px solid var(--c-low);
  opacity: 0; animation: lp 2s ease-out infinite;
}
@keyframes lp { 0%{opacity:.5;transform:scale(.8)} 100%{opacity:0;transform:scale(2.2)} }

.act-list { overflow: auto; flex: 1; min-height: 0; padding: 4px 0; }
.act-item {
  padding: 8px 14px; border-bottom: 1px solid var(--b1);
  display: flex; gap: 9px;
  animation: fi 0.3s ease; transition: background 0.08s;
}
.act-item:hover { background: var(--bg2); }
.act-item:last-child { border-bottom: none; }
@keyframes fi { from{opacity:0;transform:translateY(-3px)} to{opacity:1} }
.act-pip {
  width: 20px; height: 20px; flex-shrink: 0;
  border-radius: var(--r-sm); background: var(--bg3); border: 1px solid var(--b1);
  display: grid; place-items: center;
  font-size: 9px; font-weight: 700; color: var(--t2); margin-top: 1px;
}
.act-body { flex: 1; min-width: 0; }
.act-text { font-size: 11px; color: var(--t2); line-height: 1.5; }
.act-text b { color: var(--t1); font-weight: 600; }
.act-time { font-size: 10px; color: var(--t4); margin-top: 2px; }

/* old activity classes — still used by activity.js */
.activity-header {
  padding: 10px 14px; border-bottom: 1px solid var(--b1);
  display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
}
.activity-title { font-size: 10px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--t2); }
.activity-list { overflow-y: auto; flex: 1; min-height: 0; padding: 4px 0; }
.activity-item {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 8px 14px; border-bottom: 1px solid var(--b1);
  transition: background .08s;
}
.activity-item:hover { background: var(--bg2); }
.activity-avatar {
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 700; color: #fff; flex-shrink: 0; overflow: hidden;
}
.activity-content { flex: 1; min-width: 0; }
.activity-text { font-size: 11px; color: var(--t2); line-height: 1.4; }
.activity-text strong { color: var(--t1); font-weight: 600; }
.activity-text .hl { color: var(--a); }
.activity-time { font-size: 10px; color: var(--t4); margin-top: 2px; }
.activity-status-pill { display: inline-flex; align-items: center; gap: 3px; padding: 1px 5px; border-radius: var(--r-sm); font-size: 9px; font-weight: 700; }
.pill-done    { background: var(--c-low-bg); color: var(--c-low); }
.pill-fail    { background: var(--c-crit-bg); color: var(--c-crit); }
.pill-cleared { background: rgba(148,163,184,.1); color: var(--t3); }
.activity-empty { padding: 24px; text-align: center; color: var(--t3); font-size: 11px; }

/* ── DRAWER ──────────────────────────────────────────────────────── */
.drw-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55);
  z-index: 200; opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.drw-backdrop.open { opacity: 1; pointer-events: auto; }
.drw {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 600px; max-width: calc(100vw - 60px);
  background: var(--bg1); border-left: 1px solid var(--b2);
  box-shadow: -24px 0 60px -24px rgba(0,0,0,0.5);
  z-index: 201; transform: translateX(100%);
  transition: transform 0.26s cubic-bezier(.22,1,.36,1);
  display: flex; flex-direction: column; overflow: hidden;
}
.drw.open { transform: translateX(0); }
.drw-head { padding: 16px 20px 14px; border-bottom: 1px solid var(--b1); flex-shrink: 0; background: var(--bg2); }
.drw-id { font-size: 10px; color: var(--t3); letter-spacing: .08em; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.drw-id code { background: var(--bg3); padding: 1px 6px; border-radius: var(--r-sm); color: var(--t2); }
.drw-title { font-size: 17px; font-weight: 700; letter-spacing: -.01em; line-height: 1.25; margin-bottom: 9px; }
.drw-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.drw-close {
  position: absolute; top: 12px; right: 14px;
  width: 26px; height: 26px; border-radius: var(--r);
  display: grid; place-items: center; color: var(--t3); cursor: pointer;
}
.drw-close:hover { background: var(--bg3); color: var(--t1); }
.drw-body { padding: 18px 20px; overflow: auto; flex: 1; min-height: 0; }
.drw-sec { margin-bottom: 18px; }
.drw-sec-label { font-size: 9px; color: var(--t3); letter-spacing: .14em; text-transform: uppercase; margin-bottom: 7px; }
.drw-prose { font-family: var(--sans); font-size: 13px; line-height: 1.65; color: var(--t2); }
.drw-code {
  font-family: var(--mono); font-size: 11px;
  background: var(--bg); color: var(--c-low);
  padding: 12px 14px; border-radius: var(--r); border: 1px solid var(--b1);
  overflow-x: auto; line-height: 1.6; white-space: pre;
}
.drw-cvss { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--b1); border: 1px solid var(--b1); border-radius: var(--r); overflow: hidden; }
.drw-cvss-cell { background: var(--bg2); padding: 9px 12px; }
.drw-cvss-label { font-size: 8px; color: var(--t3); letter-spacing: .12em; text-transform: uppercase; margin-bottom: 3px; }
.drw-cvss-val { font-size: 14px; font-weight: 600; color: var(--t1); }

/* ── TABS ────────────────────────────────────────────────────────── */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--b1); margin-bottom: 16px; }
.tab {
  padding: 7px 14px; font-size: 11px; font-weight: 500;
  color: var(--t3); border-bottom: 2px solid transparent;
  margin-bottom: -1px; cursor: pointer;
  transition: color 0.1s, border-color 0.1s;
  display: flex; align-items: center; gap: 7px;
}
.tab:hover { color: var(--t1); }
.tab.active { color: var(--t1); border-bottom-color: var(--a); }
.tab-badge {
  font-size: 9px; color: var(--t4); background: var(--bg3);
  padding: 1px 5px; border-radius: var(--r-sm); border: 1px solid var(--b1);
}
.tab.active .tab-badge { color: var(--a); border-color: var(--a-dim); background: var(--a-dim); }

/* filter chips */
.filter-row { display: flex; gap: 5px; margin-bottom: 12px; flex-wrap: wrap; }
.filter-chip {
  background: var(--bg3); border: 1px solid var(--b1); border-radius: var(--r);
  padding: 3px 10px; font-size: 11px; color: var(--t3); cursor: pointer; transition: all .15s;
}
.filter-chip:hover { border-color: var(--b2); color: var(--t2); }
.filter-chip.active { background: var(--a-dim); border-color: var(--a); color: var(--a); }

/* ── EMPTY STATE ─────────────────────────────────────────────────── */
.empty { padding: 48px 20px; text-align: center; color: var(--t3); font-size: 12px; border: 1px dashed var(--b2); border-radius: var(--r); }
.empty-icon { font-size: 24px; opacity: 0.2; margin-bottom: 8px; }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 60px 20px; color: var(--t3); text-align: center; }
.empty-title { font-size: 14px; font-weight: 700; color: var(--t2); margin-bottom: 3px; }
.empty-sub { font-size: 11px; }

/* ── COMPACT DENSITY ─────────────────────────────────────────────── */
[data-density="compact"] .main        { padding: 14px 20px 64px; }
[data-density="compact"] .stat-cell   { padding: 10px 14px; }
[data-density="compact"] .stat-val    { font-size: 18px; }
[data-density="compact"] .tbl td      { padding: 6px 14px; }
[data-density="compact"] .tbl th      { padding: 5px 14px; }
[data-density="compact"] .section-body{ padding: 10px; }
[data-density="compact"] .act-item    { padding: 6px 14px; }

/* ── LOADING ─────────────────────────────────────────────────────── */
#loading-overlay {
  inset: 0; background: var(--bg); z-index: 500;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 16px;
}
.spinner {
  width: 36px; height: 36px;
  border: 2px solid var(--b1); border-top-color: var(--a);
  border-radius: 50%; animation: spin .8s linear infinite;
}
.spinner-text { font-size: 11px; color: var(--t3); letter-spacing: .05em; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── SCREENS / VIEWS ─────────────────────────────────────────────── */
.screen { display: none; min-height: 100vh; }
.screen.active { display: flex; }
.view { display: none; }
.view.active { display: block; }

/* ── LOGIN ───────────────────────────────────────────────────────── */
#login-screen {
  inset: 0; z-index: 600;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: var(--bg); overflow: hidden;
}
#login-screen.active { display: flex; }
.login-bg-grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(var(--b1) 1px,transparent 1px),
                    linear-gradient(90deg,var(--b1) 1px,transparent 1px);
  background-size: 40px 40px; opacity: .4;
}
.login-glow {
  position: absolute; width: 500px; height: 500px; border-radius: 50%;
  background: radial-gradient(ellipse, rgba(245,158,11,.08) 0%, transparent 70%);
  top: 50%; left: 50%; transform: translate(-50%,-50%);
}
.login-card {
  position: relative; z-index: 10;
  background: var(--bg1); border: 1px solid var(--b2);
  border-radius: var(--r-lg); padding: 40px 36px; width: 400px;
  box-shadow: 0 0 40px rgba(245,158,11,.06), 0 20px 60px rgba(0,0,0,.5);
}
.login-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.login-logo-img { width: 36px; height: 36px; object-fit: contain; }
.logo-text {
  font-size: 18px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--t1);
}
.logo-icon { /* keep for compat */ }
.login-tagline { font-size: 10px; color: var(--t3); margin-bottom: 28px; letter-spacing: .1em; text-transform: uppercase; }

/* ── FORM ELEMENTS ───────────────────────────────────────────────── */
.tab-row { display: flex; gap: 2px; background: var(--bg3); border-radius: var(--r); padding: 2px; margin-bottom: 20px; }
.tab-btn { flex: 1; padding: 7px; background: none; border: none; color: var(--t3); font-size: 12px; font-weight: 600; border-radius: var(--r-sm); transition: all .15s; cursor: pointer; }
.tab-btn.active { background: var(--bg2); color: var(--t1); }
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 10px; color: var(--t3); text-transform: uppercase; letter-spacing: .1em; margin-bottom: 5px; }
.form-input {
  width: 100%; background: var(--bg3); border: 1px solid var(--b1);
  border-radius: var(--r); padding: 8px 12px; color: var(--t1);
  font-size: 12px; transition: border-color .15s; outline: none;
}
.form-input:focus { border-color: var(--b2); }
.form-input::placeholder { color: var(--t3); }
.form-error { color: var(--c-crit); font-size: 12px; margin-top: 8px; display: none; }
.note-textarea {
  width: 100%; background: var(--bg3); border: 1px solid var(--b1);
  border-radius: var(--r); padding: 7px 9px; color: var(--t1);
  font-size: 11px; resize: vertical; min-height: 52px; outline: none;
  transition: border-color .15s; margin-top: 7px;
}
.note-textarea:focus { border-color: var(--b2); }
.note-textarea::placeholder { color: var(--t3); }
.dynamic-row { display: flex; gap: 6px; margin-bottom: 5px; }
.dynamic-input { flex: 1; background: var(--bg3); border: 1px solid var(--b1); border-radius: var(--r); padding: 6px 9px; color: var(--t1); font-size: 12px; outline: none; }
.dynamic-input:focus { border-color: var(--b2); }
.dynamic-textarea { flex: 1; background: var(--bg3); border: 1px solid var(--b1); border-radius: var(--r); padding: 6px 9px; color: var(--t1); font-size: 12px; outline: none; resize: vertical; min-height: 52px; line-height: 1.5; }
.dynamic-textarea:focus { border-color: var(--b2); }
.dynamic-textarea::placeholder { color: var(--t3); }

/* ── MODAL ───────────────────────────────────────────────────────── */
.modal-overlay {
  inset: 0; background: rgba(0,0,0,.7); z-index: 1000;
  display: none; align-items: center; justify-content: center; padding: 24px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--bg2); border: 1px solid var(--b2);
  border-radius: var(--r-lg); padding: 24px;
  width: 100%; max-width: 500px; max-height: 85vh; overflow-y: auto;
  animation: modalIn .2s ease;
}
@keyframes modalIn { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:translateY(0)} }
.modal-title { font-size: 15px; font-weight: 700; margin-bottom: 18px; color: var(--t1); }
.modal-footer { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }

/* ── TOAST ───────────────────────────────────────────────────────── */
.toast-container { bottom: 20px; right: 20px; z-index: 9000; display: flex; flex-direction: column; gap: 6px; }
.toast {
  background: var(--bg2); border: 1px solid var(--b2);
  border-radius: var(--r); padding: 9px 14px; font-size: 12px; color: var(--t1);
  box-shadow: var(--shadow); animation: toastIn .25s ease;
  display: flex; align-items: center; gap: 8px; max-width: 300px;
}
.toast.success { border-color: rgba(34,197,94,.4); }
.toast.error   { border-color: rgba(239,68,68,.4); }
.toast.info    { border-color: rgba(245,158,11,.3); }
@keyframes toastIn { from{opacity:0;transform:translateX(16px)} to{opacity:1;transform:translateX(0)} }

/* ── COPY BTN ────────────────────────────────────────────────────── */
.copy-btn {
  background: var(--bg3); border: 1px solid var(--b1); border-radius: var(--r-sm);
  padding: 3px 7px; font-size: 9px; color: var(--t3); cursor: pointer; transition: all .15s; flex-shrink: 0;
}
.copy-btn:hover { border-color: var(--a); color: var(--a); }
.copy-btn.copied { border-color: var(--c-low); color: var(--c-low); }

/* ── MARKDOWN ────────────────────────────────────────────────────── */
.md-body { font-size: 12px; line-height: 1.6; padding: 2px 0; }
.md-line { line-height: 1.6; }
.md-gap  { height: 6px; }
.md-h2   { font-weight: 700; font-size: 13px; margin: 8px 0 2px; line-height: 1.3; }
.md-h3   { font-weight: 600; font-size: 12px; margin: 6px 0 2px; line-height: 1.3; }
.md-li   { padding-left: 14px; position: relative; line-height: 1.6; }
.md-li::before { content: '·'; position: absolute; left: 2px; }
.md-pre  { background: var(--bg); border: 1px solid var(--b1); border-radius: var(--r); padding: 8px 10px; font-size: 11px; overflow-x: auto; margin: 4px 0; white-space: pre; color: var(--t2); line-height: 1.5; }
.md-ic   { background: var(--bg3); border: 1px solid var(--b1); border-radius: var(--r-sm); padding: 0 4px; font-size: .88em; color: var(--t2); }

/* ── AI CHAT ─────────────────────────────────────────────────────── */
.ai-chat-messages { display: flex; flex-direction: column; gap: 10px; overflow-y: auto; max-height: 340px; padding: 4px 2px; margin-bottom: 10px; }
.ai-chat-msg { display: flex; flex-direction: column; gap: 3px; max-width: 90%; }
.ai-chat-msg.user { align-self: flex-end; align-items: flex-end; }
.ai-chat-msg.ai   { align-self: flex-start; align-items: flex-start; }
.ai-chat-bubble { padding: 8px 12px; border-radius: var(--r); font-size: 12px; line-height: 1.55; word-break: break-word; }
.ai-chat-msg.user .ai-chat-bubble { background: var(--a-dim); border: 1px solid rgba(245,158,11,.2); color: var(--t1); }
.ai-chat-msg.ai   .ai-chat-bubble { background: var(--bg3); border: 1px solid var(--b1); color: var(--t2); }
.ai-chat-bubble p { margin: 0 0 6px; } .ai-chat-bubble p:last-child { margin: 0; }
.ai-chat-bubble code { font-family: var(--mono); font-size: 11px; background: var(--bg); border: 1px solid var(--b1); border-radius: var(--r-sm); padding: 1px 4px; }
.ai-chat-bubble strong { color: var(--t1); font-weight: 700; }
.ai-chat-input-row { display: flex; gap: 6px; }
.ai-chat-input { flex: 1; background: var(--bg); border: 1px solid var(--b1); border-radius: var(--r); color: var(--t1); font-size: 12px; padding: 7px 10px; resize: none; min-height: 36px; max-height: 80px; outline: none; }
.ai-chat-input:focus { border-color: var(--b2); }
.ai-chat-send { background: var(--a-dim); border: 1px solid rgba(245,158,11,.3); border-radius: var(--r); color: var(--a); font-size: 13px; padding: 0 12px; cursor: pointer; transition: all .15s; flex-shrink: 0; }
.ai-chat-send:hover { background: rgba(245,158,11,.2); }
.ai-chat-send:disabled { opacity: .4; cursor: not-allowed; }
.ai-chat-empty { font-size: 11px; color: var(--t3); text-align: center; padding: 24px 0; }
.ai-chat-typing { display: flex; gap: 4px; align-items: center; padding: 8px 12px; }
.ai-chat-typing span { width: 5px; height: 5px; border-radius: 50%; background: var(--t3); animation: ai-bounce .9s infinite; }
.ai-chat-typing span:nth-child(2) { animation-delay: .15s; }
.ai-chat-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes ai-bounce { 0%,60%,100%{transform:translateY(0)} 30%{transform:translateY(-5px)} }

/* ── AI FLOATING BUBBLE ──────────────────────────────────────────── */
#ai-fab {
  position: fixed; bottom: 24px; right: 24px; z-index: 900;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--a); color: #000;
  font-size: 18px; font-weight: 700;
  border: none; cursor: pointer;
  box-shadow: 0 4px 20px rgba(245,158,11,.35);
  transition: transform .15s, box-shadow .15s;
  display: flex; align-items: center; justify-content: center;
}
#ai-fab:hover { transform: scale(1.08); box-shadow: 0 6px 28px rgba(245,158,11,.5); }

#ai-panel {
  position: fixed; bottom: 80px; right: 24px; z-index: 900;
  width: 360px;
  background: var(--bg1); border: 1px solid var(--b2);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  transform: translateY(12px) scale(.97);
  opacity: 0; pointer-events: none;
  transition: transform .2s ease, opacity .2s ease;
}
#ai-panel.open {
  transform: translateY(0) scale(1);
  opacity: 1; pointer-events: all;
}
.ai-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--b1);
  flex-shrink: 0;
}
#ai-panel .ai-chat-messages {
  max-height: 320px; padding: 12px 14px; margin: 0;
}
#ai-panel .ai-chat-typing { padding: 4px 14px 0; }
#ai-panel .ai-chat-input-row { padding: 10px 14px; border-top: 1px solid var(--b1); flex-shrink: 0; }

/* ── CVSS CALCULATOR ─────────────────────────────────────────────── */
.cvss-grid {
  display: grid; grid-template-columns: 140px 1fr; gap: 7px 10px;
  align-items: center; background: var(--bg3); border: 1px solid var(--b1);
  border-radius: var(--r); padding: 12px 14px;
}
.cvss-label { font-size: 9px; color: var(--t3); text-transform: uppercase; letter-spacing: .07em; }
.cvss-btns  { display: flex; gap: 4px; flex-wrap: wrap; }
.cvss-btn {
  font-size: 10px; padding: 3px 8px; border-radius: var(--r-sm);
  border: 1px solid var(--b1); background: transparent;
  color: var(--t3); cursor: pointer; transition: border-color .12s, color .12s, background .12s;
}
.cvss-btn:hover { border-color: var(--a); color: var(--t1); }
.cvss-btn.active { background: var(--a-dim); border-color: var(--a); color: var(--a); font-weight: 700; }
.cvss-divider { grid-column: 1 / -1; height: 1px; background: var(--b1); margin: 2px 0; }
.cvss-score-wrap {
  display: flex; align-items: center; gap: 14px; margin-top: 10px;
  padding: 10px 14px; background: var(--bg3); border: 1px solid var(--b1); border-radius: var(--r);
}

/* ── TEST ITEMS (WSTG / methodology) ────────────────────────────── */
.test-item {
  border: 1px solid var(--b1); border-radius: var(--r);
  margin: 4px 0; overflow: hidden; background: var(--bg2); transition: border-color .15s;
}
.test-item:hover { border-color: var(--b2); }
.test-item.completed { border-color: rgba(34,197,94,.3); }
.test-item.failed    { border-color: rgba(239,68,68,.3); }
.test-item.na        { border-color: rgba(100,116,139,.25); }
.test-header { display: flex; align-items: center; padding: 8px 12px; gap: 8px; cursor: pointer; }
.test-check {
  width: 16px; height: 16px; border: 1.5px solid var(--b2); border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0; transition: all .15s; font-size: 9px;
}
.test-check:hover { border-color: var(--c-low); }
.test-item.completed .test-check { background: var(--c-low); border-color: var(--c-low); color: var(--bg); }
.test-item.failed    .test-check { background: var(--c-crit); border-color: var(--c-crit); color: #fff; }
.test-item.na        .test-check { background: var(--b2); border-color: var(--b2); color: var(--t3); }
.test-id   { font-size: 10px; color: var(--t3); flex-shrink: 0; min-width: 90px; }
.test-name { font-size: 12px; font-weight: 600; color: var(--t1); flex: 1; line-height: 1.3; }
.test-item.completed .test-name { text-decoration: line-through; color: var(--t3); }
.test-item.na        .test-name { color: var(--t3); }
.test-actions { display: flex; gap: 2px; flex-shrink: 0; }
.test-action-btn { background: none; border: 1px solid var(--b1); border-radius: var(--r-sm); padding: 2px 6px; font-size: 9px; color: var(--t3); cursor: pointer; transition: all .15s; }
.test-action-btn:hover { border-color: var(--b2); color: var(--t2); }
.test-action-btn.pass:hover { border-color: var(--c-low); color: var(--c-low); }
.test-action-btn.vuln:hover { border-color: var(--c-crit); color: var(--c-crit); }
.test-body { display: none; padding: 0 12px 12px; border-top: 1px solid var(--b1); }
.test-body.open { display: block; }
.test-list { display: none; padding: 5px 0; }
.test-list.open { display: block; }

/* last editor badge */
.last-editor { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.last-editor-avatar { width: 16px; height: 16px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 8px; font-weight: 700; color: #fff; }
.last-editor-name { font-size: 9px; color: var(--t3); }
.last-editor-time { font-size: 9px; color: var(--t3); }

/* ── CATEGORY BLOCKS ─────────────────────────────────────────────── */
.category-block { margin-bottom: 4px; }
.category-header { display: flex; align-items: center; gap: 10px; padding: 10px 0; cursor: pointer; user-select: none; border-bottom: 1px solid var(--b1); }
.category-chevron { color: var(--t3); transition: transform .2s; font-size: 10px; }
.category-header.open .category-chevron { transform: rotate(90deg); }
.category-badge { font-size: 9px; font-weight: 600; padding: 2px 6px; border-radius: var(--r-sm); background: var(--a-dim); color: var(--a); letter-spacing: .05em; }
.category-name { font-size: 13px; font-weight: 700; color: var(--t1); flex: 1; }
.cat-meta { display: flex; align-items: center; gap: 8px; }
.cat-count { font-size: 11px; color: var(--t3); }
.cat-mini-bar { width: 46px; height: 3px; background: var(--b1); overflow: hidden; display: flex; }
.cat-mini-fill { height: 100%; background: var(--c-low); transition: width .3s; }
.cat-mini-fail { height: 100%; background: var(--c-crit); transition: width .3s; }

/* ── VULN CARDS ──────────────────────────────────────────────────── */
.vuln-card { background: var(--bg2); border: 1px solid var(--b1); border-radius: var(--r); margin-bottom: 6px; overflow: hidden; transition: border-color .15s; }
.vuln-card:hover { border-color: var(--b2); }
.vuln-card.completed { border-color: rgba(34,197,94,.3); }
.vuln-card.failed    { border-color: rgba(239,68,68,.3); }
.vuln-header { display: flex; align-items: center; padding: 10px 12px; gap: 8px; cursor: pointer; }
.vuln-tag { font-size: 9px; font-weight: 700; padding: 2px 6px; background: var(--a-dim); color: var(--a); border-radius: var(--r-sm); text-transform: uppercase; flex-shrink: 0; }
.vuln-name { flex: 1; font-size: 13px; font-weight: 700; color: var(--t1); }
.vuln-actions { display: flex; gap: 3px; flex-shrink: 0; }
.vuln-body { display: none; padding: 0 12px 12px; border-top: 1px solid var(--b1); }
.vuln-body.open { display: block; }

/* ── VULN SEVERITY SECTIONS ──────────────────────────────────────── */
.vuln-severity-section { margin-bottom: 24px; }
.vuln-severity-header { display: flex; align-items: center; gap: 10px; padding: 8px 0; margin-bottom: 8px; border-bottom: 1px solid var(--b1); }
.vuln-severity-count { font-size: 11px; color: var(--t3); }

/* ── CHECKLIST ITEMS ─────────────────────────────────────────────── */
.items-section { margin-top: 10px; }
.items-label { font-size: 9px; color: var(--t3); text-transform: uppercase; letter-spacing: .1em; margin-bottom: 6px; }
.item-row { display: flex; align-items: flex-start; gap: 7px; padding: 2px 0; }
.item-checkbox { width: 13px; height: 13px; border: 1px solid var(--b2); border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; margin-top: 3px; transition: all .15s; font-size: 8px; line-height: 1; }
.item-checkbox:hover { border-color: var(--a); }
.item-checkbox.checked { background: var(--a-dim); border-color: var(--a); color: var(--a); }
.item-text { font-size: 11px; color: var(--t2); line-height: 1.5; flex: 1; }
.item-text.done { text-decoration: line-through; color: var(--t3); }

/* ── PAYLOADS ────────────────────────────────────────────────────── */
.payload-section { margin-top: 10px; }
.payload-tabs { display: flex; gap: 2px; background: var(--bg3); border-radius: var(--r-sm); padding: 2px; margin-bottom: 6px; }
.payload-tab { flex: 1; padding: 3px; background: none; border: none; color: var(--t3); font-size: 9px; font-weight: 600; text-transform: uppercase; cursor: pointer; border-radius: var(--r-sm); transition: all .15s; }
.payload-tab.active { background: var(--bg2); color: var(--a); }
.payload-panel { display: none; }
.payload-panel.active { display: block; }
.payload-row { display: flex; align-items: flex-start; gap: 5px; margin-bottom: 3px; }
.payload-code { flex: 1; background: var(--bg); border: 1px solid var(--b1); border-radius: var(--r-sm); padding: 4px 8px; font-size: 11px; color: var(--c-low); word-break: break-all; line-height: 1.5; white-space: pre-wrap; }

/* ── PORTSWIGGER ─────────────────────────────────────────────────── */
.ps-category { margin-bottom: 4px; }
.ps-cat-header { display: flex; align-items: center; gap: 8px; padding: 9px 12px; background: var(--bg2); border: 1px solid var(--b1); border-radius: var(--r); cursor: pointer; transition: border-color .15s; }
.ps-cat-header:hover { border-color: var(--b2); }
.ps-cat-header.open { border-radius: var(--r) var(--r) 0 0; }
.ps-cat-name { font-size: 13px; font-weight: 700; color: var(--t1); flex: 1; }
.ps-cat-count { font-size: 10px; color: var(--t3); }
.ps-labs { display: none; background: var(--bg2); border: 1px solid var(--b1); border-top: none; border-radius: 0 0 var(--r) var(--r); padding: 4px; }
.ps-labs.open { display: block; }
.ps-lab-row { display: flex; align-items: center; gap: 7px; padding: 5px 7px; border-radius: var(--r-sm); transition: background .1s; cursor: pointer; }
.ps-lab-row:hover { background: var(--bg3); }
.ps-lab-check { width: 14px; height: 14px; border: 1px solid var(--b2); border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; transition: all .15s; font-size: 9px; }
.ps-lab-check:hover { border-color: var(--c-low); }
.ps-lab-check.done { background: var(--c-low); border-color: var(--c-low); color: var(--bg); }
.ps-lab-title { font-size: 12px; color: var(--t2); flex: 1; line-height: 1.3; }
.ps-lab-check.done ~ .ps-lab-title { text-decoration: line-through; color: var(--t3); }
.ps-lab-title.done { text-decoration: line-through; color: var(--t3); }
.ps-note-indicator { font-size: 10px; color: var(--a); margin-left: 4px; flex-shrink: 0; opacity: .7; }
.diff-badge { font-size: 9px; font-weight: 700; padding: 2px 5px; border-radius: var(--r-sm); text-transform: uppercase; flex-shrink: 0; }
.diff-Apprentice   { background: var(--c-low-bg); color: var(--c-low); }
.diff-Practitioner { background: var(--c-high-bg); color: var(--c-high); }
.diff-Expert       { background: var(--c-crit-bg); color: var(--c-crit); }
.ps-lab-item { border-radius: var(--r); overflow: hidden; }
.ps-lab-body { display: none; padding: 6px 8px 8px 30px; background: var(--bg2); border-top: 1px solid var(--b1); }
.ps-lab-body.open { display: block; }

/* ── TARGET TABS ─────────────────────────────────────────────────── */
.target-tabs { display: flex; gap: 2px; padding: 8px 0 6px; border-bottom: 1px solid var(--b1); margin-bottom: 8px; }
.target-tab {
  background: none; border: 1px solid transparent; border-radius: var(--r-sm);
  padding: 3px 10px; font-size: 10px; color: var(--t3); cursor: pointer; transition: all .15s;
  display: flex; align-items: center; gap: 5px;
}
.target-tab:hover { color: var(--t1); background: var(--bg3); }
.target-tab.active { color: var(--a); border-color: rgba(245,158,11,.3); background: var(--a-dim); }
.target-tab-badge { background: rgba(239,68,68,.15); color: var(--c-crit); border-radius: var(--r-sm); padding: 0 5px; font-size: 9px; font-weight: 700; }
.target-tab-body { padding: 4px 0; }
.target-loading { font-size: 11px; color: var(--t3); padding: 8px 0; }
.target-empty-tab { font-size: 11px; color: var(--t3); padding: 8px 0; }
.target-data-row { display: flex; align-items: center; gap: 10px; padding: 5px 6px; border-radius: var(--r-sm); margin-bottom: 2px; }
.target-data-row:hover { background: var(--bg3); }
.port-num { font-size: 11px; font-weight: 700; color: var(--t1); width: 72px; flex-shrink: 0; }
.target-add-row { display: flex; align-items: center; gap: 6px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--b1); flex-wrap: wrap; }
.target-inline-input { background: var(--bg3); border: 1px solid var(--b1); border-radius: var(--r-sm); padding: 4px 8px; color: var(--t1); font-size: 11px; outline: none; min-width: 0; }
.target-inline-input:focus { border-color: var(--b2); }
.target-inline-select { background: var(--bg3); border: 1px solid var(--b1); border-radius: var(--r-sm); padding: 4px 6px; color: var(--t1); font-size: 11px; outline: none; cursor: pointer; flex-shrink: 0; }
.target-inline-select:focus { border-color: var(--b2); }

/* ── TICKETS ─────────────────────────────────────────────────────── */
.tickets-list { display: flex; flex-direction: column; gap: 5px; }
.ticket-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; background: var(--bg2);
  border: 1px solid var(--b1); border-radius: var(--r);
  cursor: pointer; transition: background .1s, border-color .1s;
  position: relative; overflow: hidden;
}
.ticket-row::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: transparent; transition: background .15s; }
.ticket-row:hover { background: var(--bg3); border-color: var(--b2); }
.ticket-row:hover::before { background: var(--a); }
.ticket-row-status-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.ticket-row-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ticket-row-title { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ticket-row-tag { font-size: 10px; color: var(--a); background: var(--a-dim); border: 1px solid rgba(245,158,11,.2); border-radius: var(--r-sm); padding: 1px 6px; flex-shrink: 0; white-space: nowrap; }
.ticket-row-meta { display: flex; align-items: center; gap: 6px; font-size: 10px; color: var(--t3); }
.ticket-status-badge { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; border: 1px solid; border-radius: var(--r-sm); padding: 2px 7px; }

/* ── CLIENT TICKET ROW ───────────────────────────────────────────── */
.client-ticket-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px; border-bottom: 1px solid var(--b1);
  cursor: pointer; transition: background .1s;
}
.client-ticket-row:last-child { border-bottom: none; }
.client-ticket-row:hover { background: var(--bg3); }

/* ── CLIENT PORTAL ───────────────────────────────────────────────── */
.client-proj-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.client-summary-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 24px; }
.client-sev-card { background: var(--bg2); border: 1px solid var(--b1); border-radius: var(--r); padding: 12px 16px; min-width: 90px; text-align: center; }
.client-grid { display: grid; grid-template-columns: 1fr 320px; gap: 20px; align-items: start; }
@media (max-width: 800px) { .client-grid { grid-template-columns: 1fr; } }
.client-col-main { display: flex; flex-direction: column; gap: 20px; }
.client-col-side { display: flex; flex-direction: column; gap: 20px; }
.client-section { background: var(--bg2); border: 1px solid var(--b1); border-radius: var(--r); padding: 16px; }
.client-section-title { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--t3); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.client-badge { background: var(--a-dim); color: var(--a); border-radius: var(--r-sm); padding: 1px 7px; font-size: 10px; font-weight: 700; }
.client-finding-card { border: 1px solid var(--b1); border-radius: var(--r); margin-bottom: 8px; overflow: hidden; cursor: pointer; }
.client-finding-header { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--bg3); min-width: 0; }
.client-finding-header:hover { background: var(--bg2); }
.client-finding-name { font-size: 13px; font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.client-finding-target { font-size: 10px; color: var(--t3); flex-shrink: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 200px; }
.client-finding-status { font-size: 10px; border-radius: var(--r-sm); padding: 2px 7px; flex-shrink: 0; }
.client-finding-chevron { font-size: 11px; color: var(--t3); flex-shrink: 0; transition: transform .2s ease; display: inline-block; }
.client-finding-body { display: none; padding: 12px; border-top: 1px solid var(--b1); }
.client-finding-body.open { display: block; }
.client-finding-desc { font-size: 13px; color: var(--t2); line-height: 1.6; white-space: pre-wrap; }
.client-target-row { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-bottom: 1px solid rgba(255,255,255,.06); }
.client-target-row:last-child { border-bottom: none; }
.client-target-row:hover { background: var(--bg3); border-radius: var(--r-sm); }
.client-reply { background: var(--bg3); border-radius: var(--r); padding: 10px 12px; }
.client-reply.own { background: var(--a-glow); border: 1px solid rgba(245,158,11,.12); }
.client-reply-meta { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.client-reply-body { font-size: 13px; color: var(--t2); line-height: 1.6; white-space: pre-wrap; }
.client-setting-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.06); }
.client-setting-row:last-child { border-bottom: none; }
.setting-toggle { flex-shrink: 0; width: 34px; height: 18px; border-radius: 9px; background: var(--bg3); border: 1px solid var(--b1); position: relative; cursor: pointer; transition: background .2s; }
.setting-toggle.on { background: var(--a); border-color: var(--a); }
.setting-toggle-knob { position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--t3); transition: transform .2s, background .2s; }
.setting-toggle.on .setting-toggle-knob { transform: translateX(16px); background: #000; }

/* ── WSTG CLIENT ─────────────────────────────────────────────────── */
.wstg-client-cat { border-radius: var(--r); overflow: hidden; border: 1px solid var(--b1); margin-bottom: 4px; }
.wstg-client-cat-header { display: flex; align-items: center; gap: 8px; padding: 8px 10px; cursor: pointer; background: var(--bg3); user-select: none; }
.wstg-client-cat-header:hover { background: var(--bg2); }
.wstg-client-cat.open .wstg-client-cat-header span:last-child { transform: rotate(90deg); display: inline-block; }
.wstg-client-tests { display: none; padding: 6px 10px 10px; border-top: 1px solid var(--b1); flex-direction: column; gap: 6px; }
.wstg-client-cat.open .wstg-client-tests { display: flex; }
.wstg-client-test { display: flex; gap: 8px; align-items: flex-start; padding: 4px 0; }

/* ── WSTG TARGET / LINK ROWS ─────────────────────────────────────── */
.wstg-target-row { display: flex; align-items: center; gap: 10px; padding: 6px 14px 6px 44px; background: var(--c-crit-bg); border-bottom: 1px solid rgba(239,68,68,.15); }
.wstg-target-select { flex: 1; max-width: 280px; background: var(--bg3); border: 1px solid rgba(239,68,68,.3); border-radius: var(--r-sm); color: var(--t1); font-size: 11px; padding: 4px 8px; cursor: pointer; }
.wstg-target-select:focus { outline: none; border-color: var(--c-crit); }
.wstg-target-badge { font-size: 10px; color: var(--c-crit); background: var(--c-crit-bg); border: 1px solid rgba(239,68,68,.2); border-radius: var(--r-sm); padding: 1px 6px; flex-shrink: 0; }
.wstg-link-row { display: flex; align-items: center; gap: 10px; padding: 6px 14px 6px 44px; background: var(--a-glow); border-bottom: 1px solid rgba(245,158,11,.12); }
.wstg-link-select { flex: 1; max-width: 300px; background: var(--bg3); border: 1px solid rgba(245,158,11,.25); border-radius: var(--r-sm); color: var(--t1); font-size: 11px; padding: 4px 8px; cursor: pointer; }
.wstg-link-select:focus { outline: none; border-color: var(--a); }
.wstg-link-badge { font-size: 10px; color: var(--a); background: var(--a-dim); border: 1px solid rgba(245,158,11,.2); border-radius: var(--r-sm); padding: 1px 6px; flex-shrink: 0; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── MEMBERS ─────────────────────────────────────────────────────── */
.members-card { background: var(--bg2); border: 1px solid var(--b1); border-radius: var(--r); padding: 18px; }
.members-card-title { font-size: 13px; font-weight: 700; color: var(--t1); margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; }
.member-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--b1); }
.member-row:last-child { border-bottom: none; }
.member-avatar-lg { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: #fff; flex-shrink: 0; line-height: 1; overflow: hidden; }
.member-info { flex: 1; }
.member-username { font-size: 13px; font-weight: 600; color: var(--t1); }
.member-meta { font-size: 10px; color: var(--t3); }
.role-badge { font-size: 9px; font-weight: 700; padding: 2px 6px; border-radius: var(--r-sm); text-transform: uppercase; }
.role-owner  { background: rgba(239,68,68,.12); color: var(--c-crit); }
.role-editor { background: var(--c-low-bg); color: var(--c-low); }
.role-viewer { background: var(--c-info-bg); color: var(--c-info); }

/* ── INVITE UI ───────────────────────────────────────────────────── */
.invite-code-box { background: var(--bg3); border: 1px solid var(--b2); border-radius: var(--r); padding: 14px; margin-bottom: 8px; }
.invite-code-label { font-size: 10px; color: var(--t3); text-transform: uppercase; letter-spacing: .1em; margin-bottom: 6px; }
.invite-code-row { display: flex; align-items: center; gap: 8px; }
.invite-code-token { font-size: 16px; font-weight: 700; color: var(--a); letter-spacing: .15em; flex: 1; background: var(--bg2); border: 1px solid var(--b1); border-radius: var(--r-sm); padding: 8px 12px; }
.invite-code-meta { font-size: 10px; color: var(--t3); margin-top: 6px; }
.invite-list { margin-top: 12px; }
.invite-item { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--b1); }
.invite-item:last-child { border-bottom: none; }
.invite-token-display { font-size: 13px; font-weight: 700; color: var(--a); flex: 1; letter-spacing: .1em; }
.invite-role-tag { font-size: 9px; padding: 2px 6px; border-radius: var(--r-sm); }
.invite-expires { font-size: 10px; color: var(--t3); }
.invite-used { opacity: .4; text-decoration: line-through; }
.invite-role-btn { font-size: 12px; padding: 5px 14px; border-radius: var(--r-sm); border: 1px solid var(--b1); background: var(--bg3); color: var(--t2); cursor: pointer; transition: all .15s; }
.invite-role-btn:hover { border-color: var(--a); color: var(--a); }
.invite-role-btn.active { background: var(--a-dim); border-color: var(--a); color: var(--a); font-weight: 700; }

/* ── METHODOLOGY ─────────────────────────────────────────────────── */
.method-library { width: 260px; flex-shrink: 0; border-right: 1px solid var(--b1); display: flex; flex-direction: column; background: var(--bg2); overflow-y: auto; }
.method-library-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--b1); flex-shrink: 0; }
.method-list-item { padding: 10px 14px; border-bottom: 1px solid var(--b1); cursor: pointer; transition: background .15s; }
.method-list-item:hover { background: var(--bg3); }
.method-list-item.active { background: var(--a-dim); border-left: 2px solid var(--a); }
.method-list-name { font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.method-badge-shared { font-size: 9px; background: var(--c-low-bg); color: var(--c-low); border: 1px solid rgba(34,197,94,.25); border-radius: var(--r-sm); padding: 1px 5px; flex-shrink: 0; }
.method-badge-owner { font-size: 9px; background: var(--a-dim); color: var(--a); border-radius: var(--r-sm); padding: 1px 5px; flex-shrink: 0; }
.method-runner-header { display: flex; align-items: flex-start; gap: 12px; padding: 16px 0 14px; border-bottom: 1px solid var(--b1); margin-bottom: 12px; }
.method-test-row { background: var(--bg3); border: 1px solid var(--b1); border-radius: var(--r); padding: 10px; }

/* ── PROJECTS ────────────────────────────────────────────────────── */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px,1fr)); gap: 8px; margin-bottom: 16px; }
.project-card { background: var(--bg2); border: 1px solid var(--b1); border-radius: var(--r); padding: 16px; cursor: pointer; transition: border-color .15s; }
.project-card:hover { border-color: var(--b2); }
.project-card.selected { border-color: var(--a); background: var(--a-glow); }
.project-card-name { font-size: 14px; font-weight: 700; color: var(--t1); margin-bottom: 3px; }
.project-card-target { font-size: 11px; color: var(--t3); margin-bottom: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.project-card-meta { display: flex; gap: 6px; align-items: center; }
.btn-add-project { background: var(--a-dim); border: 1px dashed rgba(245,158,11,.3); border-radius: var(--r); padding: 16px; cursor: pointer; transition: all .15s; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--a); }
.btn-add-project:hover { background: rgba(245,158,11,.16); border-color: var(--a); }

/* ── WELCOME CARDS ───────────────────────────────────────────────── */
.welcome-card { background: var(--bg2); border: 1px solid var(--b1); border-radius: var(--r); padding: 24px 20px; cursor: pointer; transition: border-color .15s; display: flex; flex-direction: column; align-items: flex-start; }
.welcome-card:hover { border-color: var(--a); background: var(--a-glow); }
.welcome-card-icon { font-size: 22px; margin-bottom: 12px; color: var(--a); font-weight: 700; }
.welcome-card-title { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.welcome-card-desc { font-size: 11px; color: var(--t3); line-height: 1.5; }

/* ── DASHBOARD PANELS ────────────────────────────────────────────── */
.dash-engagement { display: flex; background: var(--bg2); border: 1px solid var(--b1); border-radius: var(--r); overflow: hidden; margin-bottom: 16px; }
.dash-eng-item { flex: 1; padding: 12px 16px; border-right: 1px solid var(--b1); display: flex; flex-direction: column; gap: 3px; }
.dash-eng-item:last-child { border-right: none; }
.dash-eng-label { font-size: 9px; text-transform: uppercase; letter-spacing: .1em; color: var(--t3); }
.dash-eng-value { font-size: 12px; font-weight: 600; color: var(--t1); }
.dash-row { display: flex; gap: 12px; }
.dash-panel { background: var(--bg2); border: 1px solid var(--b1); border-radius: var(--r); padding: 14px 16px; min-width: 0; }
.dash-panel-title { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--t3); font-weight: 700; margin-bottom: 12px; display: flex; align-items: center; }
.dash-target-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--b1); }
.dash-target-row:last-of-type { border-bottom: none; }
.dash-cat-card { background: var(--bg3); border: 1px solid var(--b1); border-radius: var(--r-sm); padding: 8px 10px; }
.dash-finding-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--b1); }
.dash-finding-row:last-child { border-bottom: none; }
.dash-ticket-stat { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 8px; background: var(--bg3); border: 1px solid var(--b1); border-radius: var(--r); }
.dash-ticket-row { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--r-sm); cursor: pointer; transition: background .1s; margin-bottom: 2px; }
.dash-ticket-row:hover { background: var(--bg3); }
.dash-ticket-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }

/* ── REPORT PREVIEW ──────────────────────────────────────────────── */
.report-body h1 { font-size: 22px; border-bottom: 1px solid var(--b1); padding-bottom: 8px; margin-bottom: 16px; }
.report-body h2 { font-size: 17px; margin-top: 32px; margin-bottom: 12px; color: var(--a); }
.report-body h3 { font-size: 14px; margin-top: 20px; margin-bottom: 8px; }
.report-body h4 { font-size: 12px; margin-top: 16px; margin-bottom: 4px; color: var(--t2); }
.report-body p  { color: var(--t2); margin: 6px 0; }
.report-body li { color: var(--t2); margin: 3px 0; }

/* ── EVIDENCE ────────────────────────────────────────────────────── */
.evidence-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.evidence-thumb { width: 80px; height: 60px; object-fit: cover; border-radius: var(--r-sm); border: 1px solid var(--b1); cursor: zoom-in; transition: opacity .15s; }
.evidence-thumb:hover { opacity: .8; }
.evidence-thumb-sm { width: 48px; height: 36px; object-fit: cover; border-radius: var(--r-sm); border: 1px solid var(--b1); flex-shrink: 0; }
.evidence-preview-item { display: flex; align-items: center; gap: 8px; padding: 5px 8px; background: var(--bg3); border-radius: var(--r-sm); border: 1px solid var(--b1); margin-bottom: 4px; }
.evidence-name { flex: 1; font-size: 10px; color: var(--t3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* HTTP Proofs */
.http-proof { border: 1px solid var(--b1); border-radius: var(--r-sm); margin-bottom: 6px; overflow: hidden; }
.http-proof-head { display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: var(--bg2); user-select: none; }
.http-proof-head:hover { background: var(--bg3); }
.http-proof-method { font-family: var(--mono); font-size: 10px; font-weight: 700; color: var(--a); background: var(--a)15; border: 1px solid var(--a)33; border-radius: 3px; padding: 1px 6px; flex-shrink: 0; }
.http-proof-label { font-size: 11px; color: var(--t2); flex: 1; cursor: pointer; }
.http-proof-toggle { font-size: 9px; color: var(--t3); transition: transform .15s; cursor: pointer; }
.http-proof-include { display: flex; align-items: center; gap: 4px; font-size: 10px; color: var(--t3); cursor: pointer; flex-shrink: 0; }
.http-proof-include input[type="checkbox"] { accent-color: var(--a); width: 12px; height: 12px; cursor: pointer; }
.http-proof-edit-btn { background: none; border: none; color: var(--t3); font-size: 12px; cursor: pointer; padding: 0 2px; flex-shrink: 0; line-height: 1; }
.http-proof-edit-btn:hover { color: var(--t1); }
.http-proof-body { display: none; padding: 8px 10px; background: var(--bg); border-top: 1px solid var(--b1); }
.http-proof-body.open { display: block; }
.http-proof-section-label { font-size: 9px; color: var(--t3); text-transform: uppercase; letter-spacing: .08em; margin: 8px 0 4px; }
.http-proof-section-label:first-child { margin-top: 0; }
.http-proof-code { margin: 0; font-family: var(--mono); font-size: 10px; color: var(--t2); background: var(--bg1); border: 1px solid var(--b1); border-radius: var(--r-sm); padding: 8px 0; white-space: pre; overflow-x: auto; max-height: 300px; overflow-y: auto; line-height: 1.6; }
.http-proof-code .code-line { display: block; padding: 0 10px 0 0; white-space: pre-wrap; word-break: break-all; }
.http-proof-code .code-line:hover { background: var(--b1); }
.http-proof-code .line-num { display: inline-block; min-width: 2.8em; padding: 0 8px 0 10px; color: var(--t3); border-right: 1px solid var(--b1); margin-right: 10px; text-align: right; user-select: none; flex-shrink: 0; }
.http-proof-annotation { background: var(--a)08; border-left: 2px solid var(--a); border-radius: 0 var(--r-sm) var(--r-sm) 0; padding: 6px 10px; font-size: 11px; color: var(--t1); line-height: 1.6; }
.http-proof-annotation p { margin: 0 0 4px; }
.http-proof-annotation p:last-child { margin: 0; }
.http-proof-annotation code { font-family: var(--mono); font-size: 10px; background: var(--a)15; color: var(--a); border-radius: 3px; padding: 1px 4px; }

/* ── LOGO IMAGES ─────────────────────────────────────────────────── */
.topbar-logo-img { width: 22px; height: 22px; object-fit: contain; flex-shrink: 0; }
.login-logo-img  { width: 48px; height: 48px; object-fit: contain; }

/* ── SPECIAL MODES ───────────────────────────────────────────────── */
.neon-mode .sev-badge         { text-shadow: 0 0 8px currentColor, 0 0 16px currentColor; }
.neon-mode .progress-bar-fill { box-shadow: 0 0 8px var(--c-low); }
.hacker-mode::after {
  content: ''; position: fixed; inset: 0; z-index: 9998; pointer-events: none;
  background: repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(0,255,0,0.015) 3px, rgba(0,255,0,0.015) 4px);
  animation: scanlines 8s linear infinite;
}
@keyframes scanlines { from{background-position:0 0} to{background-position:0 100vh} }

/* ── RESPONSIVE ──────────────────────────────────────────────────── */
@media(max-width:1200px) { .activity-col { display: none; } .workarea { grid-template-columns: 1fr; } }
@media(max-width:900px)  { .stat-row { grid-template-columns: repeat(2,1fr); } }
@media(max-width:640px)  {
  body { grid-template-columns: 1fr; grid-template-rows: var(--topbar-h) 1fr; }
  .sidenav { display: none; }
  .topbar { grid-column: 1; }
  .workarea { grid-column: 1; grid-template-columns: 1fr; }
  .login-card { width: calc(100vw - 32px); }
}
