/* ── Design Tokens ─────────────────────────────────────────────────────────── */
:root {
  --primary: #990FFA;
  --secondary: #E60076;
  --success: #16A34A;
  --warning: #D97706;
  --danger: #DC2626;

  --bg-gradient: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
  --accent-gradient: linear-gradient(135deg, #a78bfa, #38bdf8);
  --button-gradient: linear-gradient(135deg, var(--primary), var(--secondary));
  --button-gradient-hover: linear-gradient(135deg, #b03dfc, #ff1a8c);

  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-bg-hover: rgba(255, 255, 255, 0.09);
  --glass-bg-active: rgba(153, 15, 250, 0.18);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-border-hover: rgba(167, 139, 250, 0.35);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  --glass-shadow-hover: 0 12px 40px rgba(153, 15, 250, 0.2);

  --text-primary: rgba(255, 255, 255, 0.95);
  --text-secondary: rgba(255, 255, 255, 0.65);
  --text-muted: rgba(255, 255, 255, 0.38);
  --text-accent: #a78bfa;

  --font-primary: 'Montserrat', system-ui, sans-serif;
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --sidebar-width: 240px;

  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 40px;
  --space-6: 48px;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --transition: all 0.3s ease;
  --transition-fast: all 0.15s ease;
}

/* ── Reset & Base ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { height: 100%; scroll-behavior: smooth; }

body {
  font-family: var(--font-primary);
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-gradient);
  background-attachment: fixed;
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: var(--font-primary); }
ul, ol { list-style: none; }
input, textarea, select { font-family: var(--font-primary); }

/* ── Layout ────────────────────────────────────────────────────────────────── */
#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Topbar ────────────────────────────────────────────────────────────────── */
#topbar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  height: 54px;
  background: rgba(15, 12, 41, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  padding: 0 var(--space-3);
  position: sticky;
  top: 0;
  z-index: 100;
  flex-shrink: 0;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin-right: var(--space-2);
}

.logo-icon {
  font-size: 20px;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-text {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 2px;
}

.topbar-nav { flex: 1; }

.nav-list {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-list li { margin-bottom: 0; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 13px;
  transition: var(--transition);
  border-bottom: 2px solid transparent;
  min-height: 36px;
  white-space: nowrap;
}

.nav-link:hover {
  background: var(--glass-bg-hover);
  color: var(--text-primary);
}

.nav-link.active {
  background: var(--glass-bg-active);
  color: var(--text-accent);
  border-bottom-color: var(--primary);
}

.nav-icon {
  font-size: 14px;
  flex-shrink: 0;
}

.topbar-right {
  margin-left: auto;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-user-slot {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-username {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
  white-space: nowrap;
}

.version-tag {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

/* ── Role Badges ───────────────────────────────────────────────────────────── */
.role-badge {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.role-badge.role-admin { background: rgba(153,15,250,0.25); color: #c084fc; border: 1px solid rgba(153,15,250,0.3); }
.role-badge.role-pentester { background: rgba(56,189,248,0.15); color: #38bdf8; border: 1px solid rgba(56,189,248,0.25); }
.role-badge.role-reviewer { background: rgba(251,191,36,0.15); color: #fbbf24; border: 1px solid rgba(251,191,36,0.25); }

/* ── Login Overlay ─────────────────────────────────────────────────────────── */
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: var(--bg-gradient);
  background-attachment: fixed;
}
.login-overlay:not([hidden]) {
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-box {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 40px;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--glass-shadow);
}

.login-header {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  margin-bottom: 8px;
}

.login-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 2px;
}

.login-subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 28px;
}

.login-error {
  background: rgba(220, 38, 38, 0.1);
  border: 1px solid rgba(220, 38, 38, 0.3);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  color: #f87171;
  font-size: 13px;
  margin-bottom: 16px;
}

/* ── User Table ────────────────────────────────────────────────────────────── */
.user-table {
  width: 100%;
  border-collapse: collapse;
}
.user-table th, .user-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--glass-border);
  font-size: 13px;
}
.user-table th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.user-table tbody tr:hover { background: var(--glass-bg-hover); }
.user-table tbody tr:last-child td { border-bottom: none; }

/* ── Main Content ──────────────────────────────────────────────────────────── */
#content {
  flex: 1;
  padding: var(--space-3) var(--space-4);
  min-height: calc(100vh - 54px);
}

/* ── Page Header ───────────────────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
  gap: var(--space-2);
}

.page-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 4px;
}

/* ── Cards ─────────────────────────────────────────────────────────────────── */
.card {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  transition: var(--transition);
}

.card:hover {
  background: var(--glass-bg-hover);
  border-color: var(--glass-border-hover);
  transform: translateY(-2px);
  box-shadow: var(--glass-shadow-hover);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-3);
}

/* ── Stat Cards ────────────────────────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.stat-card {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  transition: var(--transition);
}

.stat-card:hover {
  border-color: var(--glass-border-hover);
  box-shadow: var(--glass-shadow-hover);
}

.stat-value {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
  margin-bottom: var(--space-1);
}

.stat-label {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.btn-primary {
  background: var(--button-gradient);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: 10px 20px;
  font-weight: 600;
  font-size: 14px;
  min-height: 44px;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary:hover {
  background: var(--button-gradient-hover);
  box-shadow: 0 4px 20px rgba(153, 15, 250, 0.45);
  transform: translateY(-1px);
}

.btn-primary:focus-visible {
  outline: 2px solid var(--text-accent);
  outline-offset: 3px;
}

.btn-primary:active { transform: translateY(0); box-shadow: none; }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-secondary {
  background: var(--glass-bg);
  color: var(--text-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 10px 20px;
  font-weight: 500;
  font-size: 14px;
  min-height: 44px;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-secondary:hover {
  background: var(--glass-bg-hover);
  border-color: var(--glass-border-hover);
  color: var(--text-primary);
}

.btn-secondary:focus-visible {
  outline: 2px solid var(--text-accent);
  outline-offset: 3px;
}

.btn-danger {
  background: rgba(220, 38, 38, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(220, 38, 38, 0.3);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  font-weight: 500;
  font-size: 13px;
  min-height: 36px;
  transition: var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-danger:hover {
  background: rgba(220, 38, 38, 0.28);
  border-color: rgba(220, 38, 38, 0.5);
}

.btn-danger:focus-visible {
  outline: 2px solid #fca5a5;
  outline-offset: 3px;
}

.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: var(--transition-fast);
}

.btn-icon:hover { background: var(--glass-bg-hover); color: var(--text-primary); }
.btn-icon:focus-visible { outline: 2px solid var(--text-accent); outline-offset: 2px; }

/* ── Badges ────────────────────────────────────────────────────────────────── */
.badge-cwe {
  display: inline-block;
  background: rgba(167, 139, 250, 0.15);
  border: 1px solid rgba(167, 139, 250, 0.3);
  color: #c4b5fd;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-mono);
  white-space: nowrap;
}

.badge-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--glass-bg-active);
  color: var(--text-accent);
  border-radius: 999px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 700;
}

.badge-extra {
  display: inline-block;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #7dd3fc;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 600;
}

/* ── Forms ─────────────────────────────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: var(--space-2);
}

.form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.form-input, .form-textarea, .form-select {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  padding: 10px 14px;
  font-size: 14px;
  transition: var(--transition-fast);
  min-height: 44px;
  width: 100%;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(153, 15, 250, 0.08);
  box-shadow: 0 0 0 3px rgba(153, 15, 250, 0.15);
}

.form-input::placeholder, .form-textarea::placeholder {
  color: var(--text-muted);
}

.form-textarea {
  resize: vertical;
  min-height: 90px;
  line-height: 1.6;
}

.form-select {
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='rgba(255,255,255,0.4)' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.form-select option { background: #1e1b4b; color: var(--text-primary); }

/* ── Checklist View ────────────────────────────────────────────────────────── */
.checklist-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: var(--space-3);
  align-items: start;
}

.category-sidebar {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: sticky;
  top: 70px;
  max-height: calc(100vh - 90px);
  display: flex;
  flex-direction: column;
}

.category-sidebar-title {
  padding: var(--space-2) var(--space-3);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--glass-border);
  flex-shrink: 0;
}

