:root {
  --bg: #10110f;
  --panel: #171815;
  --panel-soft: #1d1e1a;
  --line: #2c2e28;
  --line-strong: #41443a;
  --text: #f2f1e9;
  --muted: #9b9d91;
  --faint: #6f7268;
  --acid: #c9ff5e;
  --acid-ink: #1b240a;
  --amber: #f5b95e;
  --red: #ff746c;
  --blue: #76a7ff;
  --radius: 14px;
  --sidebar: 248px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  max-width: 100%;
  overflow-x: clip;
}

body {
  margin: 0;
  min-width: 320px;
  max-width: 100%;
  min-height: 100vh;
  overflow-x: clip;
  background:
    radial-gradient(circle at 70% -30%, rgba(201, 255, 94, 0.07), transparent 32rem),
    var(--bg);
  color: var(--text);
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--acid);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  transform: translateY(-160%);
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--acid);
  color: var(--acid-ink);
  font-weight: 700;
}

.skip-link:focus {
  transform: translateY(0);
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 10;
  width: var(--sidebar);
  display: flex;
  flex-direction: column;
  padding: 24px 18px 18px;
  border-right: 1px solid var(--line);
  background: rgba(16, 17, 15, 0.94);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  width: fit-content;
  color: var(--text);
  font-size: 16px;
  font-weight: 750;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--acid);
  font-size: 11px;
  letter-spacing: 0.08em;
  box-shadow: inset 0 0 0 3px var(--bg);
}

.nav {
  display: grid;
  gap: 4px;
  margin-top: 56px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: 150ms ease;
}

.nav-item span {
  width: 16px;
  color: var(--faint);
  font-size: 18px;
}

.nav-item:hover,
.nav-item.active {
  background: var(--panel-soft);
  color: var(--text);
}

.nav-item.active span {
  color: var(--acid);
}

.sidebar-foot {
  display: grid;
  gap: 14px;
  margin-top: auto;
}

.service-state {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}

.service-state strong,
.service-state small {
  display: block;
}

.service-state strong {
  margin-bottom: 3px;
  font-size: 12px;
}

.service-state small {
  color: var(--faint);
  font-size: 10px;
  line-height: 1.4;
}

.status-dot {
  display: inline-block;
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  margin-top: 4px;
  border-radius: 50%;
}

.status-dot-live {
  background: var(--acid);
  box-shadow: 0 0 0 4px rgba(201, 255, 94, 0.08);
}

.content {
  grid-column: 2;
  width: min(100%, 1440px);
  margin: 0 auto;
  padding: 42px clamp(28px, 4vw, 64px) 28px;
}

.topbar,
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.topbar {
  margin-bottom: 34px;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--faint);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(30px, 4vw, 46px);
  font-weight: 580;
  letter-spacing: -0.055em;
  line-height: 1;
}

h2 {
  margin-bottom: 0;
  font-size: 20px;
  font-weight: 630;
  letter-spacing: -0.025em;
}

.icon-button {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: 150ms ease;
}

.icon-button:hover {
  border-color: var(--line-strong);
  color: var(--acid);
  transform: rotate(25deg);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel);
}

.stat {
  position: relative;
  min-height: 154px;
  padding: 22px;
  border-right: 1px solid var(--line);
}

.stat:last-child {
  border-right: 0;
}

.stat::after {
  position: absolute;
  right: 19px;
  bottom: 18px;
  width: 7px;
  height: 7px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  content: "";
}

.stat-primary::after {
  border: 0;
  background: var(--acid);
}

.stat-alert::after {
  border: 0;
  background: var(--red);
}

.stat-label,
.stat-foot {
  display: block;
}

.stat-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.stat strong {
  display: block;
  margin: 22px 0 8px;
  font-size: 36px;
  font-weight: 540;
  letter-spacing: -0.055em;
  line-height: 0.9;
}

.stat strong small {
  color: var(--faint);
  font-size: 16px;
}

.stat-foot {
  color: var(--faint);
  font-size: 11px;
}

.pipeline,
.data-section {
  scroll-margin-top: 24px;
  margin-top: 46px;
}

.pipeline {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(201, 255, 94, 0.035), transparent 42%),
    var(--panel);
}

