/* ======================================================
   VAETO AI SECURITY — Local Network Security Platform
   Design tokens mirror the Vaeto admin panel design system.
   ====================================================== */

@import url('../fonts/vaeto-fonts.css');

:root {
  /* Brand core */
  --primary: #2066F5;
  --primary-hover: #1753D6;
  --primary-light: #3B82F6;
  --primary-dark: #0E3EAC;
  --primary-bg: rgba(32, 102, 245, 0.08);
  --primary-border: rgba(32, 102, 245, 0.30);

  /* Brand gold — taken from the Vaeto marketing site, where it carries the
     primary call to action against the blue hero. */
  --gold: #F8B825;
  --gold-hover: #E2A31B;
  --gold-bg: rgba(248, 184, 37, 0.14);
  --gold-ink: #7A5200;

  /* Severity palette (supplied colour code). The base hue carries the visual
     identity -- accent bars, dots, chips. The `-ink` variant is the same hue
     darkened for text on light surfaces, because the base colours against
     white text measure 1.7-3.8:1 and would not be readable. */
  --sev-critical: #D2603A;  --sev-critical-ink: #9C4321;  --sev-critical-tint: rgba(210, 96, 58, 0.15);
  --sev-high:     #F09355;  --sev-high-ink:     #A85B18;  --sev-high-tint:     rgba(240, 147, 85, 0.20);
  --sev-medium:   #E9C34C;  --sev-medium-ink:   #7A5C05;  --sev-medium-tint:   rgba(233, 195, 76, 0.24);
  --sev-low:      #92D050;  --sev-low-ink:      #4A7A17;  --sev-low-tint:      rgba(146, 208, 80, 0.22);
  --sev-info:     #A6A6A6;  --sev-info-ink:     #5C5C5C;  --sev-info-tint:     rgba(166, 166, 166, 0.18);

  /* Status */
  --success: #10B981;
  --success-bg: rgba(16, 185, 129, 0.12);
  --warning: #F59E0B;
  --warning-bg: rgba(245, 158, 11, 0.12);
  --danger: #EF4444;
  --danger-bg: rgba(239, 68, 68, 0.12);
  --info: #2563EB;
  --info-bg: rgba(37, 99, 235, 0.12);

  /* Surfaces */
  --bg-main: #F8FAFC;
  --bg-surface: #FFFFFF;
  --bg-card-hover: #F1F5F9;
  --bg-input: #F8FAFC;

  /* Typography */
  --text-title: #0F172A;
  --text-main: #1E293B;
  --text-muted: #475569;
  --text-dim: #94A3B8;

  --border: #E2E8F0;
  --border-strong: #CBD5E1;

  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 16px 36px rgba(32, 102, 245, 0.12);

  /* Matched to vaeto.in: Plus Jakarta Sans for body, Outfit for headings. */
  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-head: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);

  --sidebar-w: 264px;
  --topbar-h: 68px;
}

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

html { -webkit-text-size-adjust: 100%; }

h1, h2, h3, h4, h5, .auth-title { font-family: var(--font-head); letter-spacing: -0.01em; }

body {
  font-family: var(--font-main);
  background: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
  color: var(--text-title);
  letter-spacing: -0.015em;
  font-weight: 600;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }

::selection { background: var(--primary-bg); color: var(--primary-dark); }

/* ======================================================
   Animations
   ====================================================== */

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

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

@keyframes softPulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.35; }
}

@keyframes sweep {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(400%); }
}

@keyframes drawCheck {
  from { stroke-dashoffset: 32; }
  to   { stroke-dashoffset: 0; }
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
  to { opacity: 0; transform: translateX(24px); }
}

/* --- Motion borrowed from the Vaeto marketing site ------------------- */

/* Slowly drifting background grid (their fwGridDrift). */
@keyframes gridDrift {
  from { background-position: 0 0, 0 0; }
  to   { background-position: 46px 46px, 46px 46px; }
}

/* Expanding radar ping (their radarPing). */
@keyframes radarPing {
  0%   { transform: scale(0.85); opacity: 0.55; }
  100% { transform: scale(1.9);  opacity: 0; }
}

/* Counter-rotating orbit ring (their ringDrift). */
@keyframes ringDrift {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* Gold status pulse (their badgePulseYellow). */
@keyframes goldPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(248, 184, 37, 0.45); }
  70%      { box-shadow: 0 0 0 8px rgba(248, 184, 37, 0); }
}

.animate-in { animation: fadeUp 0.4s cubic-bezier(0.4, 0, 0.2, 1) both; }

/* Stagger children for a calm cascade rather than everything at once. */
.stagger > * { animation: fadeUp 0.4s cubic-bezier(0.4, 0, 0.2, 1) both; }
.stagger > *:nth-child(1) { animation-delay: 0.02s; }
.stagger > *:nth-child(2) { animation-delay: 0.06s; }
.stagger > *:nth-child(3) { animation-delay: 0.10s; }
.stagger > *:nth-child(4) { animation-delay: 0.14s; }
.stagger > *:nth-child(5) { animation-delay: 0.18s; }
.stagger > *:nth-child(6) { animation-delay: 0.22s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ======================================================
   Authentication layout
   ====================================================== */

.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(1100px 620px at 50% -18%, rgba(32, 102, 245, 0.10), transparent 62%),
    var(--bg-main);
}

/* Subtle abstract security mesh behind the card, drifting slowly. */
.auth-wrap::before {
  content: "";
  position: absolute;
  inset: -46px;
  background-image:
    linear-gradient(rgba(32, 102, 245, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(32, 102, 245, 0.045) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at 50% 40%, #000 0%, transparent 72%);
  -webkit-mask-image: radial-gradient(circle at 50% 40%, #000 0%, transparent 72%);
  pointer-events: none;
  animation: gridDrift 14s linear infinite;
}

/* Warm counterpoint to the blue wash, echoing the site's blue/gold pairing. */
.auth-wrap::after {
  content: "";
  position: absolute;
  width: 460px;
  height: 460px;
  right: -120px;
  bottom: -160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(248, 184, 37, 0.16), transparent 68%);
  pointer-events: none;
  animation: floatOrb 16s ease-in-out infinite alternate;
}

@keyframes floatOrb {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(-40px, -28px) scale(1.12); }
}

/* Brand hairline across the top of the card: blue into gold. */
.auth-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 22px;
  right: 22px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 55%, var(--gold) 100%);
}

