/* Darwin Digital - Code Review Monitor. Mirrors the JSX prototype's inline styles. */

:root {
  --navy: #0E1E50;
  --navy-deep: #0A1640;
  --navy-tint: #4A6FA5;
  --white: #FFFFFF;
  --off-white: #F5F5F2;
  --gray: #8A8A8A;
  --line: rgba(255,255,255,0.15);
  --line-faint: rgba(255,255,255,0.08);
  --sev-critical: #FF5C5C;
  --sev-medium:   #F0B038;
  --sev-low:      #8FA3CC;
  --status-open:   #7CD8B0;
  --status-review: #F0B038;
  --status-merged: #8FA3CC;
  --status-passed: #7CD8B0;
  --status-failed: #FF5C5C;
  /* Token tower segments: Sonnet = teal family, Haiku = amber family,
     shaded light -> dark across in / out / cache-write / cache-read. */
  --seg-sonnet-in:  #7CD8B0;
  --seg-sonnet-out: #4FB58C;
  --seg-sonnet-cw:  #3C8E72;
  --seg-sonnet-cr:  #2C6354;
  --seg-haiku-in:   #F0B038;
  --seg-haiku-out:  #D2912A;
  --seg-haiku-cw:   #A9711F;
  --seg-haiku-cr:   #7E5417;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; background: var(--navy); color: var(--white); font-family: 'Manrope', system-ui, sans-serif; font-size: 14px; line-height: 1.55; font-feature-settings: 'tnum' 1, 'ss01' 1; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* ---- Shell ---------------------------------------------------------------- */

.shell {
  width: 100%;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
  grid-template-rows: 72px 1fr;
  background: var(--navy);
}
.topbar {
  grid-column: 1 / 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  border-bottom: 1px solid var(--line);
  background: var(--navy);
}
.brand { display: flex; align-items: center; gap: 16px; color: var(--white); }
.brand-wordmark { height: 25px; color: var(--white); display: block; }
.brand-divider { width: 1px; height: 25px; background: var(--line); }
.brand-sub { font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: rgba(255,255,255,0.7); font-weight: 600; }

.rail {
  border-right: 1px solid var(--line);
  padding: 32px 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--navy);
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 32px;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  font-weight: 600;
  border-left: 2px solid transparent;
  cursor: pointer;
}
.nav-item:hover { color: var(--white); }
.nav-item.is-active {
  color: var(--white);
  border-left-color: var(--white);
  background: rgba(255,255,255,0.04);
}
.nav-count {
  margin-left: auto;
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  letter-spacing: 0.04em;
  font-weight: 500;
}
.nav-group-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: rgba(255,255,255,0.3);
  text-transform: uppercase;
  padding: 32px 32px 12px;
}

main.content { overflow: auto; padding: 48px 48px 64px; min-width: 0; }

/* ---- Generic primitives -------------------------------------------------- */

.page-header { margin-bottom: 48px; }
.page-header .eyebrow { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--navy-tint); margin-bottom: 18px; font-weight: 600; }
.page-header h1 { font-size: 44px; font-weight: 500; letter-spacing: -0.02em; margin: 0; color: var(--white); line-height: 1.1; }
.page-header p { margin: 16px 0 0; color: rgba(255,255,255,0.65); font-size: 17px; line-height: 1.5; max-width: 720px; font-weight: 400; }

.eyebrow { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; font-weight: 600; color: var(--navy-tint); }
.eyebrow.muted { color: rgba(255,255,255,0.4); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 13px 20px;
  background: transparent;
  color: var(--white);
  border: 1px solid var(--line);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-family: inherit;
  cursor: pointer;
}
.btn::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--white); }
.btn.primary { background: var(--white); color: var(--navy); border-color: var(--white); }
.btn.primary::after { background: var(--navy); }

/* Status dot */
.status { display: inline-flex; align-items: center; gap: 8px; font-size: 11px; color: var(--white); letter-spacing: 0.16em; text-transform: uppercase; font-weight: 600; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--gray); }
.status.open::before   { background: var(--status-open); }
.status.review::before { background: var(--status-review); }
.status.merged::before { background: var(--status-merged); }
.status.passed::before { background: var(--status-passed); }
.status.failed::before { background: var(--status-failed); }

/* Avatar */
.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  display: inline-grid; place-items: center;
  font-size: 11px; font-weight: 600; letter-spacing: 0.04em;
  background: rgba(255,255,255,0.08);
  color: var(--white);
  border: 1px solid var(--line);
  flex-shrink: 0;
}

