:root {
  --bg: #0d1117; --panel: #111923; --line: #1f3040;
  --g: #39ff88; --c: #22d3ee; --a: #f5b73b; --r: #ff4d5e;
  --tx: #c9d4e0; --dim: #6b7c8f;
  --mono: "JetBrains Mono", "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg); color: var(--tx); font-family: var(--mono); font-size: 14px; line-height: 1.5;
  background-image:
    linear-gradient(rgba(34,211,238,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34,211,238,.045) 1px, transparent 1px);
  background-size: 32px 32px;
}
#matrix { position: fixed; inset: 0; width: 100%; height: 100%; opacity: .32; z-index: 0; pointer-events: none; }
.view { position: relative; z-index: 1; min-height: 100vh; padding: 20px; }
.center { display: flex; align-items: center; justify-content: center; }
.dash { max-width: 1200px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }

/* framed HUD panels with corner brackets */
.frame {
  position: relative; background: rgba(17,25,35,.92); border: 1px solid var(--line);
  box-shadow: 0 0 28px rgba(57,255,136,.08);
}
.frame::before, .frame::after { content: ""; position: absolute; width: 14px; height: 14px; border: 2px solid var(--g); pointer-events: none; }
.frame::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.frame::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }

.brand { margin: 0; font-size: 2rem; letter-spacing: .32em; color: var(--g); text-shadow: 0 0 14px rgba(57,255,136,.6); }
.brand.small { font-size: 1.1rem; letter-spacing: .24em; }
.tag { margin: 4px 0 0; color: var(--dim); font-size: .8rem; }
.dim { color: var(--dim); margin: 0; font-size: .8rem; }

/* auth box */
.auth { width: 100%; max-width: 420px; padding: 30px 28px; }
.brandbar { margin-bottom: 18px; }
.indicators { list-style: none; margin: 0 0 22px; padding: 12px 0; border-block: 1px dashed var(--line); display: grid; gap: 6px; font-size: .8rem; color: var(--dim); }
.indicators b { float: right; color: var(--tx); font-weight: 600; text-transform: uppercase; }
.dot { display: inline-block; width: 8px; height: 8px; margin-right: 10px; border-radius: 50%; background: var(--dim); }
.dot.ok { background: var(--g); box-shadow: 0 0 8px var(--g); }
.dot.warn { background: var(--a); box-shadow: 0 0 8px var(--a); }
.dot.bad { background: var(--r); box-shadow: 0 0 8px var(--r); }

label { display: block; margin: 14px 0 6px; color: var(--c); font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; }
input {
  width: 100%; padding: 11px 12px; font: inherit; color: var(--g); caret-color: var(--g);
  background: #0a0f15; border: 1px solid var(--line);
}
input:focus { outline: none; border-color: var(--g); box-shadow: 0 0 0 1px var(--g), 0 0 14px rgba(57,255,136,.25); }
.msg { min-height: 1.5em; margin: 14px 0 0; font-size: .82rem; color: var(--r); }
.msg.ok { color: var(--g); }

/* buttons */
.btn {
  font: inherit; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; cursor: pointer;
  padding: 11px 16px; color: var(--g); background: rgba(57,255,136,.06); border: 1px solid var(--g);
  transition: box-shadow .15s, background .15s;
}
.btn:hover:not(:disabled) { background: rgba(57,255,136,.16); box-shadow: 0 0 16px rgba(57,255,136,.45); }
.btn:focus-visible { outline: 2px solid var(--c); outline-offset: 2px; }
.btn:disabled { opacity: .55; cursor: progress; }
.btn.wide { width: 100%; margin-top: 22px; }
.btn.cyan { color: var(--c); border-color: var(--c); background: rgba(34,211,238,.06); }
.btn.cyan:hover:not(:disabled) { background: rgba(34,211,238,.16); box-shadow: 0 0 16px rgba(34,211,238,.45); }
.btn.danger { color: var(--r); border-color: var(--r); background: rgba(255,77,94,.06); }
.btn.danger:hover:not(:disabled) { background: rgba(255,77,94,.16); box-shadow: 0 0 16px rgba(255,77,94,.4); }
.btn.ghost { color: var(--dim); border-color: var(--line); background: none; }
.btn.small { padding: 5px 10px; font-size: .72rem; }
.btn.active { background: rgba(57,255,136,.2); box-shadow: 0 0 14px rgba(57,255,136,.4); }

/* dashboard */
.topbar { display: flex; align-items: center; gap: 16px; padding: 12px 18px; }
.brandline { display: flex; flex-direction: column; margin-right: auto; }
.brandline .tag { margin: 0; }
.opbox { color: var(--g); }
.opbox .dot { margin-right: 8px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.stat { padding: 16px 18px; }
.stat h2 { margin: 0 0 8px; font-size: .72rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--c); }
.big { margin: 0; font-size: 1.6rem; font-weight: 700; color: var(--g); text-shadow: 0 0 12px rgba(57,255,136,.4); }
.big.warn { color: var(--a); text-shadow: 0 0 12px rgba(245,183,59,.4); }
.big.bad { color: var(--r); text-shadow: 0 0 12px rgba(255,77,94,.4); }

.grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 16px; align-items: start; }
.console { padding: 18px; }
.controls { display: flex; flex-wrap: wrap; gap: 10px; padding-bottom: 16px; border-bottom: 1px dashed var(--line); }
.output { padding-top: 16px; min-height: 260px; }
.output h3 { margin: 0 0 14px; font-size: .95rem; color: var(--c); letter-spacing: .08em; text-transform: uppercase; }

/* profile card */
.pcard { display: flex; gap: 20px; align-items: flex-start; }
.hex {
  flex: none; width: 76px; height: 84px; display: grid; place-items: center; font-size: 2rem; font-weight: 700;
  color: var(--bg); background: var(--g); clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}
.pcard dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; }
.pcard dt { color: var(--dim); } .pcard dd { margin: 0; word-break: break-all; }

/* table */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .82rem; }
th, td { padding: 9px 10px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--line); }
th { color: var(--c); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; font-size: .72rem; }
tbody tr:hover { background: rgba(34,211,238,.05); }
.badge { display: inline-block; padding: 1px 8px; border: 1px solid currentColor; font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.badge.admin, .badge.active { color: var(--g); }
.badge.user { color: var(--c); }
.badge.idle { color: var(--a); }
.badge.never { color: var(--dim); }

/* terminal */
.terminal { padding: 0; }
.termhead { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); color: var(--c); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; }
.log { height: 420px; overflow-y: auto; padding: 12px 14px; font-size: .78rem; }
.line { margin: 0 0 3px; word-break: break-word; }
.line .ts { color: var(--dim); margin-right: 10px; }
.line.info { color: var(--tx); } .line.cmd { color: var(--c); } .line.ok { color: var(--g); }
.line.err { color: var(--r); } .line.warn { color: var(--a); } .line.sim { color: var(--dim); }
.line.typing .body::after { content: "\2588"; margin-left: 2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

@media (max-width: 860px) {
  .grid, .stats { grid-template-columns: 1fr; }
  .log { height: 300px; }
  .topbar { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