.category-list {
  overflow-y: auto;
  flex: 1;
  padding: var(--space-1);
}

.category-list::-webkit-scrollbar { width: 4px; }
.category-list::-webkit-scrollbar-track { background: transparent; }
.category-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 999px; }

.category-item {
  padding: 10px var(--space-2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  transition: var(--transition-fast);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-1);
  min-height: 44px;
  position: relative;
}

.category-item:hover {
  background: var(--glass-bg-hover);
  color: var(--text-primary);
}

.category-item.active {
  background: var(--glass-bg-active);
  color: var(--text-accent);
}

.checklist-list { display: flex; flex-direction: column; gap: var(--space-2); }

.checklist-item {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
}

.checklist-item-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  cursor: pointer;
  transition: var(--transition-fast);
  min-height: 56px;
}

.checklist-item-header:hover { background: var(--glass-bg-hover); }

.checklist-id {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-accent);
  background: rgba(167, 139, 250, 0.1);
  border: 1px solid rgba(167, 139, 250, 0.2);
  border-radius: var(--radius-sm);
  padding: 2px 8px;
  white-space: nowrap;
  flex-shrink: 0;
}

.checklist-name {
  flex: 1;
  font-weight: 500;
  color: var(--text-primary);
}

.checklist-chevron {
  color: var(--text-muted);
  font-size: 12px;
  transition: transform 0.25s ease;
  flex-shrink: 0;
}

.checklist-item.expanded .checklist-chevron {
  transform: rotate(180deg);
}

.checklist-detail {
  display: none;
  padding: 0 var(--space-3) var(--space-3);
  border-top: 1px solid var(--glass-border);
}

.checklist-item.expanded .checklist-detail {
  display: block;
}

.checklist-fields { display: flex; flex-direction: column; gap: var(--space-2); margin-top: var(--space-2); }

.checklist-field-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.checklist-field-content {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 13px;
  line-height: 1.8;
  color: var(--text-secondary);
}

.cwe-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: rgba(167, 139, 250, 0.12);
  border: 1px solid rgba(167, 139, 250, 0.22);
  border-radius: 4px;
  padding: 1px 6px;
  color: #c4b5fd;
}

/* ── Action Buttons for Admin ──────────────────────────────────────────────── */
.btn-icon-small {
  background: transparent;
  border: 1px solid rgba(167, 139, 250, 0.3);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
}

.btn-icon-small:hover {
  background: rgba(167, 139, 250, 0.15);
  color: var(--text-accent);
  border-color: rgba(167, 139, 250, 0.5);
}

.category-actions {
  display: none;
  position: absolute;
  right: 12px;
}

.category-item:hover .category-actions {
  display: flex;
}

.checklist-actions {
  display: none;
  align-items: center;
}

.checklist-item-header:hover .checklist-actions {
  display: flex;
}

/* ── Column Resizing ───────────────────────────────────────────────────────── */
.checklist-layout {
  position: relative;
}

.checklist-layout .resizer {
  position: absolute;
  width: 4px;
  height: 100%;
  left: 260px;
  cursor: col-resize;
  user-select: none;
  background: transparent;
  transition: background 0.2s ease;
}

.checklist-layout .resizer:hover,
.checklist-layout .resizer.dragging {
  background: rgba(167, 139, 250, 0.5);
}

.checklist-layout.resizing {
  user-select: none;
}

/* ── List Views (Usecase/Project) ──────────────────────────────────────────── */
.item-list { display: flex; flex-direction: column; gap: var(--space-2); }

.item-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  transition: var(--transition);
  cursor: pointer;
}

.item-card:hover {
  background: var(--glass-bg-hover);
  border-color: var(--glass-border-hover);
  transform: translateY(-1px);
  box-shadow: var(--glass-shadow-hover);
}

.item-card-info { flex: 1; min-width: 0; }

.item-card-name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.item-card-desc {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-card-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
}

.item-card-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* ── Detail Views ──────────────────────────────────────────────────────────── */
.detail-header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.detail-back {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition-fast);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.detail-back:hover {
  background: var(--glass-bg-hover);
  color: var(--text-primary);
}

.detail-info { flex: 1; }

.detail-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.detail-desc {
  color: var(--text-secondary);
  font-size: 14px;
}

/* ── Section Headers ───────────────────────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-2);
  flex-wrap: wrap;
  gap: var(--space-1);
}

.section-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

/* ── Testcase Assign Panel ─────────────────────────────────────────────────── */
.assign-panel {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  margin-top: var(--space-3);
}

.tc-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 10px var(--space-2);
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
}

.tc-row:hover { background: var(--glass-bg-hover); }

.tc-id {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-accent);
  width: 110px;
  flex-shrink: 0;
}

.tc-name { flex: 1; font-size: 13px; color: var(--text-secondary); }

