/* Read across a desk, often on a laptop in a corridor: large type, high
   contrast, and status that is legible at a glance rather than decorative. */

:root {
  --bg: #0e1626;
  --panel: #16213a;
  --edge: #273457;
  --ink: #eef2ff;
  --dim: #9eb0d2;
  --on: #37b24d;
  --off: #76839d;
  --bad: #e03131;
  --warn: #f59f00;
  --go: #1971c2;
}

* { box-sizing: border-box; }

html, body { margin: 0; height: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Leelawadee UI", "Sarabun", "Tahoma", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

.boot { padding: 40px; color: var(--dim); }

/* ------------------------------------------------------------------- login */

.login {
  max-width: 380px;
  margin: 12vh auto;
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: 14px;
  padding: 28px;
}

.login h1 { margin: 0 0 4px; font-size: 22px; }
.login p.sub { margin: 0 0 18px; color: var(--dim); font-size: 14px; }

label { display: block; margin: 12px 0 4px; font-size: 14px; color: var(--dim); }

input, select, textarea {
  width: 100%;
  padding: 11px 12px;
  font: inherit;
  color: var(--ink);
  background: #0d1526;
  border: 1px solid var(--edge);
  border-radius: 9px;
}

input:focus, select:focus, textarea:focus { outline: 2px solid var(--go); }

button {
  font: inherit;
  cursor: pointer;
  border-radius: 9px;
  border: 1px solid var(--edge);
  background: #1e2b4a;
  color: var(--ink);
  padding: 10px 16px;
}

button:hover { background: #27375c; }
button.primary { background: var(--go); border-color: var(--go); color: #fff; font-weight: 600; }
button.primary:hover { background: #1c7ed6; }
button.danger { background: #4a1a1a; border-color: #7d2b2b; color: #ffc9c9; }
button.wide { width: 100%; margin-top: 16px; padding: 13px; }
button:disabled { opacity: 0.5; cursor: default; }

/* ------------------------------------------------------------------ layout */

header.top {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--edge);
  flex-wrap: wrap;
}

header.top h1 { margin: 0; font-size: 19px; }

nav { display: flex; gap: 6px; }

nav button { background: none; border: none; color: var(--dim); padding: 8px 12px; }
nav button.on { color: var(--ink); background: var(--panel); border: 1px solid var(--edge); }

.spacer { margin-left: auto; }

main { padding: 20px 22px 60px; }

.bar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.bar input[type="search"] { max-width: 280px; }

.count { color: var(--dim); font-size: 14px; }

/* ------------------------------------------------------------------ tables */

table { width: 100%; border-collapse: collapse; }

th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--edge);
  vertical-align: top;
}

th { color: var(--dim); font-weight: 600; font-size: 14px; }

tr.row:hover { background: #17233c; cursor: pointer; }

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 8px;
  background: var(--off);
  vertical-align: 1px;
}

.dot.on { background: var(--on); box-shadow: 0 0 0 3px rgba(55, 178, 77, 0.18); }

.muted { color: var(--dim); font-size: 14px; }
.mono { font-family: Consolas, "Courier New", monospace; }

/* ------------------------------------------------------------------ detail */

.detail {
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: 14px;
  padding: 20px 22px;
  margin-bottom: 18px;
}

.detail h2 { margin: 0 0 2px; font-size: 21px; }
.detail .where { color: var(--dim); margin: 0 0 14px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px 18px;
  margin: 12px 0 6px;
}

.grid div span { display: block; color: var(--dim); font-size: 13px; }

.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

.secret {
  margin-top: 14px;
  padding: 14px 16px;
  background: #10251a;
  border: 1px solid #2b6c3a;
  border-radius: 10px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 2px;
  user-select: all;
}

.secret small { display: block; font-size: 13px; font-weight: 400; letter-spacing: 0; color: var(--dim); }

.msg { margin-top: 12px; padding: 10px 14px; border-radius: 9px; }
.msg.bad { background: #3a1414; border: 1px solid #7d2b2b; color: #ffc9c9; }
.msg.good { background: #10251a; border: 1px solid #2b6c3a; color: #b2f2bb; }
.msg.warn { background: #3a2d10; border: 1px solid #7d5f2b; color: #ffe8a1; }

/* ------------------------------------------------------------------ dialog */

.sheet {
  position: fixed;
  inset: 0;
  background: rgba(4, 8, 16, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.sheet .box {
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: 14px;
  padding: 22px;
  width: 100%;
  max-width: 460px;
  max-height: 90vh;
  overflow: auto;
}

.sheet h3 { margin: 0 0 6px; font-size: 19px; }

.events { margin: 14px 0 0; padding: 0; list-style: none; max-height: 260px; overflow: auto; }
.events li { padding: 6px 0; border-bottom: 1px solid var(--edge); font-size: 14px; }
.events .kind { font-weight: 600; margin-right: 8px; }
.events .boot { color: #ffd43b; }
.events .online { color: #8ce99a; }
.events .network { color: #74c0fc; }
.events .license { color: #ffa8a8; }
.events .enroll { color: #d0bfff; }
