:root {
  --bg: #f5f5f7;
  --surface: rgba(255, 255, 255, 0.86);
  --surface-strong: #ffffff;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --soft: #86868b;
  --line: rgba(0, 0, 0, 0.08);
  --line-strong: rgba(0, 0, 0, 0.13);
  --purple: #7b4dff;
  --purple-deep: #28104d;
  --green: #31d158;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.08);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html {
  color: var(--ink);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", sans-serif;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 16% -12%, rgba(123, 77, 255, 0.14), transparent 28%),
    radial-gradient(circle at 90% 0%, rgba(49, 209, 88, 0.11), transparent 24%),
    var(--bg);
}

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

.shell {
  width: min(1240px, calc(100% - 44px));
  margin: 0 auto;
  padding: 22px 0 80px;
}

.topbar {
  position: sticky;
  top: 14px;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto minmax(120px, 1fr);
  align-items: center;
  gap: 18px;
  min-height: 58px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 999px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 12px 38px rgba(0, 0, 0, 0.07);
  backdrop-filter: blur(22px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  justify-self: start;
}

.brand span {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--purple);
  font-size: 13px;
  font-weight: 800;
}

.brand strong {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0;
}

.topbar nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(245, 245, 247, 0.86);
}

.topbar nav a {
  border-radius: 999px;
  padding: 8px 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.topbar nav a:hover {
  color: var(--ink);
  background: #fff;
}

.status,
.logout {
  display: inline-flex;
  align-items: center;
}

.logout {
  justify-self: end;
  gap: 8px;
  margin: 0;
}

.status {
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  font-weight: 700;
}

.logout button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.logout button:hover {
  color: var(--ink);
  background: #fff;
}

.status i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(49, 209, 88, 0.14);
}

.hero {
  padding: 78px 0 30px;
}

.hero p,
.panel span,
.insight-row span {
  margin: 0;
  color: var(--purple);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 850px;
  margin: 12px 0 0;
  font-size: clamp(52px, 8vw, 112px);
  font-weight: 760;
  letter-spacing: 0;
  line-height: 0.92;
}

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

.owner-card,
.insight-row article,
.panel {
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.owner-card {
  display: grid;
  min-height: 176px;
  padding: 24px;
}

.owner-card.primary {
  grid-column: span 5;
  color: #fff;
  background:
    linear-gradient(145deg, rgba(123, 77, 255, 0.98), rgba(40, 16, 77, 0.98));
}

.owner-card:nth-child(2) {
  grid-column: span 5;
}

.owner-card.compact {
  grid-column: span 2;
  min-height: 150px;
}

.owner-card span {
  color: var(--soft);
  font-size: 13px;
  font-weight: 800;
}

.owner-card.primary span,
.owner-card.primary p {
  color: rgba(255, 255, 255, 0.68);
}

.owner-card strong {
  align-self: end;
  margin-top: 24px;
  font-size: clamp(42px, 5vw, 66px);
  font-weight: 760;
  letter-spacing: 0;
  line-height: 0.9;
}

.owner-card p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.45;
}

.boss-trend {
  margin-top: 14px;
}

.panel header > p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.trend-chart {
  position: relative;
  margin: 22px 24px 24px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 24px;
  padding: 18px 18px 14px;
  background:
    linear-gradient(145deg, rgba(17, 17, 22, 0.94), rgba(32, 27, 47, 0.94)),
    #16161b;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 28px 80px rgba(40, 16, 77, 0.16);
  overflow: hidden;
}

.trend-chart::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.92), rgba(0, 0, 0, 0.24));
  pointer-events: none;
}

