:root {
  --green: #1f8a4c;
  --green-dark: #156638;
  --ink: #1c2a22;
  --muted: #5f7168;
  --line: #dce5df;
  --bg: #f4f7f4;
  --card: #ffffff;
  --danger: #c0392b;
  --warn: #b8860b;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(20, 60, 40, .08), 0 6px 24px rgba(20, 60, 40, .06);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}
a { color: var(--green-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

/* header */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: .7rem 1.4rem; background: var(--card);
  border-bottom: 1px solid var(--line); flex-wrap: wrap;
}
.brand { display: flex; flex-direction: column; line-height: 1.1; }
.brand-mark { font-size: 1.25rem; color: var(--green-dark); font-weight: 600; }
.brand-mark strong { color: var(--green); }
.brand-sub { font-size: .72rem; color: var(--muted); }
.nav { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.nav .who { color: var(--muted); font-size: .85rem; }
.lang select {
  border: 1px solid var(--line); border-radius: 8px; padding: .3rem .5rem; background: #fff;
}

/* layout */
.wrap { max-width: 960px; margin: 2rem auto; padding: 0 1.2rem; }
.wrap.narrow { max-width: 460px; }
.foot { text-align: center; color: var(--muted); font-size: .8rem; padding: 2rem 1rem; }

/* cards */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1.6rem; margin-bottom: 1.4rem;
}
h1 { font-size: 1.6rem; margin: 0 0 .6rem; }
h2 { font-size: 1.15rem; margin: 1.4rem 0 .6rem; color: var(--green-dark); }
.lead { color: var(--muted); margin-top: 0; }

/* buttons */
.btn {
  display: inline-block; background: var(--green); color: #fff;
  border: 0; border-radius: 8px; padding: .6rem 1.1rem; font-size: .95rem;
  cursor: pointer; font-weight: 500;
}
.btn:hover { background: var(--green-dark); text-decoration: none; }
.btn-sm { padding: .35rem .7rem; font-size: .85rem; }
.btn-ghost { background: transparent; color: var(--green-dark); border: 1px solid var(--line); }
.btn-ghost:hover { background: #eef4ef; }
.btn-row { display: flex; gap: .8rem; align-items: center; margin-top: 1.2rem; }
.btn-block { display: block; width: 100%; text-align: center; }

/* admin actions */
.actions { display: flex; flex-direction: column; gap: .5rem; min-width: 220px; }
.upload-form { display: flex; flex-direction: column; gap: .4rem; }
.filepick {
  position: relative; display: flex; align-items: center; gap: .5rem;
  border: 1px dashed var(--line); border-radius: 8px; padding: .4rem .55rem;
  cursor: pointer; background: #fafcfa;
}
.filepick input[type=file] {
  position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer;
}
.filepick-btn {
  background: #eef4ef; color: var(--green-dark); border-radius: 6px;
  padding: .3rem .6rem; font-size: .82rem; font-weight: 500; white-space: nowrap;
}
.filepick-name {
  font-size: .8rem; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* forms */
label.field { display: block; margin: .8rem 0; }
label.field > span { display: block; font-size: .9rem; margin-bottom: .25rem; }
label.field .req { color: var(--danger); }
input[type=text], input[type=email], input[type=password], input[type=number],
select.input, textarea {
  width: 100%; padding: .55rem .65rem; border: 1px solid var(--line);
  border-radius: 8px; font-size: .95rem; background: #fff; font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--green); border-color: var(--green); }
.hint { color: var(--muted); font-size: .82rem; margin: .2rem 0 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } }

/* messages */
.alert { border-radius: 8px; padding: .8rem 1rem; margin: 1rem 0; font-size: .92rem; }
.alert-error { background: #fdecea; color: var(--danger); border: 1px solid #f5c6c0; }
.alert-ok { background: #e8f6ee; color: var(--green-dark); border: 1px solid #bfe4cd; }
.alert-info { background: #eef4ef; color: var(--ink); border: 1px solid var(--line); }

/* tables */
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-scroll { overflow-x: auto; }

/* badges */
.badge { display: inline-block; padding: .15rem .55rem; border-radius: 20px; font-size: .78rem; font-weight: 600; }
.badge-pending { background: #fff3d6; color: var(--warn); }
.badge-validated { background: #e2eefc; color: #2b6cb0; }
.badge-released { background: #e8f6ee; color: var(--green-dark); }

/* wizard */
/* clickable step navigation (matches the green card style) */
.step-nav { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.4rem; }
.step-tab {
  position: relative; display: inline-flex; align-items: center; gap: .45rem;
  background: var(--card); border: 1px solid var(--line); border-radius: 8px;
  padding: .4rem .8rem; cursor: pointer; font-size: .85rem; color: var(--muted);
  font-family: inherit; transition: color .15s, background .15s, border-color .15s;
}
.step-tab:hover { border-color: var(--green); color: var(--ink); }
.step-tab .step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%; background: var(--bg);
  border: 1px solid var(--line); color: var(--muted); font-size: .74rem;
  font-weight: 600; flex: 0 0 auto;
}
.step-tab.done { border-color: #bfe4cd; color: var(--green-dark); }
.step-tab.done .step-num { background: var(--green); border-color: var(--green); color: #fff; }
.step-tab.active {
  background: var(--green); border-color: var(--green); color: #fff; font-weight: 600;
  box-shadow: var(--shadow);
}
.step-tab.active .step-num { background: rgba(255, 255, 255, .25); border-color: transparent; color: #fff; }

/* red count badge for steps that still have missing cells */
.step-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--danger); color: #fff; font-size: .7rem; font-weight: 700;
}
.step-tab.active .step-badge { background: #fff; color: var(--danger); }
.step { display: none; }
.step.active { display: block; }
.step-head { color: var(--muted); font-size: .85rem; }
.section-head { margin: 1.2rem 0 .3rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }

/* form grid (Excel-like table) */
table.grid { width: 100%; border-collapse: collapse; margin-bottom: .4rem; }
table.grid th {
  background: #eef4ef; color: var(--ink); font-weight: 600; font-size: .85rem;
  padding: .5rem .6rem; border: 1px solid var(--line); text-align: left;
}
table.grid td { border: 1px solid var(--line); padding: .35rem .5rem; vertical-align: middle; }
table.grid td.param { font-size: .9rem; color: var(--ink); }
table.grid .col-param { width: 46%; }
.pairs-head { font-size: .98rem; color: var(--green-dark); margin: 1.5rem 0 .4rem; }

.cellwrap { border-radius: 6px; }
.numunit { display: flex; gap: .3rem; align-items: center; }
.numunit input[type=number] { flex: 1 1 auto; min-width: 56px; }
.unit {
  flex: 0 0 auto; width: auto; padding: .5rem .35rem; border: 1px solid var(--line);
  border-radius: 8px; background: #f7faf7; font-size: .82rem; color: var(--ink);
}
.unit-static { color: var(--muted); font-size: .82rem; white-space: nowrap; }
td.param { width: 52%; }
table.grid td.val { min-width: 150px; }

/* category heading (Excel category label, e.g. "Water") */
.cat-head {
  font-size: .95rem; color: var(--green-dark); margin: 1.5rem 0 .35rem;
  padding-bottom: .2rem; border-bottom: 2px solid var(--line);
}
.step-title { margin-bottom: .3rem; }

/* required (green) vs optional (yellow) tint, echoing the Excel cells */
.grid .cellwrap input, .grid .cellwrap select { background: #eef6e9; }
.grid .cellwrap.opt input, .grid .cellwrap.opt select { background: #fffdf0; }
.grid .cellwrap .unit { background: #fff; }
.opt-tag { font-size: .72rem; color: var(--muted); font-style: italic; white-space: nowrap; }

/* legend */
.legend { display: flex; gap: 1.3rem; align-items: center; font-size: .82rem; color: var(--muted); margin: 0 0 1.1rem; }
.chip { display: inline-block; width: 14px; height: 14px; border-radius: 3px; margin-right: .3rem; vertical-align: -2px; border: 1px solid rgba(0,0,0,.12); }
.chip-req { background: #cfe3c0; }
.chip-opt { background: #fdf7c8; }

/* a cell the client must fix, outlined in red (wins over the tint) */
.grid .cellwrap.missing input, .grid .cellwrap.missing select { border-color: var(--danger); background: #fdecea; }
.cellwrap.missing { outline: 2px solid rgba(192, 57, 43, .18); outline-offset: 1px; }

/* financial review table (results page), echoing the Excel red/green headers */
table.fin th { border: 1px solid var(--line); }
table.fin th.th-current { background: #f8d3d6; color: #842029; }
table.fin th.th-after { background: #cfe7d8; color: #0f5132; }
table.fin td { border: 1px solid var(--line); }
table.fin td.grp { vertical-align: middle; background: #f5f8f4; font-weight: 500; }
table.fin tr.total-row td { background: #e9ecef; font-weight: 700; border-top: 2px solid #adb5bd; }

/* metric tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin: 1rem 0; }
.tile { background: #f7faf7; border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; }
.tile .k { font-size: .8rem; color: var(--muted); }
.tile .v { font-size: 1.5rem; font-weight: 600; color: var(--green-dark); margin-top: .2rem; }
.tile.accent { background: var(--green); }
.tile.accent .k, .tile.accent .v { color: #fff; }
