/* ==========================================================================
   PentestIQ — Application Stylesheet
   Crisp Modern Light Design System
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design Tokens
   -------------------------------------------------------------------------- */

:root {
  /* Fonts */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Menlo', 'Monaco', 'Consolas', monospace;

  /* Surfaces */
  --surface-canvas: #F8F9FB;
  --surface-sidebar: #F3F5F8;
  --surface-card: #FFFFFF;
  --surface-subtle: #F8FAFC;
  --surface-hover: #F1F5F9;
  --surface-topbar: rgba(255, 255, 255, 0.86);

  /* Borders */
  --border-subtle: rgba(15, 23, 42, 0.08);
  --border-default: rgba(15, 23, 42, 0.12);
  --border-strong: rgba(15, 23, 42, 0.2);

  /* Text */
  --ink-primary: #0F172A;
  --ink-secondary: #475569;
  --ink-muted: #64748B;
  --ink-faint: #94A3B8;

  /* Brand */
  --brand-primary: #1250FB;
  --brand-hover: #0E43D8;
  --brand-soft: rgba(18, 80, 251, 0.08);
  --brand-border: rgba(18, 80, 251, 0.28);
  --brand-ring: 0 0 0 3px rgba(18, 80, 251, 0.15);

  /* Severity (aligned with PentestIQ brand palette in PDF & emails) */
  --sev-critical: #9B0100;
  --sev-critical-soft: #FEF2F2;
  --sev-critical-border: rgba(155, 1, 0, 0.2);
  --sev-high: #CC0000;
  --sev-high-soft: #FFF1F2;
  --sev-high-border: rgba(204, 0, 0, 0.2);
  --sev-medium: #FF9902;
  --sev-medium-text: #B45309;
  --sev-medium-soft: #FFFBEB;
  --sev-medium-border: rgba(217, 119, 6, 0.24);
  --sev-low: #94A3B8;
  --sev-low-text: #475569;
  --sev-low-soft: #F1F5F9;
  --sev-low-border: rgba(100, 116, 139, 0.22);
  --sev-info: #CBD5E1;
  --sev-info-text: #64748B;
  --sev-info-soft: #F8FAFC;
  --sev-info-border: rgba(148, 163, 184, 0.24);

  /* Semantic status */
  --status-success-bg: #ECFDF5;
  --status-success-text: #047857;
  --status-success-dot: #10B981;
  --status-warn-bg: #FFFBEB;
  --status-warn-text: #B45309;
  --status-warn-dot: #F59E0B;
  --status-danger-bg: #FEF2F2;
  --status-danger-text: #B91C1C;
  --status-danger-dot: #EF4444;

  /* Radii & Elevation */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 14px;
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 2px 6px rgba(15, 23, 42, 0.05), 0 1px 2px rgba(15, 23, 42, 0.03);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08), 0 2px 6px rgba(15, 23, 42, 0.04);
  --shadow-modal: 0 24px 64px rgba(15, 23, 42, 0.18), 0 4px 16px rgba(15, 23, 42, 0.08);
}

/* --------------------------------------------------------------------------
   2. Reset & Base Typography
   -------------------------------------------------------------------------- */

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

body {
  font-family: var(--font-sans);
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
  color: var(--ink-primary);
  background: var(--surface-canvas);
  min-height: 100vh;
}

.tabular-nums {
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   3. Shell: Sidebar, Topbar & Workspace Switcher
   -------------------------------------------------------------------------- */

.sidebar-layout {
  display: flex;
  min-height: 100vh;
  --sidebar-width: 240px;
}

.sidebar-layout.sidebar-collapsed {
  --sidebar-width: 64px;
}

.sidebar {
  width: var(--sidebar-width);
  background: var(--surface-sidebar);
  color: var(--ink-primary);
  display: flex;
  flex-direction: column;
  transition: width 0.25s ease, transform 0.25s ease;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 1000;
  border-right: 1px solid var(--border-subtle);
}

.sidebar-header {
  height: 56px;
  padding: 0 14px 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
  transition: opacity 0.15s ease;
}

.logo-link:hover {
  opacity: 0.85;
}

.logo-image {
  width: auto;
  height: 21px;
  object-fit: cover;
  object-position: left center;
  transition: width 0.25s ease, height 0.25s ease;
}

.sidebar.collapsed .logo-image {
  width: 26px;
  height: 26px;
  max-width: 26px;
  object-fit: cover;
  object-position: left center;
}

.sidebar-toggle {
  background: none;
  border: none;
  color: var(--ink-faint);
  cursor: pointer;
  padding: 0;
  border-radius: var(--radius-sm);
  transition: background-color 0.15s ease, color 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
}

.sidebar-toggle:hover {
  background: rgba(15, 23, 42, 0.06);
  color: var(--ink-primary);
}

.toggle-icon {
  width: 8px;
  height: 16px;
  transition: transform 0.2s ease;
}

.sidebar.collapsed .sidebar-toggle {
  margin-left: 10px;
}

.sidebar.collapsed .toggle-icon {
  transform: rotate(180deg);
}

/* Sidebar Navigation */
.sidebar-nav {
  flex: 1;
  padding: 14px 0;
  overflow-y: auto;
}

.nav-section-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 16px 8px;
}

.sidebar.collapsed .nav-section-label {
  display: none;
}

.nav-list {
  list-style: none;
  padding: 0 10px;
}

.nav-item {
  margin-bottom: 2px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  color: var(--ink-secondary);
  text-decoration: none;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-size: 13.5px;
  font-weight: 500;
  position: relative;
  transition: background-color 0.14s ease, color 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}

.nav-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--ink-secondary);
  opacity: 0.65;
  transition: opacity 0.14s ease;
}

.nav-link:hover {
  background: rgba(15, 23, 42, 0.045);
  color: var(--ink-primary);
}

.nav-link:hover .nav-icon {
  opacity: 0.9;
}

.nav-link.active {
  background: var(--surface-card);
  color: var(--ink-primary);
  font-weight: 600;
  border-color: var(--border-subtle);
  box-shadow: var(--shadow-xs);
}

.nav-link.active .nav-icon {
  color: var(--ink-primary);
  opacity: 1;
}

.nav-text {
  transition: opacity 0.25s ease;
  white-space: nowrap;
}

.sidebar.collapsed .nav-text {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

/* Sidebar Footer & Profile Popover */
.sidebar-footer {
  position: relative;
  padding: 10px;
  border-top: 1px solid var(--border-subtle);
}

.user-menu-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: left;
  font-family: var(--font-sans);
  transition: background-color 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}