.auth-card {
  position: relative;
  width: 100%;
  max-width: 428px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 40px 38px 32px;
  animation: fadeUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.auth-logo {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto 22px;
}

.auth-title {
  text-align: center;
  font-size: 21px;
  font-weight: 600;
  margin-bottom: 5px;
}

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

.auth-foot {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-dim);
  font-size: 11.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.auth-foot svg { width: 13px; height: 13px; }

/* Logo doubles as a link back to the public landing page. */
.auth-logo { text-decoration: none; transition: opacity .15s; }
.auth-logo:hover { opacity: .85; }

.auth-back {
  display: block;
  text-align: center;
  margin-top: 16px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: color .15s;
}
.auth-back:hover { color: var(--accent, #2C7BF6); }

/* ======================================================
   Application shell
   ====================================================== */

.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-head {
  height: var(--topbar-h);
  padding: 0 20px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-head img { height: 30px; width: auto; }

/* Mobile menu button. Hidden on desktop; the sidebar is always open there. */
.nav-toggle {
  display: none;
  margin-left: auto;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface, #fff);
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0;
}
.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: var(--text, #1f2937);
  transition: transform .2s ease, opacity .2s ease;
}
.sidebar.nav-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.sidebar.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
.sidebar.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
}

.nav-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 0 12px;
  margin-bottom: 10px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 3px;
  transition: background var(--transition-fast), color var(--transition-fast);
  position: relative;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  font-family: inherit;
  cursor: pointer;
}

.nav-link svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  stroke-width: 1.9;
}

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

.nav-link.active {
  background: var(--primary-bg);
  color: var(--primary);
  font-weight: 600;
}

.nav-link.active::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  border-radius: 0 3px 3px 0;
  background: var(--primary);
}

.nav-divider {
  height: 1px;
  background: var(--border);
  margin: 14px 12px;
}

.nav-spacer { flex: 1; min-height: 12px; }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 12px 5px 6px;
  border-radius: var(--radius-full);
  background: var(--bg-main);
  border: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: border-color 120ms ease, background 120ms ease;
}

.user-chip:hover {
  border-color: var(--primary);
  background: #fff;
}

.avatar {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 13px;
  flex-shrink: 0;
  text-transform: uppercase;
}

.user-chip .meta { min-width: 0; }
.user-chip .name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-title);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-chip .role { font-size: 11px; color: var(--text-dim); }

/* Main column */

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: var(--topbar-h);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  gap: 20px;
  position: sticky;
  top: 0;
  z-index: 30;
}

.topbar h1 { font-size: 16px; font-weight: 600; }
.topbar .crumb { font-size: 11.5px; color: var(--text-dim); margin-top: 1px; }

.engine-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 13px 6px 11px;
  border-radius: var(--radius-full);
  background: var(--bg-main);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
}

.content { padding: 28px 32px 48px; max-width: 1240px; width: 100%; }

/* ======================================================
   Page header
   ====================================================== */

.page-head { margin-bottom: 24px; }
.page-head h2 { font-size: 22px; margin-bottom: 4px; }
.page-head p { color: var(--text-muted); font-size: 13.5px; }

/* ======================================================
   Cards
   ====================================================== */

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-normal), transform var(--transition-normal);
}

.card-pad { padding: 22px 24px; }

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

.card-head h3 { font-size: 14.5px; }
.card-head .sub { font-size: 12px; color: var(--text-dim); margin-top: 2px; }

.section-gap { margin-bottom: 20px; }
.section-gap-lg { height: 22px; }   /* clear separation between stacked sections */

/* Stat cards */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.stat {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 20px 22px;
  transition: box-shadow var(--transition-normal), transform var(--transition-normal);
}

