:root {
  --bg: #f3f1ed;
  --panel: #fff;
  --ink: #171717;
  --muted: #77736e;
  --line: #dedbd5;
  --red: #ff0033;
  --dark: #191919;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, Arial, Helvetica, sans-serif;
}

a { color: inherit; text-decoration: none; }
button, select { font: inherit; }

.sidebar {
  width: 230px;
  height: 100vh;
  position: fixed;
  inset: 0 auto 0 0;
  display: flex;
  flex-direction: column;
  padding: 26px 20px 20px;
  color: #fff;
  background: var(--dark);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.logo-mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--red);
}

.nav { margin-top: 60px; }

.nav-title {
  margin: 0 0 12px 10px;
  color: #666;
  font-size: 9px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 7px;
  color: #8d8d8d;
  font-size: 12px;
}

.nav a:hover,
.nav a.active {
  color: #fff;
  background: #2a2a2a;
}

.nav i {
  color: #555;
  font-size: 9px;
  font-style: normal;
}

.nav a.active i { color: var(--red); }

.local-badge {
  margin-top: auto;
  padding: 14px;
  border: 1px solid #333;
  border-radius: 8px;
  font-size: 10px;
}

.local-badge > span {
  width: 7px;
  height: 7px;
  display: inline-block;
  margin-right: 7px;
  border-radius: 50%;
  background: #45c878;
}

.local-badge small {
  display: block;
  margin: 5px 0 0 17px;
  color: #777;
}

.main {
  min-height: 100vh;
  margin-left: 230px;
  padding: 0 clamp(24px, 4vw, 64px) 30px;
}

.topbar {
  min-height: 102px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: 28px;
  letter-spacing: -.04em;
}

.profile {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #222;
  font-size: 10px;
  font-weight: 700;
}

.page-tabs {
  display: flex;
  gap: 5px;
  margin-top: 24px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,255,255,.55);
}

.page-tabs a {
  padding: 10px 16px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 10px;
}

.page-tabs a.active {
  color: #fff;
  background: #222;
}

.empty-dashboard {
  min-height: calc(100vh - 185px);
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr);
  align-items: center;
  gap: 48px;
}

.empty-dashboard h2 {
  margin: 0;
  font-size: clamp(72px, 10vw, 150px);
  line-height: .82;
  letter-spacing: -.08em;
}

.empty-dashboard p {
  max-width: 480px;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.empty-window {
  min-height: 360px;
  display: grid;
  place-items: center;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  text-align: center;
}

.empty-window span {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin: 0 auto 15px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--red);
}

.empty-window strong { font-size: 13px; }
.empty-window p { max-width: 300px; margin: 7px 0 0; font-size: 10px; }

.channel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 26px;
  padding: 24px 26px;
  border-radius: 12px;
  color: #fff;
  background: var(--dark);
}

.channel-info { display: flex; align-items: center; gap: 18px; }

.youtube-icon {
  width: 55px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--red);
}

.channel h2 { margin: 4px 0; font-size: 20px; }
.channel small, .channel a { color: #999; font-size: 10px; }

.not-connected {
  display: flex;
  align-items: center;
  gap: 18px;
  color: #aaa;
  font-size: 10px;
}

.not-connected > span::before {
  content: "";
  width: 7px;
  height: 7px;
  display: inline-block;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--red);
}

.connect-button {
  padding: 11px 18px;
  border-radius: 999px;
  color: #fff;
  background: var(--red);
}

.section { margin-top: 46px; }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 17px;
}

.section-head h2 { margin-bottom: 0; font-size: 20px; letter-spacing: -.04em; }

select {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  background: #fff;
  font-size: 10px;
}

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

.card, .group, .panel {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}

.card {
  min-height: 135px;
  display: flex;
  flex-direction: column;
  padding: 17px;
}

.card p { margin: 0; color: var(--muted); font-size: 10px; }
.card strong { margin: auto 0 3px; font-size: 34px; font-weight: 500; }
.card small { color: #aaa; font-size: 8px; }

.two-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.panel { min-height: 300px; padding: 20px; }
.panel h3 { margin-bottom: 0; font-size: 16px; }

.chart {
  height: 210px;
  display: grid;
  place-items: center;
  margin-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: repeating-linear-gradient(to bottom, transparent 0 51px, #eee 52px);
  font-size: 9px;
}

.groups {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.group { padding: 20px; }
.group-number { color: var(--red); font-size: 9px; }
.group h3 { margin: 18px 0 6px; font-size: 16px; }
.group > p { min-height: 32px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.group ul { padding: 0; margin: 17px 0 0; list-style: none; }

.group li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-top: 1px solid #eee;
  font-size: 9px;
}

.group li::before {
  content: "";
  width: 5px;
  height: 5px;
  border: 1px solid #bbb;
  border-radius: 50%;
}

.group li b { margin-left: auto; color: #bbb; font-weight: 400; }

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

table { width: 100%; min-width: 760px; border-collapse: collapse; }
th { padding: 13px 16px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 8px; text-align: left; }
td { height: 150px; color: var(--muted); font-size: 10px; text-align: center; }

.integration {
  padding: 28px;
  border-radius: 12px;
  color: #fff;
  background: var(--dark);
}

.integration h2 { margin-bottom: 8px; font-size: 25px; }
.integration > p { max-width: 700px; color: #888; font-size: 10px; line-height: 1.5; }

.sources { margin-top: 25px; border-top: 1px solid #333; }

.source {
  display: grid;
  grid-template-columns: 35px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid #333;
}

.source > span { color: #666; font-size: 9px; }
.source div { display: grid; gap: 3px; }
.source strong { font-size: 11px; }
.source small, .source b { color: #777; font-size: 9px; font-weight: 400; }

.footer {
  display: flex;
  justify-content: space-between;
  padding: 26px 0;
  color: #aaa;
  font-size: 8px;
  text-transform: uppercase;
}

@media (max-width: 1050px) {
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .groups { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .sidebar {
    width: 100%;
    height: auto;
    position: static;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 15px 18px;
  }

  .nav { margin: 0; }
  .nav-title, .nav a:not(.active), .nav i, .local-badge { display: none; }
  .main { margin-left: 0; padding-inline: 18px; }
  .empty-dashboard { grid-template-columns: 1fr; padding: 70px 0; }
  .channel, .not-connected { align-items: flex-start; flex-direction: column; }
  .two-columns, .groups { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .logo strong { display: none; }
  .metrics { grid-template-columns: 1fr; }
  .section-head { align-items: flex-start; flex-direction: column; }
  .connect-button { width: 100%; text-align: center; }
  .source { grid-template-columns: 25px 1fr; }
  .source b { display: none; }
}