.user-menu-trigger:hover {
  background: rgba(15, 23, 42, 0.045);
}

.user-menu-trigger.open {
  background: var(--surface-card);
  border-color: var(--border-subtle);
  box-shadow: var(--shadow-xs);
}

.user-menu-trigger:focus-visible {
  outline: none;
  box-shadow: var(--brand-ring);
}

.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #1E293B 0%, #334155 100%);
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.user-details {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-primary);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 11.5px;
  color: var(--ink-muted);
  font-weight: 400;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-menu-chevron {
  color: var(--ink-faint);
  flex-shrink: 0;
  transition: color 0.14s ease;
}

.user-menu-trigger:hover .user-menu-chevron,
.user-menu-trigger.open .user-menu-chevron {
  color: var(--ink-secondary);
}

.sidebar.collapsed .user-menu-trigger {
  justify-content: center;
  padding: 6px;
}

.sidebar.collapsed .user-details,
.sidebar.collapsed .user-menu-chevron {
  display: none;
}

.user-popover {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  left: 10px;
  right: 10px;
  min-width: 216px;
  padding: 5px;
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  z-index: 1200;
  animation: modalFadeIn 0.12s ease-out;
}

.user-popover.open {
  display: block;
}

.user-popover-header {
  padding: 7px 10px 8px;
}

.user-popover-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-primary);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-popover-email {
  font-size: 11.5px;
  color: var(--ink-muted);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-popover-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 4px 0;
}

.user-popover-form {
  margin: 0;
  padding: 0;
}

.user-popover-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--ink-secondary);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.12s ease, color 0.12s ease;
}

.user-popover-item svg {
  color: var(--ink-muted);
  flex-shrink: 0;
}

.user-popover-item:hover {
  background: var(--surface-hover);
  color: var(--ink-primary);
}

.user-popover-item:hover svg {
  color: var(--ink-primary);
}

.user-popover-item-danger {
  color: var(--status-danger-text);
}

.user-popover-item-danger svg {
  color: var(--status-danger-text);
}

.user-popover-item-danger:hover {
  background: var(--status-danger-bg);
  color: #991B1B;
}

.user-popover-item-danger:hover svg {
  color: #991B1B;
}

/* Main Wrapper & Topbar */
.main-wrapper {
  flex: 1;
  margin-left: var(--sidebar-width);
  transition: margin-left 0.25s ease;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  height: 56px;
  padding: 0 32px;
  background: var(--surface-topbar);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mobile-sidebar-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  flex-direction: column;
  gap: 3px;
  transition: background-color 0.15s ease;
}

.mobile-sidebar-toggle:hover {
  background: var(--surface-hover);
}

.mobile-sidebar-toggle .hamburger {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--ink-primary);
  border-radius: 1px;
}

.page-title {
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink-primary);
  margin: 0;
}

/* Topbar Workspace Indicator & Org Icons */
.topbar-org {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: var(--radius-md);
  background: transparent;
  border: 1px solid transparent;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-primary);
  letter-spacing: -0.005em;
}

.topbar-org-name {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-org-chevron {
  color: var(--ink-faint);
  flex-shrink: 0;
  transition: color 0.14s ease;
}

.topbar-org-btn {
  cursor: pointer;
  transition: background-color 0.14s ease, border-color 0.14s ease;
}

.topbar-org-btn:hover {
  background: var(--surface-subtle);
  border-color: var(--border-subtle);
}

.topbar-org-btn:hover .topbar-org-chevron {
  color: var(--ink-secondary);
}

.topbar-org-btn:focus-visible {
  outline: none;
  box-shadow: var(--brand-ring);
}

.org-icon {
  position: relative;
  border-radius: 6px;
  background: var(--ink-primary);
  color: #FFFFFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.org-icon-sm {
  width: 22px;
  height: 22px;
  font-size: 11px;
}

.org-icon-md {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  font-size: 12.5px;
}

.org-icon-has-img {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
}

.org-icon-img {
  width: 100%;
  height: 100%;
  padding: 2px;
  object-fit: contain;
  display: block;
}

.org-icon-has-img .org-icon-fallback {
  display: none;
}

.org-icon-fallback {
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1;
}

.page-content {
  flex: 1;
  padding: 28px 32px 48px;
  background: var(--surface-canvas);
}

/* Mobile Sidebar Overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.sidebar-overlay.active {
  display: block;
  opacity: 1;
}

/* --------------------------------------------------------------------------
   4. Flash Toasts & Inline Alerts
   -------------------------------------------------------------------------- */

.alert {
  padding: 12px 14px;
  margin: 14px 0;
  border-radius: var(--radius-md);
  font-size: 13px;
}

.alert-error {
  background: var(--status-danger-bg);
  color: var(--status-danger-text);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.alert-warning {
  background: var(--status-warn-bg);
  color: var(--status-warn-text);
  border: 1px solid rgba(245, 158, 11, 0.28);
}

.alert-info {
  background: var(--brand-soft);
  color: var(--brand-primary);
  border: 1px solid rgba(18, 80, 251, 0.18);
}

.flash-toast-container {
  position: fixed;
  top: 16px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  width: max-content;
  max-width: calc(100vw - 32px);
}

.flash-toast {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 14px 11px 16px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 500;
  pointer-events: auto;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-md);
  animation: flashSlideIn 0.28s ease-out;
}

.flash-toast-success {
  background: var(--status-success-bg);
  color: var(--status-success-text);
  border-color: rgba(16, 185, 129, 0.25);
}

.flash-toast-error {
  background: var(--status-danger-bg);
  color: var(--status-danger-text);
  border-color: rgba(239, 68, 68, 0.25);
}

.flash-toast-message {
  flex: 1;
}

.flash-toast-close {
  background: none;
  border: none;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  color: inherit;
  opacity: 0.55;
  padding: 0 2px;
  transition: opacity 0.14s ease;
}

.flash-toast-close:hover {
  opacity: 1;
}

.flash-toast-hiding {
  animation: flashSlideOut 0.24s ease-in forwards;
}

/* --------------------------------------------------------------------------
   5. Buttons, Dropdowns & iOS Toggle Switch
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 13px;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.005em;
  line-height: 1;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  box-sizing: border-box;
  transition: background-color 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease, transform 0.1s ease, color 0.14s ease;
}

.btn svg,
.btn-icon {
  flex-shrink: 0;
}

.btn-icon {
  width: 15px;
  height: 15px;
}

.btn-primary {
  background: var(--brand-primary);
  color: #FFFFFF;
  border-color: transparent;
  box-shadow: none;
}

.btn-primary:hover {
  background: var(--brand-hover);
  box-shadow: none;
}

.btn-primary:active {
  transform: translateY(0.5px);
}

.btn-outline {
  background: var(--surface-card);
  color: var(--ink-primary);
  border-color: var(--border-default);
  box-shadow: var(--shadow-xs);
}

.btn-outline:hover {
  background: var(--surface-subtle);
  border-color: var(--border-strong);
}

.btn-secondary {
  background: var(--surface-card);
  color: var(--ink-secondary);
  border-color: var(--border-default);
  box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
  background: var(--surface-subtle);
  color: var(--ink-primary);
  border-color: var(--border-strong);
}

.btn-danger {
  background: #DC2626;
  color: #FFFFFF;
  border-color: #DC2626;
}

.btn-danger:hover {
  background: #B91C1C;
  border-color: #B91C1C;
  color: #FFFFFF;
}

.btn-sm {
  height: 30px;
  padding: 0 10px;
  font-size: 12.5px;
  border-radius: 7px;
}

.btn-ball-nav {
  background: var(--surface-card);
  color: var(--ink-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  height: 36px;
  width: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.btn-ball-nav:hover {
  background: var(--surface-subtle);
  border-color: var(--border-strong);
  color: var(--ink-primary);
}

/* Dropdowns */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 1000;
  min-width: 170px;
  margin-top: 4px;
  padding: 4px;
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  display: none;
  list-style: none;
}

