
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  background: #14141c; color: #e6e4df; min-height: 100vh;
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
a { color: #f0946a; text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- Authenticated shell: left sidebar + main --- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px; flex-shrink: 0; background: #1a1a24;
  border-right: 1px solid #2a2a36; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.sidebar-brand {
  padding: 18px 18px 14px; font-weight: 700; letter-spacing: -0.2px;
  font-size: 15px; color: #e6e4df; border-bottom: 1px solid #2a2a36;
}
.sidebar-brand b { color: #f0946a; }
.sidebar-nav {
  flex: 1; padding: 12px 10px; display: flex; flex-direction: column; gap: 2px;
  overflow-y: auto;
}
.sidebar-nav a {
  display: block; padding: 9px 12px; border-radius: 8px;
  color: #9a97a5; font-size: 13.5px; font-weight: 500; text-decoration: none;
}
.sidebar-nav a:hover { color: #e6e4df; background: #23232e; text-decoration: none; }
.sidebar-nav a.active {
  color: #f0946a; background: rgba(240, 148, 106, 0.12); font-weight: 600;
}
.nav-group { margin: 0; }
.nav-group > summary {
  list-style: none; display: flex; align-items: center; justify-content: space-between;
  padding: 9px 12px; border-radius: 8px; cursor: pointer;
  color: #9a97a5; font-size: 13.5px; font-weight: 500; user-select: none;
}
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary:hover { color: #e6e4df; background: #23232e; }
.nav-group > summary.branch-active { color: #e6e4df; font-weight: 600; }
.nav-group > summary .chevron {
  display: inline-block; width: 0; height: 0;
  border-left: 4px solid transparent; border-right: 4px solid transparent;
  border-top: 5px solid #6a6874; transition: transform 0.15s ease;
}
.nav-group[open] > summary .chevron { transform: rotate(180deg); }
.nav-children {
  display: flex; flex-direction: column; gap: 2px;
  margin: 2px 0 6px 12px; padding-left: 8px; border-left: 1px solid #2a2a36;
}
.nav-children a { padding: 7px 12px; font-size: 13px; }
.sidebar-foot {
  padding: 14px 16px 18px; border-top: 1px solid #2a2a36;
  display: flex; flex-direction: column; gap: 10px;
}
.sidebar-foot .who { color: #9a97a5; font-size: 12.5px; word-break: break-all; }
.sidebar-foot form { display: block; }
.sidebar-foot button { width: 100%; }
.main-col { flex: 1; min-width: 0; }
.main-col > main { max-width: 1080px; margin: 0 auto; padding: 28px 24px 64px; }

h1 { font-size: 22px; margin-bottom: 4px; letter-spacing: -0.3px; }
h2 { font-size: 15px; margin: 32px 0 10px; text-transform: uppercase; letter-spacing: 0.1em; color: #9a97a5; }
.sub { color: #9a97a5; }
table { width: 100%; border-collapse: collapse; background: #1a1a24; border: 1px solid #2a2a36; border-radius: 10px; overflow: hidden; }
th, td { text-align: left; padding: 8px 14px; border-bottom: 1px solid #23232e; font-size: 13.5px; }
th { color: #9a97a5; font-weight: 600; background: #1e1e29; }
tr:last-child td { border-bottom: none; }
td.num { font-variant-numeric: tabular-nums; }
.ok { color: #6fcf8f; font-weight: 600; }
.bad { color: #eb6f6f; font-weight: 600; }
.warn { color: #e6b45a; font-weight: 600; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.card { background: #1a1a24; border: 1px solid #2a2a36; border-radius: 10px; padding: 14px 16px; }
.card .big { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.card .label { color: #9a97a5; font-size: 12.5px; margin-top: 2px; }
button {
  background: #f0946a; color: #14141c; border: none; border-radius: 8px;
  padding: 8px 16px; font-weight: 700; font-size: 13.5px; cursor: pointer;
}
button:hover { background: #f4a983; }
button.ghost { background: transparent; color: #9a97a5; border: 1px solid #2a2a36; }
button.ghost:hover { color: #e6e4df; }
.actions { display: flex; gap: 10px; margin: 12px 0; flex-wrap: wrap; }
.msg {
  background: #1e2a20; border: 1px solid #2f4a35; color: #9ed8ae;
  padding: 10px 14px; border-radius: 8px; margin: 16px 0;
}
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login {
  background: #1a1a24; border: 1px solid #2a2a36; border-radius: 12px;
  padding: 32px; width: 340px;
}
.login h1 { margin-bottom: 16px; }
.login input {
  width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid #2a2a36;
  background: #14141c; color: #e6e4df; font-size: 14px; margin-bottom: 12px;
}
.login button { width: 100%; }
.login .err { color: #eb6f6f; margin-bottom: 12px; font-size: 13.5px; }
code { background: #23232e; border-radius: 4px; padding: 1px 6px; font-size: 12.5px; }
pre.codeblock {
  background: #14141c; border: 1px solid #2a2a36; border-radius: 8px;
  padding: 12px 14px; margin: 10px 0; overflow-x: auto;
  font: 12.5px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; color: #cdeacd;
}
.seed-form { display: flex; gap: 8px; margin: 8px 0 4px; max-width: 640px; }
.seed-form input {
  flex: 1; padding: 8px 12px; border-radius: 8px; border: 1px solid #2a2a36;
  background: #14141c; color: #e6e4df; font-size: 13.5px;
}
.row-actions { display: flex; gap: 6px; }
.row-actions form { display: inline; }
button.mini { padding: 4px 10px; font-size: 12px; border-radius: 6px; }

/* --- Tabs (subcue admin pattern: URL-param ?tab=, pure SSR) --- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid #2a2a36; margin: 18px 0 20px; overflow-x: auto; }
.tabs a {
  flex-shrink: 0; padding: 9px 16px; font-size: 13.5px; font-weight: 600; white-space: nowrap;
  color: #9a97a5; border-bottom: 2px solid transparent; margin-bottom: -1px; text-decoration: none;
}
.tabs a:hover { color: #e6e4df; text-decoration: none; }
.tabs a.on { color: #f0946a; border-bottom-color: #f0946a; }
.tabs a .n { margin-left: 6px; font-size: 11px; color: #6a6874; font-variant-numeric: tabular-nums; }
.tabs a.on .n { color: #f0946a; }

/* --- Measurement-pipeline health rows (GEO Technical health) --- */
.pipe { display: flex; flex-direction: column; gap: 10px; }
.pipe-row { display: flex; align-items: flex-start; gap: 10px; }
.dot { margin-top: 6px; width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dot.ok { background: #6fcf8f; } .dot.warn { background: #e6b45a; }
.dot.stale { background: #eb6f6f; } .dot.unknown { background: #6a6874; }
.pipe-row .name { font-size: 13.5px; color: #e6e4df; }
.pipe-row .hint { font-size: 11.5px; color: #6a6874; font-family: ui-monospace, monospace; }
.pipe-row .meta { font-size: 11.5px; color: #808090; font-family: ui-monospace, monospace; }
.pipe-row .thru { font-size: 11.5px; color: #6a6874; font-family: ui-monospace, monospace; }

/* --- Help tooltip (dotted underline; native title=) --- */
.help { border-bottom: 1px dotted #6a6874; cursor: help; }
.hint-p { color: #9a97a5; font-size: 12.5px; margin: 4px 0 12px; }
.textarea { width: 100%; min-height: 96px; padding: 10px 12px; border-radius: 8px; border: 1px solid #2a2a36;
  background: #14141c; color: #e6e4df; font: 12.5px/1.5 ui-monospace, monospace; resize: vertical; }

@media (max-width: 720px) {
  .app-shell { flex-direction: column; }
  .sidebar {
    width: 100%; height: auto; position: relative;
    border-right: none; border-bottom: 1px solid #2a2a36;
  }
  .sidebar-nav { flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .nav-children { margin-left: 0; border-left: none; flex-direction: row; flex-wrap: wrap; }
  .sidebar-foot { flex-direction: row; align-items: center; justify-content: space-between; }
  .sidebar-foot button { width: auto; }
}
