:root {
  --bg: #12151b; --panel: #1a1f28; --panel-2: #202634; --line: #2c3444;
  --text: #e6e9ef; --muted: #8e99ad; --accent: #6ea8fe;
  --fresh: #3fb950; --idle: #d29922; --stale: #f85149;
}
* { box-sizing: border-box; }
body {
  margin: 0; padding: 2rem 1.25rem; background: var(--bg); color: var(--text);
  font: 14px/1.5 ui-sans-serif, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.wrap { max-width: 1180px; margin: 0 auto; }
header { display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: .35rem; }
h1 { font-size: 1.3rem; margin: 0; font-weight: 600; }
.host { color: var(--muted); font-size: .85rem; }
header .spacer { flex: 1; }
header a { color: var(--accent); text-decoration: none; font-size: .85rem; }
header a:hover { text-decoration: underline; }
.meta { color: var(--muted); font-size: .82rem; margin-bottom: 1.1rem; }

.warn {
  background: #2a1f14; border: 1px solid #5c3d17; border-left: 3px solid var(--idle);
  padding: .7rem .9rem; border-radius: 6px; margin-bottom: 1.1rem; font-size: .88rem;
}
.warn strong { color: #f0b429; }

.flash { padding: .7rem .9rem; border-radius: 6px; margin-bottom: 1.1rem; font-size: .9rem; }
.flash.ok { background: #122b18; border: 1px solid #24603a; color: #7ee787; }
.flash.error { background: #2d1618; border: 1px solid #6e2b30; color: #ff9f9b; }

table { width: 100%; border-collapse: collapse; background: var(--panel); border-radius: 8px; overflow: hidden; }
th, td { padding: .6rem .75rem; text-align: left; border-bottom: 1px solid var(--line); }
th { background: var(--panel-2); font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #1e2432; }
td.mono, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85rem; }
td.dur { font-weight: 600; white-space: nowrap; }

tr.stale { border-left: 3px solid var(--stale); }
tr.idle  { border-left: 3px solid var(--idle); }
tr.fresh { border-left: 3px solid var(--fresh); }
tr.stale td.dur { color: var(--stale); }
tr.idle  td.dur { color: var(--idle); }
tr.fresh td.dur { color: var(--fresh); }

.tag { display: inline-block; padding: .1rem .45rem; border-radius: 4px; font-size: .75rem; background: var(--panel-2); border: 1px solid var(--line); }
.badge { font-size: .68rem; text-transform: uppercase; letter-spacing: .04em; padding: .05rem .35rem; border-radius: 3px; margin-left: .35rem; }
.badge.fresh { background: #10331b; color: var(--fresh); }
.badge.idle  { background: #33270e; color: var(--idle); }
.badge.stale { background: #3a1618; color: var(--stale); }
.dash { color: #56607a; }

button.kill {
  background: #3d1b1e; color: #ff9f9b; border: 1px solid #6e2b30; padding: .3rem .8rem;
  border-radius: 5px; cursor: pointer; font-size: .82rem; font-weight: 600;
}
button.kill:hover { background: #5a2429; color: #ffd7d5; }

.legend { color: var(--muted); font-size: .78rem; margin-top: .9rem; display: flex; gap: 1.1rem; flex-wrap: wrap; }
.legend span::before { content: "\25CF"; margin-right: .3rem; }
.legend .f::before { color: var(--fresh); } .legend .i::before { color: var(--idle); } .legend .s::before { color: var(--stale); }
.empty { padding: 2rem; text-align: center; color: var(--muted); background: var(--panel); border-radius: 8px; }

/* login */
.login { max-width: 340px; margin: 12vh auto; background: var(--panel); padding: 1.6rem; border-radius: 10px; border: 1px solid var(--line); }
.login h1 { font-size: 1.05rem; margin-bottom: 1.2rem; }
.login label { display: block; font-size: .78rem; color: var(--muted); margin-bottom: .3rem; }
.login input { width: 100%; padding: .5rem .6rem; margin-bottom: .9rem; background: var(--bg); border: 1px solid var(--line); border-radius: 5px; color: var(--text); font-size: .9rem; }
.login input:focus { outline: none; border-color: var(--accent); }
.login button { width: 100%; padding: .55rem; background: #1f3a63; color: #cfe1ff; border: 1px solid #2f5591; border-radius: 5px; cursor: pointer; font-weight: 600; }
.login button:hover { background: #27497b; }

/* Daemon rows: infrastructure, not chat sessions. Pinned to the bottom of the
   table because serve is always the oldest process and must never read as the
   most obviously stale row. */
tr.daemon { background: #181d29; }
tr.daemon td.dur { color: var(--muted); font-weight: 400; }
tr.daemon { border-left: 3px solid #3a4a6b; }
.tag.daemon { border-color: #3a4a6b; color: #9dc0ff; }
.badge.daemon { background: #1a2438; color: #9dc0ff; }
.legend .d::before { color: #3a4a6b; }
