:root {
  --page: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --sidebar: #0f172a;
  --sidebar-2: #111c31;
  --text: #111827;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --primary: #1d4ed8;
  --primary-2: #2563eb;
  --primary-soft: #dbeafe;
  --success: #047857;
  --warning: #b45309;
  --danger: #b91c1c;
  --info: #0369a1;
  --shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.10), transparent 30%),
    linear-gradient(180deg, #f8fafc 0%, var(--page) 44%, #eef2f7 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input, summary { font: inherit; }
button { border: 0; }
a { color: inherit; }

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 26px 22px;
  color: #e5edf7;
  background:
    linear-gradient(180deg, rgba(17, 28, 49, 0.96), rgba(15, 23, 42, 0.99)),
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.25), transparent 35%);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-mark {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 16px;
  font-weight: 900;
  letter-spacing: -0.04em;
  color: #ffffff;
  background: linear-gradient(135deg, #1d4ed8, #0f766e);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.25);
}
.brand-copy { min-width: 0; }
.brand h1 { margin: 0; font-size: 23px; letter-spacing: -0.045em; }
.brand p { margin: 3px 0 0; color: #a9b6ca; font-size: 12px; line-height: 1.35; }

.nav-list {
  display: grid;
  gap: 7px;
  margin-top: 26px;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 12px 13px;
  border-radius: 14px;
  color: #a9b6ca;
  text-decoration: none;
  border: 1px solid transparent;
  transition: 160ms ease;
}
.nav-link span {
  flex: 0 0 auto;
  width: 28px;
  color: #7f90aa;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}
.nav-link:hover,
.nav-link.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.10);
}
.nav-link.active span { color: #93c5fd; }

.sidebar-card {
  margin-top: 28px;
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.065);
  border: 1px solid rgba(255, 255, 255, 0.10);
}
.card-kicker,
.eyebrow {
  margin: 0 0 8px;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 11px;
  font-weight: 900;
}
.sidebar-card .card-kicker { color: #93c5fd; }
.sidebar-card strong { display: block; font-size: 15px; color: #fff; }
.sidebar-card p { margin: 9px 0 0; color: #a9b6ca; font-size: 13px; line-height: 1.55; }

.main {
  width: 100%;
  min-width: 0;
  max-width: 1440px;
  padding: 28px;
  display: grid;
  gap: 22px;
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 430px);
  gap: 24px;
  align-items: stretch;
}
.hero-content,
.scan-card,
.content-card,
.metric-card {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.hero-content {
  position: relative;
  overflow: hidden;
  padding: clamp(26px, 4vw, 48px);
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(30, 58, 138, 0.94)),
    radial-gradient(circle at 88% 15%, rgba(20, 184, 166, 0.28), transparent 34%);
  color: #ffffff;
}
.hero-content::after {
  content: "";
  position: absolute;
  right: -90px;
  bottom: -110px;
  width: 320px;
  height: 320px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
}
.status-pill,
.safe-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  padding: 8px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  color: #dbeafe;
  background: rgba(219, 234, 254, 0.12);
  border: 1px solid rgba(219, 234, 254, 0.18);
}
.hero-content h2 {
  max-width: 820px;
  margin: 22px 0 16px;
  font-size: clamp(36px, 5vw, 68px);
  line-height: 0.95;
  letter-spacing: -0.065em;
}
.hero-content p {
  max-width: 780px;
  margin: 0;
  color: #cbd5e1;
  font-size: 17px;
  line-height: 1.72;
}
.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}
.trust-row span {
  padding: 8px 11px;
  border-radius: 999px;
  color: #dbeafe;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.10);
  font-size: 12px;
  font-weight: 800;
}

.scan-card {
  padding: 24px;
  display: grid;
  gap: 16px;
  align-content: start;
}
.form-header,
.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.form-header h3,
.section-heading h3,
.content-card h3 { margin: 0; font-size: 23px; letter-spacing: -0.04em; }
.safe-badge {
  color: #065f46;
  background: #d1fae5;
  border-color: #a7f3d0;
}
.field-group { display: grid; gap: 8px; min-width: 0; }
.field-group.compact { padding-top: 12px; }
label { color: #334155; font-size: 13px; font-weight: 800; }
input {
  width: 100%;
  min-width: 0;
  color: var(--text);
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  padding: 13px 14px;
  outline: none;
  transition: 160ms ease;
}
input::placeholder { color: #94a3b8; }
input:focus { border-color: var(--primary-2); box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12); }
small { color: var(--muted); line-height: 1.45; }
code {
  padding: 2px 5px;
  border-radius: 6px;
  color: #1e3a8a;
  background: #eff6ff;
  overflow-wrap: anywhere;
}
.checkbox-row {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  color: #475569;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.45;
}
.checkbox-row input { width: auto; flex: 0 0 auto; margin-top: 3px; }
.advanced-settings {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-2);
  padding: 12px 14px;
}
.advanced-settings summary {
  cursor: pointer;
  color: #334155;
  font-size: 13px;
  font-weight: 900;
}
.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border-radius: 14px;
  padding: 12px 16px;
  font-weight: 900;
  cursor: pointer;
  transition: 160ms ease;
  white-space: nowrap;
}
.primary-button {
  color: #ffffff;
  background: linear-gradient(135deg, #1d4ed8, #0f766e);
  box-shadow: 0 14px 30px rgba(29, 78, 216, 0.18);
}
.primary-button:hover { transform: translateY(-1px); box-shadow: 0 18px 34px rgba(29, 78, 216, 0.24); }
.secondary-button {
  color: #1e293b;
  background: #ffffff;
  border: 1px solid var(--line-strong);
}
.secondary-button:hover { border-color: #93c5fd; color: #1d4ed8; }
button:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.status-message {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.status-message.error { color: var(--danger); }
.status-message.success { color: var(--success); }

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}
.metric-card { padding: 21px; min-width: 0; }
.metric-card span { color: var(--muted); font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.10em; }
.metric-card strong {
  display: block;
  margin-top: 10px;
  color: #0f172a;
  font-size: clamp(26px, 4vw, 40px);
  letter-spacing: -0.055em;
  line-height: 1;
  overflow-wrap: anywhere;
}
.metric-card p { margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.35; overflow-wrap: anywhere; }

.content-card { padding: 24px; min-width: 0; }
.section-heading { margin-bottom: 18px; }
.severity-bars { display: grid; gap: 13px; }
.severity-row {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) 44px;
  gap: 12px;
  align-items: center;
  color: #334155;
}
.severity-row strong { font-size: 13px; }
.severity-row span { color: var(--muted); text-align: right; font-weight: 800; }
.bar-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}
.bar-fill { height: 100%; min-width: 2%; border-radius: 999px; background: #64748b; }
.bar-fill.Critical { background: #991b1b; }
.bar-fill.High { background: #dc2626; }
.bar-fill.Medium { background: #d97706; }
.bar-fill.Low { background: #2563eb; }
.bar-fill.Info { background: #0891b2; }

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #ffffff;
}
table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  table-layout: fixed;
}
th, td {
  padding: 15px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 13px;
  overflow-wrap: anywhere;
  word-break: break-word;
}
th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #475569;
  background: #f8fafc;
  font-size: 11px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
}
td:first-child, th:first-child { width: 76px; }
td:nth-child(3), th:nth-child(3) { width: 116px; }
td strong { color: #0f172a; }
td small { display: block; margin-top: 5px; }
tr:last-child td { border-bottom: 0; }
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}
.badge.Critical { color: #7f1d1d; background: #fee2e2; }
.badge.High { color: #991b1b; background: #fee2e2; }
.badge.Medium { color: #92400e; background: #fef3c7; }
.badge.Low { color: #1d4ed8; background: #dbeafe; }
.badge.Info { color: #155e75; background: #cffafe; }

.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}
pre {
  max-width: 100%;
  max-height: 520px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 16px 0 0;
  padding: 16px;
  color: #dbeafe;
  background: #0f172a;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 16px;
  font-size: 12px;
  line-height: 1.55;
}
.report-content {
  color: #334155;
  line-height: 1.65;
  overflow-wrap: anywhere;
}
.report-content h4 { margin: 20px 0 8px; color: #0f172a; font-size: 16px; }
.report-content h4:first-child { margin-top: 0; }
.report-content p { margin: 0 0 12px; }
.report-content ul { margin: 8px 0 0; padding-left: 20px; }
.empty-state {
  color: var(--muted);
  padding: 16px;
  text-align: center;
}

@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: relative;
    height: auto;
    display: block;
    padding: 20px;
  }
  .nav-list {
    grid-template-columns: repeat(5, minmax(140px, 1fr));
    overflow-x: auto;
    padding-bottom: 4px;
  }
  .sidebar-card { margin-top: 18px; }
  .hero-panel { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .main { padding: 16px; gap: 16px; }
  .sidebar { padding: 16px; }
  .brand { padding-bottom: 18px; }
  .nav-list { grid-template-columns: 1fr; }
  .hero-content, .scan-card, .content-card { border-radius: 18px; padding: 20px; }
  .hero-content h2 { font-size: 36px; }
  .metric-grid, .two-col { grid-template-columns: 1fr; }
  .form-header, .section-heading { flex-direction: column; align-items: stretch; }
  .primary-button, .secondary-button { width: 100%; white-space: normal; }
  .severity-row { grid-template-columns: 72px minmax(0, 1fr) 34px; gap: 9px; }
  table { min-width: 760px; }
}

@media print {
  body { background: #ffffff; }
  .sidebar, .scan-card, .secondary-button, .primary-button, .trust-row { display: none !important; }
  .app-shell, .main, .hero-panel, .two-col, .metric-grid { display: block; }
  .main { max-width: none; padding: 0; }
  .hero-content, .content-card, .metric-card {
    box-shadow: none;
    border: 1px solid #cbd5e1;
    margin-bottom: 14px;
    color: #111827;
    background: #ffffff;
  }
  .hero-content p, .hero-content h2 { color: #111827; }
  pre { color: #111827; background: #f8fafc; }
}
.advanced-settings.is-configured summary::after {
  content: "Configured";
  float: right;
  color: #047857;
  background: #d1fae5;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
}
