:root {
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  background: #f3f4ef;
  color: #171a16;
  --ink: #171a16;
  --muted: #5b6158;
  --line: #d7dacd;
  --panel: #ffffff;
  --panel-soft: #f9faf5;
  --accent: #0f7b62;
  --accent-ink: #064638;
  --warn: #a24f2a;
  --negative: #b42318;
  --positive: #087443;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(15, 123, 98, 0.08), rgba(15, 123, 98, 0) 280px),
    var(--panel-soft);
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  width: min(100%, 1480px);
  margin: 0 auto;
  padding: 24px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
  padding: 4px 0 22px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 4.5vw, 4.25rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.source {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 0.92rem;
  text-align: right;
}

button {
  min-height: 42px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 0 16px;
  background: var(--accent);
  color: white;
  cursor: pointer;
  font-weight: 750;
}

button:disabled {
  opacity: 0.6;
  cursor: wait;
}

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

.metric {
  min-height: 108px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  display: grid;
  align-content: space-between;
  gap: 8px;
}

.metric span,
.metric small,
label span,
.table-meta {
  color: var(--muted);
}

.metric span,
label span {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.metric strong {
  min-width: 0;
  font-size: clamp(1.35rem, 2.5vw, 2rem);
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.metric small {
  font-size: 0.88rem;
}

.controls {
  display: grid;
  grid-template-columns: minmax(260px, 1.2fr) minmax(180px, 0.65fr) minmax(160px, 0.5fr);
  gap: 12px;
  align-items: end;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

label {
  display: grid;
  gap: 8px;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  background: white;
  color: var(--ink);
}

input:focus,
select:focus,
button:focus-visible {
  outline: 3px solid rgba(15, 123, 98, 0.22);
  outline-offset: 2px;
}

.table-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  overflow: hidden;
}

.table-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}

.table-scroll {
  overflow-x: auto;
}

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

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid #eaecdf;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #eef1e6;
  color: #373d35;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

tbody tr:hover {
  background: #f7faf2;
}

.number {
  text-align: right;
}

.company {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 260px;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: #17352e;
  color: #ffffff;
  font-weight: 850;
}

.company a {
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.company a:hover {
  color: var(--accent-ink);
  text-decoration: underline;
}

.ticker {
  color: var(--muted);
  font-weight: 750;
}

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

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

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

@media (max-width: 900px) {
  .topbar,
  .source,
  .table-meta {
    align-items: start;
    flex-direction: column;
    text-align: left;
  }

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

@media (max-width: 620px) {
  .app-shell {
    padding: 16px;
  }

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

  .metric {
    min-height: 92px;
  }
}
