:root {
  --dark-green: #096126;
  --accent-green: #49A91D;
  --grey: #BDBDBD;
  --dark-grey: #4B4B4B;
  --bg: #F7F8F6;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: #1a1a1a;
}

.topbar {
  background: var(--dark-green);
  color: white;
}

.topbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: white;
  font-weight: 600;
  text-decoration: none;
  font-size: 1.1rem;
}

.brand-logo-chip {
  display: flex;
  align-items: center;
  background: white;
  border-radius: 6px;
  padding: 3px 8px;
  line-height: 0;
}

.brand-logo-chip img {
  display: block;
  height: 28px;
  width: auto;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 28px;
}

.topbar-nav {
  display: flex;
  gap: 10px;
}

.nav-button {
  color: white;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 8px 16px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  transition: background 0.15s ease;
}

.nav-button:hover {
  background: rgba(255, 255, 255, 0.22);
}

.nav-button.active {
  background: white;
  color: var(--dark-green);
  border-color: white;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-right a {
  color: white;
  text-decoration: none;
}

.user-email {
  opacity: 0.85;
  font-size: 0.9rem;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 30px 20px 60px;
}

h1 {
  color: var(--dark-green);
  font-size: 1.5rem;
  margin-top: 30px;
}

h1:first-child { margin-top: 0; }

.card {
  background: white;
  border: 1px solid #E0E0E0;
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 20px;
}

.card.narrow {
  max-width: 380px;
  margin: 40px auto;
}

.doc-sequence-wrap {
  position: relative;
}

.doc-sequence {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  position: relative;
}

.doc-step {
  display: flex;
  gap: 18px;
  position: relative;
  padding-bottom: 22px;
  scroll-margin-top: 16px;
}

.doc-step:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 21px;
  top: 44px;
  bottom: 0;
  width: 2px;
  background: #E0E0E0;
}

.doc-step-number {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--dark-green);
  color: white;
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.doc-step-card {
  flex: 1;
  display: flex;
  align-items: stretch;
  background: white;
  border: 1px solid #E0E0E0;
  border-radius: 8px;
  overflow: hidden;
}

.doc-step-body {
  flex: 1;
  min-width: 0;
  padding: 16px 20px;
}

.doc-step-body h2 {
  font-size: 1.05rem;
  color: var(--dark-green);
  margin: 0 0 6px;
}

.doc-step-body p {
  font-size: 0.9rem;
  color: var(--dark-grey);
  margin: 0 0 12px;
}

.doc-step-status {
  flex: 0 0 560px;
  display: flex;
  border-left: 1px solid #E0E0E0;
  background: #FAFBF9;
  font-size: 0.85rem;
}

.doc-step-status-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 16px 14px;
  border-right: 1px solid #E9E9E9;
}

.doc-step-status-col:last-child {
  border-right: none;
}

.doc-step-updated {
  color: var(--dark-grey);
}

.doc-step-actions a,
.doc-step-actions .link-button {
  margin-left: 0;
}

.doc-sequence-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  gap: 18px;
  padding-bottom: 10px;
  background: var(--bg);
}

.doc-sequence-header-spacer {
  flex: 0 0 44px;
}

.doc-sequence-header-card {
  flex: 1;
  display: flex;
  background: var(--dark-green);
  border: 1px solid var(--dark-green);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 5px rgba(9, 97, 38, 0.25);
}

.doc-sequence-header-doc {
  flex: 1;
  min-width: 0;
  padding: 12px 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: white;
}

.doc-sequence-header-status {
  flex: 0 0 560px;
  display: flex;
  border-left: 1px solid rgba(255, 255, 255, 0.25);
}

.doc-sequence-header-status span {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: white;
  border-right: 1px solid rgba(255, 255, 255, 0.25);
}

.doc-sequence-header-status span:last-child {
  border-right: none;
}

.doc-number {
  display: inline-block;
  background: var(--dark-green);
  color: white;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 0.85rem;
  margin-right: 8px;
  vertical-align: middle;
}

.project-banner {
  background: #F2F7F0;
  border: 1px solid #DCEBD6;
  border-radius: 6px;
  padding: 10px 14px;
}

.active-project-card {
  margin-bottom: 20px;
}

.overview-card h2, .candidate-progress h2 {
  font-size: 1rem;
  color: var(--dark-green);
  margin: 0 0 8px;
}

.candidate-progress {
  margin-bottom: 20px;
}

.gate-status {
  font-weight: 600;
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 14px;
}

.gate-status.gate-ready {
  background: #E3F5E1;
  border: 1px solid #B8DFAE;
  color: var(--dark-green);
}

.gate-status.gate-not-ready {
  background: #FCEFD9;
  border: 1px solid #F0CE8C;
  color: #7A5900;
}

.gate-flag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 10px;
  background: #FDECEC;
  color: #A32020;
}

.gate-flag.gate-flag-complete {
  background: #DCEBD6;
  color: var(--dark-green);
}

.overview-table td, .overview-table th {
  padding: 8px 14px;
}

.active-row {
  background: #F2F7F0;
}