.live-badge,
.count {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.live-badge .status-dot {
  margin: 0;
}

.pipeline-track {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  margin-top: 26px;
}

.pipeline-step {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.step-index {
  display: grid;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--acid);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
}

.pipeline-step strong,
.pipeline-step small {
  display: block;
}

.pipeline-step strong {
  margin-bottom: 3px;
  font-size: 13px;
}

.pipeline-step small {
  color: var(--faint);
  font-size: 10px;
}

.pipeline-arrow {
  color: var(--line-strong);
  font-size: 18px;
}

.data-section {
  padding-top: 2px;
}

.data-section .section-heading {
  margin-bottom: 18px;
}

.table-wrap {
  position: relative;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

table {
  width: 100%;
  min-width: 840px;
  border-collapse: collapse;
  text-align: left;
}

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

th {
  color: var(--faint);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

td {
  color: var(--muted);
  font-size: 11px;
}

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

tbody tr {
  transition: background 120ms ease;
}

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

td strong,
td a {
  color: var(--text);
  font-size: 12px;
  font-weight: 620;
  text-decoration: none;
}

td a:hover {
  color: var(--acid);
}

td time {
  white-space: nowrap;
}

.media-cell {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 240px;
}

.media-cell small {
  display: block;
  max-width: 260px;
  margin-top: 3px;
  overflow: hidden;
  color: var(--faint);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-glyph {
  display: grid;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--acid);
  font-size: 11px;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

.status span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--amber);
}

.status-completed span {
  background: var(--acid);
}

.status-failed span {
  background: var(--red);
}

.status-downloading span,
.status-sending span {
  background: var(--blue);
  box-shadow: 0 0 0 3px rgba(118, 167, 255, 0.08);
}

.error-text {
  display: block;
  max-width: 170px;
  margin-top: 4px;
  overflow: hidden;
  color: var(--red);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.action-cell {
  text-align: right;
}

.button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--text);
  font-weight: 650;
  cursor: pointer;
  transition: 140ms ease;
}

.button:hover {
  border-color: var(--muted);
  transform: translateY(-1px);
}

.button-primary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 46px;
  border-color: var(--acid);
  background: var(--acid);
  color: var(--acid-ink);
}

.button-primary:hover {
  border-color: #dcff98;
  background: #dcff98;
}

.button-ghost {
  background: transparent;
  color: var(--muted);
}

.button-full {
  width: 100%;
}

.button-small {
  min-height: 28px;
  padding: 0 9px;
  font-size: 10px;
}

.muted {
  color: var(--faint);
}

.empty-state {
  display: grid;
  justify-items: center;
  padding: 50px 20px;
  text-align: center;
}

.empty-state > span {
  margin-bottom: 12px;
  color: var(--acid);
  font-size: 24px;
}

.empty-state strong {
  color: var(--text);
}

.empty-state p {
  margin: 7px 0 0;
  color: var(--faint);
}

.users-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
}

.user-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  min-height: 76px;
  padding: 14px 16px;
  background: var(--panel);
}

.avatar {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  background: #292b24;
  color: var(--acid);
  font-size: 11px;
  font-weight: 800;
}

.user-main {
  min-width: 0;
}

.user-main strong,
.user-main small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-main strong {
  font-size: 12px;
}

.user-main small {
  margin-top: 4px;
  color: var(--faint);
  font-size: 10px;
}

.sync-state {
  color: var(--faint);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}

.sync-state.synced {
  color: var(--acid);
}

.switch {
  position: relative;
  width: 32px;
  height: 18px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
}

.switch span {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--faint);
  transition: 160ms ease;
}

.switch.on {
  border-color: rgba(201, 255, 94, 0.4);
  background: rgba(201, 255, 94, 0.08);
}

.switch.on span {
  left: 17px;
  background: var(--acid);
}

.wide {
  grid-column: 1 / -1;
  background: var(--panel);
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 52px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.footer a {
  text-decoration: none;
}

.footer a:hover {
  color: var(--acid);
}

.login-page {
  display: grid;
  place-items: center;
  padding: 28px;
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(340px, 0.7fr);
  width: min(100%, 1040px);
  min-height: 610px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.28);
}