.stat:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.stat .top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.stat .label {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

.stat .num {
  font-size: 30px;
  font-weight: 600;
  color: var(--text-title);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.stat .note { font-size: 11.5px; color: var(--text-dim); margin-top: 6px; }

.ico {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ico svg { width: 17px; height: 17px; stroke-width: 2; }

.ico.blue    { background: var(--primary-bg); color: var(--primary); }
.ico.green   { background: var(--success-bg); color: var(--success); }
.ico.amber   { background: var(--gold-bg);    color: #B07E06; }
.ico.red     { background: var(--danger-bg);  color: var(--danger); }
.ico.slate   { background: var(--bg-main);    color: var(--text-muted); }

/* ======================================================
   Badges / status
   ====================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: var(--radius-full);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

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

.badge.ok      { background: var(--success-bg); color: #047857; }
.badge.run     { background: var(--gold-bg);    color: var(--gold-ink); }
.badge.bad     { background: var(--danger-bg);  color: #B91C1C; }
.badge.neutral { background: var(--bg-main);    color: var(--text-muted); }

/* Work in progress reads gold, the same signal the marketing site uses. */
.badge.run::before {
  background: var(--gold);
  animation: softPulse 1.4s ease-in-out infinite, goldPulse 2s ease-out infinite;
}

/* ======================================================
   Buttons
   ====================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: var(--primary);
  color: #fff;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition-fast), box-shadow var(--transition-fast),
              transform var(--transition-fast), opacity var(--transition-fast);
  white-space: nowrap;
}

.btn svg { width: 16px; height: 16px; stroke-width: 2; }

/* Buttons rendered as <a> would otherwise inherit the generic `a:hover`
   colour, which is more specific than `.btn` and repaints the label the same
   blue as the hover background — making the text vanish. Every variant below
   therefore restates its own colour on hover. */
.btn:hover {
  background: var(--primary-hover);
  color: #fff;
  box-shadow: 0 6px 16px rgba(32, 102, 245, 0.24);
}
.btn:active { transform: translateY(1px); }

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.btn.ghost {
  background: var(--bg-surface);
  color: var(--text-main);
  border-color: var(--border-strong);
}
.btn.ghost:hover { background: var(--bg-card-hover); color: var(--text-main); box-shadow: none; }

.btn.subtle {
  background: var(--primary-bg);
  color: var(--primary);
}
.btn.subtle:hover { background: rgba(32, 102, 245, 0.14); color: var(--primary); box-shadow: none; }

.btn.danger { background: var(--danger); }
.btn.danger:hover { background: #DC2626; color: #fff; box-shadow: 0 6px 16px rgba(239, 68, 68, 0.24); }

.btn.full { width: 100%; }
.btn.sm { padding: 7px 14px; font-size: 12.5px; }

.btn .spinner {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.link-btn {
  background: none;
  border: none;
  color: var(--primary);
  font: inherit;
  cursor: pointer;
  padding: 0;
}
.link-btn:hover { text-decoration: underline; }

/* ======================================================
   Forms
   ====================================================== */

.field { margin-bottom: 18px; }

.field label {
  display: block;
  margin-bottom: 7px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-main);
}

.input {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: inherit;
  font-size: 14px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast),
              background var(--transition-fast);
}

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

.input:focus {
  outline: none;
  background: var(--bg-surface);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-bg);
}

.input:disabled { opacity: 0.6; cursor: not-allowed; }

.input.mono { font-variant-numeric: tabular-nums; letter-spacing: 0.01em; }

.input-wrap { position: relative; }

.input-wrap .input { padding-right: 44px; }

.toggle-eye {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-dim);
  transition: color var(--transition-fast), background var(--transition-fast);
}

.toggle-eye:hover { color: var(--text-main); background: var(--bg-card-hover); }
.toggle-eye svg { width: 17px; height: 17px; stroke-width: 1.9; }

.field-hint { font-size: 11.5px; color: var(--text-dim); margin-top: 7px; }

.field-error {
  font-size: 12px;
  color: var(--danger);
  margin-top: 7px;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Password strength */

.strength { margin-top: 10px; }

.strength-bars { display: flex; gap: 5px; margin-bottom: 6px; }

.strength-bars span {
  height: 4px;
  flex: 1;
  border-radius: var(--radius-full);
  background: var(--border);
  transition: background var(--transition-normal);
}

.strength-text { font-size: 11.5px; color: var(--text-dim); font-weight: 500; }

.strength[data-level="1"] .strength-bars span:nth-child(-n+1) { background: var(--danger); }
.strength[data-level="2"] .strength-bars span:nth-child(-n+2) { background: var(--warning); }
.strength[data-level="3"] .strength-bars span:nth-child(-n+3) { background: var(--primary); }
.strength[data-level="4"] .strength-bars span { background: var(--success); }

.strength[data-level="1"] .strength-text { color: var(--danger); }
.strength[data-level="2"] .strength-text { color: var(--warning); }
.strength[data-level="3"] .strength-text { color: var(--primary); }
.strength[data-level="4"] .strength-text { color: var(--success); }

/* ======================================================
   Alerts
   ====================================================== */

.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 15px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 18px;
  border: 1px solid;
  animation: fadeUp 0.3s ease both;
}

.alert svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; stroke-width: 2; }

.alert.error   { background: var(--danger-bg);  border-color: rgba(239, 68, 68, 0.30);  color: #991B1B; }
.alert.success { background: var(--success-bg); border-color: rgba(16, 185, 129, 0.30); color: #065F46; }
.alert.warn    { background: var(--warning-bg); border-color: rgba(245, 158, 11, 0.30); color: #92400E; }
.alert.info    { background: var(--info-bg);    border-color: rgba(37, 99, 235, 0.25);  color: #1E40AF; }

/* ======================================================
   Toasts
   ====================================================== */

.toast-host {
  position: fixed;
  top: 22px;
  right: 22px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 268px;
  max-width: 380px;
  padding: 13px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--text-dim);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-main);
  animation: toastIn 0.28s cubic-bezier(0.4, 0, 0.2, 1) both;
  pointer-events: auto;
}

.toast.leaving { animation: toastOut 0.24s ease forwards; }

.toast .t-ico {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
}

.toast .t-ico svg { width: 12px; height: 12px; stroke-width: 3; }

.toast.success { border-left-color: var(--success); }
.toast.success .t-ico { background: var(--success); }
.toast.error   { border-left-color: var(--danger); }
.toast.error   .t-ico { background: var(--danger); }
.toast.info    { border-left-color: var(--primary); }
.toast.info    .t-ico { background: var(--primary); }

/* ======================================================
   Tables
   ====================================================== */

.table-wrap { overflow-x: auto; }

table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }

table.data th {
  text-align: left;
  padding: 11px 24px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--bg-main);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

table.data td {
  padding: 13px 24px;
  border-bottom: 1px solid var(--border);
  color: var(--text-main);
  vertical-align: middle;
}

table.data tbody tr { transition: background var(--transition-fast); }
table.data tbody tr:hover { background: var(--bg-main); }
table.data tbody tr:last-child td { border-bottom: none; }

/* Identifiers, addresses and durations are single tokens: breaking them
   across lines (VT- / NV- / 00031) is unreadable and inflates row height.
   The table already scrolls horizontally when it needs to. */
.cell-id {
  font-weight: 600;
  color: var(--text-title);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.cell-mono { font-variant-numeric: tabular-nums; white-space: nowrap; }
.cell-dim { color: var(--text-dim); }

/* Free-text columns (vendor, OS) may wrap, but not one word per line. */
.cell-wrap { white-space: normal; }
.cell-text { min-width: 156px; }
/* Long titles need room, or they stack one word per line. */
.cell-title { min-width: 270px; }

/* ======================================================
   Definition list
   ====================================================== */

.kv { display: grid; grid-template-columns: 168px 1fr; gap: 14px 20px; }

.kv dt { font-size: 12.5px; color: var(--text-muted); font-weight: 500; }
.kv dd { font-size: 13.5px; color: var(--text-title); font-weight: 500; word-break: break-word; }

/* ======================================================
   Empty states
   ====================================================== */

.empty { padding: 52px 24px; text-align: center; }

.empty .e-ico {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: var(--primary-bg);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.empty .e-ico svg { width: 24px; height: 24px; stroke-width: 1.8; }
.empty h4 { font-size: 15px; margin-bottom: 6px; }
.empty p { color: var(--text-muted); font-size: 13px; margin-bottom: 20px; }

/* ======================================================
   Scan progress
   ====================================================== */

.scan-hero { text-align: center; padding: 40px 24px 34px; }

.radar {
  position: relative;
  width: 88px;
  height: 88px;
  margin: 0 auto 22px;
  border-radius: 50%;
  background: var(--primary-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}

/* Expanding ping and a slow gold orbit ring — only while scanning. */
.radar.spin::before,
.radar.spin::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
}

.radar.spin::before {
  border: 2px solid rgba(32, 102, 245, 0.45);
  animation: radarPing 2.4s cubic-bezier(0, 0.4, 0.6, 1) infinite;
}

.radar.spin::after {
  border: 2px dashed rgba(248, 184, 37, 0.75);
  inset: -11px;
  animation: ringDrift 9s linear infinite;
}

.radar svg { width: 36px; height: 36px; stroke-width: 1.7; position: relative; }
.radar.spin svg { animation: spin 3.2s linear infinite; }

.radar.done {
  background: var(--success-bg);
  color: var(--success);
  animation: none;
}

.radar.fail {
  background: var(--danger-bg);
  color: var(--danger);
  animation: none;
}

.radar.done svg path { stroke-dasharray: 32; animation: drawCheck 0.5s ease-out 0.1s both; }

.scan-hero h3 { font-size: 18px; margin-bottom: 6px; }
.scan-hero p { color: var(--text-muted); font-size: 13.5px; }

/* Indeterminate activity bar — deliberately not a fake percentage. */
.activity {
  position: relative;
  height: 3px;
  border-radius: var(--radius-full);
  background: var(--border);
  overflow: hidden;
  margin: 24px auto 0;
  max-width: 420px;
}

.activity::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 25%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  animation: sweep 1.5s ease-in-out infinite;
}

.elapsed {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--text-title);
}

/* ======================================================
   PIN gate
   ====================================================== */

.pin-card {
  max-width: 420px;
  margin: 40px auto;
  text-align: center;
  padding: 40px 34px 34px;
}

.pin-lock {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  background: var(--warning-bg);
  color: var(--warning);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
}

.pin-lock svg { width: 26px; height: 26px; stroke-width: 1.8; }

.pin-card h3 { font-size: 17px; margin-bottom: 5px; }
.pin-card .lead { color: var(--text-muted); font-size: 13px; margin-bottom: 26px; }

.pin-input {
  width: 100%;
  padding: 14px;
  text-align: center;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0.5em;
  text-indent: 0.5em;
  font-variant-numeric: tabular-nums;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-title);
  font-family: inherit;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.pin-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-bg);
  background: var(--bg-surface);
}

