:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #eef3f8;
  --line: #d8e0ea;
  --text: #142033;
  --muted: #65758b;
  --primary: #1769aa;
  --primary-dark: #0f4d80;
  --green: #1f8a5b;
  --amber: #c27803;
  --red: #c2413b;
  --teal: #16817a;
  --purple: #7556b7;
  --shadow: 0 12px 30px rgba(20, 32, 51, 0.08);
}

* {
  box-sizing: border-box;
}

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

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 248px;
  background: #101827;
  color: #ffffff;
  padding: 24px 18px;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 32px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #d8f1e5;
  color: #105c3c;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: #b5c4d6;
  margin-top: 4px;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav-item {
  border: 0;
  border-radius: 8px;
  padding: 12px 14px;
  background: transparent;
  color: #d8e0ea;
  text-align: left;
}

.nav-item.active,
.nav-item:hover {
  background: #24334a;
  color: #ffffff;
}

.app-shell {
  margin-left: 248px;
  padding: 28px;
}

.topbar,
.table-head,
.form-head,
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
}

h2 {
  margin-bottom: 0;
  font-size: 1.2rem;
}

h3 {
  margin-bottom: 8px;
  font-size: 1rem;
}

.topbar-actions,
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.primary,
.ghost,
.mini {
  border: 1px solid transparent;
  border-radius: 8px;
  min-height: 38px;
  padding: 9px 13px;
  font-weight: 700;
}

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

.primary:hover {
  background: var(--primary-dark);
}

.ghost {
  background: var(--surface);
  color: var(--primary);
  border-color: var(--line);
}

.mini {
  min-height: 32px;
  padding: 6px 9px;
  background: var(--surface-2);
  color: var(--text);
}

.filters,
.kpi-grid,
.dashboard-grid,
.form-grid,
.proposal-grid {
  display: grid;
  gap: 14px;
}

.filters {
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  margin-bottom: 18px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  padding: 10px 11px;
  outline: none;
}

textarea {
  min-height: 88px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(23, 105, 170, 0.12);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.kpi-grid {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  margin-bottom: 18px;
}

.kpi,
.panel,
.form-panel,
.proposal,
.proposal-grid article {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.kpi {
  padding: 16px;
}

.kpi span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.kpi strong {
  display: block;
  margin-top: 8px;
  font-size: 1.9rem;
}

.kpi small {
  color: var(--muted);
}

.dashboard-grid {
  grid-template-columns: repeat(2, minmax(280px, 1fr));
}

.panel {
  min-height: 320px;
  padding: 18px;
}

.panel.wide {
  min-height: 260px;
}

.panel-head {
  margin-bottom: 18px;
}

.panel-head span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.gauge {
  --value: 0%;
  display: grid;
  place-items: center;
  width: min(240px, 70vw);
  aspect-ratio: 1;
  margin: 16px auto 0;
  border-radius: 50%;
  background: conic-gradient(var(--green) var(--value), var(--surface-2) 0);
  position: relative;
}

.gauge::after {
  content: "";
  position: absolute;
  width: 66%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--surface);
}

.gauge span {
  position: relative;
  z-index: 1;
  font-size: 2.2rem;
  font-weight: 800;
}

.bars,
.ranking {
  display: grid;
  gap: 12px;
}

.bar-row,
.rank-row {
  display: grid;
  grid-template-columns: minmax(90px, 180px) 1fr auto;
  align-items: center;
  gap: 12px;
}

.bar-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-2);
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
}

.rank-row .bar-fill {
  background: var(--green);
}

.heatmap {
  display: grid;
  grid-template-columns: 150px repeat(4, minmax(58px, 1fr));
  gap: 6px;
  align-items: stretch;
}

.heat-cell {
  min-height: 42px;
  border-radius: 8px;
  padding: 10px;
  color: #ffffff;
  font-weight: 800;
  text-align: center;
}

.heat-label {
  min-height: 42px;
  border-radius: 8px;
  padding: 10px;
  background: var(--surface-2);
  font-weight: 800;
}

.table-head {
  margin-bottom: 16px;
}

.table-head input {
  max-width: 420px;
}

.table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

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

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  background: #f9fbfd;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 4px 10px;
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.form-panel,
.proposal {
  padding: 22px;
}

.form-grid {
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  margin: 18px 0;
}

.form-panel > label {
  margin-top: 14px;
}

.form-actions {
  justify-content: flex-end;
  margin-top: 18px;
}

.proposal-grid {
  grid-template-columns: repeat(3, 1fr);
  margin: 18px 0;
}

.proposal-grid article {
  padding: 18px;
  box-shadow: none;
}

.proposal-list {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 12px 18px;
  margin: 0;
}

.proposal-list dt {
  font-weight: 800;
}

.proposal-list dd {
  margin: 0;
  color: var(--muted);
}

@media (max-width: 1100px) {
  .filters,
  .kpi-grid,
  .form-grid,
  .proposal-grid {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }
}

@media (max-width: 840px) {
  .sidebar {
    position: static;
    width: auto;
    padding: 14px;
  }

  .nav {
    grid-template-columns: repeat(4, 1fr);
  }

  .nav-item {
    text-align: center;
  }

  .app-shell {
    margin-left: 0;
    padding: 18px;
  }

  .topbar,
  .table-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .filters,
  .kpi-grid,
  .dashboard-grid,
  .form-grid,
  .proposal-grid,
  .proposal-list {
    grid-template-columns: 1fr;
  }

  .table-head input {
    max-width: none;
  }

  .bar-row,
  .rank-row {
    grid-template-columns: 1fr;
  }

  .heatmap {
    grid-template-columns: 1fr 1fr;
  }
}

@media print {
  .sidebar,
  .topbar-actions,
  .filters,
  .nav,
  .ghost,
  .primary,
  .mini {
    display: none !important;
  }

  .app-shell {
    margin: 0;
    padding: 0;
  }

  .view {
    display: block;
  }
}

