:root {
  color-scheme: dark;
  --ink: #f7f7f2;
  --muted: #a5b1a9;
  --line: rgba(255, 255, 255, 0.12);
  --panel: rgba(17, 24, 22, 0.78);
  --mint: #85f2cf;
  --coral: #ff8f70;
  --gold: #f6c96f;
  --blue: #83b7ff;
  --bg: #07110f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 18% 8%, rgba(133, 242, 207, 0.18), transparent 28%),
    radial-gradient(circle at 86% 12%, rgba(255, 143, 112, 0.16), transparent 25%),
    linear-gradient(135deg, #07110f 0%, #14211d 48%, #241915 100%);
  color: var(--ink);
}

button,
select,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.login-view {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 28px;
  min-height: 100vh;
  padding: 28px;
}

.login-art {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: calc(100vh - 56px);
  padding: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(140deg, rgba(133, 242, 207, 0.18), rgba(255, 143, 112, 0.1)),
    url("data:image/svg+xml,%3Csvg width='1200' height='640' viewBox='0 0 1200 640' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='rgba(255,255,255,0.2)'%3E%3Cpath d='M0 470 C190 260 310 530 500 310 S780 130 1000 260 1100 390 1200 180'/%3E%3Cpath d='M0 560 C210 360 350 610 540 390 S820 220 1040 350 1120 470 1200 300'/%3E%3C/g%3E%3C/svg%3E");
  background-size: cover;
}

.login-art h1 {
  max-width: 900px;
  margin: 12px 0 0;
  font-size: clamp(2.4rem, 6vw, 6rem);
  line-height: 0.94;
}

.login-card {
  align-self: center;
  display: grid;
  gap: 16px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(5, 10, 9, 0.72);
  backdrop-filter: blur(24px);
}

.login-card strong {
  font-size: 1.5rem;
}

.app-shell,
.dashboard {
  min-height: 100vh;
}

.dashboard {
  display: grid;
  grid-template-columns: 280px 1fr;
}

.sidebar {
  border-right: 1px solid var(--line);
  padding: 28px;
  background: rgba(5, 10, 9, 0.68);
  backdrop-filter: blur(24px);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 44px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: conic-gradient(from 140deg, var(--mint), var(--gold), var(--coral), var(--blue), var(--mint));
  box-shadow: 0 0 28px rgba(133, 242, 207, 0.28);
}

.brand strong,
.brand small {
  display: block;
}

.brand small,
.eyebrow,
#dateRange,
#domain,
.status-panel p,
label,
.list-item span,
.list-item small,
.empty-state {
  color: var(--muted);
}

nav,
.form-panel,
.list,
.insights {
  display: grid;
  gap: 12px;
}

.nav-item,
.actions button,
.actions select,
.ghost,
input,
select,
form button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
}

.nav-item {
  padding: 12px 14px;
  text-align: left;
}

.nav-item.active {
  background: rgba(133, 242, 207, 0.16);
  border-color: rgba(133, 242, 207, 0.42);
}

.status-panel {
  margin-top: 42px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.pulse {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 18px var(--mint);
}

.ghost {
  width: 100%;
  min-height: 42px;
  margin-top: 22px;
}

.workspace {
  padding: 28px;
}

.topbar,
.hero-band,
.panel-heading,
.actions {
  display: flex;
  align-items: center;
}

.topbar {
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 0.76rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 8px;
  font-size: clamp(2rem, 4vw, 4.3rem);
  line-height: 0.95;
}

h2 {
  max-width: 740px;
  margin-bottom: 10px;
  font-size: clamp(1.4rem, 2.7vw, 3.1rem);
  line-height: 1.03;
}

h3 {
  margin-bottom: 16px;
}

.actions {
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.actions button,
.actions select,
form button,
input,
select {
  min-height: 42px;
  padding: 0 14px;
}

.actions button,
form button {
  background: var(--mint);
  color: #05100d;
  border-color: transparent;
  font-weight: 800;
}

.actions .secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  border-color: var(--line);
}

.actions button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.hero-band {
  min-height: 240px;
  justify-content: space-between;
  gap: 28px;
  padding: 34px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(133, 242, 207, 0.16), rgba(255, 143, 112, 0.07)),
    url("data:image/svg+xml,%3Csvg width='1200' height='360' viewBox='0 0 1200 360' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='rgba(255,255,255,0.18)'%3E%3Cpath d='M0 260 C180 170 280 280 440 180 S740 70 900 160 1080 270 1200 130'/%3E%3Cpath d='M0 310 C180 220 300 330 470 230 S760 120 940 210 1080 310 1200 190'/%3E%3C/g%3E%3C/svg%3E");
  background-size: cover;
}

.score-label {
  display: block;
  color: var(--muted);
}

#score {
  display: block;
  font-size: clamp(4.8rem, 10vw, 8.5rem);
  line-height: 0.86;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.metric {
  min-height: 118px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.metric span {
  color: var(--muted);
  font-size: 0.82rem;
}

.metric strong {
  display: block;
  margin-top: 14px;
  font-size: clamp(1.4rem, 2vw, 2.2rem);
}

.report-grid,
.split {
  display: grid;
  grid-template-columns: 1.35fr 0.85fr;
  gap: 14px;
}

.panel {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.24);
}

.panel.wide {
  min-height: 330px;
}

.panel-heading {
  justify-content: space-between;
  margin-bottom: 20px;
}

.chart {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8px, 1fr));
  align-items: end;
  gap: 6px;
  height: 230px;
}

.bar {
  min-height: 18px;
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, var(--mint), rgba(133, 242, 207, 0.18));
}

.bars {
  display: grid;
  gap: 14px;
}

.channel-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.channel-track {
  grid-column: 1 / -1;
  height: 9px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.channel-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), var(--coral));
}

.table {
  display: grid;
  gap: 8px;
}

.query-row {
  display: grid;
  grid-template-columns: minmax(160px, 1.4fr) minmax(120px, 1fr) auto auto;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
}

.query-row strong {
  color: var(--ink);
}

.insights p {
  margin: 0;
  padding: 12px;
  border-left: 3px solid var(--mint);
  background: rgba(133, 242, 207, 0.08);
}

label {
  display: grid;
  gap: 6px;
  font-size: 0.86rem;
}

input,
select {
  width: 100%;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 0.5fr;
  gap: 12px;
}

.list-item {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}

#loginError {
  min-height: 20px;
  color: var(--coral);
}

@media (max-width: 980px) {
  .login-view,
  .dashboard {
    grid-template-columns: 1fr;
  }

  .login-art {
    min-height: 420px;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

  .metric-grid,
  .report-grid,
  .split {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .workspace,
  .sidebar,
  .login-view {
    padding: 18px;
  }

  .metric-grid,
  .report-grid,
  .split {
    grid-template-columns: 1fr;
  }

  .query-row {
    grid-template-columns: 1fr;
  }
}