/* ======================================================
   Misc
   ====================================================== */

.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

.muted { color: var(--text-muted); }
.dim { color: var(--text-dim); }
.mono { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }

.two-col {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 20px;
  align-items: start;
}

.divider { height: 1px; background: var(--border); margin: 20px 0; }

/* Engine card */

.engine-card { display: flex; align-items: center; gap: 15px; }

.engine-mark {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #00CFFF 0%, #0055FF 60%, #0033CC 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 6px 16px rgba(32, 102, 245, 0.24);
}

.engine-mark img { width: 26px; height: 26px; filter: brightness(0) invert(1); }

/* ======================================================
   Responsive
   ====================================================== */

@media (max-width: 1080px) {
  .two-col { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .shell { flex-direction: column; }

  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  /* The menu button appears; the nav collapses behind it. */
  .nav-toggle { display: flex; }
  .sidebar-head { padding: 0 16px; }

  .sidebar-scroll {
    display: none;
    flex-direction: column;
    gap: 4px;
    padding: 10px 14px 14px;
  }
  .sidebar.nav-open .sidebar-scroll { display: flex; }

  .nav-label, .nav-spacer { display: none; }
  .nav-divider { display: block; margin: 6px 0; }
  .nav-link { width: 100%; margin-bottom: 0; }
  .nav-link.active::before { display: none; }

  /* The user chip is part of the menu, so it shows only when open. */
  .sidebar-foot { border-top: none; padding: 4px 14px 12px; }
  .sidebar:not(.nav-open) .sidebar-foot { display: none; }

  .topbar { padding: 0 18px; }
  .content { padding: 20px 18px 40px; }

  /* A clean 2x2 beats auto-fit leaving one card orphaned on its own row. */
  .stat-grid { grid-template-columns: repeat(2, 1fr); }

  .kv { grid-template-columns: 1fr; gap: 3px 0; }
  .kv dd { margin-bottom: 12px; }
  table.data th, table.data td { padding-left: 16px; padding-right: 16px; }
}

@media (max-width: 560px) {
  .engine-pill { display: none; }
  .auth-card { padding: 30px 22px 24px; }
  .stat-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
  .toast-host { left: 14px; right: 14px; top: 14px; }
  .toast { min-width: 0; max-width: none; }
}

/* ======================================================
   Phase 2 — assessment modes, findings, stages
   ====================================================== */

/* ---------- Assessment mode selection ---------- */

.mode-hero { margin-bottom: 14px; }

.mode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.mode-card {
  position: relative;
  display: block;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  cursor: pointer;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast),
              background var(--transition-fast);
}

.mode-card:hover { border-color: var(--border-strong); background: var(--bg-main); }

.mode-card input { position: absolute; opacity: 0; pointer-events: none; }

.mode-card .mode-top {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 6px;
}

.mode-card .dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  flex-shrink: 0;
  transition: border-color var(--transition-fast);
  position: relative;
}

.mode-card .name { font-weight: 600; font-size: 14px; color: var(--text-title); }
.mode-card .desc { font-size: 12px; color: var(--text-muted); line-height: 1.45; }

.mode-card input:checked ~ .mode-top .dot { border-color: var(--primary); }

.mode-card input:checked ~ .mode-top .dot::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  background: var(--primary);
}

.mode-card:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-bg);
  box-shadow: 0 0 0 3px rgba(32, 102, 245, 0.10);
}

.mode-card.wide { grid-column: 1 / -1; }

.pill-rec {
  margin-left: auto;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* ---------- Severity badges ---------- */

.sev {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
  white-space: nowrap;
}

.sev::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.sev.critical { background: var(--sev-critical-tint); color: var(--sev-critical-ink); }
.sev.high     { background: var(--sev-high-tint);     color: var(--sev-high-ink); }
.sev.medium   { background: var(--sev-medium-tint);   color: var(--sev-medium-ink); }
.sev.low      { background: var(--sev-low-tint);      color: var(--sev-low-ink); }
.sev.info     { background: var(--sev-info-tint);     color: var(--sev-info-ink); }
.sev.minimal  { background: var(--sev-low-tint);      color: var(--sev-low-ink); }

/* The dot keeps the palette's own colour so the hue reads at a glance. */
.sev.critical::before { background: var(--sev-critical); }
.sev.high::before     { background: var(--sev-high); }
.sev.medium::before   { background: var(--sev-medium); }
.sev.low::before      { background: var(--sev-low); }
.sev.info::before     { background: var(--sev-info); }
.sev.minimal::before  { background: var(--sev-low); }

/* Risk banner */

.risk-banner {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px 22px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
}

.risk-banner .rb-level {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

.risk-banner.critical { border-left: 4px solid var(--sev-critical); }
.risk-banner.high    { border-left: 4px solid var(--sev-high); }
.risk-banner.medium  { border-left: 4px solid var(--sev-medium); }
.risk-banner.low     { border-left: 4px solid var(--sev-low); }
.risk-banner.minimal { border-left: 4px solid var(--sev-low); }

.risk-banner.critical .rb-level { color: var(--sev-critical-ink); }
.risk-banner.high .rb-level     { color: var(--sev-high-ink); }
.risk-banner.medium .rb-level   { color: var(--sev-medium-ink); }
.risk-banner.low .rb-level      { color: var(--sev-low-ink); }
.risk-banner.minimal .rb-level  { color: var(--sev-low-ink); }

.reason-list { margin: 10px 0 0; padding-left: 18px; }
.reason-list li { font-size: 13px; color: var(--text-muted); margin-bottom: 4px; }

/* ---------- Stage timeline ---------- */

.stages { list-style: none; margin: 0; padding: 0; }

.stages li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 9px 0;
  position: relative;
}

.stages li:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 28px;
  bottom: -2px;
  width: 2px;
  background: var(--border);
}

.stage-dot {
  width: 20px; height: 20px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-main);
  border: 2px solid var(--border-strong);
  z-index: 1;
}

.stage-dot svg { width: 11px; height: 11px; stroke-width: 3; }