.dropdown-menu.show {
  display: block;
}

.dropdown-menu li,
.dropdown-menu li form {
  list-style: none;
  margin: 0;
  padding: 0;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  color: var(--ink-secondary);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  text-align: left;
  cursor: pointer;
  box-sizing: border-box;
  transition: background-color 0.12s ease, color 0.12s ease;
}

.dropdown-item:hover {
  background: var(--surface-hover);
  color: var(--ink-primary);
}

.dropdown-item.text-danger {
  color: #DC2626;
}

.dropdown-item.text-danger:hover {
  background: var(--status-danger-bg);
  color: #B91C1C;
}

/* iOS-style Toggle Switch */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.ios-toggle {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
  flex-shrink: 0;
}

.ios-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.ios-toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #CBD5E1;
  border-radius: 26px;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.ios-toggle-slider::before {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  left: 2px;
  bottom: 2px;
  background: #FFFFFF;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.2);
  transition: transform 0.2s ease;
}

.ios-toggle input:checked + .ios-toggle-slider {
  background-color: var(--brand-primary);
}

.ios-toggle input:focus-visible + .ios-toggle-slider {
  box-shadow: var(--brand-ring);
}

.ios-toggle input:checked + .ios-toggle-slider::before {
  transform: translateX(20px);
}

.auto-scan-options {
  margin-top: 12px;
}

.notification-toggle-row {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

.notification-toggle-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* --------------------------------------------------------------------------
   6. Badges, Pills & Severity System
   -------------------------------------------------------------------------- */

.scan-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.4;
  white-space: nowrap;
}

.scan-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.scan-badge-pending {
  background: var(--status-warn-bg);
  color: var(--status-warn-text);
  border: 1px solid rgba(245, 158, 11, 0.22);
}
.scan-badge-pending::before { background: var(--status-warn-dot); }

.scan-badge-running {
  background: #0F172A;
  color: #FFFFFF;
  border: 1px solid #0F172A;
}
.scan-badge-running::before {
  background: #FFFFFF;
  animation: pulse-dot 1.4s ease-in-out infinite;
}

.scan-badge-completed {
  background: var(--status-success-bg);
  color: var(--status-success-text);
  border: 1px solid rgba(16, 185, 129, 0.22);
}
.scan-badge-completed::before { background: var(--status-success-dot); }

.scan-badge-failed {
  background: var(--status-danger-bg);
  color: var(--status-danger-text);
  border: 1px solid rgba(239, 68, 68, 0.22);
}
.scan-badge-failed::before { background: var(--status-danger-dot); }

.scan-badge-new {
  background: var(--surface-hover);
  color: var(--ink-muted);
  border: 1px solid var(--border-subtle);
}
.scan-badge-new::before { background: var(--ink-faint); }

/* Source pill (Auto / Manual) */
.source-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-muted);
  background: var(--surface-subtle);
  border: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.source-pill-scheduled {
  color: var(--brand-primary);
  background: var(--brand-soft);
  border-color: rgba(18, 80, 251, 0.16);
}