/* ── Empty State ───────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: var(--space-6) var(--space-4);
  color: var(--text-muted);
}

.empty-icon { font-size: 48px; margin-bottom: var(--space-2); opacity: 0.4; }

.empty-text { font-size: 15px; font-weight: 500; color: var(--text-secondary); }
.empty-sub { font-size: 13px; margin-top: 6px; }

/* ── Loading ───────────────────────────────────────────────────────────────── */
.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(167, 139, 250, 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Modal ─────────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: var(--space-3);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay:not([hidden]) {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  background: linear-gradient(135deg, rgba(48, 43, 99, 0.95), rgba(36, 36, 62, 0.95));
  border: 1px solid var(--glass-border-hover);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  transform: scale(0.95);
  transition: transform 0.2s ease;
}

.modal-overlay:not([hidden]) .modal-box { transform: scale(1); }

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

.modal-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-body { padding: var(--space-3); }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3) var(--space-3);
  border-top: 1px solid var(--glass-border);
}

/* ── Toast ─────────────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: var(--space-4);
  right: var(--space-4);
  background: linear-gradient(135deg, rgba(48, 43, 99, 0.98), rgba(24, 24, 46, 0.98));
  border: 1px solid var(--glass-border-hover);
  border-radius: var(--radius-md);
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  z-index: 300;
  max-width: 320px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.toast-error { border-color: rgba(220, 38, 38, 0.5); }
.toast.toast-success { border-color: rgba(22, 163, 74, 0.5); }

/* ── Search ────────────────────────────────────────────────────────────────── */
.search-bar {
  position: relative;
  margin-bottom: var(--space-3);
}

.search-bar input {
  width: 100%;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  padding: 10px 14px 10px 40px;
  font-size: 14px;
  transition: var(--transition-fast);
  min-height: 44px;
}

.search-bar input:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(153, 15, 250, 0.08);
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
  pointer-events: none;
}

/* ── Divider ───────────────────────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--glass-border);
  margin: var(--space-3) 0;
}

/* ── Usecase Detail Layout ─────────────────────────────────────────────────── */
.uc-detail-page {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  height: calc(100vh - 86px);
  min-height: 620px;
}

/* Split workspace: left list + resizer + right detail */
.uc-workspace {
  display: flex;
  align-items: stretch;
  flex: 1;
  min-height: 0;
  gap: 0;
}

/* Drag handle between panels */
.uc-resizer {
  width: 10px;
  flex-shrink: 0;
  cursor: col-resize;
  position: relative;
  z-index: 2;
}
.uc-resizer::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  left: 50%; transform: translateX(-50%);
  width: 3px;
  border-radius: 2px;
  background: var(--glass-border);
  transition: background 0.15s ease;
}
.uc-resizer:hover::after,
.uc-resizer.dragging::after {
  background: var(--primary);
}

/* Left panel */
.uc-tc-list-panel {
  display: flex;
  flex-direction: column;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  width: 320px;
  min-width: 160px;
  flex-shrink: 0;
}

.uc-tc-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px var(--space-3);
  border-bottom: 1px solid var(--glass-border);
  flex-shrink: 0;
  background: rgba(255,255,255,0.03);
}

.uc-tc-scroll {
  flex: 1;
  overflow-y: auto;
}

.uc-tc-scroll::-webkit-scrollbar { width: 4px; }
.uc-tc-scroll::-webkit-scrollbar-track { background: transparent; }
.uc-tc-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 999px; }

/* Right panel */
.uc-tc-detail-panel {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  overflow-y: auto;
  transition: border-color 0.3s ease;
  position: relative;
  min-height: 120px;
}

.uc-tc-detail-panel.has-content {
  border-color: rgba(167, 139, 250, 0.28);
}

.uc-tc-detail-panel::-webkit-scrollbar { width: 4px; }
.uc-tc-detail-panel::-webkit-scrollbar-track { background: transparent; }
.uc-tc-detail-panel::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 999px; }

/* Placeholder inside right panel */
.tc-detail-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 12px;
  padding: var(--space-4);
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.6;
}

.tc-detail-placeholder-icon {
  font-size: 40px;
  opacity: 0.12;
}

/* TC detail content */
.tc-detail-content {
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.tc-detail-cl-header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--glass-border);
}

.tc-detail-cl-name {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
}

.tc-detail-highlight {
  background: rgba(153, 15, 250, 0.1);
  border: 1px solid rgba(153, 15, 250, 0.22);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
}

.tc-detail-highlight-text {
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.7;
  word-break: break-word;
}

.tc-detail-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Clickable TC items in left panel */
.tc-item-clickable {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 9px 10px 9px 20px;
  cursor: pointer;
  transition: var(--transition-fast);
  border-bottom: 1px solid rgba(255,255,255,0.04);
  border-left: 2px solid transparent;
  min-height: 40px;
  position: relative;
}

.tc-item-clickable:last-child { border-bottom: none; }

.tc-item-clickable:hover {
  background: var(--glass-bg-hover);
  border-left-color: rgba(167, 139, 250, 0.3);
}

.tc-item-clickable.active {
  background: var(--glass-bg-active);
  border-left-color: var(--primary);
}

.tc-bullet {
  font-size: 16px;
  color: var(--text-muted);
  flex-shrink: 0;
  margin-top: 1px;
  transition: color 0.15s ease;
}

.tc-item-clickable.active .tc-bullet,
.tc-item-clickable:hover .tc-bullet {
  color: var(--text-accent);
}

.tc-item-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.tc-item-text {
  flex: 1;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
  word-break: break-word;
}

.tc-item-clickable.active .tc-item-text {
  color: var(--text-primary);
}

.tc-remove-btn {
  flex-shrink: 0;
  opacity: 0;
  background: transparent;
  border: none;
  color: rgba(252, 165, 165, 0.8);
  width: 24px;
  height: 24px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition-fast);
  margin-top: 1px;
}

.tc-item-clickable:hover .tc-remove-btn { opacity: 1; }
.tc-remove-btn:hover { background: rgba(220, 38, 38, 0.2); color: #fca5a5; }
.tc-remove-btn:focus-visible { opacity: 1; outline: 2px solid #fca5a5; outline-offset: 2px; }

/* TC group in list panel */
.tc-group-flat { }

.tc-group-flat .tc-group-header {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: 8px 10px 6px 14px;
  background: rgba(153, 15, 250, 0.06);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  position: sticky;
  top: 0;
  z-index: 1;
}

/* ── Notes Section — inline editable ──────────────────────────────────────── */
.uc-right-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 260px;
  min-height: 0;
  gap: 0;
}

.uc-tb-resizer {
  height: 10px;
  flex-shrink: 0;
  cursor: row-resize;
  position: relative;
  z-index: 2;
}

.uc-tb-resizer::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  top: 50%; transform: translateY(-50%);
  height: 3px;
  border-radius: 2px;
  background: var(--glass-border);
  transition: background 0.15s ease;
}