.stages li.done .stage-dot { background: var(--success); border-color: var(--success); color: #fff; }
.stages li.active .stage-dot { background: var(--primary); border-color: var(--primary); color: #fff;
                               animation: goldPulse 2s ease-out infinite; }
.stages li.failed .stage-dot { background: var(--danger); border-color: var(--danger); color: #fff; }

.stages .stage-name { font-size: 13.5px; font-weight: 500; color: var(--text-title); }
.stages .stage-meta { font-size: 11.5px; color: var(--text-dim); margin-top: 1px; }
.stages li.pending .stage-name { color: var(--text-dim); font-weight: 400; }

/* ---------- Findings ---------- */

.finding {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-bottom: 12px;
  background: var(--bg-surface);
  transition: box-shadow var(--transition-fast);
}

.finding:hover { box-shadow: var(--shadow-sm); }

.finding .f-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.finding .f-title { font-weight: 600; font-size: 14px; color: var(--text-title); }
.finding .f-body { font-size: 13px; color: var(--text-muted); line-height: 1.55; }

.finding .f-meta {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 6px 14px;
  font-size: 12.5px;
}

.finding .f-meta dt { color: var(--text-dim); font-weight: 500; }
.finding .f-meta dd { margin: 0; color: var(--text-main); word-break: break-word; }

.type-tag {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
  white-space: nowrap;
}

.type-tag.confirmed { border-color: var(--sev-critical); color: var(--sev-critical-ink); background: var(--sev-critical-tint); }
.type-tag.potential { border-color: var(--sev-medium); color: var(--sev-medium-ink); background: var(--sev-medium-tint); }

/* ---------- Comparison table ---------- */

.compare td:first-child { font-weight: 600; color: var(--text-title); }

/* ---------- Misc Phase 2 ---------- */

.chip-row { display: flex; gap: 6px; flex-wrap: wrap; }

.chip {
  padding: 3px 9px;
  border-radius: var(--radius-full);
  background: var(--bg-main);
  border: 1px solid var(--border);
  font-size: 11.5px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.port-chip { font-weight: 600; color: var(--text-title); }

.note-box {
  padding: 12px 15px;
  border-radius: var(--radius-sm);
  background: var(--bg-main);
  border: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.55;
}

.mini-stat { display: flex; gap: 22px; flex-wrap: wrap; }
.mini-stat .ms { min-width: 74px; }
.mini-stat .ms .n { font-size: 21px; font-weight: 600; color: var(--text-title); line-height: 1.2; }
.mini-stat .ms .l { font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.06em; }

@media (max-width: 760px) {
  .finding .f-meta { grid-template-columns: 1fr; gap: 2px; }
  .finding .f-meta dd { margin-bottom: 8px; }
}

/* ======================================================
   Severity summary boxes (dashboard)
   ====================================================== */

.sev-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
  align-items: stretch;
}

/* Five severities need an explicit five-track grid: auto-fit would drop the
   last box onto a row of its own. */
.sev-grid.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }

@media (max-width: 1180px) {
  .sev-grid.five { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .sev-grid.five { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.sev-box {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  overflow: hidden;
  transition: box-shadow var(--transition-normal), transform var(--transition-normal);
}

/* A slim colour bar carries the severity rather than flooding the card. */
.sev-box::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--sev-colour, var(--text-dim));
}

.sev-box:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.sev-box .sb-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.sev-box .sb-label {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--sev-ink, var(--text-muted));
}

.sev-box .sb-chip {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--sev-tint, var(--bg-main));
  color: var(--sev-ink, var(--text-muted));
  flex-shrink: 0;
}

.sev-box .sb-chip svg { width: 15px; height: 15px; stroke-width: 2.1; }

.sev-box .sb-num {
  font-size: 32px;
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--sev-ink, var(--text-title));
  font-variant-numeric: tabular-nums;
}

.sev-box .sb-note { font-size: 11.5px; color: var(--text-dim); margin-top: 6px; }

/* Zero counts read as calm, not alarming. */
.sev-box.is-zero { --sev-colour: var(--border-strong); --sev-ink: var(--text-dim); --sev-tint: var(--bg-main); }
.sev-box.is-zero .sb-num { color: var(--text-dim); }
.sev-box.is-zero::before { background: var(--border-strong); }

.sev-box.critical { --sev-colour: var(--sev-critical); --sev-ink: var(--sev-critical-ink); --sev-tint: var(--sev-critical-tint); }
.sev-box.high     { --sev-colour: var(--sev-high);     --sev-ink: var(--sev-high-ink);     --sev-tint: var(--sev-high-tint); }
.sev-box.medium   { --sev-colour: var(--sev-medium);   --sev-ink: var(--sev-medium-ink);   --sev-tint: var(--sev-medium-tint); }
.sev-box.low      { --sev-colour: var(--sev-low);      --sev-ink: var(--sev-low-ink);      --sev-tint: var(--sev-low-tint); }


/* ======================================================
   Filter row (vulnerabilities)
   ====================================================== */

.filter-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  align-items: end;
}