/* Security Score Pill */
.score-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 36px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.score-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.score-pill-green {
  background: var(--status-success-bg);
  color: var(--status-success-text);
  border: 1px solid rgba(16, 185, 129, 0.24);
}
.score-pill-green::before { background: #10B981; }

.score-pill-orange {
  background: var(--status-warn-bg);
  color: var(--status-warn-text);
  border: 1px solid rgba(245, 158, 11, 0.26);
}
.score-pill-orange::before { background: #F59E0B; }

.score-pill-red {
  background: var(--status-danger-bg);
  color: var(--status-danger-text);
  border: 1px solid rgba(239, 68, 68, 0.24);
}
.score-pill-red::before { background: #EF4444; }

.score-pill-na {
  background: var(--surface-hover);
  color: var(--ink-muted);
  border: 1px solid var(--border-subtle);
  font-weight: 500;
}
.score-pill-na::before { background: var(--ink-faint); }

/* Severity Badges (findings rows & modals) */
.severity-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 70px;
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.3;
  text-align: center;
}

.severity-badge.severity-critical { background: #9B0100; color: #FFFFFF; }
.severity-badge.severity-high     { background: #CC0000; color: #FFFFFF; }
.severity-badge.severity-medium   { background: #FF9902; color: #FFFFFF; }
.severity-badge.severity-low      { background: #E2E8F0; color: #334155; }
.severity-badge.severity-info     { background: #F1F5F9; color: #475569; border: 1px solid rgba(15, 23, 42, 0.08); }

/* Severity Text & Bar Fill Utilities */
.severity-critical-text { color: #9B0100; }
.severity-high-text     { color: #CC0000; }
.severity-medium-text   { color: #D97706; }
.severity-low-text      { color: #475569; }
.severity-info-text     { color: #64748B; }

.severity-fill-critical { background: #9B0100; }
.severity-fill-high     { background: #CC0000; }
.severity-fill-medium   { background: #FF9902; }
.severity-fill-low      { background: #94A3B8; }
.severity-fill-info     { background: #CBD5E1; }

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

.severity-dot-critical { background: var(--sev-critical); }
.severity-dot-high     { background: var(--sev-high); }
.severity-dot-medium   { background: var(--sev-medium); }
.severity-dot-low      { background: var(--sev-low); }
.severity-dot-info     { background: var(--sev-info); }

/* --------------------------------------------------------------------------
   7. Shared Page Headers, Breadcrumbs & Empty States
   -------------------------------------------------------------------------- */

.dashboard-container,
.targets-container,
.target-detail,
.scan-detail {
  max-width: 1200px;
  margin: 0;
}

.page-header-row,
.dashboard-header,
.targets-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 24px;
}

.page-header-title-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.page-header-title-line {
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-header-row h1,
.dashboard-header h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--ink-primary);
  margin: 0;
  line-height: 1.25;
}

.dashboard-subtitle,
.targets-subtitle {
  font-size: 13.5px;
  color: var(--ink-muted);
  margin: 0;
  line-height: 1.5;
}

.count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  background: var(--surface-hover);
  color: var(--ink-secondary);
  border: 1px solid var(--border-subtle);
}

.breadcrumb-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--ink-muted);
  margin-bottom: 14px;
}

.breadcrumb-nav a {
  color: var(--ink-muted);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.14s ease;
}

.breadcrumb-nav a:hover {
  color: var(--brand-primary);
}

.breadcrumb-sep {
  color: var(--ink-faint);
}

.breadcrumb-current {
  color: var(--ink-primary);
  font-weight: 500;
}

/* Empty & Onboarding States */
.getting-started-card {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}

.getting-started-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px;
}

.getting-started-copy {
  min-width: 0;
}

.getting-started-card h3 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink-primary);
  margin: 0 0 3px 0;
}

.getting-started-card p {
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-muted);
  margin: 0;
}

.getting-started-cta {
  flex-shrink: 0;
}

.getting-started-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--border-subtle);
  background: var(--surface-subtle);
}

.getting-started-step {
  padding: 18px 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.getting-started-step + .getting-started-step {
  border-left: 1px solid var(--border-subtle);
}

.step-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.step-number {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  background: var(--surface-card);
  color: var(--ink-muted);
  border: 1px solid var(--border-default);
}

.getting-started-step.is-active .step-number {
  background: #0F172A;
  color: #FFFFFF;
  border-color: #0F172A;
}

.getting-started-step.is-complete .step-number {
  background: #ECFDF5;
  color: #059669;
  border-color: rgba(5, 150, 105, 0.22);
}

.step-status {
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-muted);
}

.getting-started-step.is-active .step-status {
  color: var(--brand-primary);
  font-weight: 600;
}

.getting-started-step.is-complete .step-status {
  color: #059669;
}

.step-title {
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink-primary);
}

.getting-started-step.is-complete .step-title {
  color: var(--ink-secondary);
}

.step-desc {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-muted);
}

.empty-state {
  text-align: center;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 52px 28px;
  box-shadow: var(--shadow-xs);
}

.empty-state-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #F1F5F9;
  color: #0F172A;
  border: 1px solid var(--border-subtle);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.empty-state h3 {
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink-primary);
  margin: 0 0 6px 0;
}

.empty-state p {
  font-size: 13.5px;
  color: var(--ink-muted);
  max-width: 420px;
  margin: 0 auto 20px;
}

.empty-state-small {
  text-align: center;
  padding: 28px 20px;
  color: var(--ink-muted);
  font-size: 13px;
}

.empty-state-small p {
  margin: 0;
}

/* --------------------------------------------------------------------------
   8. Dashboard
   -------------------------------------------------------------------------- */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.stats-grid-onboarding {
  opacity: 0.6;
}

.stat-card {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  box-shadow: var(--shadow-xs);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

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

.stat-card-alert {
  border-color: rgba(204, 0, 0, 0.22);
  background: linear-gradient(180deg, #FFFBFB 0%, #FFFFFF 100%);
}

.stat-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.stat-label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-muted);
  letter-spacing: -0.005em;
}

.stat-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon svg {
  width: 16px;
  height: 16px;
}

.stat-icon-targets  { background: #F1F5F9; color: #0F172A; }
.stat-icon-scans    { background: #F1F5F9; color: #0F172A; }
.stat-icon-findings { background: var(--sev-medium-soft); color: var(--sev-medium-text); }
.stat-icon-risk     { background: var(--sev-critical-soft); color: var(--sev-high); }

.stat-card-bottom {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  color: var(--ink-primary);
}

.stat-meta {
  font-size: 12px;
  color: var(--ink-faint);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.dashboard-card {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-xs);
}

.dashboard-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.dashboard-card h3 {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink-primary);
  margin: 0;
}

.dashboard-card-sub {
  font-size: 12px;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

.dashboard-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--brand-primary);
  text-decoration: none;
}

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

/* Stacked severity posture bar */
.severity-stacked-bar {
  display: flex;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface-hover);
  gap: 2px;
  margin-bottom: 28px;
}

.severity-stacked-segment {
  height: 100%;
  min-width: 4px;
  transition: width 0.45s ease;
}

.severity-stacked-segment:first-child { border-top-left-radius: 999px; border-bottom-left-radius: 999px; }
.severity-stacked-segment:last-child  { border-top-right-radius: 999px; border-bottom-right-radius: 999px; }

.severity-breakdown {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.severity-breakdown-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.severity-breakdown-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.severity-breakdown-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-variant-numeric: tabular-nums;
}

.severity-breakdown-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-primary);
}

.severity-breakdown-pct {
  font-size: 11.5px;
  color: var(--ink-faint);
  min-width: 38px;
  text-align: right;
}

.severity-breakdown-bar {
  width: 100%;
  height: 5px;
  background: var(--surface-hover);
  border-radius: 999px;
  overflow: hidden;
}

.severity-breakdown-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.45s ease;
}

/* Recent Scans */
.recent-scans-list {
  display: flex;
  flex-direction: column;
}

.recent-scan-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  margin: 0 -10px;
  border-bottom: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.recent-scan-item:last-child {
  border-bottom: none;
}

.recent-scan-item-link {
  text-decoration: none;
  color: inherit;
  transition: background-color 0.14s ease;
}