.uc-tb-resizer:hover::after,
.uc-tb-resizer.dragging::after {
  background: var(--primary);
}

.uc-notes-panel {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  min-height: 90px;
  overflow: hidden;
}

.uc-notes-input {
  width: 100%;
  height: 100%;
  min-height: 90px;
  border: none;
  border-radius: 0;
  background: transparent;
  resize: none;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
  padding: var(--space-3);
}

.notes-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: 0;
  padding: var(--space-2);
  overflow-y: auto;
  flex: 1;
}

/* Each editable note card */
.note-edit-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3) var(--space-1);
  transition: border-color 0.2s ease;
}

.note-edit-card:focus-within {
  border-color: rgba(153, 15, 250, 0.4);
  background: rgba(153, 15, 250, 0.04);
}

.note-card-new {
  border-color: rgba(153, 15, 250, 0.3);
  background: rgba(153, 15, 250, 0.05);
}

/* Top row: title input + delete button */
.note-edit-top {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  margin-bottom: 6px;
}

.note-title-in {
  flex: 1;
  background: transparent;
  border: none;
  border-bottom: 1px solid transparent;
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  padding: 2px 0;
  outline: none;
  transition: border-color 0.15s ease;
  min-height: 28px;
}

.note-title-in::placeholder { color: var(--text-muted); font-weight: 400; }
.note-title-in:focus { border-bottom-color: var(--primary); }

/* Content textarea */
.note-ta {
  width: 100%;
  background: transparent;
  border: none;
  border-radius: 0;
  color: var(--text-secondary);
  font-family: var(--font-primary);
  font-size: 13px;
  line-height: 1.75;
  padding: 0;
  outline: none;
  resize: none;
  overflow: hidden;
  min-height: 60px;
  transition: color 0.15s ease;
  display: block;
}

.note-ta::placeholder { color: var(--text-muted); }
.note-ta:focus { color: var(--text-primary); }

/* Footer: date + save status */
.note-edit-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid rgba(255,255,255,0.05);
}

.note-meta {
  font-size: 11px;
  color: var(--text-muted);
}

.note-status {
  font-size: 11px;
  color: var(--text-accent);
  opacity: 0.8;
}

/* Delete button inside note card */
.note-del-btn {
  flex-shrink: 0;
  color: rgba(252, 165, 165, 0.5);
  transition: var(--transition-fast);
}
.note-del-btn:hover { color: #fca5a5; background: rgba(220, 38, 38, 0.15); }

/* ── Testcase Item Groups ──────────────────────────────────────────────────── */
.tc-group {
  margin-bottom: 6px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.tc-group-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 8px 12px;
  background: rgba(153, 15, 250, 0.08);
  border-bottom: 1px solid var(--glass-border);
}

.tc-group-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tc-item-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  padding: 9px 12px 9px 28px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: var(--transition-fast);
  min-height: 36px;
}

.tc-item-row:last-child { border-bottom: none; }
.tc-item-row:hover { background: var(--glass-bg-hover); }

.tc-item-content {
  flex: 1;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  word-break: break-word;
}

/* Assign modal rows */
.tc-item-assign-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
  min-height: 36px;
}

.tc-item-assign-row:hover:not(.is-assigned) { background: var(--glass-bg-hover); }
.tc-item-assign-row.is-assigned { opacity: 0.5; cursor: default; }

.tc-item-assign-row input[type="checkbox"] {
  margin-top: 3px;
  flex-shrink: 0;
  accent-color: var(--primary);
  width: 15px;
  height: 15px;
  cursor: pointer;
}

.tc-item-assign-content {
  flex: 1;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  word-break: break-word;
}

.badge-assigned {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 2px;
}

/* ── Two-column layout for detail pages ───────────────────────────────────── */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  align-items: start;
}

@media (max-width: 900px) {
  .two-col { grid-template-columns: 1fr; }
  .checklist-layout { grid-template-columns: 1fr; }
  .category-sidebar { position: static; max-height: 250px; }
  .project-3panel { grid-template-columns: 1fr; height: auto; }
}

@media (max-width: 680px) {
  #content { padding: var(--space-2); }
  #topbar { gap: var(--space-2); padding: 0 var(--space-2); }
  .nav-label { display: none; }
  .topbar-right { display: none; }
}