.filter-row label {
  display: block;
  margin-bottom: 5px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.filter-row .input { padding: 8px 11px; font-size: 13px; }

.filter-row .filter-actions {
  display: flex;
  gap: 8px;
  align-items: end;
}

@media (max-width: 620px) {
  .filter-row { grid-template-columns: 1fr 1fr; }
  .filter-row .filter-actions { grid-column: 1 / -1; }
}

/* ======================================================
   Dashboard — sections, hero band, balanced grids
   ====================================================== */

/* A tinted wash behind the dashboard so white cards lift off the page
   instead of dissolving into it. */
.page-tint {
  position: relative;
}

.page-tint::before {
  content: "";
  position: absolute;
  inset: -28px -32px auto -32px;
  height: 420px;
  background:
    radial-gradient(900px 320px at 12% 0%, rgba(32, 102, 245, 0.08), transparent 70%),
    radial-gradient(700px 300px at 88% 6%, rgba(248, 184, 37, 0.09), transparent 72%);
  pointer-events: none;
  z-index: 0;
}

.page-tint > * { position: relative; z-index: 1; }

/* ---------- Hero band ---------- */

.hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  padding: 26px 28px;
  margin-bottom: 26px;
  color: #fff;
  background: linear-gradient(135deg, #1D4ED8 0%, #1E40AF 52%, #0F172A 100%);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.18);
}

/* Faint grid, echoing the marketing site's hero. */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(circle at 22% 20%, #000, transparent 78%);
  -webkit-mask-image: radial-gradient(circle at 22% 20%, #000, transparent 78%);
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  width: 320px;
  height: 320px;
  right: -90px;
  top: -120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(248, 184, 37, 0.30), transparent 66%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
}

.hero h2 { color: #fff; font-size: 23px; margin-bottom: 4px; letter-spacing: -0.02em; }
.hero p { color: rgba(255, 255, 255, 0.76); font-size: 13.5px; }

.hero-kpis {
  display: flex;
  gap: 30px;
  flex-wrap: wrap;
}

.hero-kpi .k-num {
  font-size: 27px;
  font-weight: 600;
  line-height: 1.1;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.hero-kpi .k-lbl {
  font-size: 10.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.66);
  margin-top: 3px;
}

.hero-kpi .k-num.gold { color: var(--gold); }

/* ---------- Section headings ---------- */

.section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 30px 0 14px;
}

.section-head:first-child { margin-top: 0; }

.section-head .bar {
  width: 3px;
  height: 17px;
  border-radius: 2px;
  background: var(--primary);
  flex-shrink: 0;
}

.section-head.gold .bar { background: var(--gold); }
.section-head.red .bar  { background: var(--sev-critical); }
.section-head.green .bar{ background: var(--success); }

.section-head h3 { font-size: 15px; }
.section-head .hint { font-size: 12px; color: var(--text-dim); }
.section-head .grow { flex: 1; }

/* ---------- Balanced grids ---------- */

.grid-2, .grid-3 {
  display: grid;
  gap: 18px;
  align-items: stretch;          /* equal heights, no ragged columns */
  margin-bottom: 4px;
}

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

/* Cards in a stretched grid fill their track. */
.grid-2 > .card, .grid-3 > .card { display: flex; flex-direction: column; }
.grid-2 > .card > .card-pad, .grid-3 > .card > .card-pad { flex: 1; }

/* ---------- Tinted card headers ---------- */

.card-head.tint-blue  { background: linear-gradient(180deg, rgba(32,102,245,.06), transparent); }
.card-head.tint-gold  { background: linear-gradient(180deg, rgba(248,184,37,.10), transparent); }
.card-head.tint-green { background: linear-gradient(180deg, rgba(16,185,129,.08), transparent); }
.card-head.tint-red   { background: linear-gradient(180deg, rgba(210,96,58,.08), transparent); }

/* Accent strip on the left of a feature card. */
.card.accent { border-left: 3px solid var(--primary); }
.card.accent-gold { border-left: 3px solid var(--gold); }

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

@media (max-width: 760px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .hero-kpis { gap: 20px; }
  .hero { padding: 22px 20px; }
}

/* ======================================================
   Vaeto report format (Phase 4)
   Mirrors the printed VAPT report so the web view and the
   downloadable PDF present a finding identically.
   ====================================================== */

/* --- List of Vulnerabilities --- */

table.data.vaeto-list tbody tr.clickable { cursor: pointer; }

.sev-text {
  font-weight: 700;
  font-size: 13px;
}

/* --- Severity summary (solid colour cells, as printed) --- */

table.data.sev-summary th { text-align: center; }

table.data.sev-summary td.sev-cell {
  color: #fff;
  font-weight: 700;
  text-align: center;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.18);
  border-right: 1px solid var(--border);
}

/* --- Detailed finding --- */

.vaeto-finding { margin-bottom: 20px; scroll-margin-top: 88px; }

.vf-num {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 2px;
}

.vf-title {
  font-size: 19px;
  font-weight: 500;
  color: var(--text-title);
  letter-spacing: -0.01em;
  margin-bottom: 16px;
}

/* The Severity / CVSS / Status block */
table.data.vf-head {
  width: 100%;
  max-width: 560px;
  margin-bottom: 20px;
  border: 1px solid var(--text-title);
}

table.data.vf-head th {
  background: var(--primary);
  color: #fff;
  text-align: center;
  letter-spacing: 0.02em;
  border-bottom: none;
}

table.data.vf-head td {
  text-align: center;
  border-bottom: none;
  border-right: 1px solid var(--border);
}

table.data.vf-head td:last-child { border-right: none; }
table.data.vf-head tbody tr:hover { background: transparent; }

/* Section labels inside a finding */
.vf-label {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--primary);
  margin: 20px 0 6px;
}

.vf-line {
  font-size: 13.5px;
  color: var(--text-main);
  line-height: 1.7;
}

.vf-body {
  font-size: 13.5px;
  color: var(--text-main);
  line-height: 1.65;
  margin-bottom: 10px;
  max-width: 78ch;
}

.vf-bullets { margin: 4px 0 10px 20px; }

.vf-bullets li {
  font-size: 13.5px;
  color: var(--text-main);
  line-height: 1.65;
  margin-bottom: 3px;
}

/* Evidence box — matches the printed report's tinted monospace block */
.vf-proof {
  background: #DCE7F8;
  border: 1px solid #B9CFF0;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 10px;
  overflow-x: auto;
}

.vf-proof-head {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
  color: #12233F;
  margin-bottom: 8px;
}

.vf-proof pre {
  margin: 0;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.55;
  color: #12233F;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Technical reference strip */
.vf-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 11.5px;
  color: var(--text-dim);
}

@media (max-width: 700px) {
  .vf-title { font-size: 17px; }
  table.data.vf-head { max-width: 100%; }
}


/* ======================================================
   Severity breakdown (dashboard, vulnerabilities)
   One component, so every page presents the same counts
   in the same way.
   ====================================================== */

.sev-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 14px 10px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

/* Proportion bar: each band's width is its share of the findings. */
.sev-bar {
  display: flex;
  height: 42px;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 12px;
}

.sev-bar .sb-seg {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-basis: 0;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  font-size: 12.5px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.22);
  transition: flex-grow var(--transition-normal);
}

.sev-bar .sb-seg.critical      { background: var(--sev-critical); }
.sev-bar .sb-seg.high          { background: var(--sev-high); }
.sev-bar .sb-seg.medium        { background: var(--sev-medium); }
.sev-bar .sb-seg.low           { background: var(--sev-low); }
.sev-bar .sb-seg.informational { background: var(--sev-info); }

.sev-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  padding: 2px 4px;
}

.sl-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--sev-ink, var(--text-muted));
}

.sl-item b { font-weight: 500; color: var(--text-dim); }

.sl-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--sev-colour, var(--text-dim));
  flex-shrink: 0;
}

.sl-item.critical      { --sev-colour: var(--sev-critical); --sev-ink: var(--sev-critical-ink); }
.sl-item.high          { --sev-colour: var(--sev-high);     --sev-ink: var(--sev-high-ink); }
.sl-item.medium        { --sev-colour: var(--sev-medium);   --sev-ink: var(--sev-medium-ink); }
.sl-item.low           { --sev-colour: var(--sev-low);      --sev-ink: var(--sev-low-ink); }
.sl-item.informational { --sev-colour: var(--sev-info);     --sev-ink: var(--sev-info-ink); }

/* ---- one card per band ---- */

.sev-cards {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

@media (max-width: 1180px) { .sev-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px)  { .sev-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 460px)  { .sev-cards { grid-template-columns: 1fr; } }

.sev-card {
  position: relative;
  display: block;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-top: 4px solid var(--sev-colour, var(--border-strong));
  border-radius: var(--radius-lg);
  padding: 16px 16px 14px;
  text-decoration: none;
  color: inherit;
  transition: box-shadow var(--transition-normal), transform var(--transition-normal);
}

a.sev-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--sev-colour, var(--border-strong));
}

.sc-rank {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background: var(--sev-colour, var(--border-strong));
}

.sc-top {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 14px;
  padding-right: 26px;
}

.sc-ico {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--sev-tint, var(--bg-main));
  color: var(--sev-ink, var(--text-muted));
  flex-shrink: 0;
}

.sc-ico svg { width: 19px; height: 19px; stroke-width: 2; }

