/* Vanguard operator UI — shares the Forsan brand (navy/teal) used in the
   client-facing PDF report, so the tool and the deliverable feel like one
   product. */

:root {
  --navy: #0f1b3d;
  --navy-light: #16244d;
  --teal: #2dd4bf;
  --teal-dark: #0f9488;
  --text: #1a1a2e;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --bg: #f7f8fa;
  --card-bg: #ffffff;
  --critical: #b91c1c;
  --high: #c2410c;
  --medium: #a16207;
  --low: #2563eb;
  --info: #64748b;
  --danger: #b00020;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

header.nav {
  background: var(--navy);
  color: #fff;
  padding: 0 1.5rem;
}

header.nav .nav-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

header.nav .brand {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
  color: #fff;
  text-decoration: none;
}

header.nav .brand .accent { color: var(--teal); }

header.nav nav a {
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.9rem;
  margin-left: 1.25rem;
}

header.nav nav a:hover { color: #fff; }

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.75rem 1.5rem 4rem;
}

h1, h2, h3, h4 { color: var(--navy); margin-top: 0; }
h2 { font-size: 1.5rem; border-bottom: 2px solid var(--border); padding-bottom: 0.5rem; margin-bottom: 1.25rem; }
h3 { font-size: 1.1rem; }

a { color: var(--teal-dark); }

/* --- Flash messages --- */
ul.flashes { list-style: none; margin: 1rem auto; max-width: 960px; padding: 0 1.5rem; }
ul.flashes li {
  background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46;
  padding: 0.6rem 0.9rem; border-radius: 6px; margin-bottom: 0.5rem; font-size: 0.9rem;
}

p.error, li.error {
  background: #fef2f2; border: 1px solid #fecaca; color: var(--danger);
  padding: 0.6rem 0.9rem; border-radius: 6px; font-size: 0.9rem;
}

/* --- Cards --- */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
}

.card-list { display: flex; flex-direction: column; gap: 0.6rem; list-style: none; padding: 0; margin: 0; }
.card-list li { margin: 0; }
.card-link {
  display: block; background: var(--card-bg); border: 1px solid var(--border); border-radius: 8px;
  padding: 0.9rem 1.1rem; text-decoration: none; color: var(--text); font-weight: 600;
  transition: border-color 0.15s;
}
.card-link:hover { border-color: var(--teal); }

/* --- Forms --- */
form { display: flex; flex-direction: column; gap: 0.9rem; }
form.inline { flex-direction: row; align-items: center; gap: 0.6rem; }

label { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.85rem; font-weight: 600; color: #374151; }

input[type="text"], input[type="password"], input[type="file"], select, textarea {
  font-family: inherit; font-size: 0.95rem; font-weight: 400; color: var(--text);
  border: 1px solid #d1d5db; border-radius: 6px; padding: 0.5rem 0.65rem; background: #fff;
}

textarea { min-height: 4.5em; resize: vertical; }

button, input[type="submit"] {
  font-family: inherit; font-size: 0.9rem; font-weight: 600; cursor: pointer;
  background: var(--navy); color: #fff; border: none; border-radius: 6px;
  padding: 0.55rem 1.1rem; align-self: flex-start;
  transition: background 0.15s;
}
button:hover, input[type="submit"]:hover { background: var(--navy-light); }
button:disabled { background: #9ca3af; cursor: not-allowed; }
button.secondary { background: #fff; color: var(--navy); border: 1px solid var(--border); }
button.secondary:hover { background: #f3f4f6; }
button.danger { background: #fff; color: var(--danger); border: 1px solid #fecaca; }
button.danger:hover { background: #fef2f2; }

.btn-link {
  display: inline-block; font-size: 0.9rem; font-weight: 600; text-decoration: none;
  background: var(--navy); color: #fff; border-radius: 6px; padding: 0.55rem 1.1rem;
}
.btn-link:hover { background: var(--navy-light); }
.btn-link.secondary { background: #fff; color: var(--navy); border: 1px solid var(--border); }
.btn-link.secondary:hover { background: #f3f4f6; }

/* --- Center-card auth/create forms --- */
.center-card { max-width: 380px; margin: 3rem auto; }

/* --- Section card wrapper used across detail pages --- */
section.card h3 { margin-bottom: 1rem; }
section.card + section.card { margin-top: 1.25rem; }

/* --- Severity badges (match the PDF report's palette) --- */
.badge { display: inline-block; padding: 2px 10px; border-radius: 10px; font-size: 0.75rem; font-weight: 700; color: #fff; white-space: nowrap; }
.badge-Critical { background: var(--critical); }
.badge-High { background: var(--high); }
.badge-Medium { background: var(--medium); }
.badge-Low { background: var(--low); }
.badge-Informational { background: var(--info); }

/* --- Status pill (running/idle) --- */
.status-pill { display: inline-block; padding: 3px 11px; border-radius: 10px; font-size: 0.8rem; font-weight: 600; }
.status-running { background: #fef3c7; color: #92400e; }
.status-idle { background: #e5e7eb; color: #374151; }
.status-none { background: #e5e7eb; color: #6b7280; }

/* --- Run output panel --- */
pre#run-log {
  background: #0f172a; color: #d1d5db; border-radius: 6px; padding: 1rem;
  font-size: 0.8rem; max-height: 280px; overflow-y: auto; white-space: pre-wrap; word-break: break-word;
}

/* --- Files grouped by folder --- */
.file-group { margin-bottom: 1rem; }
.file-group h4 { margin: 0 0 0.4rem 0; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
.file-group ul { list-style: none; margin: 0; padding: 0; }
.file-group li { padding: 0.25rem 0; border-bottom: 1px solid #f1f5f9; font-size: 0.9rem; }
.file-group li:last-child { border-bottom: none; }
.file-group a { color: var(--text); text-decoration: none; }
.file-group a:hover { color: var(--teal-dark); text-decoration: underline; }

/* --- Findings list: collapsible rows --- */
details.finding { border: 1px solid var(--border); border-radius: 8px; margin-bottom: 0.75rem; background: #fff; }
details.finding summary {
  list-style: none; cursor: pointer; padding: 0.8rem 1.1rem; display: flex; align-items: center; gap: 0.7rem;
  font-weight: 600; color: var(--navy);
}
details.finding summary::-webkit-details-marker { display: none; }
details.finding summary::before { content: "▸"; color: var(--text-muted); font-size: 0.8rem; }
details.finding[open] summary::before { content: "▾"; }
details.finding .finding-body { padding: 0 1.1rem 1.1rem; border-top: 1px solid var(--border); }
details.finding .finding-body form { padding-top: 1rem; }
details.finding .finding-actions { display: flex; gap: 0.6rem; margin-top: 0.5rem; }

/* --- Evidence thumbnails --- */
.evidence-thumb { max-width: 160px; max-height: 110px; border-radius: 4px; border: 1px solid var(--border); object-fit: cover; }
