:root {
  --bg: #0a0e0d; --panel: #121917; --panel2: #18211f; --line: #23302c;
  --text: #e8f0ec; --muted: #8b9a93; --green: #00c86e; --mint: #7cf0b8;
  --red: #ff5c5c; --amber: #ffb020; --blue: #59a5ff;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.5 "Segoe UI", system-ui, sans-serif; }
a { color: var(--mint); text-decoration: none; }
a:hover { text-decoration: underline; }

header { display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 12px 20px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
header .brand { font-weight: 800; letter-spacing: .5px; color: var(--green); white-space: nowrap; }
nav { display: flex; gap: 4px; flex-wrap: wrap; }
nav a { padding: 6px 11px; border-radius: 8px; color: var(--muted); }
nav a:hover { background: var(--panel2); color: var(--text); text-decoration: none; }
nav a.on { background: var(--green); color: #06120c; font-weight: 600; }
header .right { margin-left: auto; }

main { padding: 20px; max-width: 1500px; }
h1 { font-size: 22px; margin: 0 0 16px; }
h2 { font-size: 16px; margin: 24px 0 10px; color: var(--mint); }

.cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(185px, 1fr)); margin-bottom: 8px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.card .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .4px; }
.card .value { font-size: 22px; font-weight: 700; margin-top: 4px; }
.card .sub { color: var(--muted); font-size: 12px; }
.grid2 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); }

table { width: 100%; border-collapse: collapse; background: var(--panel); border-radius: 12px; overflow: hidden; }
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--panel2); color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .4px; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #151e1c; }
.wrap { overflow-x: auto; }
.mono { font-family: Consolas, monospace; font-size: 13px; }
.muted { color: var(--muted); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

.tag { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 12px; border: 1px solid var(--line); }
.tag.ok { color: var(--green); border-color: #12482f; background: #0d2419; }
.tag.warn { color: var(--amber); border-color: #4a3a12; background: #241c0b; }
.tag.bad { color: var(--red); border-color: #4a1d1d; background: #240f0f; }
.tag.info { color: var(--blue); border-color: #1d3350; background: #0d1725; }

form.inline { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
input, select, textarea, button { font: inherit; color: var(--text); background: var(--panel2);
  border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; }
input:focus, select:focus, textarea:focus { outline: 1px solid var(--green); }
textarea { width: 100%; min-height: 90px; resize: vertical; }
button { cursor: pointer; background: var(--green); color: #06120c; border: none; font-weight: 600; }
button:hover { filter: brightness(1.08); }
button.ghost { background: var(--panel2); color: var(--text); border: 1px solid var(--line); font-weight: 500; }
button.danger { background: var(--red); color: #fff; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.field label { color: var(--muted); font-size: 12px; }

.flash { padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; }
.flash.ok { background: #0d2419; border: 1px solid #12482f; color: var(--mint); }
.flash.err { background: #240f0f; border: 1px solid #4a1d1d; color: #ffb4b4; }

.pager { display: flex; gap: 14px; align-items: center; padding: 12px 2px; color: var(--muted); }
.login { max-width: 340px; margin: 12vh auto; background: var(--panel); border: 1px solid var(--line);
  border-radius: 16px; padding: 26px; }
.login h1 { text-align: center; color: var(--green); }
.login button { width: 100%; margin-top: 8px; padding: 10px; }
.chat { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.chat .msg { padding: 8px 10px; border-radius: 10px; margin-bottom: 8px; background: var(--panel2); }
.chat .msg.admin { background: #12251d; }
pre { background: var(--panel2); padding: 10px; border-radius: 8px; overflow-x: auto; margin: 0; }