/* ── HTTP Method Badges ─────────────────────────────────────────────────────── */
.method-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  flex-shrink: 0;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  min-width: 52px;
  text-align: center;
}
.method-get    { background: rgba(22,163,74,0.18);  color: #4ade80; border: 1px solid rgba(74,222,128,0.28); }
.method-post   { background: rgba(59,130,246,0.18); color: #60a5fa; border: 1px solid rgba(96,165,250,0.28); }
.method-put    { background: rgba(217,119,6,0.18);  color: #fbbf24; border: 1px solid rgba(251,191,36,0.28); }
.method-delete { background: rgba(220,38,38,0.18);  color: #f87171; border: 1px solid rgba(248,113,113,0.28); }
.method-patch  { background: rgba(168,85,247,0.18); color: #c084fc; border: 1px solid rgba(192,132,252,0.28); }
.method-options,.method-head { background: rgba(100,116,139,0.18); color: #94a3b8; border: 1px solid rgba(148,163,184,0.28); }

/* ── Project 3-Panel Layout ─────────────────────────────────────────────────── */
.project-3panel {
  display: flex;
  align-items: stretch;
  height: calc(100vh - 160px);
  min-height: 480px;
  gap: 0;
}

/* Left: API list */
.proj-api-panel {
  display: flex;
  flex-direction: column;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  width: 50%;
  min-width: 180px;
  flex-shrink: 0;
}

/* Left/Right drag handle */
.proj-lr-resizer {
  width: 10px;
  flex-shrink: 0;
  cursor: col-resize;
  position: relative;
  z-index: 2;
}
.proj-lr-resizer::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  left: 50%; transform: translateX(-50%);
  width: 3px;
  border-radius: 2px;
  background: var(--glass-border);
  transition: background 0.15s ease;
}
.proj-lr-resizer:hover::after,
.proj-lr-resizer.dragging::after { background: var(--primary); }

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px var(--space-3);
  border-bottom: 1px solid var(--glass-border);
  flex-shrink: 0;
  background: rgba(255,255,255,0.03);
  gap: 8px;
}

.api-scroll {
  flex: 1;
  overflow-y: auto;
}

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

/* API list item */
.api-item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 3px;
  padding: 7px var(--space-3);
  cursor: pointer;
  transition: var(--transition-fast);
  border-bottom: 1px solid rgba(255,255,255,0.04);
  border-left: 3px solid transparent;
  min-height: 46px;
}
.api-item:last-child { border-bottom: none; }
.api-item:hover { background: var(--glass-bg-hover); border-left-color: rgba(167,139,250,0.3); }
.api-item.active { background: var(--glass-bg-active); border-left-color: var(--primary); }

.api-item-main {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.api-url {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.api-item.active .api-url { color: var(--text-primary); }

.api-note {
  font-size: 11px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.api-item-actions {
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.15s ease;
  flex-shrink: 0;
}
.api-item:hover .api-item-actions { opacity: 1; }

/* Right panel: split top/bottom */
.proj-right-panel {
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1;
  min-width: 200px;
  min-height: 0;
}

/* Top/Bottom drag handle */
.proj-tb-resizer {
  height: 10px;
  flex-shrink: 0;
  cursor: row-resize;
  position: relative;
  z-index: 2;
}
.proj-tb-resizer::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  top: 50%; transform: translateY(-50%);
  height: 3px;
  border-radius: 2px;
  background: var(--glass-border);
  transition: background 0.15s ease;
}
.proj-tb-resizer:hover::after,
.proj-tb-resizer.dragging::after { background: var(--primary); }

/* Top-right: usecase/testcase list */
.proj-tc-list-panel {
  display: flex;
  flex-direction: column;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  height: 50%;
  min-height: 100px;
  flex-shrink: 0;
}

.proj-tc-scroll {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}
.proj-tc-scroll::-webkit-scrollbar { width: 4px; }
.proj-tc-scroll::-webkit-scrollbar-track { background: transparent; }
.proj-tc-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 999px; }

/* Bottom-right: testcase detail */
.proj-tc-detail-panel {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  transition: border-color 0.3s ease;
}
.proj-tc-detail-panel.has-content { border-color: rgba(167,139,250,0.28); }
.proj-tc-detail-panel::-webkit-scrollbar { width: 4px; }
.proj-tc-detail-panel::-webkit-scrollbar-track { background: transparent; }
.proj-tc-detail-panel::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 999px; }

/* TC group header inside proj-tc-scroll */
.tc-group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  position: sticky;
  top: 0;
  z-index: 1;
}

.tc-group-icon { font-size: 12px; color: var(--text-muted); flex-shrink: 0; }

.tc-group-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-accent);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tc-group-remove {
  opacity: 0;
  flex-shrink: 0;
}
.tc-group-header:hover .tc-group-remove { opacity: 1; }

/* Checkbox */
.tc-check {
  appearance: none;
  -webkit-appearance: none;
  width: 15px;
  height: 15px;
  border: 1.5px solid rgba(255,255,255,0.22);
  border-radius: 3px;
  flex-shrink: 0;
  cursor: pointer;
  background: transparent;
  transition: border-color 0.15s ease, background 0.15s ease;
  position: relative;
}
.tc-check:hover { border-color: var(--primary); }
.tc-check:checked { background: var(--primary); border-color: var(--primary); }
.tc-check:checked::after {
  content: "";
  position: absolute;
  left: 4px; top: 1px;
  width: 4px; height: 8px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}
.tc-check:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.tc-item-clickable.tc-checked .tc-item-text {
  color: var(--text-muted);
  text-decoration: line-through;
  text-decoration-color: rgba(255,255,255,0.18);
}

/* Progress bar in panel header */
.tc-progress-bar {
  height: 3px;
  background: rgba(255,255,255,0.08);
  border-radius: 999px;
  overflow: hidden;
  flex: 1;
  min-width: 40px;
  max-width: 80px;
}
.tc-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 999px;
  transition: width 0.3s ease;
}

/* ── Vulnerability Workspace ───────────────────────────────────────────────── */
.vuln-workspace {
  display: flex;
  gap: 0;
  height: calc(100vh - var(--topbar-height) - var(--space-4) * 2 - 72px);
  min-height: 400px;
  overflow: hidden;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.project-list-workspace {
  display: flex;
  flex-direction: row;
  gap: 0;
  height: 100%;
}

.project-list-panel-only {
  flex: 1 1 50%;
  max-width: 50%;
  width: auto;
  min-width: 0;
  border-right: 1px solid var(--glass-border);
}

.project-list-panel-only .vuln-list-scroll {
  max-height: none;
  min-height: 220px;
  height: 100%;
}

.proj-list-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.project-info-tab {
  min-height: 320px;
  flex: 1 1 50%;
  max-width: 50%;
  width: auto;
  min-width: 0;
  overflow-y: auto;
  padding: var(--space-3);
}

.vuln-list-panel {
  width: 300px;
  min-width: 220px;
  max-width: 50%;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--glass-border);
  flex-shrink: 0;
}

.vuln-list-scroll {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-1) 0;
}
.vuln-list-scroll::-webkit-scrollbar { width: 4px; }
.vuln-list-scroll::-webkit-scrollbar-track { background: transparent; }
.vuln-list-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 999px; }

.vuln-list-item {
  padding: 10px var(--space-3);
  cursor: pointer;
  border-left: 3px solid transparent;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background 0.15s ease, border-color 0.15s ease;
}
.vuln-list-item:last-child { border-bottom: none; }
.vuln-list-item:hover { background: var(--glass-bg-hover); border-left-color: rgba(167,139,250,0.4); }
.vuln-list-item.active { background: var(--glass-bg-active); border-left-color: var(--primary); }

.vuln-resizer {
  width: 6px;
  cursor: col-resize;
  background: transparent;
  flex-shrink: 0;
  position: relative;
  transition: background 0.15s ease;
}
.vuln-resizer::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 2px;
  height: 48px;
  border-radius: 2px;
  background: var(--glass-border);
  transition: background 0.15s ease;
}
.vuln-resizer:hover::after,
.vuln-resizer.dragging::after { background: var(--primary); }

.vuln-detail-panel {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding: var(--space-3);
}
.vuln-detail-panel::-webkit-scrollbar { width: 4px; }
.vuln-detail-panel::-webkit-scrollbar-track { background: transparent; }
.vuln-detail-panel::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 999px; }

.proj-empty-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  text-align: center;
}

.vuln-step-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: var(--space-2) var(--space-3);
  margin-top: var(--space-2);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.vuln-api-chooser {
  max-height: 180px;
  overflow-y: auto;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: var(--space-1) var(--space-2);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.vuln-api-chooser::-webkit-scrollbar { width: 4px; }
.vuln-api-chooser::-webkit-scrollbar-track { background: transparent; }
.vuln-api-chooser::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 999px; }

