@import url('https://fonts.googleapis.com/css2?family=Kumbh+Sans:wght@400;500;600;700&display=swap');

/* Shadow — Maglo-inspired theme */

:root {
  color-scheme: dark;
  --sidebar-width: 226px;
  --bg: #000000;
  --surface: #070809;
  --surface2: #0f1012;
  --surface3: #181a1d;
  --surface-raised: #0c0d0f;
  --surface-hover: #151719;
  --border: rgba(255, 255, 255, 0.085);
  --border2: rgba(200, 242, 61, 0.42);
  --text: #f8fafc;
  --fg: #f8fafc;
  --muted: #8f98a6;
  --subtle: #666d78;
  --accent: #c8f23d;
  --accent-contrast: #000000;
  --accent2: #20b486;
  --red: #e5363d;
  --orange: #f79e1b;
  --yellow: #c8f23d;
  --blue: #5243aa;
  --green: #19d076;
  --purple: #8b5cf6;
  --gray: #78778b;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
  --soft-shadow: 0 18px 50px rgba(0, 0, 0, 0.42);
  --nav-active-bg: #c8f23d;
  --nav-active-text: #000000;
  --chip-bg: rgba(200, 242, 61, 0.12);
  --chip-border: rgba(200, 242, 61, 0.28);
  --card-bg: linear-gradient(180deg, #0f1012 0%, #0c0d0f 100%);
  --card-bg-solid: #101113;
  --card-bg-strong: #151719;
  --card-strong-text: #ffffff;
  --card-border: rgba(255, 255, 255, 0.052);
  --card-hover-border: rgba(255, 255, 255, 0.085);
  --topbar-bg: linear-gradient(180deg, #000000 0%, rgba(0, 0, 0, 0.94) 78%, rgba(0, 0, 0, 0));
  --topbar-border: rgba(255, 255, 255, 0.045);
  --sidebar-bg: linear-gradient(180deg, #070809 0%, #050506 100%);
  --sidebar-border: rgba(255, 255, 255, 0.045);
  --scrollbar-track: rgba(255, 255, 255, 0.035);
  --scrollbar-thumb: rgba(200, 242, 61, 0.32);
  --scrollbar-thumb-hover: rgba(200, 242, 61, 0.55);
  --scrollbar-thumb-border: rgba(0, 0, 0, 0.72);
  --note-text: #f2f5f8;
  --toolbar-bg: rgba(15, 16, 18, 0.78);
  --empty-bg: rgba(255, 255, 255, 0.026);
  --table-header-bg: #101113;
  --focus-ring: rgba(200, 242, 61, 0.36);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #fbfbfb;
  --surface2: #f8f8f8;
  --surface3: #f2f3f4;
  --surface-raised: #ffffff;
  --surface-hover: #f3f4f4;
  --border: rgba(27, 33, 45, 0.06);
  --border2: rgba(27, 33, 45, 0.12);
  --text: #1b212d;
  --fg: #1b212d;
  --muted: #8f98aa;
  --subtle: #6f7685;
  --accent: #c8f23d;
  --accent-contrast: #1b212d;
  --accent2: #20a678;
  --red: #e5363d;
  --orange: #f79e1b;
  --yellow: #a6c832;
  --blue: #5243aa;
  --green: #20a678;
  --purple: #6f5bd9;
  --gray: #78778b;
  --shadow: 0 24px 70px rgba(27, 33, 45, 0.08);
  --soft-shadow: 0 14px 45px rgba(27, 33, 45, 0.045);
  --nav-active-bg: #c8f23d;
  --nav-active-text: #1b212d;
  --chip-bg: rgba(32, 166, 120, 0.08);
  --chip-border: rgba(32, 166, 120, 0.2);
  --card-bg: #ffffff;
  --card-bg-solid: #f8f9fa;
  --card-bg-strong: #f1f3f4;
  --card-strong-text: #1b212d;
  --card-border: rgba(27, 33, 45, 0.07);
  --card-hover-border: rgba(27, 33, 45, 0.12);
  --topbar-bg: linear-gradient(180deg, #ffffff 0%, rgba(255, 255, 255, 0.96) 78%, rgba(255, 255, 255, 0));
  --topbar-border: rgba(27, 33, 45, 0.06);
  --sidebar-bg: #fbfbfb;
  --sidebar-border: rgba(27, 33, 45, 0.045);
  --scrollbar-track: rgba(27, 33, 45, 0.055);
  --scrollbar-thumb: rgba(32, 166, 120, 0.36);
  --scrollbar-thumb-hover: rgba(32, 166, 120, 0.58);
  --scrollbar-thumb-border: rgba(255, 255, 255, 0.8);
  --note-text: #1b212d;
  --toolbar-bg: rgba(255, 255, 255, 0.76);
  --empty-bg: rgba(27, 33, 45, 0.025);
  --table-header-bg: #f8f9fa;
  --focus-ring: rgba(200, 242, 61, 0.46);
}

* {
  box-sizing: border-box;
  letter-spacing: 0 !important;
}

body {
  margin: 0;
  background: var(--bg) !important;
  color: var(--text) !important;
  font-family: 'Kumbh Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-feature-settings: "tnum" 1;
}

.app-shell {
  background: var(--bg);
  color: var(--text);
}

.content-area {
  background: var(--bg);
  padding: 30px 40px 40px !important;
}

.app-login {
  background:
    radial-gradient(circle at 25% 20%, rgba(200, 238, 68, 0.14), transparent 28rem),
    radial-gradient(circle at 80% 85%, rgba(41, 160, 115, 0.12), transparent 30rem),
    var(--bg) !important;
  color: var(--text) !important;
}

/* ══════════════════════════════════════════════════════════
   SIDEBAR
══════════════════════════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  min-height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 30px 25px;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 30px;
  padding: 0;
  border-bottom: 0;
  margin-bottom: 40px;
}

.logo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  color: var(--accent);
  background: rgba(200, 238, 68, 0.12);
  font-size: 1rem;
  line-height: 1;
  filter: none;
}

.logo-text {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
}

.logo-version {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 2px 7px;
  border-radius: 999px;
  margin-left: auto;
}

.nav-section-label {
  padding: 5px 0 8px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: none;
  color: var(--muted);
}

.nav-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 12px 15px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  border-left: 0;
  border-radius: 12px;
  margin: 1px 0;
  transition: color 0.12s, background 0.12s, border-color 0.12s;
}

.nav-link:hover {
  color: var(--text);
  background: var(--surface2);
}

.nav-link.active {
  color: var(--nav-active-text);
  border-left-color: transparent;
  background: var(--nav-active-bg);
}

.sidebar-footer {
  padding: 18px 0 0;
  border-top: 1px solid var(--border);
  margin-top: 22px;
}

/* ══════════════════════════════════════════════════════════
   TOPBAR
══════════════════════════════════════════════════════════ */
.topbar {
  background: var(--bg);
  border-bottom: 0;
  padding: 30px 40px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  min-height: 78px;
}

.topbar-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.topbar > .flex:first-child > span:last-child {
  color: var(--text) !important;
  font-size: 1.45rem !important;
  font-weight: 600 !important;
  line-height: 1.25;
}

.topbar-command {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 42px;
  min-width: 168px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface2);
  color: var(--muted);
  font-size: 0.78rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.topbar-command:hover {
  border-color: var(--border2);
  color: var(--text);
  background: var(--surface-hover);
}

.topbar-command span {
  flex: 1;
  text-align: left;
}

.topbar-command kbd {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 5px;
  font-size: 0.62rem;
  color: var(--muted);
  background: var(--surface);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.topbar-select {
  height: 42px;
  min-width: 150px;
  max-width: 220px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background-color: var(--surface2);
  color: var(--text);
  font-size: 0.76rem;
  padding: 0 28px 0 9px;
  outline: none;
}

.topbar-select:focus {
  border-color: var(--accent);
}

.theme-toggle {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface2);
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.12s;
}

.theme-toggle:hover {
  color: var(--text);
  border-color: var(--border2);
  background: var(--surface-hover);
  transform: translateY(-1px);
}

:root[data-theme="light"] .theme-toggle .theme-icon-sun,
:root:not([data-theme="light"]) .theme-toggle .theme-icon-moon {
  display: none;
}

/* ══════════════════════════════════════════════════════════
   CARDS
══════════════════════════════════════════════════════════ */
.card {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
}

.card-title {
  font-size: 0.88rem;
  font-weight: 600;
  text-transform: none;
  color: var(--muted);
  margin-bottom: 12px;
}

/* ── Stat cards ─── */
.stat-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.15s, transform 0.15s;
}

.stat-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: transparent;
  border-radius: 10px 0 0 10px;
}

.stat-card.accent-red::before {
  background: transparent;
}

.stat-card.accent-green::before {
  background: transparent;
}

.stat-card.accent-blue::before {
  background: transparent;
}

.stat-card.accent-orange::before {
  background: transparent;
}

.stat-card.accent-yellow::before {
  background: transparent;
}

.stat-card.accent-purple::before {
  background: transparent;
}

.stat-card:hover {
  border-color: var(--border2);
}

.stat-value {
  font-size: 1.55rem;
  font-weight: 700;
  font-family: 'Kumbh Sans', system-ui, sans-serif;
  line-height: 1.1;
  color: var(--text);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 8px;
  font-weight: 500;
  text-transform: none;
}

.stat-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.08;
  color: var(--text);
  width: 40px;
  height: 40px;
}

/* Lucide icon sizing helpers */
.icon-xs {
  width: 11px;
  height: 11px;
}

.icon-sm {
  width: 13px;
  height: 13px;
}

.icon-md {
  width: 16px;
  height: 16px;
}

.icon-lg {
  width: 20px;
  height: 20px;
}

.icon-xl {
  width: 24px;
  height: 24px;
}

/* Form section icon (Lucide) */
.form-section i[data-lucide] {
  width: 13px;
  height: 13px;
  color: var(--muted);
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════
   TABLES
══════════════════════════════════════════════════════════ */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.855rem;
}

.table thead th {
  text-align: left;
  padding: 8px 14px;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.01);
}

