:root {
  color-scheme: light;
  --bg: #edf3f7;
  --panel: #ffffff;
  --panel-alt: #f7fafc;
  --ink: #112033;
  --muted: #607085;
  --line: #d4dfeb;
  --line-strong: #b8c9db;
  --brand: #0f5ea8;
  --brand-dark: #0a3f70;
  --green: #1f7a4d;
  --amber: #c27a1a;
  --red: #be3a31;
  --cyan: #0b8f8a;
  --shadow: 0 10px 30px rgba(16, 24, 40, 0.06);
  --shadow-strong: 0 20px 50px rgba(16, 24, 40, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

button,
input,
select {
  font: inherit;
}

/* Cross-project equipment type shortage summary */
.equip-type-shortage { display: flex; flex-direction: column; gap: 10px; }
.shortage-banner {
  background: rgba(194, 122, 26, 0.10);
  border-left: 4px solid var(--amber);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--ink);
  font-weight: 600;
  margin-bottom: 4px;
}
.shortage-banner.ok { background: rgba(31, 122, 77, 0.10); border-left-color: var(--green); }
.shortage-banner span { font-weight: 700; }
.type-shortage-card {
  background: var(--panel-alt);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.type-shortage-card summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  font-weight: 700;
  font-size: 14px;
  list-style: none;
}
.type-shortage-card summary::-webkit-details-marker { display: none; }
.type-shortage-card summary::before { content: '▸'; margin-right: 8px; transition: transform 0.2s; }
.type-shortage-card[open] summary::before { transform: rotate(90deg); }
.type-shortage-name { flex: 1; color: var(--ink); }
.type-shortage-status {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
}
.type-shortage-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
  padding: 0 16px 8px;
}
.type-shortage-meta > div {
  display: flex;
  flex-direction: column;
  padding: 8px 12px;
  background: var(--panel);
  border-radius: 8px;
  font-size: 12px;
}
.type-shortage-meta span { color: var(--muted); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; }
.type-shortage-meta strong { color: var(--ink); font-weight: 700; font-size: 13px; margin-top: 2px; }
.type-shortage-bar { height: 8px; background: var(--panel); margin: 0 16px; border-radius: 999px; overflow: hidden; }
.type-shortage-bar .bar-fill { height: 100%; transition: width 0.4s; }
.type-shortage-projects {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-top: 10px;
}
.type-shortage-projects th, .type-shortage-projects td {
  padding: 6px 16px;
  border-top: 1px solid var(--line);
  text-align: left;
}
.type-shortage-projects th {
  background: var(--panel);
  font-size: 10.5px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Fleet plan vs actual comparison */
.fleet-plan-comparison { display: flex; flex-direction: column; gap: 14px; }
.fleet-plan-card {
  background: var(--panel-alt);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
}
.fleet-plan-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}
.fleet-plan-header h3 { margin: 0; font-size: 14px; font-weight: 700; color: var(--ink); }
.fleet-plan-summary { display: flex; gap: 12px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.fleet-plan-summary strong { color: var(--ink); font-weight: 700; }
.fleet-plan-pct {
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 12px;
  background: rgba(96, 112, 133, 0.10);
  color: var(--muted);
}
.fleet-plan-pct.good { background: rgba(31, 122, 77, 0.14); color: var(--green); }
.fleet-plan-pct.mid { background: rgba(194, 122, 26, 0.14); color: var(--amber); }
.fleet-plan-pct.low { background: rgba(190, 58, 49, 0.12); color: var(--red); }
.fleet-plan-rows { display: flex; flex-direction: column; gap: 10px; }
.fleet-plan-row {
  display: grid;
  grid-template-columns: minmax(140px, 1.2fr) 2fr minmax(90px, auto);
  gap: 10px;
  align-items: center;
}
.fleet-plan-row-label { font-size: 12px; }
.fleet-plan-row-label strong { display: block; font-weight: 700; color: var(--ink); margin-bottom: 2px; }
.fleet-plan-row-label small { display: block; color: var(--muted); font-size: 11px; line-height: 1.4; }
.fleet-plan-row-bars { position: relative; height: 24px; background: var(--panel); border-radius: 6px; overflow: hidden; }
.fleet-plan-bar { position: absolute; top: 0; bottom: 0; left: 0; }
.fleet-plan-bar-plan { background: rgba(15, 94, 168, 0.20); height: 12px; top: 0; }
.fleet-plan-bar-actual { background: var(--brand); height: 12px; bottom: 0; top: auto; }
.fleet-plan-row-status { display: flex; flex-direction: column; align-items: flex-end; font-size: 11px; gap: 2px; font-weight: 700; }
.fleet-plan-row-status strong { font-size: 14px; }

@media (max-width: 640px) {
  .fleet-plan-row { grid-template-columns: 1fr; gap: 6px; }
  .fleet-plan-row-status { align-items: flex-start; flex-direction: row; gap: 8px; }
}

/* BoQ progress */
.boq-progress { display: flex; flex-direction: column; gap: 12px; }
.boq-card {
  background: var(--panel-alt);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
}
.boq-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.boq-header h3 { margin: 0; font-size: 14px; font-weight: 700; }
.boq-summary { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.boq-totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; margin-bottom: 8px; }
.boq-totals > div {
  display: flex;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--panel);
  border-radius: 8px;
  font-size: 12px;
}
.boq-totals span:first-child { color: var(--muted); font-weight: 600; }
.boq-totals strong { font-size: 12.5px; }
.boq-totals strong.good { color: var(--green); }
.boq-totals strong.mid { color: var(--amber); }
.boq-totals strong.low { color: var(--red); }
.boq-scope-detail summary { cursor: pointer; font-size: 12px; color: var(--brand); font-weight: 600; padding: 6px 0; }
.boq-scope-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
  margin-top: 6px;
}
.boq-scope-table th, .boq-scope-table td { padding: 5px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.boq-scope-table th { background: var(--panel); font-weight: 700; color: var(--muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.04em; }

.hero {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(115deg, rgba(4, 21, 39, 0.92) 0%, rgba(7, 49, 87, 0.82) 50%, rgba(15, 94, 168, 0.78) 100%),
    linear-gradient(180deg, #081828 0%, #0f5ea8 100%);
  color: #fff;
  padding: 28px 24px 36px;
}
@media (max-width: 768px) {
  .hero { padding: 22px 16px 28px; }
}

.hero-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(61, 170, 255, 0.2), transparent 28%),
    radial-gradient(circle at 80% 0%, rgba(77, 255, 196, 0.16), transparent 26%),
    linear-gradient(transparent 0, transparent calc(100% - 1px), rgba(255, 255, 255, 0.08) calc(100% - 1px)),
    linear-gradient(90deg, transparent 0, transparent calc(100% - 1px), rgba(255, 255, 255, 0.08) calc(100% - 1px));
  background-size: auto, auto, 100% 48px, 48px 100%;
  pointer-events: none;
}

.hero-inner,
.page {
  max-width: 1320px;
  margin: 0 auto;
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
}

.hero-copy {
  max-width: 860px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 8px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  opacity: 0.75;
}

h1,
h2 {
  margin: 0;
  letter-spacing: -0.03em;
}

h1 {
  font-size: 32px;
}

h2 {
  font-size: 20px;
}

.subtitle {
  margin: 12px 0 0;
  max-width: 760px;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.55;
}

.hero-badges {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.hero-badge {
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  padding: 10px 12px;
  min-width: 148px;
}

.hero-badge .label {
  display: block;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.72);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hero-badge strong {
  display: block;
  margin-top: 6px;
  font-size: 16px;
}

.hero-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-pill,
.panel,
.kpi-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.hero-pill {
  min-width: 180px;
  padding: 12px 14px;
  color: var(--ink);
  box-shadow: var(--shadow);
}

.hero-pill.accent {
  background: rgba(255, 255, 255, 0.92);
}

.hero-pill span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.page {
  padding: 22px;
  margin-top: -18px;
  position: relative;
  z-index: 2;
}

.panel {
  padding: 18px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

button {
  border: 0;
  border-radius: 8px;
  padding: 10px 16px;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

button.secondary {
  background: #e8eef7;
  color: var(--ink);
}

button.ghost {
  background: #f5f8fb;
  color: var(--ink);
  border: 1px solid var(--line);
}

.filters,
.kpi-grid,
.plan-grid,
.fleet-grid,
.two-col,
.insight-strip {
  display: grid;
  gap: 14px;
}

.filters {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.filters label span {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

input,
select {
  width: 100%;
  border: 1px solid #c8d3df;
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
}

input:focus,
select:focus {
  outline: 0;
  border-color: #8eb8e2;
  box-shadow: 0 0 0 3px rgba(15, 94, 168, 0.12);
}

.filter-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.active-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-alt);
  color: var(--ink);
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1;
}

.auto-refresh-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.auto-refresh-toggle input {
  width: 16px;
  height: 16px;
}

.kpi-grid {
  grid-template-columns: repeat(7, minmax(0, 1fr));
  margin-bottom: 18px;
}

.kpi-card {
  padding: 18px;
  box-shadow: var(--shadow);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 249, 252, 0.98));
  position: relative;
  overflow: hidden;
}

.kpi-card::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 4px;
  background: linear-gradient(90deg, var(--brand-dark), var(--brand), var(--cyan));
}

.kpi-card .label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.kpi-card .value {
  margin-top: 10px;
  font-size: 28px;
  font-weight: 800;
}

.kpi-card .caption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.insight-strip {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 18px;
}

.insight-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 16px;
  box-shadow: var(--shadow);
}