/* Severity color chips */
.sev-none    { color: var(--text-muted); }
.sev-low     { color: #60a5fa; }
.sev-medium  { color: #fbbf24; }
.sev-high    { color: #f97316; }
.sev-critical{ color: #f43f5e; }

/* ── CVSS Calculator ───────────────────────────────────────────────────────── */
.form-section-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-accent);
  margin: 12px 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--glass-border);
}

.cvss-calculator {
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.cvss-result-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--glass-border);
}

.cvss-score-num {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
  font-family: var(--font-heading);
  transition: color 0.2s ease;
}

.cvss-vector-str {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  word-break: break-all;
  flex: 1;
  min-width: 0;
  text-align: left;
  line-height: 1.5;
}

.cvss-metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.cvss-col:first-child {
  border-right: 1px solid var(--glass-border);
}

.cvss-metric-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px var(--space-2);
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.cvss-metric-row:last-child { border-bottom: none; }

.cvss-metric-label {
  font-size: 11px;
  color: var(--text-secondary);
  width: 150px;
  flex-shrink: 0;
  white-space: nowrap;
}

.cvss-options {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.cvss-opt-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  border-radius: 4px;
  padding: 3px 9px;
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}
.cvss-opt-btn:hover:not(:disabled) {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.25);
  color: var(--text-primary);
}
.cvss-opt-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
}
.cvss-opt-btn:disabled { opacity: 0.5; cursor: default; }

/* ── Vuln API Picker ────────────────────────────────────────────────────────── */
.vuln-api-picker-wrap {
  position: static;
}

.vuln-api-dropdown {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--glass-border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  padding: var(--space-2);
  max-height: 240px;
  gap: 4px;
  margin-bottom: 8px;
}
.vuln-api-dropdown:not([hidden]) {
  display: flex;
  flex-direction: column;
}

.vuln-api-list {
  overflow-y: auto;
  flex: 1;
}
.vuln-api-list::-webkit-scrollbar { width: 4px; }
.vuln-api-list::-webkit-scrollbar-track { background: transparent; }
.vuln-api-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 999px; }

.api-pick-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.12s ease;
  border: 1px solid transparent;
}
.api-pick-item:hover { background: var(--glass-bg-hover); }
.api-pick-item.selected {
  background: rgba(153,15,250,0.1);
  border-color: rgba(153,15,250,0.3);
}

.api-pick-check {
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  width: 16px;
  text-align: center;
  flex-shrink: 0;
}

.selected-apis-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 6px;
}

.selected-api-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.selected-api-header {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 8px;
  cursor: pointer;
  user-select: none;
  transition: background 0.12s ease;
}
.selected-api-header:hover { background: rgba(255,255,255,0.05); }

.selected-api-card:has(.api-params-section:not([hidden])) .selected-api-header {
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.api-card-url {
  font-size: 11px;
  flex-shrink: 1;
  min-width: 60px;
  max-width: 40%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-secondary);
}

.api-param-count {
  font-size: 10px;
  color: var(--primary);
  background: rgba(153,15,250,0.12);
  border: 1px solid rgba(153,15,250,0.25);
  border-radius: 10px;
  padding: 0px 6px;
  flex-shrink: 0;
  white-space: nowrap;
}

.api-param-tags {
  display: flex;
  gap: 3px;
  overflow: hidden;
  flex: 1;
  min-width: 0;
}

.api-param-tag {
  font-size: 9px;
  color: var(--text-muted);
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 3px;
  padding: 1px 5px;
  white-space: nowrap;
  flex-shrink: 0;
}

.api-card-arrow {
  font-size: 10px;
  color: var(--text-muted);
  flex-shrink: 0;
  width: 12px;
  text-align: center;
}

.api-params-section {
  padding: 8px 10px;
  flex-direction: column;
  gap: 4px;
}
.api-params-section:not([hidden]) { display: flex; }

.api-param-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── Markdown render ────────────────────────────────────────────────────────── */
.md-h { font-weight: 700; color: var(--text-primary); margin: 10px 0 4px; line-height: 1.4; }
h2.md-h { font-size: 15px; } h3.md-h { font-size: 13px; } h4.md-h { font-size: 12px; }
.md-p { margin: 0 0 8px; font-size: 13px; color: var(--text-secondary); line-height: 1.7; white-space: normal; }
.md-p:last-child { margin-bottom: 0; }
.md-ul { list-style: disc; margin: 4px 0 8px 20px; padding: 0; font-size: 13px; color: var(--text-secondary); line-height: 1.7; }
.md-code { font-family: var(--font-mono); font-size: 11px; background: rgba(255,255,255,0.08); border-radius: 3px; padding: 1px 5px; color: var(--text-accent); }

/* ── Viewer vulnerability detail ────────────────────────────────────────────── */
.viewer-vuln-section {
  margin-bottom: 20px;
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.viewer-section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-primary);
  padding: 9px 14px;
  background: rgba(167,139,250,0.10);
  border-bottom: 1px solid rgba(167,139,250,0.18);
  border-left: 3px solid var(--text-accent);
}
.viewer-section-label::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-accent);
  flex-shrink: 0;
}
.viewer-section-body {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.75;
  padding: 12px 14px;
}
.viewer-step-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-sm);
  padding: var(--space-2);
  margin: 0 14px 10px;
}
.viewer-step-card:first-of-type {
  margin-top: 10px;
}
.viewer-step-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-accent);
  margin-bottom: 6px;
  letter-spacing: 0.05em;
}

