:root {
  color: #16191f;
  background: #f6f7f9;
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.4;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

.shell {
  max-width: 1480px;
  margin: 0 auto;
  padding: 24px;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 360px) 1fr;
  gap: 24px;
  align-items: end;
  margin-bottom: 18px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
}

h2 {
  font-size: 20px;
}

p,
span,
label,
td,
th,
input,
select,
button {
  font-size: 14px;
}

p,
span {
  color: #5f6b7a;
}

.filters {
  display: grid;
  grid-template-columns: 130px 100px 150px 110px;
  gap: 12px;
  align-items: end;
}

label {
  display: grid;
  gap: 5px;
  color: #424a57;
  font-weight: 700;
}

input,
select,
button {
  height: 38px;
  border: 1px solid #b8c0cc;
  border-radius: 6px;
  background: #fff;
  padding: 0 10px;
}

button {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.secondary {
  border-color: #b8c0cc;
  background: #fff;
  color: #2563eb;
}

.panel {
  background: #fff;
  border: 1px solid #d5d9e0;
  border-radius: 8px;
  padding: 18px;
  margin-top: 18px;
}

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

.legend {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: end;
  max-width: 720px;
}

.legendItem {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  white-space: nowrap;
  color: #424a57;
  font-size: 13px;
}

.swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.chart {
  width: 100%;
  min-height: 420px;
}

.search {
  width: min(360px, 100%);
}

.summaryChange {
  display: inline-flex;
  align-items: center;
  margin-left: 10px;
  font-weight: 700;
}

.openMonthNote {
  display: block;
  margin-top: 6px;
  color: #5f6b7a;
  font-size: 13px;
}

.tagPanel {
  padding-bottom: 12px;
}

.tagActions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: end;
}

.tagList {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
  max-height: 210px;
  overflow: auto;
  padding: 2px;
}

.tagOption {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  border: 1px solid #d5d9e0;
  border-radius: 6px;
  padding: 8px 10px;
  background: #fff;
  color: #16191f;
  font-weight: 400;
}

.tagOption input {
  width: 16px;
  height: 16px;
  padding: 0;
  flex: 0 0 auto;
}

.tagOption span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #16191f;
}

.emptyState {
  color: #5f6b7a;
  padding: 8px 2px 14px;
}

.tableWrap {
  overflow: auto;
}

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

th,
td {
  border-bottom: 1px solid #e7e9ee;
  padding: 10px 12px;
  text-align: right;
}

th:first-child,
td:first-child {
  text-align: left;
  position: sticky;
  left: 0;
  background: #fff;
}

th {
  color: #424a57;
  font-weight: 700;
}

tbody tr:hover td {
  background: #f8fafc;
}

.moneyCell {
  white-space: nowrap;
}

.projectionText {
  display: inline-flex;
  margin-top: 3px;
  color: #5f6b7a;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.contractLabel {
  font-weight: 700;
}

.contractCell {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.expandButton {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  padding: 0;
  border-color: #b8c0cc;
  background: #fff;
  color: #2563eb;
  line-height: 1;
}

.contractName {
  display: block;
  margin-top: 2px;
  color: #5f6b7a;
  font-size: 12px;
}

.statusPill {
  display: inline-flex;
  max-width: 140px;
  height: 24px;
  align-items: center;
  border: 1px solid #b8c0cc;
  border-radius: 999px;
  padding: 0 9px;
  color: #424a57;
  background: #f8fafc;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.statusPill.muted {
  color: #5f6b7a;
  font-weight: 400;
}

.serviceDetailRow td {
  background: #f8fafc;
  text-align: left;
  position: static;
}

.serviceDetail {
  border: 1px solid #d5d9e0;
  border-radius: 6px;
  background: #fff;
  padding: 12px;
}

.serviceHeader {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: #424a57;
}

.serviceTableWrap {
  overflow: auto;
}

.serviceTable {
  min-width: 760px;
  width: 100%;
  border-collapse: collapse;
}

.serviceTable th,
.serviceTable td {
  padding: 7px 10px;
  border-top: 1px solid #edf0f4;
  border-bottom: 0;
  text-align: right;
  font-size: 12px;
}

.serviceTable th:first-child,
.serviceTable td:first-child {
  position: static;
  text-align: left;
  background: transparent;
}

.serviceTable th {
  color: #424a57;
  font-weight: 700;
}

.serviceName {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #16191f;
}

.serviceValue,
.servicePercent {
  text-align: right;
  color: #16191f;
  white-space: nowrap;
}

.servicePercent {
  color: #5f6b7a;
  font-weight: 700;
}

.changeBadge {
  display: inline-flex;
  justify-content: flex-end;
  min-width: 58px;
  margin-top: 3px;
  font-size: 12px;
  font-weight: 700;
}

.up {
  color: #b42318;
}

.down {
  color: #067647;
}

.flat {
  color: #5f6b7a;
}

.error {
  color: #b42318;
  font-weight: 700;
}

@media (max-width: 920px) {
  .shell {
    padding: 14px;
  }

  .toolbar,
  .filters {
    grid-template-columns: 1fr;
  }

  .panelHead {
    display: grid;
  }

  .legend {
    justify-content: start;
  }

  .tagActions {
    justify-content: start;
  }
}