.recent-scan-item-link:hover {
  background: var(--surface-subtle);
}

.recent-scan-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.recent-scan-target {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-primary);
}

.recent-scan-time {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-faint);
}

.recent-scan-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.recent-scan-findings {
  font-size: 12px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--ink-muted);
}

.row-chevron {
  color: var(--ink-faint);
  opacity: 0;
  transform: translateX(-3px);
  transition: opacity 0.14s ease, transform 0.14s ease, color 0.14s ease;
  flex-shrink: 0;
}

.recent-scan-item-link:hover .row-chevron,
.findings-table-row-clickable:hover .row-chevron {
  opacity: 1;
  transform: translateX(0);
  color: var(--ink-secondary);
}

/* --------------------------------------------------------------------------
   9. Targets Index
   -------------------------------------------------------------------------- */

.targets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}

.target-card {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

a.target-card-clickable {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

a.target-card-clickable:hover {
  border-color: var(--brand-border);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.target-card-body {
  padding: 18px 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}

.target-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

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

.target-name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink-primary);
  margin: 0 0 3px 0;
}

a.target-card-clickable:hover .target-name {
  color: var(--ink-primary);
}

.target-url {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.target-findings-summary {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.severity-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.severity-pill.severity-critical { background: #9B0100; color: #FFFFFF; }
.severity-pill.severity-high     { background: #CC0000; color: #FFFFFF; }
.severity-pill.severity-medium   { background: #FF9902; color: #FFFFFF; }
.severity-pill.severity-low      { background: #D8DEE6; color: #1E293B; }
.severity-pill.severity-info     { background: #ECEFF3; color: #475569; }

.severity-pill-skeleton {
  display: inline-block;
  min-width: 28px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #E2E8F0 25%, #F1F5F9 50%, #E2E8F0 75%);
  background-size: 800px 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

.sev-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
  border: 1px solid transparent;
}

.sev-chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.sev-chip-clean {
  background: var(--status-success-bg);
  color: var(--status-success-text);
  border-color: rgba(16, 185, 129, 0.22);
}
.sev-chip-clean .sev-chip-dot { background: var(--status-success-dot); }

.sev-chip-empty {
  background: var(--surface-subtle);
  color: var(--ink-faint);
  border-color: var(--border-subtle);
  font-weight: 500;
}

.target-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 20px;
  background: var(--surface-subtle);
  border-top: 1px solid var(--border-subtle);
  gap: 10px;
}

.target-last-scan {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-muted);
}

.cadence-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-secondary);
}

.cadence-pill svg {
  color: var(--brand-primary);
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   10. Target Detail, Scan Detail, Diffs & Findings Tables
   -------------------------------------------------------------------------- */

.target-detail-header,
.scan-detail-header {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-xs);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}

.target-detail-title-row,
.scan-detail-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.target-detail-title-row h2,
.scan-detail-title-row h2 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--ink-primary);
  margin: 0;
}

.target-meta-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.target-detail-url {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
  border: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-secondary);
  text-decoration: none;
  word-break: break-all;
  transition: border-color 0.14s ease, color 0.14s ease, background-color 0.14s ease;
}

.target-detail-url:hover {
  border-color: var(--brand-border);
  color: var(--brand-primary);
  background: var(--brand-soft);
}

.target-detail-desc {
  font-size: 13.5px;
  color: var(--ink-muted);
  margin: 10px 0 0 0;
  line-height: 1.55;
  max-width: 680px;
}

.target-detail-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.target-detail-actions form {
  margin: 0;
  padding: 0;
  display: flex;
}

.scan-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--ink-muted);
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
  border: 1px solid var(--border-subtle);
  font-size: 12px;
  color: var(--ink-muted);
}

.meta-chip strong {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--ink-primary);
  font-variant-numeric: tabular-nums;
}

/* Unified 5-Column Hairline-Divided Severity Summary Strip */
.findings-overview {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  margin-bottom: 18px;
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}

.findings-overview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 22px;
  border-bottom: 1px solid var(--border-subtle);
}

.findings-overview h3 {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink-primary);
  margin: 0;
}

.severity-summary-bar {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.severity-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 18px 22px;
  background: transparent;
  border: none;
  border-right: 1px solid var(--border-subtle);
  gap: 8px;
}

.severity-stat:last-child {
  border-right: none;
}

.severity-stat-label-row {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.severity-label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-muted);
  letter-spacing: -0.005em;
}

.severity-count {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  color: var(--ink-primary);
}

.severity-count-zero {
  color: var(--ink-faint);
  font-weight: 500;
}

.severity-stat-clickable {
  text-decoration: none;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: background-color 0.14s ease, box-shadow 0.14s ease;
}

.severity-stat-clickable:hover {
  background: var(--surface-subtle);
}

.severity-stat-active,
.severity-stat-active:hover {
  background: var(--brand-soft);
  box-shadow: inset 0 -2px 0 var(--brand-primary);
}

.severity-count-row {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
}

.severity-delta {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  padding: 1px 6px;
  border-radius: 999px;
}

.severity-delta-up {
  background: var(--status-danger-bg);
  color: var(--status-danger-text);
}

.severity-delta-down {
  background: var(--status-success-bg);
  color: var(--status-success-text);
}

/* Scan Diff Chips, Tags & Resolved Section */
.diff-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  font-variant-numeric: tabular-nums;
  transition: filter 0.12s ease;
}

.diff-chip:hover {
  filter: brightness(0.96);
}

.diff-chip-new {
  background: var(--status-danger-bg);
  color: var(--status-danger-text);
  border: 1px solid rgba(239, 68, 68, 0.22);
}

.diff-chip-resolved {
  background: var(--status-success-bg);
  color: var(--status-success-text);
  border: 1px solid rgba(16, 185, 129, 0.24);
}

.diff-chip-unchanged {
  background: var(--surface-subtle);
  color: var(--ink-muted);
  border: 1px solid var(--border-subtle);
  font-family: var(--font-sans);
  font-weight: 500;
}

.diff-baseline-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--ink-faint);
  padding: 4px 2px;
}

.diff-baseline-link a {
  color: var(--ink-muted);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 11.5px;
}

.diff-baseline-link a:hover {
  color: var(--brand-primary);
  text-decoration: underline;
}

.finding-name-line {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 2px;
}

.finding-name-line strong {
  margin-bottom: 0;
}

.diff-tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 1.4;
}

