@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=IBM+Plex+Sans+Condensed:wght@600;700&family=IBM+Plex+Sans:wght@400;500;600&display=swap');

:root {
  --bg: #151a22;
  --surface: #1d2430;
  --surface-2: #253040;
  --line: #313c4d;
  --text: #dfe5ee;
  --muted: #808da1;
  --admit: #62c08d;
  --deny: #e2704c;
  --accent: #f0b429;
  --display: "IBM Plex Sans Condensed", system-ui, sans-serif;
  --body: "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --radius: 3px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.wrap { max-width: 900px; margin: 0 auto; padding: 0 20px 64px; }

/* --- header --- */

header.top {
  border-bottom: 1px solid var(--line);
  margin-bottom: 28px;
  background: linear-gradient(180deg, #1a212c, var(--bg));
}
header.top .wrap {
  display: flex; align-items: baseline; gap: 20px;
  padding-top: 18px; padding-bottom: 16px;
}
.brand {
  font-family: var(--display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
}
.brand span { color: var(--accent); }
header.top nav { margin-left: auto; display: flex; gap: 18px; font-size: 14px; }
header.top nav a { color: var(--muted); }
header.top nav a:hover, header.top nav a.on { color: var(--text); text-decoration: none; }

/* --- typography --- */

h2 {
  font-family: var(--display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 32px 0 12px;
}
.hint { color: var(--muted); font-size: 13px; margin: 6px 0 0; }

/* --- panels --- */

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.panel + .panel { margin-top: 12px; }

/* --- status strip --- */

.status {
  display: flex; align-items: center; gap: 14px;
  font-family: var(--mono); font-size: 13px;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.live { background: var(--admit); box-shadow: 0 0 0 3px rgba(98,192,141,.18); }
.dot.err { background: var(--deny); box-shadow: 0 0 0 3px rgba(226,112,76,.18); }
.status .grow { flex: 1; }
.err-text { color: var(--deny); font-family: var(--mono); font-size: 12px; margin-top: 10px; word-break: break-word; }

/* --- forms --- */

label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
input[type=text], input[type=password], textarea, select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
  padding: 9px 11px;
}
textarea { font-family: var(--body); font-size: 14px; resize: vertical; min-height: 66px; }
select { font-family: var(--body); font-size: 14px; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); outline: none; }

.field { margin-bottom: 16px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > .field { flex: 1 1 200px; }

.check { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.check input { width: 15px; height: 15px; accent-color: var(--accent); flex: none; }
.check label { margin: 0; color: var(--text); font-size: 14px; }

button, .btn {
  font-family: var(--body); font-size: 14px; font-weight: 500;
  padding: 9px 16px; border-radius: var(--radius); cursor: pointer;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text);
}
button:hover, .btn:hover { border-color: var(--muted); text-decoration: none; }
button.primary { background: var(--accent); border-color: var(--accent); color: #1a1206; font-weight: 600; }
button.primary:hover { filter: brightness(1.08); }
button.danger { background: transparent; color: var(--deny); border-color: rgba(226,112,76,.4); }
.actions { display: flex; gap: 10px; align-items: center; margin-top: 22px; }
.actions .spacer { flex: 1; }

/* --- gate board --- */

.board { display: flex; flex-direction: column; gap: 8px; }
.gate {
  display: flex; align-items: center; gap: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--line);
  border-radius: var(--radius);
  padding: 13px 16px;
}
.gate.on { border-left-color: var(--admit); }
.gate.off { border-left-color: var(--line); opacity: .62; }
.gate .id { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.gate .name { font-weight: 500; }
.gate .name .id { display: block; }
.gate .grow { flex: 1; }
.tag {
  font-family: var(--mono); font-size: 11px; letter-spacing: .06em;
  text-transform: uppercase; padding: 3px 8px; border-radius: 2px;
  border: 1px solid var(--line); color: var(--muted); white-space: nowrap;
}
.tag.ban { color: var(--deny); border-color: rgba(226,112,76,.35); }
.tag.kick { color: var(--accent); border-color: rgba(240,180,41,.35); }

.empty {
  border: 1px dashed var(--line); border-radius: var(--radius);
  padding: 28px 20px; text-align: center; color: var(--muted);
}

/* --- log table --- */

table.log { width: 100%; border-collapse: collapse; font-size: 13px; }
table.log th {
  font-family: var(--display); font-size: 11px; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
  text-align: left; padding: 0 10px 8px; border-bottom: 1px solid var(--line);
}
table.log td { padding: 9px 10px; border-bottom: 1px solid rgba(49,60,77,.5); vertical-align: top; }
table.log td.t, table.log td.who { font-family: var(--mono); font-size: 12px; }
table.log td.t { color: var(--muted); white-space: nowrap; }
.verdict { font-family: var(--mono); font-size: 12px; white-space: nowrap; }
.verdict.admit { color: var(--admit); }
.verdict.deny { color: var(--deny); }

/* --- flash --- */

.flash {
  border-left: 3px solid var(--admit);
  background: rgba(98,192,141,.08);
  padding: 10px 14px; font-size: 14px; border-radius: var(--radius);
  margin-bottom: 20px;
}

/* --- login --- */

.login-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-box { width: 100%; max-width: 340px; }
.login-box .brand { display: block; margin-bottom: 22px; font-size: 22px; }

@media (max-width: 620px) {
  .gate { flex-wrap: wrap; gap: 10px; }
  table.log td.who { word-break: break-word; }
}