.insight-card .label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.insight-card .value {
  margin-top: 10px;
  font-size: 24px;
  font-weight: 800;
}

.insight-card .meta {
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.plan-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.plan-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #f9fbfd, #f4f8fb);
}

.plan-card .label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.plan-card .value {
  margin-top: 10px;
  font-size: 26px;
  font-weight: 800;
}

.plan-card .meta {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

.progress-track {
  margin-top: 12px;
  height: 12px;
  border-radius: 999px;
  background: #e8edf4;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--brand);
}

.fleet-summary {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.fleet-chip {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  background: linear-gradient(180deg, #fbfdff, #f2f7fb);
}

.fleet-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.fleet-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.fleet-card h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.fleet-card .meta {
  color: var(--muted);
  font-size: 13px;
}

.fleet-card ul {
  margin: 10px 0 0;
  padding-left: 18px;
}

.curve-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: linear-gradient(180deg, #fbfdff, #f5f9fc);
}

.curve-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
}

.section-note {
  margin: -4px 0 14px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.legend {
  display: flex;
  gap: 18px;
  margin-bottom: 10px;
  font-size: 13px;
}

.legend span::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  margin-right: 8px;
}

.legend .actual::before {
  background: var(--brand);
}

.legend .baseline::before {
  background: var(--amber);
}

.curve-svg {
  width: 100%;
  height: auto;
}

.axis,
.grid-line {
  stroke: #d8e0ea;
  stroke-width: 1;
}

.curve-line {
  fill: none;
  stroke-width: 3;
}

.curve-line.actual {
  stroke: var(--brand);
}

.curve-line.baseline {
  stroke: var(--amber);
}

.curve-dot.actual {
  fill: var(--brand);
}

.curve-dot.baseline {
  fill: var(--amber);
}

.axis-label {
  fill: var(--muted);
  font-size: 11px;
}

.chart-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chart-row {
  display: grid;
  grid-template-columns: 160px 1fr 120px;
  gap: 10px;
  align-items: center;
}

.chart-row .label {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-row .value {
  font-size: 13px;
  font-weight: 700;
  text-align: right;
}

.bar-track {
  height: 14px;
  border-radius: 999px;
  background: #e8edf4;
  overflow: hidden;
}

.bar-fill.brand {
  background: var(--brand);
}

.bar-fill.green {
  background: var(--green);
}

.bar-fill.amber {
  background: var(--amber);
}

.daily-list .chart-row {
  grid-template-columns: 110px 1fr 1fr;
}

.daily-cell {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.daily-meta {
  font-size: 12px;
  color: var(--muted);
}

.breakdown-ok,
.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 14px;
  color: var(--muted);
  background: #fbfcfd;
}

.breakdown-alert {
  border: 1px solid #f3c8c8;
  background: #fff7f7;
  color: var(--red);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 12px;
  font-weight: 700;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  text-align: left;
  font-size: 13px;
}

th {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 11px;
}

.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 1100px) {
  .filters,
  .kpi-grid,
  .fleet-grid,
  .insight-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .plan-grid,
  .two-col {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .hero-inner,
  .section-head,
  .filter-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .filters,
  .kpi-grid,
  .fleet-grid,
  .insight-strip {
    grid-template-columns: 1fr;
  }

  .chart-row,
  .daily-list .chart-row {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 28px;
  }
}
