:root {
  color-scheme: dark;
  --ink: #f5f5f7;
  --muted: #a0a0a5;
  --teal: #d0d0d4;
  --orange: #85858b;
  --line: #38383a;
}

body {
  background: #000;
  color: var(--ink);
}

aside {
  background: #000;
  border-right: 1px solid #252527;
}

main {
  background: #000;
}

.toolbar,
.kpi,
.panel {
  background: #1c1c1e;
  border-color: #38383a;
}

.button,
select,
input,
.chart-periods {
  background: #242426;
  border-color: #3a3a3c;
  color: var(--ink);
}

select option {
  background: #242426;
  color: var(--ink);
}

.brand .mark {
  background: #3a3a3c;
  color: #fff;
}

nav button {
  color: #b0b0b5;
}

nav button.active {
  background: #242426;
  color: #fff;
  box-shadow: inset 3px 0 #d0d0d4;
}

nav button:hover,
.button:hover,
.kpi:hover {
  background-color: #29292b;
}

.kpi .value,
.period strong,
.cost-label strong {
  color: var(--ink);
}

th {
  background: #262628;
  border-color: #38383a;
}

td {
  border-color: #303032;
}

.source-row,
.detail-grid div,
.folder-links a {
  background: #242426;
  border-color: #38383a;
}

.track,
.cost-bar {
  background: #353538;
}

.track span,
.cost-bar span {
  background: #a5a5aa;
}

.alert {
  background: #29292b;
  border-color: #444446;
  color: #d0d0d4;
}

.alert strong {
  color: #f5f5f7;
}

.badge {
  background: #303033;
  color: #dedee2;
}

.badge.active {
  background: #29292b;
  color: #dedee2;
}

.badge.planned {
  background: #303033;
  color: #bcbcc1;
}

.badge.warn {
  background: #353538;
  color: #dedee2;
}

.chart-period-button {
  border: 0;
  border-radius: 5px;
  padding: 7px 13px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
}

.chart-period-button.active {
  background: #414144;
  color: #fff;
}

.financial-panel .chart-periods button.chart-period-button.active {
  background: #414144;
  color: #fff;
}

.chart-period-button:hover {
  color: #fff;
}

.cost-change {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  font-size: 12px;
}

.cost-change small {
  color: var(--muted);
  text-align: right;
}

.cost-change.up {
  color: #ff5c5c;
}

.cost-change.down {
  color: #39d98a;
}

.cost-change.flat {
  color: var(--muted);
}

.kpi.financial-trend.up .value,
.kpi.financial-trend.up .note {
  color: #ff5c5c;
}

.kpi.financial-trend.down .value,
.kpi.financial-trend.down .note {
  color: #39d98a;
}

.kpi.financial-trend.flat .value,
.kpi.financial-trend.flat .note {
  color: var(--muted);
}

.financial-panel svg line {
  stroke: #3b3b3e;
}

.financial-panel svg {
  max-height: none;
  min-height: 300px;
}

.financial-details-table {
  table-layout: fixed;
  min-width: 1040px;
  white-space: normal;
  width: 100%;
}

.financial-details-table th,
.financial-details-table td {
  padding: 10px 8px;
  overflow-wrap: anywhere;
  vertical-align: top;
}

.financial-details-table th:nth-child(1) { width: 10%; }
.financial-details-table th:nth-child(2) { width: 10%; }
.financial-details-table th:nth-child(3) { width: 9%; }
.financial-details-table th:nth-child(4) { width: 13%; }
.financial-details-table th:nth-child(5) { width: 7%; }
.financial-details-table th:nth-child(6) { width: 10%; }
.financial-details-table th:nth-child(7) { width: 10%; }
.financial-details-table th:nth-child(8) { width: 9%; }
.financial-details-table th:nth-child(9) { width: 12%; }
.financial-details-table th:nth-child(10) { width: 10%; }

.legend .rig-orange {
  background: #dc8a3b;
}

.legend .rig-green {
  background: #128875;
}

svg text {
  fill: #b0b0b5;
}

dialog {
  background: #1c1c1e;
  border-color: #3a3a3c;
  color: var(--ink);
}

dialog::backdrop {
  background: #000c;
}

footer {
  border-color: var(--line);
}

.hole-link,
.source-link,
.folder-links a {
  color: #d0d0d4;
}

@media (max-width: 700px) {
  .financial-details-scroll {
    overflow: visible;
  }

  .financial-details-table {
    min-width: 0;
    display: block;
    white-space: normal;
  }

  .financial-details-table thead {
    display: none;
  }

  .financial-details-table tbody {
    display: grid;
    gap: 10px;
  }

  .financial-details-table tr {
    display: grid;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #242426;
  }

  .financial-details-table td {
    display: grid;
    grid-template-columns: minmax(88px, 34%) minmax(0, 1fr);
    gap: 10px;
    padding: 7px 0;
    border-bottom: 1px solid #303032;
  }

  .financial-details-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 11px;
  }

  .financial-details-table tr td:last-child {
    border-bottom: 0;
  }

  .cost-change {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .cost-change small {
    text-align: left;
  }
}

.cost-usage { margin: 5px 0 8px; }