.table tbody tr {
  border-bottom: 1px solid rgba(48, 54, 61, 0.6);
  transition: background 0.1s;
}

.table tbody tr:last-child {
  border-bottom: none;
}

.table tbody td {
  padding: 10px 14px;
  color: var(--text);
  vertical-align: middle;
}

.table tbody tr:hover {
  background: var(--surface2);
}

.table tbody tr.clickable {
  cursor: pointer;
}

/* ══════════════════════════════════════════════════════════
   INPUTS & FORMS
══════════════════════════════════════════════════════════ */
.input {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  padding: 10px 14px;
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
  display: block;
  box-sizing: border-box;
}

.input:hover:not(:focus) {
  border-color: var(--border2);
}

.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(200, 238, 68, 0.14);
}

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

.surface-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.surface-search {
  position: relative;
  flex: 1;
  min-width: 0;
}

.surface-search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  width: 14px;
  height: 14px;
  color: var(--muted);
  transform: translateY(-50%);
  pointer-events: none;
}

.surface-filter-input {
  height: 34px;
  padding-left: 34px;
  font-size: 0.78rem;
}

.surface-count {
  color: var(--muted);
  font-size: 0.75rem;
  white-space: nowrap;
}

.coverage-filter-select {
  width: 180px;
  height: 34px;
  font-size: 0.78rem;
}

.scope-template-button {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  opacity: 0.4;
  filter: invert(1);
  cursor: pointer;
}

textarea.input {
  resize: vertical;
  font-size: 0.84rem;
  line-height: 1.6;
  min-height: 80px;
}

select.input {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  height: 42px;
  line-height: 1.4;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%238b949e' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}

.label {
  display: block;
  font-size: 0.71rem;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  user-select: none;
}

.req {
  color: var(--red);
}

/* Field */
.field {
  display: flex;
  flex-direction: column;
}

/* Helper text */
.field-hint {
  font-size: 0.71rem !important;
  color: var(--muted) !important;
  margin-top: 5px;
  line-height: 1.5;
  opacity: 1;
}

.field-code {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 5px;
  font-family: monospace;
  font-size: 0.9em;
  color: var(--accent2);
}

/* Section divider */
.form-section {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.form-section-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text);
  white-space: nowrap;
}

.form-section-sub {
  font-size: 0.71rem;
  color: var(--muted);
}

/* Action bar */
.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 8px;
  padding-bottom: 8px;
}

/* Mono textarea */
.font-mono.input {
  font-family: 'Fira Code', 'Cascadia Code', 'Courier New', monospace;
  font-size: 0.78rem;
}

/* ══════════════════════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════════════════════ */
.btn-primary {
  background: var(--accent);
  color: var(--accent-contrast);
  border: none;
  border-radius: 999px;
  padding: 9px 17px;
  font-size: 0.855rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: opacity 0.15s, transform 0.1s;
  white-space: nowrap;
}

.btn-primary:hover {
  opacity: 0.92;
  box-shadow: 0 10px 24px rgba(200, 238, 68, 0.18);
}

.btn-primary:active {
  transform: scale(0.97);
}

.btn-secondary {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 15px;
  font-size: 0.855rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: border-color 0.15s, background 0.15s;
  white-space: nowrap;
}

.btn-secondary:hover {
  border-color: var(--border2);
  background: var(--surface-hover);
}

.btn-danger {
  background: transparent;
  color: var(--red);
  border: 1px solid rgba(248, 81, 73, 0.35);
  border-radius: 999px;
  padding: 8px 15px;
  font-size: 0.855rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
}

