:root {
  color-scheme: light;
  --bg: #f4f6f3;
  --surface: #ffffff;
  --surface-soft: #eef4eb;
  --text: #17211b;
  --muted: #647066;
  --line: #dce4da;
  --green: #157a3a;
  --green-strong: #0b5d2a;
  --blue: #235f9b;
  --red: #b33939;
  --amber: #a86d0a;
  --shadow: 0 14px 32px rgba(23, 33, 27, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px;
  background: #102118;
  color: #f7fbf5;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #f4c842;
  color: #102118;
  font-weight: 800;
}

.brand span,
.upload-panel small {
  display: block;
  color: #bad0c1;
  font-size: 0.86rem;
}

.upload-panel {
  display: grid;
  gap: 8px;
  padding: 20px;
  border: 1px dashed rgba(255, 255, 255, 0.34);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
}

.upload-panel:hover {
  background: rgba(255, 255, 255, 0.1);
}

.upload-panel input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
}

.upload-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--green);
  font-size: 1.15rem;
  font-weight: 700;
}

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

.filters label {
  display: grid;
  gap: 8px;
  color: #d8e6dc;
  font-size: 0.9rem;
}

.filters input,
.filters select {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 11px 12px;
  background: #183226;
  color: #fff;
}

main {
  padding: 28px;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--green-strong);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1.08;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.4rem);
}

h2 {
  font-size: 1rem;
}

.status {
  max-width: 360px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  text-align: right;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

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

.metrics article {
  padding: 18px;
}

.metrics span,
.panel-heading span {
  color: var(--muted);
  font-size: 0.88rem;
}

.metrics strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(1.35rem, 2.1vw, 1.95rem);
  line-height: 1.1;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 14px;
  align-items: stretch;
}

.panel {
  min-width: 0;
  padding: 18px;
}

.panel.wide {
  grid-row: span 2;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

canvas {
  display: block;
  width: 100%;
  min-height: 220px;
}

.bar-list,
.transaction-list {
  display: grid;
  gap: 12px;
}

.bar-row {
  display: grid;
  gap: 6px;
}

.bar-meta,
.transaction-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.bar-meta span,
.transaction-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-soft);
}

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

.transaction-row {
  align-items: baseline;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.transaction-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.transaction-row small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.negative {
  color: var(--red);
}

.positive {
  color: var(--green-strong);
}

.table-panel {
  margin-top: 14px;
}

.table-wrap {
  overflow: auto;
}

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

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

th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0;
}

.amount {
  text-align: right;
  white-space: nowrap;
}

.empty {
  padding: 38px 10px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .metrics,
  .dashboard-grid {
    grid-template-columns: 1fr 1fr;
  }

  .panel.wide {
    grid-column: 1 / -1;
    grid-row: auto;
  }
}

@media (max-width: 680px) {
  main,
  .sidebar {
    padding: 18px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .status {
    max-width: none;
    text-align: left;
  }

  .metrics,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}