.sc-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--sev-ink, var(--text-muted));
  line-height: 1.2;
}

.sc-scale { font-size: 11.5px; color: var(--text-dim); margin-top: 3px; }

.sc-mid {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.sc-num {
  font-size: 38px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--text-title);
  font-variant-numeric: tabular-nums;
}

.sc-pct {
  font-size: 14px;
  font-weight: 600;
  color: var(--sev-ink, var(--text-dim));
  font-variant-numeric: tabular-nums;
}

.sc-track {
  height: 7px;
  border-radius: 4px;
  background: var(--bg-main);
  overflow: hidden;
}

.sc-track i {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: var(--sev-colour, var(--border-strong));
  transition: width var(--transition-slow);
}

.sc-foot { font-size: 11.5px; color: var(--text-dim); margin-top: 9px; }

.sev-card.critical      { --sev-colour: var(--sev-critical); --sev-ink: var(--sev-critical-ink); --sev-tint: var(--sev-critical-tint); }
.sev-card.high          { --sev-colour: var(--sev-high);     --sev-ink: var(--sev-high-ink);     --sev-tint: var(--sev-high-tint); }
.sev-card.medium        { --sev-colour: var(--sev-medium);   --sev-ink: var(--sev-medium-ink);   --sev-tint: var(--sev-medium-tint); }
.sev-card.low           { --sev-colour: var(--sev-low);      --sev-ink: var(--sev-low-ink);      --sev-tint: var(--sev-low-tint); }
.sev-card.informational { --sev-colour: var(--sev-info);     --sev-ink: var(--sev-info-ink);     --sev-tint: var(--sev-info-tint); }

/* A band with nothing in it should not read as an alert. */
.sev-card.is-zero { --sev-colour: var(--border-strong); --sev-ink: var(--text-dim); --sev-tint: var(--bg-main); }
.sev-card.is-zero .sc-num { color: var(--text-dim); }

.sev-note {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.55;
  margin-top: 12px;
}

/* Narrow viewports cannot fit band names inside their segments. */
@media (max-width: 900px) {
  .sev-bar { height: 30px; }
  .sev-bar .sb-seg { font-size: 0; }
}

/* Marks a vulnerability that rolled several instances into one. */
.chip.tiny {
  font-size: 10.5px;
  padding: 1px 7px;
  margin-left: 8px;
  vertical-align: middle;
}

/* ---- Row selection (reports) ---- */

.cell-check { width: 34px; text-align: center; padding-right: 0; }

.cell-check input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--primary);
  cursor: pointer;
  vertical-align: middle;
}

.btn.danger:disabled,
.btn.danger[disabled] {
  background: var(--bg-main);
  border-color: var(--border);
  color: var(--text-dim);
  cursor: not-allowed;
}

/* The CVSS vector behind a score, shown so the rating can be checked. */
.vf-vector {
  font-size: 11.5px;
  color: var(--text-dim);
  margin-top: 8px;
  margin-bottom: 4px;
}

.vf-vector .mono { font-size: 11px; color: var(--text-muted); }

/* Captured screenshot of a discovered web service. */
.vf-proof.shot { padding: 0; overflow: hidden; }

.vf-proof.shot img {
  display: block;
  width: 100%;
  height: auto;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.vf-proof.shot .shot-cap {
  font-size: 11.5px;
  color: var(--text-dim);
  padding: 8px 12px;
  line-height: 1.5;
}

/* ======================================================
   Web VAPT additions
   Components specific to the web application scanner:
   the authorization gate, the live progress bar, stage
   details, and the discovered-URL status pills.
   ====================================================== */

/* --- Authorization gate (sections 4 and 36) ---------------------------
   Deliberately prominent. The user is about to direct traffic at someone
   else's application, and the confirmation should read as a decision
   rather than as another form field. */

.auth-gate {
  border: 1px solid var(--warning);
  background: var(--warning-bg);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  transition: border-color var(--transition-normal),
              background var(--transition-normal);
}

.auth-gate.confirmed {
  border-color: var(--success);
  background: var(--success-bg);
}

.ag-warn {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-title);
  margin-bottom: 14px;
}

.ag-warn svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  margin-top: 1px;
  color: var(--warning);
}

.auth-gate.confirmed .ag-warn svg { color: var(--success); }

.ag-check {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  cursor: pointer;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-main);
  padding-top: 13px;
  border-top: 1px solid rgba(15, 23, 42, 0.10);
}

.ag-check input[type="checkbox"] {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  margin-top: 2px;
  accent-color: var(--primary);
  cursor: pointer;
}

.ag-note {
  margin-top: 10px;
  font-size: 11.5px;
  color: var(--text-muted);
}

/* --- Live progress bar ----------------------------------------------- */

.progress-block { margin-top: 18px; }

.pb-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 7px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.pb-pct {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--text-title);
}

.pb-track {
  height: 9px;
  border-radius: var(--radius-full);
  background: var(--bg-card-hover);
  overflow: hidden;
  position: relative;
}

.pb-track i {
  display: block;
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

/* A sweep across the filled portion, so a slow stage still reads as live. */
.pb-track i::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 40%;
  background: linear-gradient(90deg, transparent,
                              rgba(255, 255, 255, 0.35), transparent);
  animation: sweep 1.8s linear infinite;
}

/* --- Stage detail ----------------------------------------------------- */

.stage-detail {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 3px;
  line-height: 1.5;
}

.stages li.skipped .stage-dot {
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
  color: var(--text-dim);
}

.stages li.skipped .stage-name { color: var(--text-dim); }

/* --- Discovered URL status pills -------------------------------------- */