.btn-danger:hover {
  background: var(--red);
  color: white;
  border-color: var(--red);
}

/* CVSS Calculator */
.cvss-table {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.cvss-section-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0 4px;
  font-size: 0.63rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--border2);
}

.cvss-section-row::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.cvss-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 5px 0;
  border-bottom: 1px solid rgba(48, 54, 61, 0.5);
}

.cvss-row:last-child {
  border-bottom: none;
}

.cvss-row-label {
  font-size: 0.69rem;
  color: var(--muted);
  font-weight: 500;
}

.cvss-row-opts {
  display: flex;
  gap: 4px;
}

.cvss-opt {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.69rem;
  font-weight: 500;
  padding: 5px 4px;
  cursor: pointer;
  transition: all 0.12s;
  background: var(--surface2);
  color: var(--muted);
  text-align: center;
  white-space: nowrap;
}

.cvss-opt:hover {
  color: var(--text);
  border-color: var(--border2);
  background: var(--surface3);
}

.cvss-opt-critical {
  border-top: 2px solid rgba(248, 81, 73, 0.35);
}

.cvss-opt-high {
  border-top: 2px solid rgba(230, 126, 34, 0.35);
}

.cvss-opt-medium {
  border-top: 2px solid rgba(227, 179, 65, 0.35);
}

.cvss-opt-low {
  border-top: 2px solid rgba(56, 139, 253, 0.35);
}

.cvss-opt-none {
  border-top: 2px solid rgba(139, 148, 158, 0.25);
}

.cvss-opt-critical.cvss-opt-active {
  background: rgba(248, 81, 73, 0.12);
  border-color: rgba(248, 81, 73, 0.5);
  border-top-color: #f85149;
  color: #f85149;
}

.cvss-opt-high.cvss-opt-active {
  background: rgba(230, 126, 34, 0.12);
  border-color: rgba(230, 126, 34, 0.5);
  border-top-color: #e67e22;
  color: #e67e22;
}

.cvss-opt-medium.cvss-opt-active {
  background: rgba(227, 179, 65, 0.12);
  border-color: rgba(227, 179, 65, 0.5);
  border-top-color: #e3b341;
  color: #e3b341;
}

.cvss-opt-low.cvss-opt-active {
  background: rgba(56, 139, 253, 0.12);
  border-color: rgba(56, 139, 253, 0.5);
  border-top-color: #388bfd;
  color: #388bfd;
}

.cvss-opt-none.cvss-opt-active {
  background: rgba(139, 148, 158, 0.1);
  border-color: rgba(139, 148, 158, 0.4);
  border-top-color: #8b949e;
  color: #8b949e;
}

/* Icon button (table actions) */
.btn-icon {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px 7px;
  border-radius: 5px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.12s, background 0.12s, color 0.12s;
  white-space: nowrap;
}

.btn-icon:hover {
  border-color: var(--border);
  background: var(--surface2);
  color: var(--text);
}

/* Copy button */
.btn-copy {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 5px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.71rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  white-space: nowrap;
  text-decoration: none;
}

.btn-copy:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(88, 166, 255, 0.07);
}

.btn-copy.copied {
  border-color: var(--green);
  color: var(--green);
  background: rgba(63, 185, 80, 0.07);
}

/* ══════════════════════════════════════════════════════════
   BADGES
══════════════════════════════════════════════════════════ */
.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.67rem;
  font-weight: 600;
  text-transform: none;
  white-space: nowrap;
}

/* severity */
.badge-critical {
  background: rgba(248, 81, 73, 0.15);
  color: #f85149;
  border: 1px solid rgba(248, 81, 73, 0.3);
}

.badge-high {
  background: rgba(230, 126, 34, 0.15);
  color: #e67e22;
  border: 1px solid rgba(230, 126, 34, 0.3);
}

.badge-medium {
  background: rgba(227, 179, 65, 0.15);
  color: #e3b341;
  border: 1px solid rgba(227, 179, 65, 0.3);
}

.badge-low {
  background: rgba(56, 139, 253, 0.15);
  color: #388bfd;
  border: 1px solid rgba(56, 139, 253, 0.3);
}

.badge-info {
  background: rgba(118, 131, 144, 0.15);
  color: #768390;
  border: 1px solid rgba(118, 131, 144, 0.3);
}

/* status */
.badge-draft {
  background: rgba(125, 133, 144, 0.12);
  color: #8b949e;
  border: 1px solid rgba(125, 133, 144, 0.25);
}

.badge-ready {
  background: rgba(56, 139, 253, 0.12);
  color: #388bfd;
  border: 1px solid rgba(56, 139, 253, 0.25);
}

.badge-submitted {
  background: rgba(188, 140, 255, 0.12);
  color: #bc8cff;
  border: 1px solid rgba(188, 140, 255, 0.25);
}

.badge-accepted {
  background: rgba(63, 185, 80, 0.12);
  color: #3fb950;
  border: 1px solid rgba(63, 185, 80, 0.25);
}

.badge-duplicate {
  background: rgba(125, 133, 144, 0.12);
  color: #8b949e;
  border: 1px solid rgba(125, 133, 144, 0.25);
}

.badge-informative {
  background: rgba(227, 179, 65, 0.12);
  color: #e3b341;
  border: 1px solid rgba(227, 179, 65, 0.25);
}

.badge-rejected {
  background: rgba(248, 81, 73, 0.12);
  color: #f85149;
  border: 1px solid rgba(248, 81, 73, 0.25);
}

.badge-fixed {
  background: rgba(63, 185, 80, 0.12);
  color: #3fb950;
  border: 1px solid rgba(63, 185, 80, 0.25);
}

.badge-reopened {
  background: rgba(230, 126, 34, 0.12);
  color: #e67e22;
  border: 1px solid rgba(230, 126, 34, 0.25);
}

/* misc */
.badge-active {
  background: rgba(63, 185, 80, 0.12);
  color: #3fb950;
  border: 1px solid rgba(63, 185, 80, 0.25);
}

.badge-paused {
  background: rgba(227, 179, 65, 0.12);
  color: #e3b341;
  border: 1px solid rgba(227, 179, 65, 0.25);
}

.badge-completed {
  background: rgba(56, 139, 253, 0.12);
  color: #388bfd;
  border: 1px solid rgba(56, 139, 253, 0.25);
}

.badge-planning {
  background: rgba(125, 133, 144, 0.12);
  color: #8b949e;
  border: 1px solid rgba(125, 133, 144, 0.25);
}

.badge-in_progress {
  background: rgba(63, 185, 80, 0.12);
  color: #3fb950;
  border: 1px solid rgba(63, 185, 80, 0.25);
}

.badge-running {
  background: rgba(63, 185, 80, 0.12);
  color: #3fb950;
  border: 1px solid rgba(63, 185, 80, 0.25);
}

