:root {
  color-scheme: dark;
  --bg: #0a0b12;
  --panel: rgba(18, 20, 32, 0.9);
  --panel-strong: rgba(25, 28, 44, 0.96);
  --line: rgba(255, 255, 255, 0.08);
  --text: #edf0f7;
  --muted: #9aa3b8;
  --accent: #f0563a;
  --accent-2: #ff8d6a;
  --good: #72e1a6;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(240, 86, 58, 0.16), transparent 34%),
    radial-gradient(circle at top right, rgba(114, 225, 166, 0.10), transparent 28%),
    linear-gradient(180deg, #0a0b12 0%, #090a0f 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

.shell {
  width: min(1280px, calc(100vw - 24px));
  margin: 0 auto;
  padding: 18px 0 28px;
}

.topbar,
.hero,
.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.topbar {
  border-radius: 26px;
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  animation: slideIn 520ms ease-out both;
}

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

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #ff7f4f);
  box-shadow: 0 14px 30px rgba(240, 86, 58, 0.28);
}

.eyebrow {
  margin: 0 0 4px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  font-size: 11px;
}

h1, h2, h3, p {
  margin: 0;
}

h1 {
  font-size: clamp(22px, 3vw, 32px);
}

.meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.chat-link {
  padding: 10px 14px;
  border-radius: 999px;
  color: #fff;
  background: rgba(240, 86, 58, 0.16);
  border: 1px solid rgba(240, 86, 58, 0.35);
}

.content {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.card {
  border-radius: var(--radius);
}

.hero {
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto -40px -80px auto;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(240, 86, 58, 0.24), transparent 65%);
  filter: blur(4px);
}

.hero h2 {
  font-size: clamp(24px, 4vw, 38px);
  max-width: 12ch;
  line-height: 1.05;
}

.hero-copy {
  margin-top: 10px;
  max-width: 56ch;
  color: var(--muted);
}

.kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}

.kpi {
  padding: 18px 16px;
  min-height: 112px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  animation: rise 520ms ease both;
}

.kpi .label {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.kpi strong {
  font-size: clamp(22px, 2.4vw, 30px);
  font-variant-numeric: tabular-nums;
}

.charts {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 14px;
}

.chart-card {
  padding: 18px;
  min-height: 330px;
}

.card-head {
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-head h3 {
  font-size: 16px;
}

.table-card {
  padding: 0;
  overflow: hidden;
}

.tabs {
  display: flex;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.tab {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  border-radius: 999px;
  padding: 10px 14px;
  font: inherit;
  cursor: pointer;
}

.tab.active {
  color: #fff;
  background: rgba(240, 86, 58, 0.16);
  border-color: rgba(240, 86, 58, 0.35);
}

.table-wrap {
  overflow: auto;
}

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

thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  text-align: left;
  background: var(--panel-strong);
  color: #dfe5f7;
}

th, td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

tbody tr {
  background: rgba(255, 255, 255, 0.01);
}

tbody tr:nth-child(2n) {
  background: rgba(255, 255, 255, 0.03);
}

tbody tr:hover {
  background: rgba(240, 86, 58, 0.08);
}

.pos {
  color: var(--good);
}

.neg {
  color: #ff8a80;
}

.empty {
  color: var(--muted);
  padding: 24px 16px;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1180px) {
  .kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .charts {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .shell {
    width: min(100vw - 16px, 100%);
    padding-top: 8px;
  }

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

  .meta {
    align-items: flex-start;
  }

  .kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero {
    padding: 18px;
  }

  .chart-card {
    min-height: 280px;
    padding: 14px;
  }

  .tabs {
    overflow-x: auto;
  }
}

@media (max-width: 420px) {
  .kpis {
    grid-template-columns: 1fr;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 14px;
  }
}