/* Severity row */
.sev-row { display: inline-flex; gap: 18px; font-variant-numeric: tabular-nums; }
.sev-pill { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; }
.sev-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.sev-pill.critical { color: var(--sev-critical); }
.sev-pill.medium   { color: var(--sev-medium); }
.sev-pill.low      { color: var(--sev-low); }

/* ---- Dashboard ----------------------------------------------------------- */

.meta-row { display: flex; align-items: center; justify-content: space-between; padding-bottom: 24px; margin-bottom: 48px; border-bottom: 1px solid var(--line); }
.meta-left { display: flex; gap: 32px; align-items: center; }
.meta-item { display: flex; flex-direction: column; gap: 6px; }
.meta-label { font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--navy-tint); font-weight: 600; }
.meta-value { font-size: 14px; color: var(--white); font-variant-numeric: tabular-nums; }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-bottom: 96px;
}
.kpi { padding: 32px; border-right: 1px solid var(--line); }
.kpi:last-child { border-right: none; }
.kpi-label { font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--navy-tint); font-weight: 600; margin-bottom: 24px; }
.kpi-value { font-size: 56px; font-weight: 500; letter-spacing: -0.025em; color: var(--white); line-height: 1; font-variant-numeric: tabular-nums; }
.kpi-value.critical { color: var(--sev-critical); }
.kpi-value.medium   { color: var(--sev-medium); }
.kpi-value.low      { color: var(--sev-low); }
.kpi-delta { font-size: 13px; color: rgba(255,255,255,0.55); margin-top: 16px; }

.charts-row { display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; margin-bottom: 96px; }
.chart-header { display: flex; justify-content: space-between; align-items: flex-end; padding-bottom: 20px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.chart-title { font-size: 22px; font-weight: 500; color: var(--white); letter-spacing: -0.01em; margin-top: 8px; }
.legend-row { display: flex; gap: 18px; font-size: 11px; color: rgba(255,255,255,0.7); letter-spacing: 0.16em; text-transform: uppercase; font-weight: 600; }
.legend-row > span { display: inline-flex; align-items: center; gap: 8px; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.chart-headline-num { font-size: 32px; font-weight: 500; color: var(--white); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

.section-eyebrow { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 24px; }
.section-title { font-size: 32px; font-weight: 500; color: var(--white); letter-spacing: -0.02em; margin: 8px 0 0; }
.section-link { font-size: 11px; color: var(--white); letter-spacing: 0.16em; text-transform: uppercase; font-weight: 600; cursor: pointer; }
.section-link:hover { color: rgba(255,255,255,0.8); }

/* Table - shared dashboard + search */

table.darwin { width: 100%; border-collapse: collapse; font-size: 14px; }
table.darwin th {
  text-align: left;
  padding: 16px 24px 16px 0;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--navy-tint);
  font-weight: 600;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
table.darwin td {
  padding: 22px 24px 22px 0;
  border-bottom: 1px solid var(--line-faint);
  vertical-align: middle;
  color: var(--white);
}
table.darwin tr:last-child td { border-bottom: none; }
.pr-id-cell { font-size: 13px; color: rgba(255,255,255,0.55); letter-spacing: 0.04em; font-variant-numeric: tabular-nums; }
.pr-title-cell .title { font-size: 16px; color: var(--white); font-weight: 500; margin-bottom: 8px; letter-spacing: -0.005em; }
.pr-title-cell .meta { display: flex; gap: 10px; align-items: center; font-size: 12px; color: rgba(255,255,255,0.5); }
.pr-title-cell .meta .dot { color: rgba(255,255,255,0.3); }
.pr-title-cell .meta .branch { letter-spacing: 0.04em; }
.owner-cell { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--white); }
.runs-cell { font-variant-numeric: tabular-nums; font-size: 16px; color: var(--white); font-weight: 500; }
.updated-cell { color: rgba(255,255,255,0.55); font-size: 13px; }
tr.row-critical td:first-child { box-shadow: inset 2px 0 0 var(--sev-critical); padding-left: 16px; }
tr.clickable { cursor: pointer; transition: background 0.12s; }
tr.clickable:hover td { background: rgba(255,255,255,0.02); }

.provider-icon { display: inline-flex; color: rgba(255,255,255,0.85); }

/* ---- PR Search ----------------------------------------------------------- */

.search-block { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 32px; }
.search-form { display: flex; align-items: center; gap: 20px; padding: 32px 0; }
.search-icon { color: var(--navy-tint); flex-shrink: 0; }
.search-input {
  background: transparent;
  border: none;
  outline: none;
  flex: 1;
  font-family: inherit;
  font-size: 32px;
  font-weight: 500;
  color: var(--white);
  letter-spacing: -0.02em;
  caret-color: var(--white);
  padding: 0;
}
.search-input::placeholder { color: rgba(255,255,255,0.4); font-weight: 500; }
.search-hint { font-size: 11px; color: var(--navy-tint); letter-spacing: 0.16em; text-transform: uppercase; font-weight: 600; }
.search-submit {
  background: transparent;
  color: var(--white);
  border: 1px solid var(--line);
  padding: 8px 14px;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 600;
  cursor: pointer;
}

.filter-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-bottom: 32px;
}
.filter-cell { padding: 32px 24px; border-right: 1px solid var(--line); }
.filter-cell:first-child { padding-left: 0; }
.filter-cell:last-child { border-right: none; padding-right: 0; }
.filter-label { font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--navy-tint); font-weight: 600; margin-bottom: 12px; }
.filter-select {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  appearance: none;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  color: var(--white);
  cursor: pointer;
  padding: 0 24px 0 0;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16' fill='none' stroke='%234A6FA5' stroke-width='1.3'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right center;
}
.filter-select option { background: var(--navy); color: var(--white); }