.badge-pending {
  background: rgba(227, 179, 65, 0.12);
  color: #e3b341;
  border: 1px solid rgba(227, 179, 65, 0.25);
}

.badge-failed,
.badge-cancelled {
  background: rgba(248, 81, 73, 0.12);
  color: #f85149;
  border: 1px solid rgba(248, 81, 73, 0.25);
}

.badge-mcp {
  background: rgba(188, 140, 255, 0.12);
  color: #bc8cff;
  border: 1px solid rgba(188, 140, 255, 0.25);
}

.badge-web {
  background: rgba(56, 139, 253, 0.12);
  color: #388bfd;
  border: 1px solid rgba(56, 139, 253, 0.25);
}

/* ══════════════════════════════════════════════════════════
   TABS
══════════════════════════════════════════════════════════ */
.tab {
  color: var(--muted);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  padding: 8px 16px;
  font-size: 0.855rem;
  transition: color 0.15s;
}

.tab:hover {
  color: var(--text);
}

.tab-active {
  color: var(--text);
  border-bottom: 2px solid var(--red) !important;
  cursor: pointer;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  padding: 8px 16px;
  font-size: 0.855rem;
}

/* ══════════════════════════════════════════════════════════
   LINKS
══════════════════════════════════════════════════════════ */
.link {
  color: var(--accent);
  text-decoration: none;
}

.link:hover {
  text-decoration: underline;
}

/* ══════════════════════════════════════════════════════════
   CODE BLOCKS
══════════════════════════════════════════════════════════ */
.code-block-wrap {
  border: 1px solid var(--border);
  border-radius: 7px;
  overflow: hidden;
}

.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
}

.code-block-label {
  font-size: 0.69rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}

.code-block {
  background: var(--bg);
  padding: 12px 14px;
  font-family: 'Fira Code', 'Cascadia Code', 'Courier New', monospace;
  font-size: 0.75rem;
  color: #cdd9e5;
  overflow-x: auto;
  white-space: pre;
  word-break: normal;
  max-height: 440px;
  overflow-y: auto;
  margin: 0;
  border: none;
  border-radius: 0;
  line-height: 1.55;
}

/* ══════════════════════════════════════════════════════════
   REPORT PREVIEW (full-width, edge-to-edge)
══════════════════════════════════════════════════════════ */
.report-preview {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin: -1.5rem;
  padding: 48px 64px;
  min-height: 100%;
  line-height: 1.7;
  color: #cdd9e5;
}

.report-preview h1 {
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--text);
  border-bottom: 2px solid var(--border);
  padding-bottom: 12px;
  margin-bottom: 20px;
}

.report-preview h2 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  margin: 2em 0 0.6em;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.report-preview h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: #f85149;
  margin: 1.4em 0 0.4em;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.report-preview p {
  margin: 0.6em 0;
}

.report-preview strong {
  color: var(--text);
  font-weight: 600;
}

.report-preview code {
  background: var(--surface2) !important;
  padding: 2px 7px !important;
  border-radius: 4px !important;
  font-family: 'Fira Code', 'Cascadia Code', 'Courier New', monospace !important;
  font-size: 0.82em !important;
  border: 1px solid var(--border) !important;
  color: #79c0ff !important;
  white-space: nowrap;
}

.report-preview pre {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px 20px;
  overflow-x: auto;
  margin: 0.8em 0;
}

.report-preview pre code {
  background: none !important;
  border: none !important;
  padding: 0 !important;
  color: #e6edf3 !important;
  white-space: pre;
  font-size: 0.85em !important;
}

.report-preview table {
  border-collapse: collapse;
  width: 100%;
  margin: 1em 0;
}

.report-preview th {
  background: var(--surface2);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 8px 14px;
  border: 1px solid var(--border);
  text-align: left;
}

.report-preview td {
  padding: 8px 14px;
  border: 1px solid var(--border);
  font-size: 0.9rem;
}

.report-preview tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.02);
}

.report-preview ul,
.report-preview ol {
  padding-left: 1.5em;
  margin: 0.5em 0;
}

.report-preview li {
  margin: 0.3em 0;
}

.report-preview hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2em 0;
}

.report-preview a {
  color: var(--accent);
}

.report-preview blockquote {
  border-left: 3px solid var(--border2);
  padding-left: 14px;
  color: var(--muted);
  margin: 0.75em 0;
}

/* ══════════════════════════════════════════════════════════
   PROSE (rendered markdown)
══════════════════════════════════════════════════════════ */
.prose {
  line-height: 1.65;
}

.prose h1,
.prose h2,
.prose h3 {
  color: var(--text);
  margin: 1em 0 0.4em;
  font-weight: 600;
}

.prose h1 {
  font-size: 1.1em;
}

.prose h2 {
  font-size: 1em;
}

.prose h3 {
  font-size: 0.95em;
  color: var(--muted);
}

.prose p {
  color: #cdd9e5;
  margin: 0.5em 0;
}

.prose code {
  background: var(--surface2);
  padding: 2px 5px;
  border-radius: 3px;
  font-family: monospace;
  font-size: 0.84em;
  border: 1px solid var(--border);
  color: #ff7b72;
}

.prose pre {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px;
  overflow-x: auto;
  margin: 0.75em 0;
}

.prose pre code {
  background: none;
  padding: 0;
  border: none;
  color: #cdd9e5;
  font-size: 0.82em;
}

.prose table {
  border-collapse: collapse;
  width: 100%;
  margin: 0.75em 0;
}

.prose th,
.prose td {
  border: 1px solid var(--border);
  padding: 7px 12px;
}

.prose th {
  background: var(--surface2);
  font-size: 0.85em;
  color: var(--muted);
}

.prose ul,
.prose ol {
  padding-left: 1.4em;
}

.prose li {
  margin: 0.3em 0;
  color: #cdd9e5;
}

.prose a {
  color: var(--accent);
}

.prose hr {
  border-color: var(--border);
  margin: 1.2em 0;
}

.prose strong {
  color: var(--text);
  font-weight: 600;
}

.prose blockquote {
  border-left: 3px solid var(--border2);
  padding-left: 12px;
  color: var(--muted);
  margin: 0.75em 0;
}

/* ══════════════════════════════════════════════════════════
   FINDINGS LIST CARDS
══════════════════════════════════════════════════════════ */
.findings-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  font-size: 0.82rem;
  color: var(--muted);
}

.findings-summary-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--border2);
  flex-shrink: 0;
}

.findings-summary-count {
  font-weight: 700;
  color: var(--text);
  font-size: 0.9rem;
}

.findings-summary-total {
  color: var(--muted);
}

.findings-summary-bounty {
  color: var(--green);
  font-weight: 700;
  font-family: monospace;
}

