:root {
  --bg: #eef1f3;
  --panel: #ffffff;
  --ink: #20252a;
  --muted: #66717b;
  --line: #d8dee4;
  --dark: #21262d;
  --accent: #d7681d;
  --gold: #edb13f;
  --green: #4f9e5b;
  --blue: #547ca7;
  --shadow: 0 18px 46px rgba(28, 35, 42, 0.12);
  font-family: Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); }
.is-hidden { display: none !important; }

.rail {
  position: fixed;
  inset: 0 auto 0 0;
  width: 260px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  background: #20252b;
  color: #fff;
  z-index: 10;
}

.brand {
  display: grid;
  place-items: center;
  min-height: 86px;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.brand img { width: 88%; max-height: 72px; object-fit: contain; }
nav { display: grid; gap: 7px; }
nav a, .supervisor-link {
  color: rgba(255,255,255,.82);
  text-decoration: none;
  padding: 12px 13px;
  border-radius: 8px;
}
nav a:hover, .supervisor-link:hover { background: rgba(255,255,255,.1); color: #fff; }
.supervisor-link { margin-top: auto; border: 1px solid rgba(255,255,255,.18); text-align: center; font-weight: 800; }

main { margin-left: 260px; padding: 24px; }
section { scroll-margin-top: 20px; }
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  margin-bottom: 18px;
}

.hero > div, .panel, .metrics article {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.hero > div { padding: 30px; }
.eyebrow { margin: 0 0 8px; color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 12px; font-size: 42px; line-height: 1.05; }
h2 { margin-bottom: 0; font-size: 24px; }
.lead { max-width: 900px; color: var(--muted); font-size: 18px; line-height: 1.48; }

.hero-status { display: grid; align-content: center; gap: 10px; }
.hero-status span, .metrics span, .metrics small, .muted { color: var(--muted); }
.hero-status strong { font-size: 58px; line-height: .95; }
.progress-track { height: 14px; background: #e3e8ed; border-radius: 99px; overflow: hidden; }
.progress-track i { display: block; width: 0%; height: 100%; background: linear-gradient(90deg, var(--accent), var(--green)); }

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.metrics article { padding: 20px; }
.metrics strong { display: block; margin: 8px 0 3px; font-size: 36px; }

.panel { padding: 20px; margin-bottom: 18px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.section-head.compact { align-items: end; }
.head-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.ghost {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
}

.scope-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 520px;
  gap: 18px;
  align-items: start;
}
.scope-copy {
  display: grid;
  gap: 12px;
  color: #45525e;
  line-height: 1.55;
}
.scope-copy p { margin-bottom: 0; }
.scope-totals {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.scope-totals article {
  min-height: 100px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafb;
}
.scope-totals span {
  display: block;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}
.scope-totals strong {
  font-size: 30px;
  line-height: 1;
}
.scope-table-wrap {
  margin-top: 18px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.scope-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  font-size: 14px;
}
.scope-table th,
.scope-table td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.scope-table th {
  background: #20252b;
  color: #fff;
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.scope-table tr:last-child td { border-bottom: 0; }
.scope-table td:first-child strong {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
}
.scope-notes {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.scope-notes span {
  display: block;
  padding: 10px 12px;
  border-left: 4px solid var(--accent);
  background: #fff8f2;
  color: #5b6670;
  line-height: 1.42;
}

.front-grid { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 12px; }
.front-card { padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: #f8fafb; }
.front-card b { display: block; margin-bottom: 8px; font-size: 17px; }
.front-card p { color: var(--muted); font-size: 14px; line-height: 1.38; }
.front-card .mini-progress { height: 9px; margin-top: 13px; background: #e0e6ec; border-radius: 99px; overflow: hidden; }
.front-card .mini-progress i { display: block; height: 100%; width: 0%; background: var(--accent); }

.split { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(360px, .9fr); gap: 18px; }
.map-wrap { position: relative; aspect-ratio: 1450 / 900; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: #dfe4e8; }
.map-wrap img { width: 100%; height: 100%; object-fit: contain; display: block; }
.map-wrap svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.map-wrap path { fill: none; stroke: var(--gold); stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 2px 2px rgba(0,0,0,.4)); }
.route-dot {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 32px;
  height: 32px;
  display: grid; place-items: center;
  border: 3px solid var(--dark);
  border-radius: 50%;
  background: var(--gold);
  color: #101820;
  font-weight: 900;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 7px 18px rgba(15, 23, 42, .34), inset 0 0 0 1px rgba(255, 255, 255, .55);
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.route-dot.is-extra {
  width: 24px;
  height: 24px;
  border: 2px solid #1c7c54;
  background: linear-gradient(180deg, #ecfdf3 0%, #7ee787 100%);
  color: #064e3b;
  font-size: 9px;
  letter-spacing: 0;
  box-shadow: 0 0 0 3px rgba(236, 253, 243, .88), 0 6px 16px rgba(6, 78, 59, .28);
}
.route-dot:hover {
  transform: translate(-50%, -50%) scale(1.08);
  z-index: 3;
}
.route-dot.is-active { outline: 4px solid rgba(215,104,29,.28); }
.route-dot.is-extra.is-active {
  outline: 4px solid rgba(28, 124, 84, .24);
  box-shadow: 0 0 0 4px rgba(236, 253, 243, .95), 0 10px 24px rgba(6, 78, 59, .34);
}

select, input, textarea {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  font: inherit;
  padding: 0 10px;
}

.before-after { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.before-after article { display: grid; gap: 8px; }
.before-after span { color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.before-after img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border: 1px solid var(--line); border-radius: 8px; background: #e4e9ee; }

.schedule { display: grid; gap: 8px; }
.task-row { display: grid; grid-template-columns: 240px 1fr 54px; align-items: center; gap: 12px; }
.task-row strong { font-size: 14px; }
.task-track { position: relative; height: 24px; background: #edf1f4; border-radius: 5px; overflow: hidden; }
.task-plan, .task-progress { position: absolute; top: 5px; height: 14px; border-radius: 99px; }
.task-plan { background: #b9c3ce; }
.task-progress { background: linear-gradient(90deg, var(--accent), var(--green)); width: 0; }
.task-row output { color: var(--muted); font-weight: 800; text-align: right; }

.log-list { display: grid; gap: 14px; }
.log-card { padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: #f8fafb; }
.log-card header { display: flex; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.log-card header div { display: grid; gap: 4px; }
.log-card header small,
.log-card p { color: var(--muted); line-height: 1.45; }
.log-summary {
  display: grid;
  gap: 7px;
  margin: 0 0 12px;
  padding-left: 20px;
  color: #44515d;
  line-height: 1.5;
}
.log-more {
  margin: -2px 0 12px;
  font-weight: 800;
}
.task-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 12px;
}
.task-chips span {
  padding: 7px 9px;
  border: 1px solid #d6dde4;
  border-radius: 999px;
  background: #fff;
  color: #46535e;
  font-size: 12px;
  font-weight: 800;
}
.thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 8px;
}
.thumb-button {
  display: block;
  min-height: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  cursor: zoom-in;
}
.thumb-button img,
.thumbs img { width: 100%; aspect-ratio: 4 / 3; border: 0; object-fit: cover; display: block; }
.log-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.image-modal {
  position: fixed;
  inset: 0;
  z-index: 99;
  display: grid;
  place-items: center;
  padding: 62px 22px 22px;
  background: rgba(11, 16, 20, .88);
}
.image-modal button {
  position: absolute;
  top: 16px;
  right: 16px;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
}
.image-modal img {
  max-width: min(1180px, 100%);
  max-height: 82vh;
  border-radius: 8px;
  background: #fff;
  object-fit: contain;
  box-shadow: 0 28px 80px rgba(0,0,0,.45);
}

.final-close {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  margin: 0 0 22px;
  padding: 26px 30px;
  border-left: 6px solid #168553;
  background: #eef8f3;
}
.final-close h2 { margin: 4px 0 8px; font-size: 24px; }
.final-close p { margin: 0; color: #46535e; }
.final-report-button {
  flex: 0 0 auto;
  padding: 13px 18px;
  border-radius: 6px;
  background: #17191b;
  color: #fff;
  font-weight: 900;
  text-decoration: none;
}
.scope-history-label {
  margin: 26px 0 10px;
  color: #4d5962;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}
.plan-history {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 22px;
}
.plan-history article {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}
.plan-history span {
  display: block;
  padding: 11px 13px;
  background: #17191b;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}
.plan-history img {
  display: block;
  width: 100%;
  height: 310px;
  object-fit: contain;
  background: #f4f6f7;
}

@media (max-width: 1120px) {
  .rail { position: static; width: auto; }
  main { margin-left: 0; }
  .hero, .split, .front-grid, .scope-layout { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 680px) {
  main { padding: 12px; }
  h1 { font-size: 32px; }
  .metrics, .before-after, .scope-totals { grid-template-columns: 1fr; }
  .task-row { grid-template-columns: 1fr; }
  .final-close { align-items: stretch; flex-direction: column; padding: 22px; }
  .final-report-button { text-align: center; }
  .plan-history { grid-template-columns: 1fr; }
  .plan-history img { height: 230px; }
}
