/* Visual identity ported from the ESP32 HoneyMire dashboard. Same dark
   palette, honey accent, card layout, KPI grid and badges so the firmware
   and the hub feel like the same product. */
:root {
  --bg:   #0e0f13;
  --fg:   #e7e9ee;
  --mut:  #9098a8;
  --card: #171a21;
  --acc:  #f0b429;
  --bad:  #e94560;
  --good: #41d693;
  --bord: #262a35;
  --link: #7ad9ff;
}

* { box-sizing: border-box; }

html, body { height: 100%; }
body {
  margin: 0;
  font: 14px/1.45 -apple-system, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--fg);
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--bord);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
header h1 {
  margin: 0;
  font-size: 18px;
  color: var(--acc);
}
header h1 a { color: inherit; text-decoration: none; }
nav a {
  color: var(--fg);
  text-decoration: none;
  margin-left: 14px;
  padding: 6px 10px;
  border-radius: 6px;
}
nav a.active, nav a:hover { background: #222633; text-decoration: none; }
nav .who { color: var(--mut); margin-left: 14px; font-size: 12px; }

main {
  padding: 18px;
  max-width: 1100px;
  margin: 0 auto;
}

.card {
  background: var(--card);
  border: 1px solid var(--bord);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 14px;
}
.card h3 { margin: 4px 0 12px; font-size: 16px; }
.card h4 { margin: 14px 0 8px; font-size: 13px; color: var(--mut); text-transform: uppercase; letter-spacing: .05em; }

.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}
.kpi {
  background: #1c2029;
  border: 1px solid var(--bord);
  border-radius: 8px;
  padding: 10px;
}
.kpi b { display: block; font-size: 22px; color: var(--acc); }
.kpi span {
  color: var(--mut);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .05em;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th, td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--bord);
  text-align: left;
  vertical-align: top;
}
td.when { white-space: nowrap; }
th.c, td.c { text-align: center; }
th {
  color: var(--mut);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-size: 11px;
}
tr:hover td { background: #1b1f29; }

.badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 11px;
  color: #0e0f13;
  font-weight: 600;
}
.badge.tn  { background: #7ad9ff; }
.badge.ssh { background: var(--acc); }
.badge.ok  { background: var(--good); }
.badge.no  { background: var(--bad); color: #fff; }
.badge.muted { background: #333a4d; color: var(--fg); }

.flag { font-size: 16px; margin-right: 6px; }

/* Profile chip — icon-only tile. The human-readable label and the
   long classifier blurb live in `title` (mouse hover) and `aria-label`
   (screen readers), so we deliberately don't print them next to the
   icon. `cursor: help` signals there's a tooltip; focus-visible keeps
   it keyboard-discoverable. */
.profile-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  font-size: 16px;
  line-height: 1;
  background: #1c2029;
  border: 1px solid var(--bord);
  border-radius: 8px;
  color: var(--fg);
  cursor: help;
  vertical-align: middle;
  user-select: none;
  transition: border-color .12s, transform .12s;
}
.profile-chip:hover,
.profile-chip:focus-visible {
  border-color: var(--acc);
  transform: translateY(-1px);
  outline: none;
}
.profile-chip.large {
  width: 44px;
  height: 44px;
  font-size: 24px;
  border-radius: 10px;
}

code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  background: #0c0d12;
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 12.5px;
}
pre {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  background: #0c0d12;
  padding: 10px;
  border-radius: 6px;
  overflow: auto;
  border: 1px solid var(--bord);
  font-size: 12.5px;
}

/* Transcript card on the attack-detail page. Server output renders
   muted (so the prompt/banner reads as background); attacker input is
   highlighted in honey-accent so the eye scans straight to "what they
   typed". Both share the surrounding <pre> — \r\n in the data renders
   as a real line break. */
pre.transcript { white-space: pre-wrap; word-break: break-word; }
pre.transcript .t-srv { color: var(--mut); }
pre.transcript .t-op  { color: var(--acc); font-weight: 600; }

.meta { color: var(--mut); font-size: 12px; }

form .row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}
input, select, textarea {
  width: 100%;
  background: #0c0d12;
  color: var(--fg);
  border: 1px solid var(--bord);
  border-radius: 6px;
  padding: 8px 10px;
  font: 13px ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
input[type=checkbox] { width: auto; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--acc);
}