/* Card */
.finding-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow 0.15s, transform 0.12s, border-color 0.15s;
}

.finding-card:hover {
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  transform: translateY(-1px);
}

.finding-card-critical {
  border-left-color: #f85149;
}

.finding-card-high {
  border-left-color: #e67e22;
}

.finding-card-medium {
  border-left-color: #e3b341;
}

.finding-card-low {
  border-left-color: #388bfd;
}

.finding-card-info {
  border-left-color: #444c56;
}

.finding-card:hover.finding-card-critical {
  border-color: rgba(248, 81, 73, 0.4);
  border-left-color: #f85149;
}

.finding-card:hover.finding-card-high {
  border-color: rgba(230, 126, 34, 0.4);
  border-left-color: #e67e22;
}

.finding-card:hover.finding-card-medium {
  border-color: rgba(227, 179, 65, 0.4);
  border-left-color: #e3b341;
}

.finding-card:hover.finding-card-low {
  border-color: rgba(56, 139, 253, 0.4);
  border-left-color: #388bfd;
}

.finding-card:hover.finding-card-info {
  border-color: rgba(68, 76, 86, 0.6);
  border-left-color: #444c56;
}

/* Header row */
.finding-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 12px;
}

.finding-card-left {
  min-width: 0;
  flex: 1;
}

.finding-card-name {
  font-size: 0.935rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.finding-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  color: var(--muted);
  overflow: hidden;
  white-space: nowrap;
}

.finding-card-sep {
  color: var(--border2);
  font-size: 0.7rem;
}

.finding-card-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.finding-card-bounty {
  font-family: monospace;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--green);
  background: rgba(63, 185, 80, 0.08);
  border: 1px solid rgba(63, 185, 80, 0.2);
  border-radius: 5px;
  padding: 2px 8px;
}

.finding-card-chevron {
  color: var(--border2);
  transition: color 0.15s, transform 0.15s;
  flex-shrink: 0;
}

.finding-card:hover .finding-card-chevron {
  color: var(--muted);
  transform: translateX(3px);
}

/* Severity bar */
.finding-sev-bar {
  display: flex;
  height: 4px;
  overflow: hidden;
  background: var(--surface2);
  gap: 1px;
}

.finding-sev-seg {
  height: 100%;
  min-width: 4px;
}

.seg-critical {
  background: #f85149;
}

.seg-high {
  background: #e67e22;
}

.seg-medium {
  background: #e3b341;
}

.seg-low {
  background: #388bfd;
}

.seg-info {
  background: #444c56;
}

/* Footer */
.finding-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 16px 13px;
  gap: 8px;
}

.finding-card-total {
  font-size: 0.74rem;
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ══════════════════════════════════════════════════════════
   ACTIVITY FEED
══════════════════════════════════════════════════════════ */
.activity-feed {
  padding: 2px 0;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 0;
  position: relative;
  padding: 0 0 0 28px;
  margin-bottom: 14px;
}

.activity-item:last-child {
  margin-bottom: 0;
}

/* vertical connecting line — sits in the left gutter */
.activity-line {
  position: absolute;
  left: 5px;
  top: 20px;
  bottom: -14px;
  width: 1px;
  background: var(--border);
}

.activity-item:last-child .activity-line {
  display: none;
}

/* dot — absolute in left gutter */
.activity-dot {
  position: absolute;
  left: 0;
  top: 4px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2px solid var(--surface);
  background: var(--border2);
  z-index: 1;
  flex-shrink: 0;
}

.activity-dot-mcp {
  background: var(--purple);
  box-shadow: 0 0 6px rgba(188, 140, 255, 0.4);
}

.activity-dot-web {
  background: var(--blue);
  box-shadow: 0 0 6px rgba(56, 139, 253, 0.4);
}

.activity-dot-system {
  background: var(--muted);
}

/* body content */
.activity-body {
  flex: 1;
  min-width: 0;
}

.activity-action {
  font-size: 0.82rem;
  color: var(--text);
  font-weight: 500;
  text-transform: capitalize;
  line-height: 1.4;
}

.activity-detail {
  font-size: 0.73rem;
  color: var(--muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.activity-time {
  font-size: 0.68rem;
  color: var(--border2);
  margin-top: 3px;
}

/* ══════════════════════════════════════════════════════════
   EMPTY STATE
══════════════════════════════════════════════════════════ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  color: var(--muted);
}

.empty-state-icon {
  margin-bottom: 12px;
  opacity: 0.3;
  color: var(--muted);
}

.empty-state-icon i[data-lucide] {
  width: 32px;
  height: 32px;
}

.empty-state-text {
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.empty-state-sub {
  font-size: 0.8rem;
  color: var(--muted);
  opacity: 0.7;
}

/* ══════════════════════════════════════════════════════════
   SCROLLBAR
══════════════════════════════════════════════════════════ */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border2);
}

/* ══════════════════════════════════════════════════════════
   LOGOUT
══════════════════════════════════════════════════════════ */
.btn-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  padding: 8px 12px;
  border-radius: 6px;
  background: rgba(248, 81, 73, 0.1);
  border: 1px solid rgba(248, 81, 73, 0.3);
  color: #f85149;
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btn-logout:hover {
  background: var(--red);
  border-color: var(--red);
  color: white;
}

/* ══════════════════════════════════════════════════════════
   TOAST
══════════════════════════════════════════════════════════ */
#toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-size: 0.84rem;
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.6);
  pointer-events: all;
  animation: toast-in 0.2s ease;
  max-width: 380px;
}

.toast.toast-success {
  border-color: rgba(63, 185, 80, 0.4);
}

.toast.toast-error {
  border-color: rgba(248, 81, 73, 0.4);
}

.toast.toast-info {
  border-color: rgba(56, 139, 253, 0.4);
}

.toast-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.toast-success .toast-dot {
  background: var(--green);
}

.toast-error .toast-dot {
  background: var(--red);
}

.toast-info .toast-dot {
  background: var(--blue);
}

.toast-out {
  animation: toast-out 0.18s ease forwards;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toast-out {
  from {
    opacity: 1;
    transform: translateY(0);
  }

  to {
    opacity: 0;
    transform: translateY(-8px);
  }
}

/* ══════════════════════════════════════════════════════════
   CONFIRM MODAL
══════════════════════════════════════════════════════════ */
#confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fade-in 0.15s ease;
  backdrop-filter: blur(3px);
}

#confirm-overlay.hidden {
  display: none;
}

#confirm-box {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 10px;
  padding: 24px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 16px 56px rgba(0, 0, 0, 0.75);
  animation: scale-in 0.15s ease;
}

#confirm-title {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 8px;
}

#confirm-message {
  color: var(--muted);
  font-size: 0.875rem;
  margin-bottom: 20px;
  line-height: 1.55;
}

