:root{
  --gwg-blue:#0032A0;
  --gwg-bg:#ffffff;
  --gwg-text:#183153;
  --gwg-border:#d7e1f5;
  --gwg-shadow:0 8px 24px rgba(0,0,0,.08);
  --gwg-radius:18px;
  --gwg-max-width:1200px;
}

*{
  box-sizing:border-box;
}

body{
  margin:0;
  font-family:Arial,Helvetica,sans-serif;
  background:var(--gwg-bg);
  color:var(--gwg-text);
}

.app-shell{
  width:min(calc(100% - 24px), var(--gwg-max-width));
  margin:20px auto 40px;
}

.app-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  margin-bottom:18px;
  flex-wrap:wrap;
}

.header-brand{
  display:flex;
  align-items:center;
  gap:12px;
}

.header-logo{
  height:50px;
  width:auto;
  display:block;
}

.header-title{
  font-size:1.4rem;
  font-weight:700;
  color:var(--gwg-blue);
}

.header-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.btn{
  border:2px solid var(--gwg-blue);
  background:#fff;
  color:var(--gwg-blue);
  border-radius:12px;
  padding:10px 16px;
  font-weight:700;
  cursor:pointer;
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:44px;
}


/* HEADER-MATCHED SELECTION BUTTONS */

.pillbar.header-style{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.pillbar.header-style .pill{
  border:2px solid var(--gwg-blue);
  background:#fff;
  color:var(--gwg-blue);
  border-radius:12px;
  padding:10px 16px;
  font-weight:700;
  cursor:pointer;
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:44px;
  box-shadow:0 1px 2px rgba(0,0,0,.04);
  transition:transform .08s ease, box-shadow .08s ease, background .08s ease, color .08s ease;
}

.pillbar.header-style .pill input{
  display:none;
}

.pillbar.header-style .pill:hover{
  box-shadow:0 4px 12px rgba(0,0,0,.08);
}

.pillbar.header-style .pill:active{
  transform:scale(.98);
  box-shadow:inset 0 2px 6px rgba(0,0,0,.10);
}

.pillbar.header-style .pill.active{
  background:var(--gwg-blue);
  color:#fff;
  box-shadow:inset 0 2px 6px rgba(0,0,0,.12);
}

/* EMPHASISED RESULT TILES */

.result-tile.emphasis{
  border:2px solid var(--gwg-blue);
  background:#fff;
}

.result-tile.emphasis .result-label,
.result-tile.emphasis .result-value{
  color:var(--gwg-blue);
}

/* NPSH STATUS VISUALS */

.result-tile.status-good{
  background:#ecfdf3;
  border:1px solid #86efac;
}

.result-tile.status-good .result-value{
  color:#166534;
}

.result-tile.status-warning{
  background:#fefce8;
  border:1px solid #fde68a;
}

.result-tile.status-warning .result-value{
  color:#854d0e;
}

.result-tile.status-fail{
  background:#fef2f2;
  border:1px solid #fca5a5;
}

.result-tile.status-fail .result-value{
  color:#991b1b;
}

.result-tile.status-disabled{
  background:#f8fafc;
  border:1px solid #d7e1f5;
}

.card{
  background:#fff;
  border:1px solid var(--gwg-border);
  border-radius:var(--gwg-radius);
  box-shadow:var(--gwg-shadow);
  padding:20px;
  margin-bottom:18px;
}

.card-title{
  margin:0 0 14px;
  color:var(--gwg-blue);
  font-size:1.15rem;
}

.grid{
  display:grid;
  gap:16px;
}

.grid.two{
  grid-template-columns:repeat(2,minmax(0,1fr));
}

.field{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.field label{
  font-weight:700;
}

.field input,
.field select,
.field textarea{
  width:100%;
  min-height:44px;
  padding:10px 12px;
  border:1px solid #b8c8ea;
  border-radius:12px;
  font:inherit;
  background:#fff;
}

.actions-row{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:18px;
}

.error-box{
  display:none;
  border:1px solid #cf2f2f;
  background:#fff5f5;
  color:#8e1f1f;
  border-radius:14px;
  padding:12px 14px;
  margin-bottom:16px;
}

.error-box.visible{
  display:block;
}

.index-tiles{
  display:grid;
  gap:18px;
  grid-template-columns:repeat(2,minmax(0,1fr));
}

.tile{
  text-decoration:none;
  color:inherit;
  transition:transform .08s ease, box-shadow .08s ease;
}

/* RESULTS TABLE */

.results-table{
  width:100%;
  border-collapse:collapse;
  min-width:800px;
}

.results-table th{
  text-align:left;
  color:var(--gwg-blue);
  border-bottom:1px solid #ccc;
  padding:8px;
  vertical-align:top;
}

.results-table td{
  border-bottom:1px solid #eee;
  padding:8px;
  vertical-align:top;
}

/* MOBILE TABLE SCROLL */

.table-scroll{
  overflow-x:auto;
  width:100%;
}

/* TILE INTERACTION POLISH */

.tile:hover .card{
  box-shadow:0 10px 28px rgba(0,0,0,.12);
}

.tile:active{
  transform:scale(.97);
}

.tile:active .card{
  box-shadow:0 4px 12px rgba(0,0,0,.12);
}

/* MOBILE LAYOUT */

@media (max-width:780px){
  .grid.two{
    grid-template-columns:1fr;
  }

  .index-tiles{
    grid-template-columns:1fr;
  }
}