.diff-tag-new {
  background: var(--status-danger-bg);
  color: var(--status-danger-text);
  border: 1px solid rgba(239, 68, 68, 0.22);
}

.diff-tag-resolved {
  background: var(--status-success-bg);
  color: var(--status-success-text);
  border: 1px solid rgba(16, 185, 129, 0.24);
}

.resolved-findings-details {
  padding: 0;
}

.resolved-summary-header {
  list-style: none;
  cursor: pointer;
  border-bottom: none;
  user-select: none;
  transition: background-color 0.14s ease;
}

.resolved-summary-header::-webkit-details-marker {
  display: none;
}

.resolved-summary-header:hover {
  background: var(--surface-subtle);
}

.resolved-findings-details[open] .resolved-summary-header {
  border-bottom: 1px solid var(--border-subtle);
}

.count-pill-resolved {
  background: var(--status-success-bg);
  color: var(--status-success-text);
  border-color: rgba(16, 185, 129, 0.24);
}

.resolved-toggle-hint {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-muted);
}

.resolved-toggle-hint svg {
  transition: transform 0.16s ease;
}

.resolved-findings-details[open] .resolved-toggle-hint svg {
  transform: rotate(180deg);
}

.findings-row-resolved .findings-col-name strong {
  color: var(--ink-secondary);
  text-decoration: line-through;
  text-decoration-color: rgba(100, 116, 139, 0.45);
}

/* Findings & Scan History Tables */
.findings-list-section,
.scan-history-section {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  margin-bottom: 18px;
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}

.section-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--border-subtle);
}

.section-card-header h3 {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink-primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.findings-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.findings-search {
  position: relative;
  display: flex;
  align-items: center;
}

.findings-search svg {
  position: absolute;
  left: 10px;
  color: var(--ink-faint);
  pointer-events: none;
}

.findings-search-input {
  height: 30px;
  width: 230px;
  padding: 0 10px 0 30px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  background: var(--surface-subtle);
  font-family: var(--font-sans);
  font-size: 12.5px;
  color: var(--ink-primary);
  transition: border-color 0.14s ease, background-color 0.14s ease, box-shadow 0.14s ease;
}

.findings-search-input::placeholder {
  color: var(--ink-faint);
}

.findings-search-input:focus {
  outline: none;
  background: var(--surface-card);
  border-color: var(--brand-primary);
  box-shadow: var(--brand-ring);
}

.findings-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-btn {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-secondary);
  background: var(--surface-subtle);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  text-decoration: none;
  font-variant-numeric: tabular-nums;
  transition: all 0.14s ease;
}

.filter-btn:hover {
  background: var(--surface-hover);
  color: var(--ink-primary);
  border-color: var(--border-default);
}

.filter-btn.active {
  background: var(--ink-primary);
  color: #FFFFFF;
  border-color: var(--ink-primary);
}

.filter-critical.active { background: #9B0100; border-color: #9B0100; color: #FFFFFF; }
.filter-high.active     { background: #CC0000; border-color: #CC0000; color: #FFFFFF; }
.filter-medium.active   { background: #D97706; border-color: #D97706; color: #FFFFFF; }
.filter-low.active      { background: #475569; border-color: #475569; color: #FFFFFF; }
.filter-info.active     { background: #64748B; border-color: #64748B; color: #FFFFFF; }
.filter-new.active      { background: #B91C1C; border-color: #B91C1C; color: #FFFFFF; }

.findings-table {
  width: 100%;
}

.findings-table-header {
  display: grid;
  grid-template-columns: 108px 1fr 96px 24px;
  gap: 16px;
  padding: 10px 22px;
  background: var(--surface-subtle);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--ink-muted);
  letter-spacing: 0.05em;
}

.findings-table-row {
  display: grid;
  grid-template-columns: 108px 1fr 96px 24px;
  gap: 16px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--border-subtle);
  align-items: center;
  font-size: 13.5px;
  transition: background-color 0.12s ease;
}

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

.findings-table-row-clickable {
  cursor: pointer;
}

.findings-table-row-clickable:hover {
  background: var(--surface-subtle);
}

.findings-col-name strong {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-primary);
  margin-bottom: 2px;
  line-height: 1.35;
}

.finding-desc {
  display: block;
  font-size: 12.5px;
  color: var(--ink-muted);
  line-height: 1.45;
}

.findings-col-type {
  font-size: 12px;
  color: var(--ink-muted);
}

.type-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 5px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-secondary);
  background: var(--surface-subtle);
  border: 1px solid var(--border-subtle);
  text-transform: lowercase;
}

/* Scan History Table */
.scan-history-header {
  display: grid;
  grid-template-columns: 124px 90px 96px 96px 1fr 140px;
  gap: 12px;
  padding: 10px 22px;
  background: var(--surface-subtle);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--ink-muted);
  letter-spacing: 0.05em;
}

.scan-history-row {
  display: grid;
  grid-template-columns: 124px 90px 96px 96px 1fr 140px;
  gap: 12px;
  padding: 12px 22px;
  border-bottom: 1px solid var(--border-subtle);
  align-items: center;
  font-size: 13px;
  color: var(--ink-secondary);
  transition: background-color 0.12s ease;
}

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

.scan-history-row:hover {
  background: var(--surface-subtle);
}

.scan-col-findings,
.scan-col-duration,
.scan-col-date {
  font-family: var(--font-mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--ink-secondary);
}

.scan-col-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.scan-history-row-extra {
  display: none;
}

.scan-history-table.scan-history-expanded .scan-history-row-extra {
  display: grid;
}

.scan-history-table:not(.scan-history-expanded) .scan-history-row:nth-child(6) {
  border-bottom: none;
}

.scan-history-footer {
  border-top: 1px solid var(--border-subtle);
  background: var(--surface-subtle);
}

.scan-history-toggle-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 16px;
  background: transparent;
  border: none;
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-secondary);
  cursor: pointer;
  transition: background-color 0.14s ease, color 0.14s ease;
}

.scan-history-toggle-btn:hover {
  background: var(--surface-hover);
  color: var(--ink-primary);
}

.scan-history-toggle-btn svg {
  color: var(--ink-muted);
  transition: transform 0.16s ease;
}

.scan-history-toggle-btn.expanded svg {
  transform: rotate(180deg);
}

/* --------------------------------------------------------------------------
   11. Modals (Finding Detail, Org Switcher, Settings)
   -------------------------------------------------------------------------- */

