:root {
  color-scheme: dark;
  --bg: #10130f;
  --surface: #161b15;
  --surface-strong: #20281d;
  --line: rgba(219, 231, 205, 0.13);
  --text: #eef4e8;
  --muted: #9fa99a;
  --faint: #717b6c;
  --accent: #d4ef77;
  --accent-strong: #efff9b;
  --orange: #e59b28;
  --rose: #df4f7a;
  --red: #f05d52;
  --green: #8fd776;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100svh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

button {
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

.app-shell {
  min-height: 100svh;
}

.login-view {
  display: grid;
  min-height: 100svh;
  padding: 24px;
  place-items: center;
}

.login-panel {
  width: min(420px, 100%);
}

.login-panel h1,
.topbar h1,
.section-heading h2,
.drawer-header h2 {
  margin: 0;
}

.login-panel h1 {
  font-size: 44px;
  line-height: 0.98;
  max-width: 10ch;
}

.login-panel label {
  color: var(--muted);
  display: grid;
  gap: 10px;
  margin-top: 32px;
}

.login-panel input {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  min-height: 48px;
  padding: 0 14px;
}

.login-panel button,
#refreshButton {
  background: var(--accent);
  color: #171b17;
  font-weight: 800;
  min-height: 40px;
  padding: 0 16px;
}

.login-panel button {
  margin-top: 14px;
  width: 100%;
}

.login-panel button:hover,
#refreshButton:hover {
  background: var(--accent-strong);
}

.quiet-button,
.text-button {
  background: transparent;
  color: var(--text);
  min-height: 38px;
  padding: 0 14px;
}

.text-button {
  color: var(--accent);
}

.quiet-button:hover,
.text-button:hover {
  background: var(--surface-strong);
}

.form-error {
  color: var(--red);
  min-height: 22px;
}

.dashboard-view {
  margin: 0 auto;
  max-width: 1480px;
  padding: 24px 28px 36px;
}

.topbar {
  align-items: end;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 24px;
  justify-content: space-between;
  padding-bottom: 18px;
}

.topbar h1 {
  font-size: 40px;
  line-height: 1;
}

.topbar-copy {
  color: var(--muted);
  margin: 10px 0 0;
  max-width: 680px;
}

.topbar-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin: 0 0 8px;
  text-transform: uppercase;
}

.sync-pill,
.status-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  font-size: 13px;
  line-height: 1;
  padding: 8px 10px;
  white-space: nowrap;
}

.kpi-grid {
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin: 22px 0;
  overflow: hidden;
  border-radius: 8px;
}

.kpi {
  background: var(--surface);
  color: var(--text);
  min-height: 104px;
  padding: 16px;
  text-align: left;
}

.kpi:hover {
  background: var(--surface-strong);
}

.kpi strong {
  display: block;
  font-size: 38px;
  line-height: 1;
}

.kpi span,
.kpi small {
  display: block;
}

.kpi span {
  color: var(--text);
  font-weight: 800;
  margin-top: 10px;
}

.kpi small {
  color: var(--muted);
  margin-top: 4px;
}

.dashboard-grid {
  display: grid;
  gap: 24px 28px;
  grid-template-columns: minmax(360px, 0.9fr) minmax(520px, 1.35fr) minmax(320px, 0.75fr);
}

.focus-panel {
  grid-row: span 2;
}

.wave-panel {
  grid-column: span 2;
}

.section-heading {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-heading h2 {
  font-size: 22px;
  line-height: 1.05;
}

.creator-list,
.creator-table,
.pipeline-bars,
.agenda-list {
  border-top: 1px solid var(--line);
}

.creator-row,
.agenda-row,
.bar-row {
  border-bottom: 1px solid var(--line);
}

.creator-row {
  align-items: start;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 14px 0;
}

.creator-row[data-mode="table"] {
  grid-template-columns: minmax(220px, 1fr) 72px 96px auto;
}

.creator-row[data-mode="drawer"] {
  grid-template-columns: minmax(0, 1fr) auto;
}

.creator-title {
  color: var(--text);
  font-weight: 800;
  line-height: 1.15;
}

.creator-meta,
.creator-action,
.agenda-row span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.creator-action {
  margin-top: 7px;
}

.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.link-row a {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  font-size: 12px;
  padding: 6px 9px;
  text-decoration: none;
}

.link-row a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.status-pill[data-tone="green"] {
  border-color: rgba(143, 215, 118, 0.45);
  color: var(--green);
}

.status-pill[data-tone="orange"] {
  border-color: rgba(229, 155, 40, 0.45);
  color: var(--orange);
}

.status-pill[data-tone="rose"] {
  border-color: rgba(223, 79, 122, 0.45);
  color: var(--rose);
}

.status-pill[data-tone="red"] {
  border-color: rgba(240, 93, 82, 0.45);
  color: var(--red);
}

.bar-row {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(118px, 0.8fr) 1fr 36px;
  padding: 9px 0;
}

.bar-row span {
  color: var(--muted);
  font-size: 13px;
}

.bar-track {
  background: var(--surface);
  border-radius: 999px;
  height: 9px;
  overflow: hidden;
}

.bar-fill {
  background: var(--accent);
  height: 100%;
}

.agenda-row {
  align-items: center;
  background: transparent;
  color: var(--text);
  display: flex;
  justify-content: space-between;
  padding: 13px 0;
  text-align: left;
  width: 100%;
}

.agenda-row:hover {
  color: var(--accent);
}

.empty-state {
  color: var(--faint);
  padding: 22px 0;
}

.drawer-backdrop {
  background: rgba(0, 0, 0, 0.45);
  inset: 0;
  opacity: 0;
  position: fixed;
  transition: opacity 160ms ease;
  z-index: 10;
}

.drawer-backdrop[data-open="true"] {
  opacity: 1;
}

.detail-drawer {
  background: #121711;
  border-left: 1px solid var(--line);
  bottom: 0;
  box-shadow: -22px 0 60px rgba(0, 0, 0, 0.28);
  display: grid;
  grid-template-rows: auto 1fr;
  max-width: min(720px, 100vw);
  position: fixed;
  right: 0;
  top: 0;
  transform: translateX(24px);
  opacity: 0;
  transition: opacity 160ms ease, transform 160ms ease;
  width: 48vw;
  z-index: 11;
}

.detail-drawer[data-open="true"] {
  opacity: 1;
  transform: translateX(0);
}

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

.drawer-header h2 {
  font-size: 28px;
}

.drawer-body {
  overflow: auto;
  padding: 0 22px 24px;
}

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

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

  .focus-panel,
  .wave-panel {
    grid-column: span 2;
  }

  .detail-drawer {
    width: 72vw;
  }
}

@media (max-width: 760px) {
  .dashboard-view {
    padding: 18px;
  }

  .topbar,
  .topbar-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar h1 {
    font-size: 34px;
  }

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

  .dashboard-grid,
  .focus-panel,
  .wave-panel {
    display: block;
  }

  .signal-panel,
  .pipeline-panel,
  .agenda-panel,
  .wave-panel {
    margin-top: 26px;
  }

  .creator-row[data-mode="table"] {
    grid-template-columns: 1fr auto;
  }

  .detail-drawer {
    width: 100vw;
  }
}