button, .btn {
  background: var(--acc);
  border: none;
  color: #0e0f13;
  font-weight: 600;
  padding: 9px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  text-decoration: none;
  display: inline-block;
}
button:hover, .btn:hover { filter: brightness(1.05); text-decoration: none; }
button.alt, .btn.alt { background: #2a3142; color: var(--fg); }
button.danger, .btn.danger { background: var(--bad); color: #fff; }

.flash {
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 14px;
  border-left: 4px solid var(--acc);
  background: #1c2029;
}
.flash.error  { border-left-color: var(--bad); }
.flash.ok     { border-left-color: var(--good); }

.token-callout {
  background: #1c2029;
  border: 1px dashed var(--acc);
  border-radius: 8px;
  padding: 12px;
  margin: 10px 0;
}
.token-callout code {
  display: block;
  font-size: 14px;
  padding: 8px 10px;
  word-break: break-all;
}

.empty {
  color: var(--mut);
  text-align: center;
  padding: 30px 10px;
}

.foot {
  color: var(--mut);
  font-size: 12px;
  text-align: center;
  margin-top: 20px;
}

.row-actions { display: flex; gap: 6px; align-items: center; }

@media (max-width: 600px) {
  form .row { grid-template-columns: 1fr; }
  table { font-size: 12px; }
  th, td { padding: 6px 8px; }
}

/* ----- /docs rendered markdown ------------------------------------ */
.docs-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 14px;
  align-items: start;
}
@media (max-width: 900px) {
  .docs-shell { grid-template-columns: 1fr; }
}
.docs-toc { position: sticky; top: 14px; max-height: calc(100vh - 28px); overflow: auto; }
.docs-toc h4 { color: var(--mut); font-size: 11px; }
.docs-toc ul { list-style: none; padding: 0; margin: 0; }
.docs-toc li { padding: 3px 0; }
.docs-toc li.toc-l3 { padding-left: 14px; }
.docs-toc a { color: var(--fg); text-decoration: none; font-size: 13px; }
.docs-toc a:hover { color: var(--acc); }

.markdown-body { line-height: 1.55; }
.markdown-body h1, .markdown-body h2, .markdown-body h3,
.markdown-body h4, .markdown-body h5 {
  color: var(--fg);
  margin: 22px 0 10px;
  scroll-margin-top: 14px;
}
.markdown-body h1 { font-size: 22px; color: var(--acc); margin-top: 0; }
.markdown-body h2 { font-size: 18px; border-bottom: 1px solid var(--bord); padding-bottom: 4px; }
.markdown-body h3 { font-size: 15px; color: var(--acc); }
.markdown-body h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--mut); }
.markdown-body p, .markdown-body ul, .markdown-body ol { margin: 8px 0; }
.markdown-body ul, .markdown-body ol { padding-left: 22px; }
.markdown-body li { margin: 3px 0; }
.markdown-body blockquote {
  border-left: 3px solid var(--acc);
  margin: 10px 0;
  padding: 4px 12px;
  color: var(--mut);
  background: #1c2029;
  border-radius: 0 6px 6px 0;
}
.markdown-body table { margin: 10px 0; }
.markdown-body table th { background: #1c2029; }
.markdown-body table th, .markdown-body table td {
  border: 1px solid var(--bord);
  border-bottom: 1px solid var(--bord);
}
.markdown-body pre { white-space: pre; }
.markdown-body hr { border: 0; border-top: 1px solid var(--bord); margin: 18px 0; }
.markdown-body a { color: var(--link); }
.markdown-body code { white-space: nowrap; }
.markdown-body pre code { white-space: pre; background: transparent; padding: 0; }