.finding-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 2000;
  justify-content: center;
  align-items: flex-start;
  padding: 48px 16px;
  overflow-y: auto;
}

.finding-modal-overlay.active {
  display: flex;
}

.finding-modal {
  background: var(--surface-card);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-default);
  width: 100%;
  max-width: 680px;
  box-shadow: var(--shadow-modal);
  overflow: hidden;
  animation: modalFadeIn 0.15s ease-out;
}

.finding-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  background: var(--surface-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.finding-modal-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.finding-modal-title-row h3 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink-primary);
  margin: 0;
  line-height: 1.4;
}

.finding-modal-close {
  background: none;
  border: none;
  font-size: 22px;
  color: var(--ink-faint);
  cursor: pointer;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: background-color 0.12s ease, color 0.12s ease;
}

.finding-modal-close:hover {
  background: var(--surface-hover);
  color: var(--ink-primary);
}

.finding-modal-body {
  padding: 20px 22px;
}

.finding-detail-section {
  margin-bottom: 18px;
}

.finding-detail-section:last-child {
  margin-bottom: 0;
}

.finding-detail-section h4 {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--ink-muted);
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.finding-detail-section p {
  font-size: 13.5px;
  color: var(--ink-secondary);
  line-height: 1.65;
  margin: 0;
}

.finding-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
}

.finding-detail-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
  border: 1px solid var(--border-subtle);
}

.finding-detail-label {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--ink-muted);
  letter-spacing: 0.05em;
}

.finding-detail-value {
  font-size: 12.5px;
  color: var(--ink-primary);
  word-break: break-all;
}

.finding-detail-url {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--brand-primary);
}

.finding-detail-value code {
  font-family: var(--font-mono);
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 11.5px;
  color: var(--ink-primary);
}

.finding-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.finding-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--surface-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--ink-secondary);
}

.finding-references {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.finding-ref-link {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--brand-primary);
  text-decoration: none;
  word-break: break-all;
}

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

.finding-ref-text {
  display: block;
  font-size: 12.5px;
  color: var(--ink-secondary);
}

.finding-curl-block {
  background: #0F172A;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 34px 14px 14px;
  overflow-x: auto;
  position: relative;
}

.finding-curl-block::before {
  content: "cURL";
  position: absolute;
  top: 9px;
  left: 14px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748B;
}

.finding-curl-block code {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #E2E8F0;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-all;
}

.curl-copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: #94A3B8;
  cursor: pointer;
  padding: 5px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.14s ease, color 0.14s ease;
}

.curl-copy-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #E2E8F0;
}

.curl-copy-btn.copied {
  color: #4ADE80;
}

/* Org Switcher Modal */
.org-modal-body {
  padding: 6px 0;
  max-height: 320px;
  overflow-y: auto;
}

.org-option-form {
  margin: 0;
  width: 100%;
}

.org-modal-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 18px;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.12s ease;
}

.org-modal-option:hover {
  background: var(--surface-subtle);
}

.org-modal-option.active {
  background: var(--brand-soft);
}

.org-modal-option-lead {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.org-modal-option-info {
  flex: 1;
  min-width: 0;
}

.org-modal-option-name {
  font-weight: 600;
  font-size: 13.5px;
  color: var(--ink-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.org-modal-option-role {
  font-size: 11.5px;
  color: var(--ink-muted);
  text-transform: capitalize;
}

.org-modal-option.active .org-modal-option-name,
.org-modal-option.active .org-modal-option-role {
  color: var(--brand-primary);
}

.org-check {
  color: var(--brand-primary);
  flex-shrink: 0;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

.warning-message {
  background: var(--status-warn-bg);
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 14px;
  text-align: center;
}

.warning-icon {
  color: #F59E0B;
  margin-bottom: 8px;
}

.warning-message h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-primary);
  margin: 0 0 6px 0;
}

.warning-message p {
  font-size: 13px;
  color: var(--status-warn-text);
  margin: 0 0 6px 0;
  line-height: 1.5;
}

.warning-message p:last-child {
  margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   12. Forms & Settings
   -------------------------------------------------------------------------- */

.form-page {
  max-width: 640px;
  margin: 0;
}

.form-container {
  max-width: 640px;
  margin: 0;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 28px 30px;
  box-shadow: var(--shadow-xs);
}

.form-header {
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.form-header h2 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink-primary);
  margin: 0 0 4px 0;
}

.form-header p {
  font-size: 13.5px;
  color: var(--ink-muted);
  margin: 0;
}

.settings-form,
.password-form,
.invite-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 18px;
}

.settings-form .form-group,
.password-form .form-group,
.invite-form .form-group {
  margin-bottom: 0;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-field {
  display: flex;
  flex-direction: column;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-primary);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 9px 12px;
  font-family: var(--font-sans);
  font-size: 13.5px;
  color: var(--ink-primary);
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

.form-textarea {
  resize: vertical;
  min-height: 84px;
}

.form-input::placeholder {
  color: var(--ink-faint);
}

.form-input:hover {
  border-color: var(--border-strong);
}

.form-input:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: var(--brand-ring);
}

.form-help {
  display: block;
  font-size: 12px;
  color: var(--ink-muted);
  margin-top: 5px;
  line-height: 1.45;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border-subtle);
}

.settings-form .form-actions {
  margin-top: 6px;
}

.error-messages {
  background: var(--status-danger-bg);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 18px;
}

.error-messages h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--status-danger-text);
  margin: 0 0 6px 0;
}

.error-messages ul {
  margin: 0;
  padding-left: 18px;
  font-size: 12.5px;
  color: var(--status-danger-text);
}

.radio-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.radio-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 14px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-card);
  cursor: pointer;
  transition: border-color 0.14s ease, background-color 0.14s ease;
}

.radio-option:hover {
  background: var(--surface-subtle);
  border-color: var(--border-strong);
}

.radio-option:has(input[type="radio"]:checked) {
  border-color: var(--brand-primary);
  background: var(--brand-soft);
}

.radio-option input[type="radio"] {
  accent-color: var(--brand-primary);
  margin-top: 2px;
}

.radio-option-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.radio-option-label {
  font-weight: 600;
  font-size: 13px;
  color: var(--ink-primary);
}

.radio-option input[type="radio"]:checked ~ .radio-option-content .radio-option-label {
  color: var(--brand-primary);
}

.radio-option-desc {
  font-size: 12px;
  color: var(--ink-muted);
}

/* Settings Page Layout */
.settings-container {
  max-width: 880px;
  margin: 0;
  padding: 0;
}