.active-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 48px; }
.active-label { font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--navy-tint); font-weight: 600; margin-right: 8px; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 8px 14px;
  font-size: 12px;
  color: var(--white);
  border: 1px solid var(--line);
  background: transparent;
  letter-spacing: 0.02em;
}
.pill .dim { font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--navy-tint); font-weight: 600; }
.pill .x {
  display: inline-grid; place-items: center;
  width: 20px; height: 20px; color: var(--white);
  background: rgba(255,255,255,0.06);
}
.clear-all { font-size: 11px; color: var(--white); letter-spacing: 0.16em; text-transform: uppercase; font-weight: 600; margin-left: 12px; border-bottom: 1px solid var(--white); padding-bottom: 1px; }

.results-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 24px; }
.results-count-bold { color: var(--white); font-weight: 600; }
.results-showing { color: rgba(255,255,255,0.6); font-weight: 400; margin-left: 16px; font-size: 18px; }
.sort-control { display: flex; align-items: center; gap: 14px; font-size: 11px; color: var(--white); letter-spacing: 0.16em; text-transform: uppercase; font-weight: 600; }
.sort-dim { color: var(--navy-tint); }

.pagination-bar { padding-top: 32px; display: flex; align-items: center; justify-content: space-between; font-size: 14px; color: rgba(255,255,255,0.6); }
.page-controls { display: flex; align-items: center; gap: 0; }
.page-btn {
  min-width: 40px; height: 40px; padding: 0 8px;
  display: inline-grid; place-items: center;
  font-size: 13px; font-weight: 500;
  background: transparent; border: 1px solid var(--line);
  color: var(--white); cursor: pointer;
  margin-left: -1px;
  font-family: inherit;
}
.page-btn.active { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.4); color: var(--white); font-weight: 600; z-index: 1; position: relative; cursor: default; }
.page-btn.ghost { color: var(--navy-tint); }
.page-btn.ellipsis { border: none; color: var(--navy-tint); cursor: default; }
.page-btn[disabled] { cursor: not-allowed; opacity: 0.5; }
.page-size { display: flex; align-items: center; gap: 14px; }
.page-size-label { font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--navy-tint); font-weight: 600; }
.page-size-value { padding: 8px 14px; font-size: 13px; color: var(--white); border: 1px solid var(--line); display: inline-flex; align-items: center; gap: 10px; }
.page-size-select {
  padding: 8px 32px 8px 14px;
  font-size: 13px;
  color: var(--white);
  background: transparent;
  border: 1px solid var(--line);
  appearance: none;
  font-family: inherit;
  cursor: pointer;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 16 16' fill='none' stroke='%23ffffff' stroke-width='1.4'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.page-size-select option { background: var(--navy); color: var(--white); }
.page-indicator { font-size: 11px; color: var(--navy-tint); letter-spacing: 0.16em; text-transform: uppercase; font-weight: 600; }

/* ---- PR Detail ----------------------------------------------------------- */

.breadcrumb { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 11px; color: var(--navy-tint); letter-spacing: 0.16em; text-transform: uppercase; font-weight: 600; margin-bottom: 32px; }
.breadcrumb .sep { color: rgba(255,255,255,0.3); }
.breadcrumb .current { color: var(--white); }

.pr-head { padding-bottom: 32px; border-bottom: 1px solid var(--line); margin-bottom: 48px; }
.pr-title { font-size: 48px; font-weight: 500; letter-spacing: -0.025em; color: var(--white); margin: 0 0 24px; max-width: 1100px; line-height: 1.1; }
.pr-meta-grid { display: flex; gap: 32px; align-items: center; flex-wrap: wrap; }
.pr-meta { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; color: rgba(255,255,255,0.75); }
.pr-meta.muted { color: rgba(255,255,255,0.5); }
.branch-pill { padding: 6px 14px; border: 1px solid var(--line); font-size: 12px; color: var(--white); letter-spacing: 0.04em; }

.kpi-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-bottom: 64px;
}
.kpi-grid-4 .kpi { padding: 32px; border-right: 1px solid var(--line); }
.kpi-grid-4 .kpi:last-child { border-right: none; }
.kpi-sub { font-size: 13px; color: rgba(255,255,255,0.55); margin-top: 16px; }

