:root {
  --bg: #f4f2ef;
  --card: #ffffff;
  --ink: #1f1f1f;
  --muted: #6b6b6b;
  --safe: #1b8f45;
  --alert: #d18f00;
  --danger: #c62e2e;
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--ink);
  background: linear-gradient(135deg, #fdf6e3, #f4f2ef 50%, #ecf0f4);
  min-height: 100vh;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
  padding: 32px 8vw 24px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 8px;
}

.subtitle {
  margin: 8px 0 0;
  color: var(--muted);
}

.risk-badge {
  font-size: 24px;
  font-weight: 700;
  padding: 14px 28px;
  border-radius: 999px;
  color: white;
  background: linear-gradient(135deg, #27a456, #1b8f45);
  border: 2px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 12px 28px rgba(27, 143, 69, 0.35), var(--shadow);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  position: relative;
  overflow: hidden;
}

.risk-badge.alert {
  background: linear-gradient(135deg, #f0b020, #d18f00);
  box-shadow: 0 12px 28px rgba(209, 143, 0, 0.35), var(--shadow);
}

.risk-badge.danger {
  background: linear-gradient(135deg, #e14a4a, #c62e2e);
  box-shadow: 0 12px 28px rgba(198, 46, 46, 0.35), var(--shadow);
  animation: dangerPulse 1.6s ease-in-out infinite;
}

@keyframes dangerPulse {
  0% {
    transform: scale(1);
    box-shadow: 0 12px 28px rgba(198, 46, 46, 0.35), var(--shadow);
  }
  50% {
    transform: scale(1.04);
    box-shadow: 0 18px 34px rgba(198, 46, 46, 0.5), var(--shadow);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 12px 28px rgba(198, 46, 46, 0.35), var(--shadow);
  }
}

.grid {
  display: grid;
  gap: 24px;
  padding: 0 8vw 48px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.card {
  background: var(--card);
  padding: 24px;
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin-top: 12px;
}

.label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.value {
  font-size: 24px;
  font-weight: 600;
  display: inline-block;
  margin-right: 6px;
}

.unit {
  color: var(--muted);
  font-size: 14px;
}

.table-card table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: 14px;
}
.card canvas {
  display: block;
}
.table-card th,
.table-card td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid #eee;
}

@media (max-width: 700px) {
  .site-header {
    padding: 24px 6vw;
  }

  .grid {
    padding: 0 6vw 32px;
  }

  .risk-badge {
    width: 100%;
    text-align: center;
  }
}

/* ── Scrollable alert table — shows ~5 rows, rest scroll inside the card ── */

.table-card {
  display: flex;
  flex-direction: column;
}

.table-card table {
  display: block;
  width: 100%;
}

.table-card thead {
  display: table;
  width: 100%;
  table-layout: fixed;
}

.table-card tbody {
  display: block;
  max-height: 260px;   /* roughly 5 rows tall — adjust if your row height differs */
  overflow-y: auto;
}

.table-card tbody tr {
  display: table;
  width: 100%;
  table-layout: fixed;
}

/* Optional: nicer scrollbar */
.table-card tbody::-webkit-scrollbar {
  width: 8px;
}
.table-card tbody::-webkit-scrollbar-thumb {
  background: #d0cdc6;
  border-radius: 8px;
}
.table-card tbody::-webkit-scrollbar-track {
  background: transparent;
}
/* ── Senior Dev Centered Navigation ── */
.project-navigation {
  padding: 32px 8vw 16px;
  display: flex;
  flex-direction: column;   /* Stacks the brand name directly above the links */
  align-items: center;      /* Centers both items horizontally */
  gap: 16px;                /* Natural structural gap between brand and links */
  max-width: 1400px;
  margin: 0 auto;
}

/* Minimalist brand text identifier centered above */
.project-navigation .nav-brand {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;    /* Elegantly spaced out typography */
  color: var(--ink);
  opacity: 0.85;
}

.project-navigation ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;  /* Centers the inline list elements */
  gap: 36px;
}

.project-navigation a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  position: relative;
  transition: color 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 6px 0;
}

/* Premium micro-interaction underline effect */
.project-navigation a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--ink);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-navigation a:hover {
  color: var(--ink);
}

.project-navigation a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.project-navigation a.active {
  color: var(--ink);
}

.project-navigation a.active::after {
  transform: scaleX(1);
}

/* Responsive adjustments for mobile viewports */
@media (max-width: 700px) {
  .project-navigation {
    padding: 24px 6vw 12px;
    gap: 12px;
  }
  
  .project-navigation ul {
    gap: 20px;
    flex-wrap: wrap;
  }
  
  .project-navigation a {
    font-size: 12px;
  }
}

/* Custom form elements for secondary pages */
.form-group {
  margin-bottom: 20px;
}
.form-group label {
  display: block;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 8px;
  font-weight: 600;
}
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--ink);
}
.submit-btn {
  background: var(--ink);
  color: white;
  border: none;
  padding: 14px 28px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 8px;
  cursor: pointer;
  width: 100%;
  transition: background 0.2s;
}
.submit-btn:hover {
  background: #333333;
}
/* Update your site-header to allow optional centering */
.site-header {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
  padding: 32px 8vw 24px;
}

/* Add this class specifically for pages where you want the header centered */
.site-header.centered {
  text-align: center;
  flex-direction: column;
  justify-content: center;
  max-width: 800px;
  margin: 0 auto;
}

/* Ensure sub elements look clean when centered */
.site-header.centered .eyebrow,
.site-header.centered .subtitle {
  width: 100%;
}

/* Reusing your exact form variables naturally for report.html */
.form-card {
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
}

.form-group {
  margin-bottom: 20px;
  text-align: left; /* Keeps form labels aligned even if header is centered */
}

.form-group label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 8px;
  font-weight: 600;
}

.form-group input, 
.form-group select, 
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #e2e2e2;
  border-radius: 12px; /* Smooth rounded corners matching your cards */
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  background-color: var(--card);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus, 
.form-group select:focus, 
.form-group textarea:focus {
  outline: none;
  border-color: var(--muted);
  box-shadow: 0 0 0 3px rgba(0,0,0,0.02);
}

.submit-btn {
  background: var(--ink);
  color: white;
  border: none;
  padding: 14px 28px;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: 999px; /* Pill style matching your risk badge */
  cursor: pointer;
  width: 100%;
  box-shadow: var(--shadow);
  transition: opacity 0.2s, transform 0.1s;
}

.submit-btn:hover {
  opacity: 0.9;
}

.submit-btn:active {
  transform: scale(0.98);
}
/* ── Senior Dev Design Cleanups ── */
.project-section-title {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  border-bottom: 1px solid #eee;
  padding-bottom: 8px;
  margin-bottom: 16px;
  font-weight: 700;
}

.narrative-text {
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink);
  margin-bottom: 32px;
}

.narrative-text strong {
  font-weight: 600;
}