.settings-content {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.settings-card {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--surface-card);
}

.card-title {
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink-primary);
  margin: 0 0 2px 0;
}

.card-description {
  font-size: 12.5px;
  color: var(--ink-muted);
  margin: 0;
}

.card-content {
  padding: 20px 22px;
}

.organizations-section,
.team-members-section,
.pending-invitations-section {
  margin-bottom: 24px;
}

.organizations-section:last-child,
.team-members-section:last-child,
.pending-invitations-section:last-child {
  margin-bottom: 0;
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-primary);
  margin: 0 0 12px 0;
}

.section-title-row .section-title {
  margin-bottom: 0;
}

/* Organizations & Members Tables */
.members-table {
  width: 100%;
  border-collapse: collapse;
}

.members-table th {
  text-align: left;
  padding: 9px 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
  background: var(--surface-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.members-table th:last-child {
  width: 48px;
}

.members-table td {
  padding: 12px;
  font-size: 13px;
  color: var(--ink-secondary);
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

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

.members-table tbody tr:hover {
  background: var(--surface-subtle);
}

.org-table-cell {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.org-table-name {
  font-weight: 600;
  color: var(--ink-primary);
  font-size: 13.5px;
}

.org-current-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 4px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  background: var(--brand-soft);
  color: var(--brand-primary);
  border: 1px solid rgba(18, 80, 251, 0.18);
}

.member-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.member-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1E293B 0%, #334155 100%);
  color: #FFFFFF;
  font-size: 11.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.member-details {
  display: flex;
  flex-direction: column;
}

.member-name {
  font-weight: 600;
  color: var(--ink-primary);
  font-size: 13px;
  line-height: 1.3;
}

.member-email {
  font-size: 12px;
  color: var(--ink-muted);
}

.member-role {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  margin-right: 4px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: capitalize;
  background: var(--surface-subtle);
  color: var(--ink-secondary);
  border: 1px solid var(--border-subtle);
}

.member-role.owner {
  background: var(--brand-soft);
  color: var(--brand-primary);
  border-color: rgba(18, 80, 251, 0.2);
}

.member-role.admin {
  background: #F5F3FF;
  color: #6D28D9;
  border-color: rgba(109, 40, 217, 0.18);
}

.member-role.member {
  background: var(--surface-subtle);
  color: var(--ink-secondary);
  border-color: var(--border-subtle);
}

.member-actions-cell {
  text-align: right;
  width: 48px;
}

.member-actions-cell .btn-ball-nav {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
}

.member-actions-cell .btn-ball-nav:hover {
  background: var(--surface-hover);
}

/* Pending Invitations */
.invitations-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.invitation-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
  border: 1px solid var(--border-subtle);
}

.invitation-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.invitation-email {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-primary);
}

.invitation-role {
  font-size: 12px;
  color: var(--ink-secondary);
}

.invitation-date {
  font-size: 11.5px;
  color: var(--ink-muted);
}

.invitation-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* --------------------------------------------------------------------------
   13. Scan Progress, Skeletons & Keyframes
   -------------------------------------------------------------------------- */

.scan-in-progress {
  text-align: center;
  padding: 48px 28px;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}

.scan-in-progress h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink-primary);
  margin: 14px 0 6px;
}

.scan-in-progress p {
  font-size: 13.5px;
  color: var(--ink-muted);
}

.scan-progress-icon {
  color: var(--brand-primary);
}

.spinning {
  animation: spin 1s linear infinite;
}

.skeleton-rows {
  display: flex;
  flex-direction: column;
}

.skeleton-row {
  display: grid;
  grid-template-columns: 108px 1fr 96px;
  gap: 16px;
  align-items: center;
  padding: 14px 22px;
  border-bottom: 1px solid var(--border-subtle);
}

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

.skeleton-line {
  display: block;
  border-radius: 4px;
  background: linear-gradient(90deg, #E2E8F0 25%, #F1F5F9 50%, #E2E8F0 75%);
  background-size: 800px 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

.skeleton-count {
  width: 32px;
  height: 26px;
  margin-top: 2px;
}

.skeleton-badge {
  width: 68px;
  height: 22px;
}

.skeleton-text {
  height: 16px;
}

.skeleton-small {
  width: 52px;
  height: 16px;
}

.skeleton-hint {
  text-align: center;
  padding: 14px 22px;
  font-size: 12.5px;
  color: var(--ink-muted);
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.8); }
}

@keyframes flashSlideIn {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes flashSlideOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-12px); }
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

/* --------------------------------------------------------------------------
   14. Responsive Breakpoints
   -------------------------------------------------------------------------- */

@media (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .severity-summary-bar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .severity-stat {
    border-bottom: 1px solid var(--border-subtle);
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: 260px;
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .main-wrapper {
    margin-left: 0;
  }

  .mobile-sidebar-toggle {
    display: flex;
  }

  .sidebar-toggle {
    display: none;
  }

  .topbar {
    padding: 0 16px;
  }

  .page-content {
    padding: 20px 16px 36px;
  }

  .page-header-row,
  .dashboard-header,
  .targets-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .getting-started-header {
    flex-direction: column;
    align-items: flex-start;
    padding: 18px;
  }

  .getting-started-steps {
    grid-template-columns: 1fr;
  }

  .getting-started-step {
    padding: 16px 18px;
  }

  .getting-started-step + .getting-started-step {
    border-left: none;
    border-top: 1px solid var(--border-subtle);
  }

  .targets-grid {
    grid-template-columns: 1fr;
  }

  .severity-summary-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .severity-stat {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-subtle);
  }

  .target-detail-header,
  .scan-detail-header {
    flex-direction: column;
    padding: 18px;
  }

  .target-detail-actions {
    flex-wrap: wrap;
  }

  .findings-table-header,
  .findings-table-row {
    grid-template-columns: 92px 1fr 20px;
    padding: 12px 16px;
  }

  .findings-col-type {
    display: none;
  }

  .scan-history-header,
  .scan-history-row {
    grid-template-columns: 112px 1fr 120px;
    padding: 12px 16px;
  }

  .scan-col-source,
  .scan-col-duration,
  .scan-col-date {
    display: none;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .form-actions,
  .modal-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .invitation-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .invitation-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

@media (max-width: 640px) {
  .finding-detail-grid {
    grid-template-columns: 1fr;
  }

  .finding-modal-overlay {
    padding: 16px;
  }
}
