:root {
  --bg: #070d14;
  --bg-panel: #ffffff0f;
  --card: #ffffff0f;
  --text: #ffffff;
  --muted: #aeaeb2;
  --accent: #8a7cf8;
  --accent-hover: #9b90f9;
  --ok: #3d9a6a;
  --err: #ff6b6b;
  --line: #ffffff14;
  --input: #ffffff0f;
  --radius: 2px;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font: 16px/1.45 Inter, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  letter-spacing: -0.2px;
}
a { color: var(--accent); }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

body.app {
  display: flex;
  min-height: 100%;
  background: #070d14;
}
.sidebar {
  width: 226px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: #0c131c;
  position: relative;
}
.sidebar::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(180deg, #ffffff00, #ffffff1f 10%, #ffffff1f 90%, #ffffff00);
  pointer-events: none;
}
.sidebar-logo {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 16px 14px 12px;
  text-decoration: none;
  color: inherit;
}
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px;
  flex: 1;
}
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 8px;
  border-radius: 8px;
  color: #ffffff8f;
  text-decoration: none;
  font-size: 14px;
  line-height: 20px;
  letter-spacing: -0.2px;
}
.sidebar-item:hover {
  background: #ffffff0a;
  color: #ffffffb8;
}
.sidebar-item.is-active {
  color: var(--accent);
}
.sidebar-icon {
  width: 20px;
  height: 20px;
  display: flex;
  flex-shrink: 0;
  color: inherit;
}
.sidebar-icon svg { display: block; }
.sidebar-foot {
  margin-top: auto;
  padding: 8px 8px 16px;
  display: grid;
  gap: 4px;
}
.sidebar-who {
  padding: 8px;
  display: grid;
  gap: 2px;
  min-width: 0;
}
.sidebar-who-email {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-who-role { font-size: 12px; color: var(--muted); }
.sidebar-logout {
  width: 100%;
  background: transparent;
  color: var(--muted);
  font-weight: 500;
}
.sidebar-logout:hover {
  background: #ffffff0a;
  color: #fff;
}
.app-main {
  flex: 1;
  min-width: 0;
  padding: 28px 40px 80px;
  overflow: auto;
}
.app-main > * { max-width: 960px; }
.eyebrow {
  margin: 0 0 4px;
  font-size: 13px;
  color: var(--muted);
}
.lede {
  margin: 0 0 20px;
  color: var(--muted);
  max-width: 560px;
}
.dash {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0;
}
.dash-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  text-decoration: none;
  color: inherit;
  display: grid;
  gap: 4px;
}
.dash-card:hover { border-color: #ffffff2e; }
.dash-value {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.6px;
}
.dash-label { color: var(--muted); font-size: 13px; }
button.danger {
  background: transparent;
  color: var(--err);
  border: 1px solid #ff6b6b55;
}
button.danger:hover { background: #3a1f1f; }

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  border-bottom: 1px solid var(--line);
  background: #070d14cc;
  backdrop-filter: blur(20px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
}
.top nav { display: flex; gap: 12px; align-items: center; }
.who { color: var(--muted); font-size: 14px; }
.wrap { max-width: 880px; margin: 0 auto; padding: 24px; }
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.page-head h1 { margin: 0; font-size: 24px; font-weight: 600; letter-spacing: -0.4px; }
.app-main h2 {
  margin: 28px 0 8px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.2px;
}
.app-main h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}
a.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  width: max-content;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  margin: 16px 0;
  display: grid;
  gap: 10px;
}
label { display: grid; gap: 4px; font-size: 14px; color: var(--muted); }
input, select, button {
  font: inherit;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 0;
  background: var(--input);
  color: var(--text);
}
button {
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  width: max-content;
  font-weight: 600;
  font-size: 14px;
  border-radius: 8px;
}
button:hover { background: var(--accent-hover); }
.inline { display: inline; }
.inline button {
  height: 32px;
  padding: 0 12px;
  font-size: 13px;
}
.inline-row { display: flex; gap: 8px; align-items: center; margin: 12px 0; }
.inline-row label { flex: 1; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inline-row.compact { margin: 0; }
.inline-row.compact select {
  width: auto;
  min-width: 7rem;
  padding: 6px 8px;
  font-size: 13px;
}
.inline-row.compact button {
  height: 32px;
  padding: 0 12px;
  font-size: 13px;
}
table { width: 100%; border-collapse: collapse; margin: 12px 0 24px; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); }
.tag {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--line);
}
.muted { color: var(--muted); }
.flash { padding: 10px 12px; border-radius: 8px; }
.flash.error { background: #3a1f1f; color: #f0c4c4; }
.flash.ok { background: #1c3326; color: #b7e0c6; }
code { font-size: 13px; }

.auth-chip {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: #9ad7c8;
  background: #9ad7c81f;
  letter-spacing: 0;
}
.logo-mark { display: block; color: #fff; }

.auth-page {
  min-height: 100%;
  background: #070d14;
}
.auth-art {
  display: none;
}
.auth-panel {
  min-height: 100%;
  display: flex;
  justify-content: center;
  padding: 24px 16px 48px;
}
.auth-panel-inner {
  width: 100%;
  max-width: 320px;
  margin: auto 0;
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 48px;
  margin-bottom: 32px;
}
.auth-title {
  margin: 0 0 8px;
  font-size: 24px;
  line-height: 32px;
  font-weight: 600;
  letter-spacing: -0.4px;
}
.auth-lead {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 14px;
}
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.auth-input {
  width: 100%;
  height: 40px;
  padding: 10px 12px;
  border-radius: 2px;
  background: #ffffff0f;
  color: #fff;
}
.auth-input::placeholder { color: #ffffff52; }
.auth-forgot {
  align-self: flex-start;
  margin-top: -4px;
  font-size: 12px;
  color: #ffffff52;
  text-decoration: none;
}
.auth-forgot:hover { color: #ffffff8f; }
.field-error {
  margin: 0;
  font-size: 14px;
  color: var(--err);
}
.auth-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 40px;
  margin-top: 8px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  box-sizing: border-box;
  background: var(--accent);
  color: #fff;
}
a.auth-submit:hover { background: var(--accent-hover); }
.auth-secondary {
  display: block;
  text-align: center;
  font-size: 14px;
}
.auth-footnote {
  margin: 8px 0 0;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}
.auth-footnote a { text-decoration: none; }
.auth-bypass {
  margin-top: 32px;
  color: var(--muted);
  font-size: 13px;
}
.auth-bypass form {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

@media (min-width: 768px) {
  .auth-art {
    display: block;
    position: fixed;
    inset: 0;
    background-color: #070d14;
    background-image: url("/partner-handshake-intro.jpg?v=3");
    background-size: cover;
    background-position: calc(50% + 160px) center;
  }
  .auth-art::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, #070d14 0%, #070d1400 42%);
    pointer-events: none;
  }
  .auth-panel {
    position: relative;
    z-index: 1;
    width: 640px;
    min-height: 100%;
    justify-content: center;
    padding: 32px 160px 110px;
    background: #ffffff0f;
    backdrop-filter: blur(40px);
    box-shadow: 1px 0 0 #ffffff0f;
  }
  .auth-panel-inner {
    max-width: 320px;
    margin: auto;
  }
}

@media (max-width: 767px) {
  body.app { flex-direction: column; }
  .sidebar { width: 100%; }
  .sidebar::after { display: none; }
  .sidebar-logo { flex-direction: row; align-items: center; padding: 12px 14px; }
  .sidebar-nav {
    flex-direction: row;
    overflow-x: auto;
    padding: 0 8px 8px;
    flex: 0;
  }
  .sidebar-item { white-space: nowrap; }
  .sidebar-foot {
    flex-direction: row;
    grid-template-columns: 1fr auto;
    align-items: center;
    padding: 8px 14px 12px;
  }
  .app-main { padding: 16px; }
  .dash { grid-template-columns: 1fr; }
}