.two-col { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 48px; }
.section-eyebrow-bordered { display: flex; justify-content: space-between; align-items: baseline; padding-bottom: 20px; border-bottom: 1px solid var(--line); margin-bottom: 0; }
.section-title-md { font-size: 24px; font-weight: 500; color: var(--white); letter-spacing: -0.01em; margin: 8px 0 0; }
.section-meta { font-size: 11px; color: var(--navy-tint); letter-spacing: 0.16em; text-transform: uppercase; font-weight: 600; }

.run-row { padding: 28px 16px; border-bottom: 1px solid var(--line-faint); display: grid; grid-template-columns: auto 1fr auto; gap: 24px; align-items: center; cursor: pointer; transition: background 0.12s; color: inherit; text-decoration: none; margin: 0 -16px; }
.run-row:hover { background: rgba(255,255,255,0.03); }
.run-row.is-active { background: rgba(255,255,255,0.06); border-left: 2px solid var(--white); padding-left: 14px; }
.run-row:last-child { border-bottom: none; }
.run-badge { min-width: 56px; font-size: 11px; color: var(--navy-tint); letter-spacing: 0.16em; text-transform: uppercase; font-weight: 600; }
.run-badge-num { font-size: 28px; color: var(--white); letter-spacing: -0.02em; font-weight: 500; margin-top: 4px; font-variant-numeric: tabular-nums; }
.run-meta-top { font-size: 16px; color: var(--white); font-weight: 500; margin-bottom: 8px; letter-spacing: -0.005em; }
.run-meta-bottom { font-size: 13px; color: rgba(255,255,255,0.55); display: flex; gap: 14px; }
.run-meta-bottom .dot { color: rgba(255,255,255,0.3); }

.comments-scroll { max-height: 780px; overflow-y: auto; padding-right: 8px; }
.comment-item { padding: 24px 0; border-bottom: 1px solid var(--line-faint); display: grid; grid-template-columns: auto 1fr; gap: 18px; }
.comment-item:last-child { border-bottom: none; }
.comment-mark { width: 8px; height: 8px; margin-top: 10px; border-radius: 50%; }
.comment-mark.critical { background: var(--sev-critical); }
.comment-mark.medium   { background: var(--sev-medium); }
.comment-mark.low      { background: var(--sev-low); }
.comment-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 11px; letter-spacing: 0.04em; flex-wrap: wrap; }
.comment-sev { font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; font-weight: 600; }
.comment-sev.critical { color: var(--sev-critical); }
.comment-sev.medium   { color: var(--sev-medium); }
.comment-sev.low      { color: var(--sev-low); }
.comment-file { color: var(--white); }
.comment-file-muted { color: rgba(255,255,255,0.55); }
.comment-body { font-size: 15px; color: rgba(255,255,255,0.85); line-height: 1.6; }

/* ---- Settings: token towers ---------------------------------------------- */

.tower-legend { flex-wrap: wrap; gap: 18px; margin-bottom: 32px; }
.chart-header-spaced { margin-top: 56px; }