#confirm-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes scale-in {
  from {
    opacity: 0;
    transform: scale(0.93);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ══════════════════════════════════════════════════════════
   INLINE EDIT DROPDOWN
══════════════════════════════════════════════════════════ */
.inline-edit {
  cursor: pointer;
  display: inline-block;
}

.inline-edit:hover {
  opacity: 0.85;
}

.inline-edit-dropdown {
  position: fixed;
  z-index: 10000;
  min-width: 140px;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  padding: 4px;
  animation: scale-in 0.12s ease;
}

.inline-edit-opt {
  display: block;
  width: 100%;
  padding: 6px 12px;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 0.82rem;
  text-align: left;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.1s;
}

.inline-edit-opt:hover {
  background: var(--surface2);
}

.inline-edit-opt.active {
  color: var(--accent);
  font-weight: 600;
}

.inline-edit-opt.saving {
  color: var(--muted);
  font-style: italic;
  pointer-events: none;
}

/* ══════════════════════════════════════════════════════════
   VIEW TOGGLE
══════════════════════════════════════════════════════════ */
.view-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.view-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px 10px;
  color: var(--muted);
  background: transparent;
  transition: all 0.15s ease;
  text-decoration: none;
}

.view-toggle-btn:hover {
  color: var(--fg);
  background: var(--surface-hover);
}

.view-toggle-btn.active {
  color: var(--accent);
  background: rgba(56, 139, 253, 0.1);
}

/* ══════════════════════════════════════════════════════════
   BULK DROPDOWN (status menu in toolbar)
══════════════════════════════════════════════════════════ */
.bulk-dropdown-wrap {
  position: relative;
}

.bulk-dropdown {
  position: absolute;
  bottom: 100%;
  left: 0;
  margin-bottom: 6px;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  padding: 4px;
  z-index: 100;
  animation: scale-in 0.12s ease;
}

.bulk-dropdown.hidden {
  display: none;
}

.bulk-dropdown-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 6px 12px;
  font-size: 0.8rem;
  color: var(--fg);
  background: transparent;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.1s;
}

.bulk-dropdown-item:hover {
  background: var(--surface-hover);
}

/* ══════════════════════════════════════════════════════════
   BULK OPERATIONS TOOLBAR
══════════════════════════════════════════════════════════ */
#bulk-toolbar {
  position: fixed;
  bottom: 20px;
  left: calc(var(--sidebar-width) + (100vw - var(--sidebar-width)) / 2);
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 22px;
  width: 400px;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: 10px;
  box-shadow: var(--shadow), 0 0 0 1px rgba(200, 238, 68, 0.12);
  animation: toast-in 0.2s ease;
  justify-content: center;
}

#bulk-toolbar.hidden {
  display: none;
}

.bulk-count {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}

.bulk-sep {
  width: 1px;
  height: 20px;
  background: var(--border);
}

.bulk-check {
  accent-color: var(--accent);
  cursor: pointer;
  width: 14px;
  height: 14px;
}

/* ══════════════════════════════════════════════════════════
   MODAL (quick-add)
══════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fade-in 0.15s ease;
  backdrop-filter: blur(3px);
}

.modal-overlay.hidden {
  display: none;
}

.modal-box {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 10px;
  width: 100%;
  max-width: 520px;
  box-shadow: 0 16px 56px rgba(0, 0, 0, 0.75);
  animation: scale-in 0.15s ease;
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0;
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface2);
}

/* ══════════════════════════════════════════════════════════
   COMMAND PALETTE
══════════════════════════════════════════════════════════ */
.command-palette {
  position: fixed;
  inset: 0;
  z-index: 600;
  background: rgba(1, 4, 9, 0.72);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 16px 24px;
}

.command-palette.hidden {
  display: none;
}

.command-box {
  width: min(680px, 100%);
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.command-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.command-input-row input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 0.96rem;
}

.command-results {
  max-height: 420px;
  overflow-y: auto;
  padding: 6px;
}

.command-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 11px;
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
}

.command-item:hover,
.command-item.active {
  background: var(--surface2);
}

.command-item i {
  color: var(--muted);
  flex-shrink: 0;
}

.command-item span {
  display: block;
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.25;
}

.command-item small {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  margin-top: 2px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  max-width: 560px;
}

.command-empty {
  padding: 28px 12px;
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
}

/* ══════════════════════════════════════════════════════════
   KEYBOARD SHORTCUTS HELP
══════════════════════════════════════════════════════════ */
.shortcut-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(48, 54, 61, 0.5);
  font-size: 0.84rem;
}

.shortcut-row:last-child {
  border-bottom: none;
}

.shortcut-row kbd {
  display: inline-block;
  padding: 2px 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.78rem;
  color: var(--text);
  min-width: 24px;
  text-align: center;
}

.shortcut-row span {
  color: var(--muted);
}

/* ══════════════════════════════════════════════════════════
   SORTABLE TABLE HEADERS
══════════════════════════════════════════════════════════ */
th[data-sort] {
  cursor: pointer;
  user-select: none;
  transition: color 0.12s;
}

th[data-sort]:hover {
  color: var(--text);
}

th[data-sort]::after {
  content: '⇅';
  margin-left: 4px;
  font-size: 0.6rem;
  opacity: 0.3;
}

th[data-sort].sort-asc::after {
  content: '↑';
  opacity: 0.8;
  color: var(--accent);
}

th[data-sort].sort-desc::after {
  content: '↓';
  opacity: 0.8;
  color: var(--accent);
}

/* ══════════════════════════════════════════════════════════
   FILTER BAR
══════════════════════════════════════════════════════════ */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.12s;
  white-space: nowrap;
}

.filter-chip:hover {
  border-color: var(--border2);
  color: var(--text);
}

.filter-chip.active {
  background: rgba(88, 166, 255, 0.1);
  border-color: rgba(88, 166, 255, 0.4);
  color: var(--accent);
}

.filter-chip-count {
  font-size: 0.68rem;
  line-height: 1;
  color: var(--muted);
  padding-left: 2px;
}

.filter-chip.active .filter-chip-count {
  color: inherit;
  opacity: 0.85;
}

.filter-sep {
  width: 1px;
  height: 20px;
  margin: 0 4px;
  background: var(--border);
}

.filter-chip-sev.active[data-severity="critical"] {
  background: rgba(248, 81, 73, 0.1);
  border-color: rgba(248, 81, 73, 0.4);
  color: #f85149;
}

.filter-chip-sev.active[data-severity="high"] {
  background: rgba(230, 126, 34, 0.1);
  border-color: rgba(230, 126, 34, 0.4);
  color: #e67e22;
}

.filter-chip-sev.active[data-severity="medium"] {
  background: rgba(227, 179, 65, 0.1);
  border-color: rgba(227, 179, 65, 0.4);
  color: #e3b341;
}