.link-button {
  background: none;
  border: none;
  padding: 0;
  color: var(--dark-green);
  text-decoration: underline;
  font-size: inherit;
  cursor: pointer;
  margin-left: 10px;
}

.link-button:hover { background: none; color: var(--accent-green); }

.link-button.danger { color: #A32020; }

.button, button {
  display: inline-block;
  background: var(--accent-green);
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 6px;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
}

.button:hover, button:hover { background: var(--dark-green); }

form label {
  display: block;
  margin-bottom: 14px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--dark-grey);
}

form input, form textarea, form select {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 8px 10px;
  border: 1px solid var(--grey);
  border-radius: 4px;
  font-size: 0.95rem;
  font-weight: normal;
  font-family: inherit;
  background: white;
}

.logo-preview {
  display: block;
  max-height: 60px;
  max-width: 220px;
  margin-top: 8px;
  padding: 8px;
  border: 1px solid var(--grey);
  border-radius: 4px;
  background: white;
}

.field-guidance {
  display: block;
  margin-top: 4px;
  font-size: 0.8rem;
  font-weight: normal;
  font-style: italic;
  color: var(--dark-grey);
}

/* Two-column field layout: question on the left, input aligned in a column on
   the right - used by the online checklist form to keep long question lists
   scannable instead of a tall label-above-input stack. */
.field-row {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 12px;
}

.field-row .field-label-text {
  flex: 0 0 56%;
  max-width: 56%;
  padding-top: 8px;
}

.field-row .field-input-wrap {
  flex: 1 1 auto;
  min-width: 0;
}

.field-row input,
.field-row textarea,
.field-row select {
  margin-top: 0;
}

/* Highlights a computed Yes/No row (e.g. "IS THIS PROJECT NOTIFIABLE?") in green
   once the answer is Yes - mirrors the same conditional highlight in the PDF. */
.field-row-highlight {
  background: #E3F5E1;
  border: 1px solid #B8DFAE;
  border-radius: 6px;
  padding: 10px 12px;
  margin-left: -12px;
  margin-right: -12px;
}

@media (max-width: 640px) {
  .field-row {
    flex-direction: column;
    gap: 4px;
  }
  .field-row .field-label-text {
    flex-basis: auto;
    max-width: 100%;
    padding-top: 0;
  }
}

/* Grid layout for side-by-side comparisons (e.g. Selection Matrix candidates) -
   criteria as rows, candidates as columns, matching the master workbook's own layout. */
.matrix-scroll {
  overflow-x: auto;
  margin-bottom: 12px;
}

.matrix-table {
  border-collapse: collapse;
  table-layout: fixed;
  width: 100%;
  min-width: 720px;
  font-size: 0.9rem;
}

/* Fixed widths shared across every matrix table in a form (Applicant Details,
   Assessment Criteria, Scoring Summary) so their candidate columns line up
   vertically, even though only the Criteria table actually uses the Weight column. */
.matrix-col-label { width: 230px; }
.matrix-col-weight { width: 70px; }
.matrix-col-candidate { width: auto; }

.matrix-table th, .matrix-table td {
  border: 1px solid var(--grey);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
  overflow-wrap: break-word;
}

.matrix-table th {
  background: #F2F7F0;
  color: var(--dark-green);
  font-size: 0.85rem;
}

.matrix-table td.matrix-row-label {
  font-weight: 600;
}

.matrix-table td.matrix-weight {
  text-align: center;
  color: var(--dark-grey);
}

.matrix-table input, .matrix-table select {
  margin-top: 0;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.form-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.button-secondary {
  background: white;
  color: var(--dark-green);
  border: 1px solid var(--dark-green);
}

.button-secondary:hover {
  background: #F2F7F0;
  color: var(--dark-green);
}

.status-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 10px;
  vertical-align: middle;
  margin-left: 6px;
}

.status-draft {
  background: #FCE8B2;
  color: #7A5900;
}

.status-complete {
  background: #DCEBD6;
  color: var(--dark-green);
}

.status-not-started {
  background: #EAEAEA;
  color: var(--dark-grey);
}

fieldset {
  border: 1px solid #E0E0E0;
  border-radius: 6px;
  margin-bottom: 18px;
  padding: 16px;
}

legend {
  font-weight: 600;
  color: var(--dark-green);
  padding: 0 6px;
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border: 1px solid #E0E0E0;
  border-radius: 8px;
  overflow: hidden;
}

.doc-table th, .doc-table td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid #EEE;
  font-size: 0.9rem;
}

.doc-table th {
  background: #F2F7F0;
  color: var(--dark-green);
}

.project-name-button {
  display: inline-block;
  color: white;
  background: var(--accent-green);
  border: 1px solid var(--accent-green);
  border-radius: 6px;
  padding: 6px 14px;
  font-weight: 700;
  text-decoration: none;
}

.project-name-button:hover {
  background: var(--dark-green);
  border-color: var(--dark-green);
}

.hint {
  color: var(--dark-grey);
  font-size: 0.85rem;
}

.form-error {
  background: #FDECEC;
  color: #A32020;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 0.9rem;
}

.back-link {
  display: inline-block;
  margin-bottom: 14px;
  color: var(--dark-green);
  text-decoration: none;
  font-size: 0.9rem;
}
