:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-muted: #eef2f6;
  --line: #d8e0e8;
  --text: #1f2933;
  --muted: #66788a;
  --blue: #245c9c;
  --green: #25845b;
  --red: #b94747;
  --amber: #a66f1f;
  --teal: #1f7a7a;
  --shadow: 0 12px 30px rgba(31, 41, 51, 0.08);
}

* {
  box-sizing: border-box;
}

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

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 28px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 24px;
  line-height: 1.25;
}

h2 {
  font-size: 16px;
  line-height: 1.3;
}

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

.button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--blue);
  border-radius: 6px;
  background: var(--blue);
  color: #ffffff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.button.secondary {
  background: #ffffff;
  color: var(--blue);
}

.app-shell {
  width: min(1480px, calc(100% - 32px));
  margin: 18px auto 32px;
  display: grid;
  gap: 16px;
}

.status-strip {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfd;
  color: var(--muted);
  font-size: 13px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

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

.kpi-card {
  padding: 16px;
}

.kpi-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.kpi-value {
  margin-top: 8px;
  font-size: 28px;
  font-weight: 800;
}

.kpi-note {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.panel {
  padding: 16px;
}

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

.panel-header p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.panel-header.compact {
  margin-bottom: 12px;
}

.sector-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sector-tab {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
}

.sector-tab.active {
  border-color: var(--blue);
  background: #e9f1fb;
  color: var(--blue);
}

.layout-grid {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 16px;
}

.filters-panel {
  display: grid;
  align-content: start;
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

select,
input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  font-size: 14px;
  padding: 0 10px;
}

.sector-bars {
  display: grid;
  gap: 12px;
}

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

.bar-label {
  font-weight: 700;
}

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

.bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--blue), var(--green));
}

.bar-value {
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

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

table {
  width: 100%;
  min-width: 1120px;
  border-collapse: collapse;
  background: #ffffff;
}

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

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
  color: #4a5c6f;
  font-size: 12px;
  text-transform: uppercase;
}

td:nth-child(5),
td:nth-child(6),
td:nth-child(7) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
}

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

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

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

.badge.strategy {
  background: #e8f5f5;
  color: var(--teal);
}

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

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

@media (max-width: 720px) {
  .app-header,
  .status-strip,
  .bar-row {
    display: grid;
  }

  .app-header {
    padding: 16px;
  }

  .app-shell {
    width: min(100% - 20px, 1480px);
  }

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

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

  .bar-value {
    text-align: left;
  }
}
