:root {
  --bg: #e8ecf2;
  --surface: #fff;
  --ink: #111827;
  --muted: #6b7280;
  --line: #d1d5db;
  --brand: #1e3a5f;
  --brand-hover: #152a45;
  --accent: #2563a8;
  --danger: #b91c1c;
  --success: #047857;
  --warning: #b45309;
  --radius: 6px;
  --font: "Inter", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
}
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-hover); }
.page { min-height: 100vh; display: flex; flex-direction: column; }
.container { width: min(1200px, calc(100% - 2rem)); margin: 0 auto; }
.header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.header-inner {
  min-height: 60px;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: .65rem; font-weight: 700; color: var(--ink); }
.brand img { width: 36px; height: 36px; border-radius: 6px; }
.brand em { font-style: normal; color: var(--muted); font-weight: 500; }
.nav { display: flex; gap: .35rem; flex-wrap: wrap; }
.nav a {
  padding: .45rem .75rem; border-radius: var(--radius); color: var(--muted); font-weight: 500;
}
.nav a.is-active, .nav a:hover { background: #eef2f7; color: var(--brand); }
.main { flex: 1; padding: 1.25rem 0 2rem; }
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
}
.card h2, .card h3 { margin: 0 0 .75rem; font-size: 1rem; }
.muted { color: var(--muted); }
.stat { font-size: 1.5rem; font-weight: 700; }
.badge {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .2rem .55rem; border-radius: 999px; font-size: .82rem; font-weight: 600;
}
.badge.ok { background: #ecfdf5; color: var(--success); }
.badge.off { background: #fef2f2; color: var(--danger); }
.badge.warn { background: #fffbeb; color: var(--warning); }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--brand); background: var(--brand); color: #fff;
  border-radius: var(--radius); padding: .55rem .9rem; font-weight: 600; cursor: pointer;
}
.btn:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: #fff; }
.btn-ghost { background: #fff; color: var(--brand); }
.btn-danger { background: var(--danger); border-color: var(--danger); }
.btn-sm { padding: .35rem .65rem; font-size: .88rem; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.flash { padding: .75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; }
.flash-ok { background: #ecfdf5; color: var(--success); border: 1px solid #a7f3d0; }
.flash-err { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 2rem; }
.login-card { width: min(420px, 100%); }
.form label { display: block; margin-bottom: .85rem; font-weight: 500; }
.form input, .form textarea, .form select {
  width: 100%; margin-top: .35rem; padding: .6rem .75rem;
  border: 1px solid var(--line); border-radius: var(--radius); font: inherit;
}
.form textarea { min-height: 280px; font-family: var(--mono); font-size: .85rem; }
.log-box {
  background: #0f172a; color: #e2e8f0; font-family: var(--mono); font-size: .78rem;
  border-radius: var(--radius); padding: .75rem; max-height: 520px; overflow: auto; white-space: pre-wrap;
}
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: .55rem .4rem; border-bottom: 1px solid var(--line); }
.progress {
  height: 8px; background: #eef2f7; border-radius: 999px; overflow: hidden; margin-top: .35rem;
}
.progress > span { display: block; height: 100%; background: var(--accent); }
.footer { padding: 1rem 0; color: var(--muted); font-size: .88rem; }
.breadcrumb { font-family: var(--mono); font-size: .85rem; word-break: break-all; }
.breadcrumb a { color: var(--brand); }
.inline-form { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.inline-form input[type=text], .inline-form input[type=file] { width: auto; flex: 1; min-width: 140px; margin-top: 0; }
code { font-family: var(--mono); font-size: .88em; background: #eef2f7; padding: .1rem .35rem; border-radius: 4px; }