.tower-chart { margin-top: 24px; }
.tower-grid {
  display: grid;
  grid-template-columns: repeat(14, 1fr);
  gap: 10px;
  align-items: end;
  height: 320px;
  border-bottom: 1px solid var(--line);
}
.tower-col { display: flex; flex-direction: column; justify-content: flex-end; height: 100%; min-width: 0; }
.tower { display: flex; flex-direction: column-reverse; width: 100%; }
.tower-seg { width: 100%; }
.tower-empty { width: 100%; height: 2px; background: var(--line-faint); }
.tower-xlabel {
  margin-top: 12px; text-align: center;
  font-size: 10px; letter-spacing: 0.06em;
  color: rgba(255,255,255,0.45); font-variant-numeric: tabular-nums;
}

/* segment fills keyed to the {model}_{category} keys from queries.py */
.seg-sonnet_in_token     { background: var(--seg-sonnet-in); }
.seg-sonnet_out_token    { background: var(--seg-sonnet-out); }
.seg-sonnet_cache_written{ background: var(--seg-sonnet-cw); }
.seg-sonnet_cached_read  { background: var(--seg-sonnet-cr); }
.seg-haiku_in_token      { background: var(--seg-haiku-in); }
.seg-haiku_out_token     { background: var(--seg-haiku-out); }
.seg-haiku_cache_written { background: var(--seg-haiku-cw); }
.seg-haiku_cached_read   { background: var(--seg-haiku-cr); }

/* ---- Empty state --------------------------------------------------------- */
.empty {
  border: 1px dashed var(--line);
  padding: 64px;
  text-align: center;
  color: rgba(255,255,255,0.55);
  font-size: 14px;
}
.empty strong { color: var(--white); font-weight: 600; display: block; margin-bottom: 8px; font-size: 18px; }

/* ---- Settings: daily spend limit ----------------------------------------- */
.settings-card {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 32px;
  margin-bottom: 56px;
  background: var(--navy-deep);
}
.settings-card-title { font-size: 22px; font-weight: 500; margin: 16px 0 0; color: var(--white); letter-spacing: -0.01em; }
.settings-card-sub { margin: 12px 0 0; color: rgba(255,255,255,0.6); font-size: 14px; line-height: 1.5; max-width: 640px; }
.limit-form { display: flex; align-items: flex-end; gap: 16px; margin-top: 28px; flex-wrap: wrap; }
.btn-save {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  padding: 18px 24px;
  background: var(--white); color: var(--navy);
  border: 1px solid var(--white);
  font-size: 11px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase;
  font-family: inherit; cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.btn-save:hover { background: var(--off-white); border-color: var(--off-white); }
.btn-save-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--navy); }
.field { display: flex; flex-direction: column; gap: 10px; }
.field label { font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--navy-tint); font-weight: 600; }
.field-input { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 4px; background: var(--navy); padding: 0 14px; }
.field-input:focus-within { border-color: var(--white); }
.field-prefix { color: rgba(255,255,255,0.5); font-variant-numeric: tabular-nums; }
.field-input input {
  background: transparent; border: 0; outline: none;
  color: var(--white); font-family: inherit; font-size: 16px;
  padding: 12px 10px; width: 160px; font-variant-numeric: tabular-nums;
}
.limit-status { display: flex; align-items: center; gap: 16px; margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line-faint); }
.limit-status-label { font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--navy-tint); font-weight: 600; }
.limit-status-value { font-size: 18px; color: var(--white); font-variant-numeric: tabular-nums; }
.limit-pill { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 600; padding: 4px 10px; border-radius: 999px; }
.limit-pill.reached { color: var(--sev-critical); background: rgba(255,92,92,0.12); }
.limit-pill.ok { color: var(--status-passed); background: rgba(124,216,176,0.12); }
.limit-pill.none { color: var(--gray); background: rgba(138,138,138,0.12); }

/* ---- Rail logout footer --------------------------------------------------- */

.rail-footer {
  margin-top: auto;
  padding-top: 24px;
  margin-left: 32px;
  margin-right: 32px;
  border-top: 1px solid var(--line-faint);
}
.logout-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 12px 0;
  background: transparent;
  border: none;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  font-weight: 600;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}
.logout-btn:hover { color: var(--white); }

/* ---- Login --------------------------------------------------------------- */

.login {
  width: 100%;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  background: var(--navy);
  color: var(--white);
}

