:root {
  --page-gutter: clamp(28px, 4vw, 64px);
  --content-max: 1560px;
  --ink: #172026;
  --muted: #60717f;
  --line: #d9e1e7;
  --bg: #f5f7f9;
  --panel: #ffffff;
  --blue: #2864c9;
  --teal: #087f8c;
  --green: #1f8f5f;
  --amber: #b7791f;
  --red: #c2413f;
  --shadow: 0 14px 35px rgba(23, 32, 38, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  overflow-x: hidden;
  min-height: 100vh;
  color: var(--ink);
  background: linear-gradient(180deg, #eef6f3 0%, #ffffff 34%, var(--bg) 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
}

.nav-wrap {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 22px var(--page-gutter) 0;
}

.navbar {
  width: 100%;
  max-width: var(--content-max);
  min-height: 110px;
  margin: 0 auto;
  padding: 10px 16px;
  border: 1px solid rgba(15, 107, 85, 0.12);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 12px 34px rgba(9, 33, 61, 0.09);
  backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 26px;
}

.brand {
  display: flex;
  align-items: center;
  min-width: 240px;
}

.brand-mark {
  width: 101px;
  height: 86px;
  object-fit: contain;
  object-position: center;
  border-radius: 14px;
}

.nav-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 11px;
  flex-wrap: wrap;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 43px;
  padding: 0 15px;
  border-radius: 14px;
  color: #09213d;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}

.nav-link:hover {
  background: #eef7f4;
  color: var(--green);
}

.module-button {
  gap: 8px;
  border: 1px solid var(--line);
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(9, 33, 61, 0.08);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  font-weight: 700;
}

.module-button:hover {
  background: #ffffff;
  border-color: #bdd2de;
}

.nav-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.provider {
  display: grid;
  gap: 6px;
  min-width: 230px;
}

.provider span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

select,
input,
button,
.file-button {
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  padding: 0 12px;
  font: inherit;
}

button,
.file-button {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 650;
}

.file-button input {
  display: none;
}

.primary {
  background: var(--blue);
  color: #ffffff;
  border-color: var(--blue);
}

main {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: clamp(20px, 3.2vw, 40px) var(--page-gutter) 56px;
  min-width: 0;
}

.topbar {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 25px;
  line-height: 1.08;
}

h2 {
  font-size: 14px;
}

.topbar p,
.panel-head span,
.kpi span,
td small {
  color: var(--muted);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  justify-content: flex-end;
}

.control-strip,
.kpi-grid,
.grid,
.scenario-grid {
  display: grid;
  gap: 10px;
}

.control-strip {
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  margin-bottom: 10px;
}

.control-strip label {
  display: grid;
  gap: 5px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}

.kpi-grid {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  margin-bottom: 10px;
}

.kpi,
.panel,
.scenario {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.kpi {
  padding: 12px 14px;
}

.kpi b {
  display: block;
  font-size: 22px;
  margin-top: 5px;
  line-height: 1.12;
}

.kpi span {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.grid.two {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  margin-bottom: 10px;
}

.panel {
  padding: 12px 14px;
  min-width: 0;
  margin-bottom: 10px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

canvas {
  max-height: 178px;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 780px;
}

th,
td {
  padding: 9px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 12px;
}

th {
  color: #43515a;
  font-size: 12px;
  text-transform: uppercase;
  background: #f9fbfc;
}

.pill {
  display: inline-flex;
  align-items: center;
  height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  font-weight: 750;
  font-size: 12px;
}

.high {
  background: #fde8e7;
  color: var(--red);
}

.medium {
  background: #fff4d8;
  color: var(--amber);
}

.low {
  background: #e4f6ed;
  color: var(--green);
}

.heatmap {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.hotspot {
  border: 1px solid var(--line);
  border-left: 6px solid var(--teal);
  border-radius: 7px;
  padding: 12px;
  background: #fbfdfd;
}

.hotspot strong {
  display: block;
  margin-bottom: 4px;
}

.scenario-grid {
  grid-template-columns: repeat(5, minmax(160px, 1fr));
}

.scenario {
  padding: 13px;
}

.scenario strong,
.scenario span {
  display: block;
}

.scenario span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 8px;
}

.copyright {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  padding: 8px 0 2px;
}

@media (max-width: 980px) {
  .navbar {
    align-items: flex-start;
    min-height: auto;
  }

  .brand {
    min-width: 140px;
  }

  .brand-mark {
    width: 92px;
    height: 78px;
  }

  .nav-actions {
    justify-content: flex-start;
  }

  .control-strip,
  .grid.two,
  .kpi-grid,
  .scenario-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
  }

  .actions {
    justify-content: flex-start;
  }
}

@media (max-width: 680px) {
  :root {
    --page-gutter: 16px;
  }

  .nav-wrap {
    padding-top: 12px;
  }

  .navbar {
    display: grid;
    gap: 14px;
    border-radius: 18px;
  }

  .brand {
    min-width: 0;
  }

  .nav-actions,
  .provider {
    width: 100%;
  }

  .nav-link {
    min-height: 42px;
    padding: 0 12px;
  }
}