.chart-legend {
  position: relative;
  z-index: 1;
  display: inline-flex;
  gap: 14px;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 8px 10px;
  color: rgba(255, 255, 255, 0.68);
  background: rgba(255, 255, 255, 0.06);
  font-size: 12px;
  font-weight: 800;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.chart-legend i,
.chart-legend b {
  display: block;
  width: 22px;
  height: 3px;
  border-radius: 999px;
}

.chart-legend i {
  background: linear-gradient(90deg, #7b4dff, #00d4ff);
  box-shadow: 0 0 18px rgba(0, 212, 255, 0.38);
}

.chart-legend b {
  background: linear-gradient(90deg, #31d158, #b7ff5a);
  box-shadow: 0 0 18px rgba(49, 209, 88, 0.36);
}

.trend-chart svg {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  min-height: 260px;
  margin-top: 10px;
  overflow: visible;
}

.chart-grid line {
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 1;
}

.chart-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 4;
}

.chart-line.glow {
  filter: url("#lineGlow");
}

.chart-line-pv {
  stroke: url("#pvLine");
}

.chart-line-uv {
  stroke: url("#uvLine");
}

.chart-day {
  outline: none;
  pointer-events: all;
}

.chart-hit-area {
  fill: rgba(255, 255, 255, 0);
  cursor: crosshair;
  pointer-events: all;
}

.chart-focus-line {
  opacity: 0;
  stroke: rgba(255, 255, 255, 0.24);
  stroke-dasharray: 5 7;
  stroke-width: 1.5;
  transition: opacity 160ms ease;
}

.chart-point circle {
  stroke: rgba(22, 22, 27, 0.95);
  stroke-width: 3;
  transition:
    r 160ms ease,
    stroke-width 160ms ease;
}

.chart-point-pv circle {
  fill: #00d4ff;
  filter: drop-shadow(0 0 8px rgba(0, 212, 255, 0.8));
}

.chart-point-uv circle {
  fill: #b7ff5a;
  filter: drop-shadow(0 0 8px rgba(49, 209, 88, 0.72));
}

.chart-tooltip {
  opacity: 0;
  pointer-events: none;
  transform-box: fill-box;
  transform-origin: center;
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.chart-tooltip rect {
  fill: rgba(255, 255, 255, 0.92);
  stroke: rgba(255, 255, 255, 0.72);
  stroke-width: 1;
  filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.22));
}

.chart-tooltip text {
  fill: rgba(29, 29, 31, 0.66);
  font-size: 12px;
  font-weight: 850;
}

.chart-tooltip .tooltip-date {
  fill: rgba(29, 29, 31, 0.72);
}

.chart-tooltip .tooltip-pv {
  fill: #315dff;
}

.chart-tooltip .tooltip-uv {
  fill: #188a3a;
}

.chart-day:hover .chart-focus-line,
.chart-day:focus .chart-focus-line,
.chart-day:focus-within .chart-focus-line,
.chart-day.is-hover .chart-focus-line {
  opacity: 1;
}

.chart-day:hover .chart-tooltip,
.chart-day:focus .chart-tooltip,
.chart-day:focus-within .chart-tooltip,
.chart-day.is-hover .chart-tooltip {
  opacity: 1;
  transform: translateY(-6px);
}

.chart-day:hover .chart-point circle,
.chart-day:focus .chart-point circle,
.chart-day:focus-within .chart-point circle,
.chart-day.is-hover .chart-point circle {
  r: 7;
  stroke-width: 4;
}

.trend-hover-card {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 4;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  width: 168px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 18px;
  padding: 12px 13px;
  opacity: 0;
  color: rgba(29, 29, 31, 0.74);
  background: rgba(255, 255, 255, 0.92);
  box-shadow:
    0 20px 44px rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
  pointer-events: none;
  transition:
    opacity 140ms ease,
    transform 140ms ease;
}

.trend-hover-card.is-visible {
  opacity: 1;
}

.trend-hover-card > span {
  grid-column: 1 / -1;
  color: rgba(29, 29, 31, 0.64);
  font-size: 12px;
  font-weight: 850;
}

.trend-hover-card strong {
  display: inline-flex;
  justify-content: space-between;
  border-radius: 12px;
  padding: 8px 9px;
  background: rgba(245, 245, 247, 0.92);
  font-size: 12px;
  font-weight: 900;
}

.trend-hover-card strong:first-of-type {
  color: #315dff;
}

.trend-hover-card strong:last-of-type {
  color: #188a3a;
}

.trend-chart text {
  fill: rgba(255, 255, 255, 0.5);
  font-size: 12px;
  font-weight: 800;
  text-anchor: middle;
}

.trend-values {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  margin-top: 6px;
}

.trend-values span {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 9px 8px;
  color: rgba(255, 255, 255, 0.46);
  background: rgba(255, 255, 255, 0.045);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.trend-values strong,
.trend-values b {
  font-size: 13px;
  font-weight: 850;
}

.trend-values strong {
  color: #8eb8ff;
}

.trend-values b {
  color: #b7ff5a;
}

.empty-state {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

.insight-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.insight-row article {
  padding: 26px;
  box-shadow: none;
}

.insight-row strong {
  display: block;
  margin-top: 12px;
  font-size: clamp(22px, 2.4vw, 34px);
  font-weight: 730;
  line-height: 1.05;
}

.insight-row p {
  max-width: 580px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 14px;
  margin-top: 14px;
}

.panel {
  overflow: hidden;
  padding: 0;
}

.panel-wide {
  grid-column: span 1;
}

.panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 22px 24px 18px;
}

.panel h2 {
  margin: 7px 0 0;
  font-size: 21px;
  font-weight: 730;
  letter-spacing: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  padding: 15px 24px;
  text-align: left;
  vertical-align: top;
}

tr:last-child td {
  border-bottom: 0;
}

th {
  color: var(--soft);
  background: rgba(245, 245, 247, 0.58);
  font-size: 12px;
  font-weight: 800;
}

td {
  color: rgba(29, 29, 31, 0.82);
  font-weight: 560;
  line-height: 1.4;
}

td:last-child,
th:last-child {
  text-align: right;
}

.events {
  margin-top: 14px;
}

.events td:last-child,
.events th:last-child {
  text-align: left;
}

code {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 9px;
  color: var(--purple-deep);
  background: rgba(123, 77, 255, 0.08);
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.login-shell {
  width: min(520px, calc(100% - 32px));
  padding: 48px 0;
}

.login-card {
  display: grid;
  gap: 34px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 30px;
  padding: clamp(28px, 5vw, 44px);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.login-card .brand {
  justify-self: start;
}

.login-card p {
  margin: 0;
  color: var(--purple);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.login-card h1 {
  margin: 14px 0 12px;
  font-size: clamp(38px, 8vw, 64px);
  font-weight: 760;
  letter-spacing: 0;
  line-height: 0.96;
}

.login-card div > span {
  color: var(--muted);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.45;
}

.login-form {
  display: grid;
  gap: 16px;
}

.login-form label {
  display: grid;
  gap: 9px;
}

.login-form label span {
  color: var(--soft);
  font-size: 13px;
  font-weight: 800;
}

.login-form input {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0 16px;
  color: var(--ink);
  background: rgba(245, 245, 247, 0.72);
  font: inherit;
  font-size: 17px;
  outline: none;
}

.login-form input:focus {
  border-color: rgba(123, 77, 255, 0.48);
  box-shadow: 0 0 0 5px rgba(123, 77, 255, 0.1);
}

.login-form button {
  min-height: 52px;
  border: 0;
  border-radius: 16px;
  color: #fff;
  background: var(--ink);
  font: inherit;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
}

.login-form button:hover {
  background: var(--purple-deep);
}

.login-error {
  margin: -4px 0 0;
  color: #d70015;
  font-size: 14px;
  font-weight: 700;
}

@media (max-width: 1080px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }

  .topbar nav {
    display: none;
  }

  .hero,
  .owner-overview,
  .insight-row,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .owner-card.primary,
  .owner-card:nth-child(2) {
    grid-column: span 1;
  }

  .owner-card.compact {
    grid-column: span 1;
  }
}

@media (max-width: 680px) {
  .shell {
    width: min(100% - 28px, 1240px);
    padding-top: 14px;
  }

  .topbar {
    top: 8px;
    min-height: 54px;
  }

  .brand strong {
    display: none;
  }

  .logout {
    gap: 6px;
  }

  .logout button {
    padding: 0 10px;
  }

  .hero {
    gap: 18px;
    padding: 54px 0 24px;
  }

  .owner-card {
    min-height: 148px;
  }

  .trend-chart {
    margin: 18px;
    padding: 14px 12px;
  }

  .trend-chart svg {
    min-width: 680px;
  }

  .trend-values {
    grid-template-columns: repeat(7, minmax(72px, 1fr));
    overflow-x: auto;
  }

  .panel {
    overflow-x: auto;
  }

  table {
    min-width: 560px;
  }

  th,
  td {
    padding: 14px 18px;
  }
}