.login-brand {
  position: relative;
  overflow: hidden;
  border-right: 1px solid var(--line);
  padding: 48px 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.login-grid { position: absolute; inset: 0; pointer-events: none; }
.login-brand-top { display: flex; align-items: center; gap: 16px; position: relative; }
.login-brand-mid { max-width: 480px; position: relative; }
.login-brand-mid .eyebrow { margin-bottom: 24px; }
.login-headline {
  font-size: 56px; font-weight: 500; letter-spacing: -0.03em;
  line-height: 1.08; margin: 0 0 24px; color: var(--white);
}
.login-lede {
  font-size: 17px; line-height: 1.6; color: rgba(255,255,255,0.6); margin: 0;
}

.login-form-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 80px;
}
.login-form-inner { width: 100%; max-width: 380px; margin: 0 auto; }
.login-form-head { margin-bottom: 48px; }
.login-title {
  font-size: 32px; font-weight: 500; letter-spacing: -0.02em;
  margin: 12px 0 0; color: var(--white);
}

.login-error {
  margin-bottom: 28px;
  padding: 12px 16px;
  border: 1px solid rgba(255,92,92,0.4);
  background: rgba(255,92,92,0.12);
  color: var(--sev-critical);
  font-size: 13px;
  letter-spacing: 0.02em;
}

.login-field { margin-bottom: 28px; }
.login-field-row {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 12px;
}
.login-label {
  font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--navy-tint); font-weight: 600;
}
.login-input-wrap {
  display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
}
.login-input-wrap:focus-within { border-bottom-color: var(--white); }
.login-input-icon { color: var(--navy-tint); flex-shrink: 0; }
.login-input {
  flex: 1;
  background: transparent; border: 0; outline: none;
  color: var(--white); font-family: inherit;
  font-size: 18px; font-weight: 500; letter-spacing: -0.01em;
}
.login-input::placeholder { color: rgba(255,255,255,0.3); font-weight: 400; }

.login-submit {
  width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 18px 24px;
  margin-top: 16px;
  background: var(--white); color: var(--navy);
  border: 1px solid var(--white);
  font-size: 11px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase;
  font-family: inherit; cursor: pointer;
}
.login-submit:hover { background: var(--off-white); border-color: var(--off-white); }
.login-submit-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--navy); }

.login-footer {
  margin-top: 64px; padding-top: 24px;
  border-top: 1px solid var(--line-faint);
  font-size: 12px; color: rgba(255,255,255,0.45); line-height: 1.6;
}

@media (max-width: 760px) {
  .login { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .login-form-panel { padding: 48px 32px; }
}

/* ---- Documentation ------------------------------------------------------- */

.docs-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 40px;
}
.docs-tab {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 600;
  color: rgba(255,255,255,0.55);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.12s;
}
.docs-tab:hover { color: rgba(255,255,255,0.85); }
.docs-tab.is-active { color: var(--white); border-bottom-color: var(--white); }
.docs-tab .provider-icon { opacity: 0.85; }

.doc-body { max-width: 760px; color: rgba(255,255,255,0.75); font-size: 15px; line-height: 1.7; }
.doc-body > :first-child { margin-top: 0; }
.doc-body h1 { font-size: 34px; font-weight: 500; letter-spacing: -0.02em; color: var(--white); line-height: 1.15; margin: 0 0 24px; }
.doc-body h2 { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; color: var(--white); margin: 48px 0 16px; }
.doc-body h3 { font-size: 17px; font-weight: 600; color: var(--white); margin: 32px 0 12px; }
.doc-body p { margin: 0 0 16px; }
.doc-body a { color: var(--navy-tint); text-decoration: underline; text-underline-offset: 2px; }
.doc-body a:hover { color: var(--white); }
.doc-body strong { color: var(--white); font-weight: 600; }
.doc-body ul, .doc-body ol { margin: 0 0 16px; padding-left: 22px; }
.doc-body li { margin: 6px 0; }
.doc-body li::marker { color: var(--navy-tint); }

.doc-body blockquote {
  margin: 16px 0;
  padding: 4px 0 4px 18px;
  border-left: 2px solid var(--line);
  color: rgba(255,255,255,0.55);
}
.doc-body blockquote p:last-child { margin-bottom: 0; }