.filter-chip-sev.active[data-severity="low"] {
  background: rgba(56, 139, 253, 0.1);
  border-color: rgba(56, 139, 253, 0.4);
  color: #388bfd;
}

.filter-chip-sev.active[data-severity="info"] {
  background: rgba(118, 131, 144, 0.1);
  border-color: rgba(118, 131, 144, 0.4);
  color: #768390;
}

/* ══════════════════════════════════════════════════════════
   TABLE ACTION BUTTONS (inline)
══════════════════════════════════════════════════════════ */
.table-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.12s;
}

tr:hover .table-actions {
  opacity: 1;
}

/* ══════════════════════════════════════════════════════════
   HOVER & TRANSITION HELPERS
══════════════════════════════════════════════════════════ */
.card {
  transition: border-color 0.15s;
}

.card:hover {
  border-color: var(--border2);
}

.stat-card {
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}

.stat-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

/* Focus visible ring for accessibility */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ══════════════════════════════════════════════════════════
   MOBILE SIDEBAR & HAMBURGER
══════════════════════════════════════════════════════════ */
.hamburger-btn {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}

.hamburger-btn:hover {
  color: var(--text);
  border-color: var(--border2);
  background: var(--surface2);
}

.sidebar-close {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 5px;
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
  margin-left: auto;
}

