:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --panel: #ffffff;
  --ink: #122033;
  --muted: #637083;
  --line: #dfe6ee;
  --orange: #ff6b13;
  --green: #0ba66b;
  --red: #dc2626;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 248px;
  background: #080a0d;
  color: #fff;
  padding: 26px 18px;
}

.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 26px;
  margin-bottom: 42px;
}

nav {
  display: grid;
  gap: 8px;
}

nav a {
  color: #aeb6c1;
  text-decoration: none;
  padding: 11px 14px;
  border-radius: 7px;
  font-weight: 700;
}

nav a.active,
nav a:hover {
  background: var(--orange);
  color: #fff;
}

main {
  margin-left: 248px;
  min-height: 100vh;
}

.topbar {
  height: 64px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 32px;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 7px 13px;
  border-radius: 999px;
  background: #e9fff4;
  color: #08764d;
  font-weight: 800;
}

button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 7px;
  padding: 9px 13px;
  font-weight: 800;
  cursor: pointer;
}

.hero {
  padding: 34px 42px 18px;
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

h1 {
  margin: 0;
  font-size: 38px;
  line-height: 1.1;
}

h2 {
  margin: 0 0 4px;
  font-size: 22px;
}

p {
  color: var(--muted);
}

.cards,
.grid,
.panel {
  margin: 0 42px 24px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.card,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(18, 32, 51, .04);
}

.card {
  padding: 22px;
}

.label {
  color: var(--muted);
  text-transform: uppercase;
  font-size: 13px;
  font-weight: 900;
}

.value {
  margin-top: 8px;
  font-size: 34px;
  font-weight: 900;
}

.value.red {
  color: var(--red);
}

.value.green {
  color: var(--green);
}

.grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 24px;
}

.panel {
  padding: 22px;
}

.panel.wide {
  margin: 0;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: start;
  margin-bottom: 18px;
}

.chart {
  display: flex;
  align-items: end;
  gap: 8px;
  height: 230px;
  border-bottom: 1px solid var(--line);
  padding-top: 12px;
  overflow-x: auto;
}

.bar {
  min-width: 28px;
  border-radius: 5px 5px 0 0;
  background: linear-gradient(180deg, #ff8b3d, #ff5f05);
  position: relative;
}

.bar.over {
  background: linear-gradient(180deg, #ef4444, #b91c1c);
}

.bar span {
  position: absolute;
  bottom: -24px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.list {
  display: grid;
  gap: 10px;
}

.row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-weight: 800;
}

.table {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: 12px;
  vertical-align: top;
}

th {
  color: var(--muted);
  text-transform: uppercase;
  font-size: 12px;
}

@media (max-width: 900px) {
  .sidebar {
    position: static;
    width: auto;
  }

  main {
    margin-left: 0;
  }

  .cards,
  .grid {
    grid-template-columns: 1fr;
  }
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  z-index: 20;
  padding: 7px 9px;
  border-radius: 7px;
  background: #172033;
  color: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .2);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition: opacity .14s ease, transform .14s ease;
}

[data-tooltip]:hover::after,
[data-tooltip]:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.app-notification {
  position: fixed;
  top: 22px;
  right: 22px;
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  gap: 20px;
  width: min(430px, calc(100vw - 44px));
  padding: 17px 18px;
  border: 1px solid #fecaca;
  border-left: 5px solid var(--red);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(15, 23, 42, .2);
}

.app-notification strong { font-size: 16px; }
.app-notification p { margin: 5px 0 0; }
.app-notification button { margin-left: auto; border: 0; padding: 0; font-size: 22px; line-height: 1; }
