/* News_Land admin stats — self-hosted, no CDN. Palette matches app.js canvas
   colors (GitHub dark): bg #0d1117, panel #161b22, border #21262d, text #c9d1d9. */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: #0d1117; color: #c9d1d9;
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }

/* ── login ── */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card {
  width: 340px; padding: 28px 26px; background: #161b22;
  border: 1px solid #21262d; border-radius: 10px;
}
.login-logo { font-size: 17px; font-weight: 600; color: #e6edf3; margin-bottom: 18px; text-align: center; }
.login-card input[type=password] {
  width: 100%; padding: 9px 11px; margin-bottom: 12px;
  background: #0d1117; color: #c9d1d9; border: 1px solid #30363d; border-radius: 6px;
  font-size: 14px;
}
.login-card input[type=password]:focus { outline: none; border-color: #58a6ff; }
.login-card button {
  width: 100%; padding: 9px 0; background: #238636; color: #fff; font-weight: 600;
  border: 0; border-radius: 6px; font-size: 14px; cursor: pointer;
}
.login-card button:hover { background: #2ea043; }
.err { color: #f85149; font-size: 13px; margin: 0 0 12px; }

/* ── shell ── */
header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 20px; border-bottom: 1px solid #21262d; background: #161b22;
  position: sticky; top: 0; z-index: 5; flex-wrap: wrap;
}
.brand { font-size: 16px; font-weight: 650; color: #e6edf3; }
.hdr-ctl { display: flex; align-items: center; gap: 8px; }
select, .filters input {
  background: #0d1117; color: #c9d1d9; border: 1px solid #30363d; border-radius: 6px;
  padding: 6px 9px; font-size: 13px;
}
select:focus, .filters input:focus { outline: none; border-color: #58a6ff; }
.ghost, .ghost:link, .ghost:visited {
  background: #21262d; color: #c9d1d9; border: 1px solid #30363d; border-radius: 6px;
  padding: 6px 12px; font-size: 13px; cursor: pointer; text-decoration: none; display: inline-block;
}
.ghost:hover { background: #30363d; border-color: #8b949e; }

nav#tabs { display: flex; gap: 4px; padding: 10px 20px 0; border-bottom: 1px solid #21262d; }
.tab {
  background: transparent; color: #8b949e; border: 0; border-bottom: 2px solid transparent;
  padding: 8px 14px; font-size: 14px; cursor: pointer; border-radius: 6px 6px 0 0;
}
.tab:hover { color: #c9d1d9; background: #161b22; }
.tab.on { color: #e6edf3; font-weight: 600; border-bottom-color: #f78166; background: #161b22; }

.status { min-height: 20px; padding: 4px 20px; color: #d29922; font-size: 13px; }
.page { padding: 6px 20px 24px; }

/* ── tiles ── */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; margin: 10px 0 16px; }
.tile { background: #161b22; border: 1px solid #21262d; border-radius: 8px; padding: 12px 14px; }
.tile .tt { color: #8b949e; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; }
.tile .tv { color: #e6edf3; font-size: 22px; font-weight: 650; margin: 4px 0 2px; }
.tile .ts { color: #8b949e; font-size: 12px; }

/* ── panels / charts ── */
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 14px; }
@media (max-width: 950px) { .grid2 { grid-template-columns: 1fr; } }
.panel { background: #161b22; border: 1px solid #21262d; border-radius: 8px; padding: 14px 14px 10px; min-width: 0; }
.panel h3 { margin: 0 0 10px; font-size: 14px; font-weight: 600; color: #e6edf3; display: flex; gap: 10px; align-items: baseline; }
.pct { color: #8b949e; font-size: 12px; font-weight: 400; }
canvas { display: block; }
.legend { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.lg { color: #8b949e; font-size: 12px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.lg i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.lg b { color: #c9d1d9; font-weight: 600; }

/* ── funnel ── */
.fr { display: flex; align-items: center; gap: 10px; padding: 5px 0; }
.fr .fl { flex: 0 0 200px; color: #c9d1d9; font-size: 13px; }
.fr .fbw { flex: 1; height: 16px; background: #21262d; border-radius: 4px; overflow: hidden; }
.fr .fbw i { display: block; height: 100%; border-radius: 4px; }
.fr .fv { flex: 0 0 auto; color: #e6edf3; font-size: 13px; font-weight: 600; }
.fv .conv { color: #8b949e; font-weight: 400; font-size: 12px; margin-left: 6px; }

/* ── tables / filters ── */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 12px; }
.filters input { min-width: 220px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left; color: #8b949e; font-weight: 500; font-size: 12px;
  padding: 6px 8px; border-bottom: 1px solid #30363d; white-space: nowrap;
}
td { padding: 6px 8px; border-bottom: 1px solid #21262d; vertical-align: top; }
tbody tr:hover { background: #1c2129; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.dim { color: #8b949e; }
.chip {
  display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 11px; font-weight: 600;
  border: 1px solid transparent; white-space: nowrap;
}
.chip.ok   { color: #3fb950; border-color: #238636; background: rgba(63,185,80,.08); }
.chip.fail { color: #f85149; border-color: #da3633; background: rgba(248,81,73,.08); }
.chip.warn { color: #d29922; border-color: #9e6a03; background: rgba(210,153,34,.08); }
.mini {
  background: #21262d; color: #58a6ff; border: 1px solid #30363d; border-radius: 5px;
  padding: 2px 8px; font-size: 12px; cursor: pointer; white-space: nowrap;
}
.mini:hover { background: #30363d; }
.det { max-width: 720px; }
.det span {
  display: inline-block; background: #21262d; border-radius: 4px; padding: 1px 6px; margin: 1px 4px 1px 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11.5px; color: #a5d6ff;
  word-break: break-all;
}

/* tk timeline detail panel */
.dr { display: flex; gap: 10px; padding: 4px 0; border-bottom: 1px solid #21262d; font-size: 12.5px; }
.dr .dk { flex: 0 0 150px; color: #8b949e; font-family: ui-monospace, Menlo, monospace; }
.dr .dv { color: #e6edf3; word-break: break-all; }
.dip { color: #58a6ff; }
.dtxt { color: #c9d1d9; }

footer { padding: 18px 20px 26px; color: #484f58; font-size: 12px; border-top: 1px solid #21262d; margin-top: 12px; }