.doc-body code {
  font-family: ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, Consolas, monospace;
  font-size: 0.875em;
  background: var(--line-faint);
  padding: 2px 6px;
  border-radius: 4px;
}
.doc-body pre {
  background: var(--navy-deep);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 18px 20px;
  overflow-x: auto;
  margin: 0 0 20px;
}
.doc-body pre code {
  background: none;
  padding: 0;
  border-radius: 0;
  font-size: 13px;
  line-height: 1.6;
  color: rgba(255,255,255,0.85);
}

.doc-body table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 0 0 20px; }
.doc-body th {
  text-align: left;
  padding: 12px 16px 12px 0;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--navy-tint);
  font-weight: 600;
  border-bottom: 1px solid var(--line);
}
.doc-body td {
  padding: 14px 16px 14px 0;
  border-bottom: 1px solid var(--line-faint);
  color: var(--white);
}

/* ---- Login extras (register link, banner, registration note) ------------- */

.login-banner {
  margin-bottom: 28px;
  padding: 12px 16px;
  border: 1px solid rgba(124,216,176,0.4);
  background: rgba(124,216,176,0.12);
  color: var(--status-passed);
  font-size: 13px;
  letter-spacing: 0.02em;
}
.login-hint { font-size: 11px; letter-spacing: 0.04em; color: rgba(255,255,255,0.4); font-weight: 500; }
.login-link {
  color: var(--white);
  text-decoration: none;
  border-bottom: 1px solid var(--navy-tint);
  padding-bottom: 1px;
  margin-left: 6px;
}
.login-link:hover { border-bottom-color: var(--white); }
.login-note {
  display: grid; grid-template-columns: auto 1fr; gap: 14px;
  margin-top: 28px; padding: 16px 18px;
  border: 1px solid var(--line); background: rgba(255,255,255,0.02);
}
.login-note-mark { width: 8px; height: 8px; border-radius: 50%; background: var(--navy-tint); margin-top: 6px; }
.login-note-text { font-size: 13px; line-height: 1.55; color: rgba(255,255,255,0.7); }
.login-note-text strong { color: var(--white); font-weight: 700; }

/* ---- User management ----------------------------------------------------- */

.um-summary {
  display: grid; grid-template-columns: repeat(3, max-content); gap: 48px;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 28px 0; margin-bottom: 48px;
}
.um-sum-item { display: flex; flex-direction: column; gap: 10px; }
.um-sum-label { font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--navy-tint); font-weight: 600; }
.um-sum-value { font-size: 40px; font-weight: 500; letter-spacing: -0.025em; color: var(--white); line-height: 1; font-variant-numeric: tabular-nums; }
.um-sum-value.approved { color: var(--status-passed); }
.um-sum-value.pending { color: #F0B038; }

.um-toolbar { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 24px; }
.um-tabs { display: flex; }
.um-tab {
  padding: 10px 18px; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; font-weight: 600;
  border: 1px solid var(--line); color: rgba(255,255,255,0.6);
  text-decoration: none; margin-left: -1px;
}
.um-tab:hover { color: var(--white); }
.um-tab.is-active { background: var(--white); border-color: var(--white); color: var(--navy); z-index: 1; position: relative; }

.um-th-right { text-align: right; }
.um-user-cell { display: flex; align-items: center; gap: 14px; }
.um-user-name { font-size: 15px; color: var(--white); font-weight: 500; letter-spacing: -0.005em; display: flex; align-items: center; gap: 10px; }
.um-admin-tag {
  font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 600;
  color: var(--navy-tint); border: 1px solid var(--line); padding: 2px 7px;
}
.um-joined { font-size: 13px; color: rgba(255,255,255,0.55); }

.status-pill { display: inline-flex; align-items: center; gap: 8px; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 600; }
.status-pill .status-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-pill.approved { color: var(--status-passed); }
.status-pill.pending { color: #F0B038; }

.um-actions-cell { text-align: right; }
.um-actions { display: inline-flex; gap: 0; justify-content: flex-end; }
.um-actions form { margin: 0; }
.um-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px;
  font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 600;
  border: 1px solid var(--line); background: transparent;
  color: var(--white); font-family: inherit; cursor: pointer; margin-left: -1px;
}
.um-btn:hover { border-color: rgba(255,255,255,0.4); }
.um-btn.approve { background: var(--white); border-color: var(--white); color: var(--navy); z-index: 1; position: relative; }
.um-btn.approve:hover { background: var(--off-white); border-color: var(--off-white); }
.um-btn.delete { color: rgba(255,255,255,0.7); }
.um-btn.delete:hover { color: var(--sev-critical); border-color: rgba(255,92,92,0.4); }