/* Section accent colours per topic */
.viewer-vuln-section[data-section="desc"] .viewer-section-label   { border-left-color: #60a5fa; background: rgba(96,165,250,0.08);  border-bottom-color: rgba(96,165,250,0.18);  }
.viewer-vuln-section[data-section="desc"] .viewer-section-label::before   { background: #60a5fa; }
.viewer-vuln-section[data-section="impact"] .viewer-section-label { border-left-color: #f97316; background: rgba(249,115,22,0.08);  border-bottom-color: rgba(249,115,22,0.18);  }
.viewer-vuln-section[data-section="impact"] .viewer-section-label::before { background: #f97316; }
.viewer-vuln-section[data-section="rec"] .viewer-section-label    { border-left-color: #34d399; background: rgba(52,211,153,0.08);  border-bottom-color: rgba(52,211,153,0.18);  }
.viewer-vuln-section[data-section="rec"] .viewer-section-label::before    { background: #34d399; }
.viewer-vuln-section[data-section="api"] .viewer-section-label    { border-left-color: #38bdf8; background: rgba(56,189,248,0.08);  border-bottom-color: rgba(56,189,248,0.18);  }
.viewer-vuln-section[data-section="api"] .viewer-section-label::before    { background: #38bdf8; }
.viewer-vuln-section[data-section="scenario"] .viewer-section-label { border-left-color: #f43f5e; background: rgba(244,63,94,0.08); border-bottom-color: rgba(244,63,94,0.18);   }
.viewer-vuln-section[data-section="scenario"] .viewer-section-label::before { background: #f43f5e; }
.viewer-vuln-section[data-section="ref"] .viewer-section-label    { border-left-color: #a78bfa; background: rgba(167,139,250,0.08); border-bottom-color: rgba(167,139,250,0.18); }
.viewer-vuln-section[data-section="ref"] .viewer-section-label::before    { background: #a78bfa; }

/* ── Vuln export buttons ────────────────────────────────────────────────────── */
.vuln-export-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.btn-export-fmt {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(167,139,250,0.35);
  background: rgba(167,139,250,0.08);
  color: var(--text-accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
}
.btn-export-fmt:hover {
  background: rgba(167,139,250,0.2);
  border-color: rgba(167,139,250,0.6);
  color: #fff;
}

/* ── is_public toggle ───────────────────────────────────────────────────────── */
.toggle-check {
  width: 32px;
  height: 18px;
  appearance: none;
  -webkit-appearance: none;
  background: rgba(255,255,255,0.12);
  border-radius: 999px;
  cursor: pointer;
  position: relative;
  transition: background 0.2s ease;
  flex-shrink: 0;
}
.toggle-check:checked { background: var(--primary); }
.toggle-check::after {
  content: "";
  position: absolute;
  width: 12px; height: 12px;
  background: white;
  border-radius: 50%;
  top: 3px; left: 3px;
  transition: transform 0.2s ease;
}
.toggle-check:checked::after { transform: translateX(14px); }

/* ── Scrollbar ─────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.22); }

/* ── Ant Theme Override ─────────────────────────────────────────────────────── */
:root {
  --primary: #1677ff;
  --secondary: #8B5CF6;
  --success: #16A34A;
  --warning: #D97706;
  --danger: #DC2626;

  --surface: #FFFFFF;
  --surface-soft: #FAFAFA;
  --surface-muted: #F5F5F5;
  --text-primary: #111827;
  --text-secondary: #4B5563;
  --text-muted: #6B7280;
  --text-accent: #1677ff;

  --paper-border: #D9D9D9;
  --paper-shadow: 0 6px 20px rgba(15, 23, 42, 0.08);
  --paper-shadow-soft: 0 2px 10px rgba(15, 23, 42, 0.06);

  --font-primary: "Plus Jakarta Sans", "Segoe UI", Arial, sans-serif;
  --font-display: "Plus Jakarta Sans", "Segoe UI", Arial, sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", monospace;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 12px;
  --transition: all 0.2s ease;
  --transition-fast: all 0.12s ease;
}

body {
  background: #F5F7FB;
  color: var(--text-primary);
  font-family: var(--font-primary);
}

a { color: inherit; }

#topbar {
  height: 64px;
  background: #ffffff;
  border-bottom: 1px solid var(--paper-border);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.logo-icon,
.logo-text,
.login-title {
  color: var(--primary);
  background: none;
  -webkit-text-fill-color: unset;
}

.logo-text,
.page-title,
.detail-title,
.stat-value {
  font-family: var(--font-display);
  letter-spacing: 0;
}

.version-tag,
.page-subtitle,
.empty-sub,
.item-card-meta,
.login-subtitle {
  color: var(--text-muted);
}

.nav-link {
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
}

.nav-link:hover {
  background: #f0f5ff;
  border-color: #d6e4ff;
  color: var(--primary);
}

.nav-link.active {
  background: #e6f4ff;
  border-color: #91caff;
  color: var(--primary);
}

#content { padding: 24px; }

.card,
.item-card,
.checklist-item,
.uc-tc-list-panel,
.uc-tc-detail-panel,
.proj-right-panel,
.proj-tc-list-panel,
.proj-tc-detail-panel,
.vuln-list-panel,
.vuln-detail-panel,
.note-card-new,
.note-edit-card,
.modal-box,
.login-box,
.viewer-vuln-item,
.viewer-vuln-section,
.cvss-grid,
.vuln-form,
.project-workspace,
.usecase-workspace {
  background: var(--surface);
  border: 1px solid var(--paper-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--paper-shadow-soft);
}

.section-header,
.panel-header,
.detail-header,
.uc-tc-list-header,
.tc-detail-cl-header,
.selected-api-header {
  border-bottom: 1px solid #f0f0f0;
  background: #fafafa;
}

.category-sidebar,
.category-list,
.checklist-list,
.item-list,
.uc-tc-scroll,
.proj-tc-scroll,
.vuln-list-scroll {
  background: transparent;
}

.category-item,
.proj-list-item,
.vuln-list-item,
.tc-item-clickable,
.item-card,
.viewer-vuln-item {
  border: 1px solid var(--paper-border);
  background: var(--surface);
  border-radius: var(--radius-md);
  transition: var(--transition-fast);
}

.category-item:hover,
.proj-list-item:hover,
.vuln-list-item:hover,
.tc-item-clickable:hover,
.item-card:hover {
  border-color: #91caff;
  box-shadow: 0 2px 8px rgba(22, 119, 255, 0.12);
}

.category-item.active,
.proj-list-item.active,
.vuln-list-item.active,
.tc-item-clickable.active {
  background: #e6f4ff;
  border-color: #69b1ff;
  color: #0958d9;
}

.btn-primary,
.btn-secondary,
.btn-danger,
.btn-icon,
.btn-export-fmt {
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  box-shadow: none;
  font-weight: 600;
  transition: var(--transition-fast);
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.btn-primary:hover {
  background: #4096ff;
  border-color: #4096ff;
}

.btn-primary:active {
  background: #0958d9;
  border-color: #0958d9;
}

.btn-secondary,
.btn-icon,
.btn-export-fmt {
  background: #ffffff;
  color: var(--text-primary);
  border-color: var(--paper-border);
}

.btn-secondary:hover,
.btn-icon:hover,
.btn-export-fmt:hover {
  color: var(--primary);
  border-color: #91caff;
  background: #f0f5ff;
}

.btn-danger {
  background: #fff2f0;
  color: #cf1322;
  border-color: #ffccc7;
}

.btn-danger:hover {
  background: #ffebe6;
  border-color: #ff7875;
}

.btn-primary:disabled,
.btn-secondary:disabled,
.btn-danger:disabled,
.btn-icon:disabled,
.btn-export-fmt:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.form-input,
.form-textarea,
.form-select,
input[type="text"],
input[type="password"],
input[type="number"],
textarea,
select {
  background: #ffffff;
  color: var(--text-primary);
  border: 1px solid var(--paper-border);
  border-radius: var(--radius-sm);
  box-shadow: none;
}

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236B7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

.form-select option {
  background: #ffffff;
  color: var(--text-primary);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus,
input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
  background: #ffffff;
  border-color: #4096ff;
  box-shadow: 0 0 0 2px rgba(22, 119, 255, 0.15);
}

.form-input::placeholder,
.form-textarea::placeholder,
input::placeholder,
textarea::placeholder {
  color: #9ca3af;
}

.checklist-id,
.badge-count,
.badge-cwe,
.method-badge,
.role-badge {
  border: 1px solid #d9d9d9;
  background: #fafafa;
  color: var(--text-secondary);
}

.role-badge.role-admin {
  background: #e6f4ff;
  color: #0958d9;
  border-color: #91caff;
}

.role-badge.role-pentester {
  background: #f6ffed;
  color: #389e0d;
  border-color: #b7eb8f;
}

.role-badge.role-reviewer {
  background: #fffbe6;
  color: #d48806;
  border-color: #ffe58f;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--paper-border);
  box-shadow: var(--paper-shadow-soft);
}

.stat-value {
  font-size: 32px;
  color: var(--primary);
}

.stat-label { font-size: 14px; color: var(--text-muted); }

table,
.user-table {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--paper-border);
  border-collapse: collapse;
  border-radius: var(--radius-md);
  overflow: hidden;
}

th, td {
  border-bottom: 1px solid #f0f0f0;
  color: var(--text-primary);
}

th {
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--text-secondary);
  background: #fafafa;
  text-transform: uppercase;
}

tr:hover td { background: #fafcff; }

.modal-overlay {
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(1px);
}

.modal-box { border-radius: 12px; }

.toast {
  background: #1f1f1f;
  color: #ffffff;
  border: 1px solid #1f1f1f;
  box-shadow: var(--paper-shadow);
}

.login-overlay {
  background: linear-gradient(180deg, #f7f9fc 0%, #edf2fa 100%);
}

.login-box {
  box-shadow: var(--paper-shadow);
}

.toggle-check {
  background: #f0f0f0;
  border: 1px solid #d9d9d9;
}

.toggle-check:checked { background: var(--primary); }

:focus-visible {
  outline: 2px solid #1677ff;
  outline-offset: 2px;
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb {
  background: #c9d3e2;
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover { background: #aab8cc; }

.viewer-project-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.viewer-project-card-info {
  flex: 1;
  min-width: 0;
}

.viewer-project-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.viewer-project-empty-text {
  font-size: 11px;
  color: var(--text-muted);
}

.viewer-project-severity-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.viewer-project-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.viewer-project-arrow {
  font-size: 16px;
  color: var(--text-muted);
}

.viewer-vuln-list-header {
  padding: 10px var(--space-2);
  border-bottom: 1px solid #f0f0f0;
  flex-shrink: 0;
  background: #fafafa;
}

.viewer-back-btn { margin-bottom: 8px; }

.viewer-project-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.viewer-vuln-list-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
  gap: 8px;
}

.viewer-vuln-count {
  font-size: 11px;
  color: var(--text-muted);
}

.viewer-vuln-item {
  gap: 6px;
  margin: 6px;
  border-radius: var(--radius-sm);
}

.viewer-vuln-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.viewer-vuln-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.viewer-vuln-meta {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
}

.viewer-vuln-item.active {
  border-color: #69b1ff;
  background: #e6f4ff;
  box-shadow: 0 2px 10px rgba(22, 119, 255, 0.14);
}

.viewer-vuln-item:focus-visible,
.viewer-project-card:focus-visible {
  outline: 2px solid #1677ff;
  outline-offset: 2px;
}

#viewer-vuln-detail {
  padding: 0;
  overflow: hidden;
}

.viewer-vuln-detail-content {
  padding: var(--space-3);
  height: 100%;
  overflow-y: auto;
  box-sizing: border-box;
}

.viewer-vuln-hero {
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid #f0f0f0;
}

.viewer-vuln-chip-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.viewer-vuln-title-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
}

.viewer-vuln-detail-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  flex: 1;
}

.viewer-vuln-ref-id {
  font-size: 11px;
  color: #1677ff;
  background: #f0f5ff;
  border: 1px solid #d6e4ff;
  padding: 2px 8px;
  border-radius: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

.viewer-vuln-score-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.viewer-vuln-score-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.viewer-vuln-score {
  font-size: 22px;
  font-weight: 700;
}

.viewer-vuln-score-label {
  font-size: 11px;
  color: var(--text-muted);
}

.viewer-vuln-vector {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  word-break: break-all;
}

.viewer-severity-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid transparent;
}

.viewer-severity-chip-sm {
  padding: 1px 6px;
  font-size: 9px;
}

.viewer-api-list {
  padding: 10px 14px;
}

.viewer-api-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 0;
  border-bottom: 1px solid #f0f0f0;
  flex-wrap: wrap;
}

.viewer-api-row:last-child { border-bottom: 0; }

.viewer-method-badge {
  font-size: 10px;
  padding: 1px 6px;
  flex-shrink: 0;
}

.viewer-api-url {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.viewer-api-param-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: #fafafa;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  padding: 1px 6px;
  font-size: 10px;
  white-space: nowrap;
}

.viewer-api-param-type { color: var(--text-muted); }
.viewer-api-param-name { color: #1677ff; font-weight: 600; }
.viewer-api-param-value { color: var(--text-secondary); }
.viewer-api-status {
  display: inline-flex;
  align-items: center;
}

.viewer-step-description {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.viewer-step-image {
  max-width: 100%;
  border-radius: 8px;
  border: 1px solid #d9d9d9;
  margin-top: 8px;
}

.md-code {
  background: #f5f5f5;
  color: #1677ff;
  border: 1px solid #e5e7eb;
}

.viewer-vuln-section {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  margin-bottom: 18px;
}

.viewer-section-label {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0;
  color: var(--text-primary);
  padding: 0 0 8px;
  border: 0;
  border-bottom: 1px solid #f0f0f0;
  background: transparent;
  text-transform: none;
}

.viewer-section-label::before {
  display: none;
}

.viewer-vuln-section[data-section] .viewer-section-label {
  border-left: 0;
  border-bottom-color: #f0f0f0;
  background: transparent;
}

.viewer-vuln-section .viewer-section-body {
  padding: 10px 0 0;
}

@media (max-width: 900px) {
  #topbar {
    height: auto;
    min-height: 56px;
    padding: 8px 12px;
  }
  .nav-list {
    flex-wrap: wrap;
    gap: 6px;
  }
  #content { padding: 12px; }
  .stat-value { font-size: 24px; }
}