.status-pill {
  display: inline-block;
  min-width: 34px;
  text-align: center;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.status-pill.s2 { background: var(--success-bg); color: #0B7A5B; }
.status-pill.s3 { background: var(--info-bg);    color: var(--primary-dark); }
.status-pill.s4 { background: var(--warning-bg); color: var(--gold-ink); }
.status-pill.s5 { background: var(--danger-bg);  color: #B02A2A; }

/* --- Key/value tables -------------------------------------------------- */
/* Used wherever the report shows a label/value pair, so the web preview and
   the PDF present the same structure. */

table.data.kv-table th {
  width: 190px;
  background: var(--bg-input);
  color: var(--text-muted);
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
}

table.data.kv-table td { color: var(--text-main); }

/* --- Confidence chips --------------------------------------------------- */

.chip.high   { background: var(--success-bg); color: #0B7A5B; }
.chip.medium { background: var(--warning-bg); color: var(--gold-ink); }
.chip.low    { background: var(--bg-card-hover); color: var(--text-muted); }

/* --- Evidence source label --------------------------------------------- */

.vf-proof-src {
  float: right;
  font-size: 10px;
  letter-spacing: 0.05em;
  opacity: 0.72;
  font-weight: 500;
}

/* --- Long tables ------------------------------------------------------- */

.table-scroll { max-height: 560px; overflow-y: auto; }

/* --- Severity summary cells -------------------------------------------- */

td.sev-cell {
  color: #ffffff;
  font-weight: 600;
  text-align: center;
  text-shadow: 0 1px 2px rgba(15, 23, 42, 0.28);
}

/* ======================================================
   Multi-select and bulk actions
   ====================================================== */

/* The toolbar appears only when a row is selected, so the table is not
   permanently carrying a control the user has no use for yet. */
.bulk-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  background: var(--primary-bg);
  border-bottom: 1px solid var(--primary-border);
  animation: fadeIn 0.18s ease both;
}

.bulk-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary-dark);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

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

.bulk-bar .grow { flex: 1; }

/* --- Selectable rows --------------------------------------------------- */

table.data.selectable tbody tr { cursor: pointer; }

table.data.selectable tbody tr.is-selected {
  background: var(--primary-bg);
}

table.data.selectable tbody tr.is-selected td {
  border-color: var(--primary-border);
}

/* The header checkbox and .btn.danger:disabled are already defined above with
   the reports row-selection styles; only the bulk toolbar is new here. */

/* ======================================================
   Plugin catalogue: search, filters and sorting
   ====================================================== */

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

/* The search field grows to take the space the selects do not. */
.search-field {
  position: relative;
  flex: 1 1 300px;
  min-width: 240px;
  display: flex;
  align-items: center;
}

.search-field svg {
  position: absolute;
  left: 12px;
  width: 15px;
  height: 15px;
  color: var(--text-dim);
  pointer-events: none;
}

.search-field .input {
  padding-left: 35px;
  padding-right: 30px;
  margin: 0;
}

/* Safari draws its own clear control on type=search; ours is consistent
   across browsers and matches the field's typography. */
.search-field input[type="search"]::-webkit-search-decoration,
.search-field input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.search-clear {
  position: absolute;
  right: 8px;
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-dim);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.search-clear:hover { background: var(--bg-card-hover); color: var(--text-main); }

.input.sm {
  width: auto;
  min-width: 150px;
  padding: 8px 11px;
  font-size: 12.5px;
  margin: 0;
}

/* --- Result count ------------------------------------------------------ */

.result-line {
  padding: 9px 18px;
  font-size: 12px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  background: var(--bg-input);
  font-variant-numeric: tabular-nums;
}

/* --- Sortable column headers ------------------------------------------- */

table.data th.sortable {
  cursor: pointer;
  user-select: none;
  position: relative;
  padding-right: 20px;
  transition: color var(--transition-fast);
}

table.data th.sortable:hover { color: var(--primary); }

/* A caret appears only on the column actually in use, so the header row is
   not cluttered with arrows on every column. */
table.data th.sortable::after {
  content: "";
  position: absolute;
  right: 7px;
  top: 50%;
  margin-top: -2px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

table.data th.sorted-asc::after {
  border-bottom: 5px solid currentColor;
  opacity: 0.75;
}

table.data th.sorted-desc::after {
  border-top: 5px solid currentColor;
  opacity: 0.75;
}

@media (max-width: 900px) {
  .filter-bar { flex-direction: column; align-items: stretch; }
  .input.sm { width: 100%; }
}

/* --- Catalogue table density -------------------------------------------
   Nine columns is a lot for one row. The table still scrolls if the viewport
   is narrow, but at a normal desktop width it should fit without the
   Enable/Disable control -- the primary action on this page -- ending up
   behind a horizontal scrollbar. */

#p-table th,
#p-table td {
  padding-left: 10px;
  padding-right: 10px;
}

#p-table td.cell-mono.cell-dim { font-size: 11.5px; }

#p-table td.cell-title {
  min-width: 190px;
  white-space: normal;
}

#p-table th[data-sort="findings"],
#p-table td:nth-child(7) { text-align: center; }

#p-table .btn.sm { padding: 5px 11px; font-size: 11.5px; }

/* ======================================================
   Confirmation dialog
   One in-application modal for every destructive action.
   ====================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  animation: fadeIn 0.16s ease both;
}

.modal-backdrop.leaving { animation: fadeIn 0.14s ease both reverse; }

.modal {
  width: 100%;
  max-width: 468px;
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
  overflow: hidden;
  animation: modalIn 0.2s cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-backdrop.leaving .modal { animation: none; }

/* A coloured hairline across the top carries the tone, so the dialog reads as
   destructive before the text is parsed. */
.modal::before {
  content: "";
  display: block;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
}

.modal.danger::before {
  background: linear-gradient(90deg, var(--danger), #F87171);
}

/* --- Header ------------------------------------------------------------ */

.modal-head {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 22px 24px 4px;
}

.modal-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  background: var(--info-bg);
  color: var(--primary);
}

.modal.danger .modal-ico { background: var(--danger-bg); color: var(--danger); }

.modal-ico svg { width: 19px; height: 19px; }

.modal-head h3 { font-size: 16px; line-height: 1.35; }

/* --- Body -------------------------------------------------------------- */

.modal-body { padding: 12px 24px 4px; }

.modal-message {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-muted);
}

/* What is about to be affected, named rather than counted. */
.modal-items {
  list-style: none;
  margin: 14px 0 0;
  padding: 10px 12px;
  max-height: 190px;
  overflow-y: auto;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--text-main);
}

.modal-items li { padding: 3px 0; }
.modal-items li.more { color: var(--text-dim); font-style: italic; }

.modal-note {
  margin-top: 13px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-dim);
}

.modal-typed {
  display: block;
  margin-top: 16px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
}

.modal-typed .input { margin-top: 7px; }

/* --- Actions ----------------------------------------------------------- */

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 20px 24px 22px;
}

.modal-actions .btn { min-width: 96px; justify-content: center; }

@media (max-width: 520px) {
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions .btn { width: 100%; }
}

/* --- Scan profile cards -------------------------------------------------- */

.mode-count {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--primary-dark);
  background: var(--primary-bg);
  border-radius: var(--radius-full);
  padding: 2px 10px;
  white-space: nowrap;
}

.mode-top .grow { flex: 1; }

.mode-meta {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-size: 11.5px;
  color: var(--text-muted);
}

.mode-meta svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  margin-top: 1px;
  color: var(--text-dim);
}

.mode-meta span { display: flex; gap: 7px; align-items: flex-start; }

/* --- Status filter chips ------------------------------------------------ */

.chip-filter {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.chip-filter:hover {
  border-color: var(--primary-border);
  background: var(--primary-bg);
  color: var(--primary-dark);
}

.chip-filter b {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--text-title);
}

.chip-filter.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.chip-filter.active b { color: #fff; }

/* The assessment row carries four links; keep them from wrapping mid-word. */
td.cell-actions { font-size: 12.5px; }

/* --- Assessment table density ------------------------------------------
   Ten columns is tight. The table still scrolls on a narrow viewport, but at
   desktop width the status and the report links should be visible without
   one. */

table.data.selectable th,
table.data.selectable td { padding-left: 10px; padding-right: 10px; }