.sidebar-close:hover {
  color: var(--text);
  background: var(--surface2);
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
  z-index: 299;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.sidebar-backdrop.active {
  opacity: 1;
}

/* ══════════════════════════════════════════════════════════
   TABLE RESPONSIVE WRAPPER
══════════════════════════════════════════════════════════ */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ══════════════════════════════════════════════════════════
   MAGLO THEME COMPATIBILITY FOR EXISTING TAILWIND UTILITIES
══════════════════════════════════════════════════════════ */
main,
.app-shell main {
  background: var(--bg);
}

.card,
.command-box,
.modal-box,
#confirm-box,
.inline-edit-dropdown,
.bulk-dropdown,
.finding-card {
  box-shadow: var(--soft-shadow);
}

:root[data-theme="light"] .card,
:root[data-theme="light"] .command-box,
:root[data-theme="light"] .modal-box,
:root[data-theme="light"] #confirm-box,
:root[data-theme="light"] .inline-edit-dropdown,
:root[data-theme="light"] .bulk-dropdown,
:root[data-theme="light"] .finding-card {
  box-shadow: none;
}

.link,
.btn-copy:hover,
.tab-active,
.view-toggle-btn.active,
.filter-chip.active,
.bulk-count,
th[data-sort].sort-asc::after,
th[data-sort].sort-desc::after {
  color: var(--accent2);
}

.tab-active {
  border-bottom-color: var(--accent) !important;
}

.filter-chip.active,
.view-toggle-btn.active {
  background: var(--chip-bg);
  border-color: var(--chip-border);
}

.btn-copy:hover {
  background: rgba(41, 160, 115, 0.08);
  border-color: rgba(41, 160, 115, 0.28);
}

.table thead th {
  background: var(--surface2);
}

.table tbody tr:hover,
.command-item:hover,
.command-item.active {
  background: var(--surface-hover);
}

.stat-card.accent-red,
.finding-card-critical {
  border-color: rgba(229, 54, 61, 0.28);
}

.stat-card.accent-green {
  border-color: rgba(41, 160, 115, 0.28);
}

.stat-card.accent-blue {
  border-color: rgba(82, 67, 170, 0.28);
}

.stat-card.accent-orange {
  border-color: rgba(247, 158, 27, 0.28);
}

.stat-card.accent-yellow {
  border-color: rgba(200, 238, 68, 0.28);
}

.stat-card.accent-purple {
  border-color: rgba(139, 92, 246, 0.28);
}

[class~="text-[#e6edf3]"],
[class~="text-[#cdd9e5]"],
[class~="hover:text-[#e6edf3]"]:hover {
  color: var(--text) !important;
}

[class~="text-[#7d8590]"],
[class~="text-[#8b949e]"],
[class~="text-[#929eae]"],
[class~="placeholder-[#8b949e]"]::placeholder {
  color: var(--muted) !important;
}

[class~="text-[#58a6ff]"],
[class~="text-[#79c0ff]"],
[class~="text-[#388bfd]"] {
  color: var(--accent2) !important;
}

[class~="text-[#3fb950]"] {
  color: var(--green) !important;
}

[class~="text-[#f85149]"],
[class~="hover:text-[#f85149]"]:hover {
  color: var(--red) !important;
}

[class~="text-[#e67e22]"],
[class~="text-[#f0883e]"] {
  color: var(--orange) !important;
}

[class~="text-[#e3b341]"] {
  color: var(--yellow) !important;
}

[class~="text-[#bc8cff]"] {
  color: var(--purple) !important;
}

[class*="bg-[#0d1117]"] {
  background-color: var(--bg) !important;
}

[class*="bg-[#161b22]"],
[class*="bg-[#1c2128]"] {
  background-color: var(--surface) !important;
}

[class*="bg-[#21262d]"],
[class*="bg-[#2d333b]"] {
  background-color: var(--surface2) !important;
}

[class*="bg-[#30363d]"] {
  background-color: var(--border) !important;
}

[class*="bg-[#f85149]"] {
  background-color: rgba(229, 54, 61, 0.12) !important;
}

[class*="bg-[#3fb950]"],
[class*="bg-[#238636]"],
[class*="bg-[#1f6f3a]"] {
  background-color: rgba(41, 160, 115, 0.14) !important;
}

[class*="bg-[#e3b341]"] {
  background-color: rgba(200, 238, 68, 0.14) !important;
}

[class*="bg-[#388bfd]"],
[class*="bg-[#58a6ff]"],
[class*="bg-[#79c0ff]"] {
  background-color: rgba(41, 160, 115, 0.12) !important;
}

[class~="bg-[#f85149]"] {
  background-color: var(--red) !important;
}

[class~="bg-[#3fb950]"],
[class~="bg-[#238636]"],
[class~="bg-[#1f6f3a]"] {
  background-color: var(--green) !important;
}

[class~="bg-[#e3b341]"] {
  background-color: var(--yellow) !important;
}

[class~="bg-[#388bfd]"],
[class~="bg-[#58a6ff]"],
[class~="bg-[#79c0ff]"] {
  background-color: var(--accent2) !important;
}

[class~="border-[#30363d]"],
[class~="border-[#21262d]"],
[class~="border-[#1c2128]"],
[class~="divide-[#21262d]"] > :not([hidden]) ~ :not([hidden]) {
  border-color: var(--border) !important;
}

[class~="border-[#f85149]"] {
  border-color: rgba(229, 54, 61, 0.35) !important;
}

[class~="border-[#3fb950]"],
[class~="border-[#238636]"] {
  border-color: rgba(41, 160, 115, 0.35) !important;
}

[class~="border-[#e3b341]"] {
  border-color: rgba(200, 238, 68, 0.35) !important;
}

[class~="rounded-lg"],
.rounded-lg {
  border-radius: 10px !important;
}

pre,
code,
.font-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace !important;
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE — TABLET (≤1024px)
══════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .sidebar {
    position: fixed;
    left: -260px;
    top: 0;
    bottom: 0;
    z-index: 300;
    width: 250px;
    transition: left 0.25s ease;
    box-shadow: none;
  }

  .sidebar.open {
    left: 0;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5);
  }

  .sidebar-backdrop {
    display: block;
    pointer-events: none;
  }

  .sidebar-backdrop.active {
    pointer-events: auto;
  }

  .hamburger-btn {
    display: flex;
  }

  .sidebar-close {
    display: flex;
  }

  .content-area {
    padding: 16px;
  }

  .topbar {
    padding: 8px 16px;
  }

  .topbar-command {
    min-width: 120px;
  }

  .topbar-select {
    max-width: 160px;
  }

  /* Reduce grid columns */
  .grid.grid-cols-4,
  .grid.grid-cols-5 {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .grid.grid-cols-3 {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Report preview padding */
  .report-preview {
    padding: 32px 24px;
    margin: -1rem;
  }
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE — MOBILE (≤768px)
══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .content-area {
    padding: 12px;
  }

  .topbar {
    padding: 8px 12px;
    min-height: 44px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .topbar-tools {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .topbar-command {
    min-width: 112px;
  }

  .topbar-command kbd,
  .topbar-select {
    display: none;
  }

  /* Stat cards smaller */
  .stat-card {
    padding: 12px 14px;
  }

  .stat-value {
    font-size: 1.15rem;
  }

  .stat-icon {
    display: none;
  }

  /* Cards smaller padding */
  .card {
    padding: 12px;
  }

  .card-title {
    font-size: 0.82rem;
  }

  /* Grids go single / dual column */
  .grid.grid-cols-4,
  .grid.grid-cols-5 {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }

  .grid.grid-cols-3 {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  .grid.grid-cols-2 {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  /* col-span overrides for stacked layout */
  [class*="col-span"] {
    grid-column: span 1 !important;
  }

  /* Tables scroll horizontally */
  .table {
    min-width: 600px;
  }

  .table th,
  .table td {
    padding: 8px 10px;
    font-size: 0.75rem;
  }

  /* Finding cards */
  .finding-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 12px;
  }

  .finding-card-right {
    width: 100%;
    justify-content: flex-start;
  }

  .finding-card-name {
    white-space: normal;
    font-size: 0.87rem;
  }

  .finding-card-footer {
    padding: 8px 12px;
  }

  /* Filter bar */
  .filter-bar {
    gap: 6px;
  }

  .filter-chip {
    padding: 3px 8px;
    font-size: 0.7rem;
  }

  /* Buttons */
  .btn-primary,
  .btn-secondary,
  .btn-danger {
    padding: 7px 14px;
    font-size: 0.78rem;
  }

  /* Empty state */
  .empty-state {
    padding: 32px 16px;
  }

  /* Bulk toolbar */
  #bulk-toolbar {
    left: 12px;
    right: 12px;
    width: auto;
    max-width: none;
    transform: none;
    padding: 8px 14px;
    border-radius: 8px;
    flex-wrap: wrap;
    gap: 6px;
  }

  /* Confirm modal */
  #confirm-box {
    margin: 16px;
    max-width: calc(100vw - 32px);
    padding: 20px;
  }

  /* Modal */
  .modal-box {
    margin: 16px;
    max-width: calc(100vw - 32px);
  }

  .modal-header {
    padding: 12px 16px;
  }

  .modal-body {
    padding: 16px;
  }

  .modal-footer {
    padding: 10px 16px;
  }

  /* Toast */
  .toast {
    max-width: calc(100vw - 32px);
    font-size: 0.8rem;
  }

  /* Report preview */
  .report-preview {
    padding: 20px 16px;
    margin: -0.75rem;
  }

  .report-preview h1 {
    font-size: 1.3rem;
  }

  .report-preview h2 {
    font-size: 1rem;
  }

  /* Code blocks */
  .code-block {
    font-size: 0.7rem;
    padding: 10px;
  }

  /* CVSS calculator */
  .cvss-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .cvss-opts {
    flex-wrap: wrap;
    width: 100%;
  }

  .cvss-opt {
    flex: unset;
    padding: 5px 10px;
    font-size: 0.7rem;
  }

  /* Form sections */
  .form-section {
    flex-wrap: wrap;
  }

  /* Topbar action buttons - truncate */
  .topbar .flex.items-center.gap-2:last-child {
    flex-shrink: 1;
    overflow: hidden;
  }

  /* Activity feed */
  .activity-detail {
    white-space: normal;
  }

  /* View toggle */
  .view-toggle-btn {
    padding: 4px 8px;
  }

  /* Inline edit dropdown */
  .inline-edit-dropdown {
    min-width: 120px;
  }

  /* Shortcut rows */
  .shortcut-row {
    gap: 8px;
    font-size: 0.78rem;
  }

  /* Technique coverage bars */
  .grid.grid-cols-2.gap-x-8 {
    grid-template-columns: 1fr !important;
    gap: 6px !important;
  }
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE — SMALL MOBILE (≤480px)
══════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
  .content-area {
    padding: 8px;
  }

  .topbar {
    padding: 6px 8px;
  }

  .grid.grid-cols-4,
  .grid.grid-cols-5 {
    grid-template-columns: 1fr !important;
    gap: 6px !important;
  }

  .stat-card {
    padding: 10px 12px;
  }

  .stat-value {
    font-size: 1rem;
  }

  .stat-label {
    font-size: 0.65rem;
  }

  .card {
    padding: 10px;
  }

  /* Finding card meta wrap */
  .finding-card-meta {
    flex-wrap: wrap;
    white-space: normal;
  }

  /* Findings summary */
  .findings-summary {
    flex-wrap: wrap;
    gap: 6px;
  }

  /* Sidebar wider on very small screens */
  .sidebar {
    width: 80vw;
    max-width: 280px;
    left: calc(-80vw - 10px);
  }

  /* Toast full width */
  #toast-container {
    left: 8px;
    right: 8px;
    transform: none;
    width: auto;
  }

  .toast {
    max-width: 100%;
    width: 100%;
  }

  /* Bulk toolbar full width */
  #bulk-toolbar {
    left: 8px;
    right: 8px;
    width: auto;
    max-width: none;
    transform: none;
    bottom: 12px;
    font-size: 0.78rem;
  }

  .btn-primary,
  .btn-secondary,
  .btn-danger {
    padding: 6px 12px;
    font-size: 0.75rem;
  }
}