.login-brand {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 42px;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(150deg, rgba(201, 255, 94, 0.08), transparent 45%),
    #141512;
}

.login-brand h1 {
  max-width: 580px;
  margin-bottom: 26px;
  font-size: clamp(38px, 5vw, 64px);
  font-weight: 480;
  line-height: 0.98;
}

.login-copy {
  max-width: 520px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.signal-line {
  display: grid;
  grid-template-columns: 8px 28px 1fr 8px;
  align-items: center;
  gap: 7px;
}

.signal-line span {
  height: 2px;
  background: var(--line-strong);
}

.signal-line span:nth-child(2) {
  background: var(--acid);
}

.login-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 40px;
}

.login-card h2 {
  font-size: 27px;
}

.login-form {
  display: grid;
  gap: 18px;
  margin-top: 34px;
}

.login-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.login-form input {
  width: 100%;
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  outline: 0;
  background: var(--bg);
  color: var(--text);
  transition: border-color 140ms ease;
}

.login-form input:focus {
  border-color: var(--acid);
  box-shadow: 0 0 0 3px rgba(201, 255, 94, 0.06);
}

.login-note {
  margin: 18px 0 0;
  color: var(--faint);
  font-size: 10px;
  text-align: center;
}

.alert {
  margin-top: 22px;
  padding: 11px 12px;
  border-radius: 8px;
  font-size: 11px;
}

.alert-error {
  border: 1px solid rgba(255, 116, 108, 0.25);
  background: rgba(255, 116, 108, 0.06);
  color: #ffaaa4;
}

.legal-page {
  padding: 42px 22px;
}

.legal-shell {
  width: min(100%, 760px);
  margin: 0 auto;
}

.legal-shell > .brand {
  margin-bottom: 88px;
}

.legal-shell h1 {
  margin-bottom: 42px;
  font-size: clamp(40px, 7vw, 72px);
}

.legal-content {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.75;
}

.legal-content h2 {
  margin: 36px 0 10px;
  color: var(--text);
}

.legal-content a {
  color: var(--acid);
  text-underline-offset: 3px;
}

.legal-contact {
  margin-top: 56px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 12px;
}

@media (max-width: 980px) {
  :root {
    --sidebar: 76px;
  }

  .sidebar {
    align-items: center;
    padding-inline: 10px;
  }

  .brand > span:last-child,
  .nav-item:not(.active)::after,
  .nav-item {
    font-size: 0;
  }

  .nav-item {
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
  }

  .nav-item span {
    width: auto;
    font-size: 19px;
  }

  .service-state,
  .sidebar-foot .button {
    display: none;
  }

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

  .stat:nth-child(2) {
    border-right: 0;
  }

  .stat:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

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

  .login-shell {
    grid-template-columns: 1fr 360px;
  }

  .login-brand {
    padding: 32px;
  }
}

@media (max-width: 720px) {
  :root {
    --sidebar: 0px;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    inset: auto 12px 12px;
    width: auto;
    height: 58px;
    flex-direction: row;
    justify-content: center;
    padding: 7px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(23, 24, 21, 0.95);
  }

  .sidebar > .brand,
  .sidebar-foot {
    display: none;
  }

  .nav {
    grid-template-columns: repeat(3, 1fr);
    width: 100%;
    margin: 0;
  }

  .nav-item {
    width: auto;
    height: 42px;
  }

  .content {
    padding: 28px 16px 92px;
  }

  .topbar {
    margin-bottom: 26px;
  }

  h1 {
    font-size: 34px;
  }

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

  .stat {
    min-height: 132px;
    padding: 17px;
  }

  .stat strong {
    margin-top: 18px;
    font-size: 30px;
  }

  .pipeline-track {
    grid-template-columns: 1fr;
  }

  .pipeline-arrow {
    margin-left: 18px;
    transform: rotate(90deg);
  }

  .login-page {
    padding: 14px;
  }

  .login-shell {
    display: block;
    min-height: 0;
  }

  .login-brand {
    min-height: 270px;
    padding: 26px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .login-brand h1 {
    font-size: 38px;
  }

  .login-copy {
    display: none;
  }

  .login-card {
    padding: 34px 26px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
