
:root {
  color-scheme: dark;
  --bg: #111315;
  --panel: #171a1d;
  --panel-2: #1d2125;
  --border: #2a2f35;
  --text: #e4e7ea;
  --muted: #959ea7;
  --accent: #34b27b;
  --accent-strong: #44c98e;
  --accent-weak: rgba(52, 178, 123, 0.14);
  --warn: #d9a441;
  --danger: #e0605a;
  --radius: 8px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.6 system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Noto Sans JP", sans-serif;
}
a { color: var(--accent-strong); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre, .mono { font-family: var(--mono); font-size: 12.5px; }
h1 { font-size: 20px; font-weight: 600; margin: 0; }
h2 { font-size: 14px; font-weight: 600; margin: 0 0 12px; }
p { margin: 0 0 8px; }
.muted { color: var(--muted); }

.shell { display: flex; min-height: 100%; }
.sidebar {
  width: 216px; flex: none; background: var(--panel); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 12px 8px; gap: 2px;
}
.brand {
  display: flex; align-items: center; gap: 10px; padding: 6px 10px 14px;
  font-weight: 600; color: var(--text);
}
.brand-mark {
  width: 22px; height: 22px; border-radius: 6px; background: var(--accent);
  display: grid; place-items: center; color: #0b1f15; font-size: 12px; font-weight: 700;
}
.nav-label { font-size: 11px; color: var(--muted); padding: 14px 10px 4px; letter-spacing: 0.04em; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 6px;
  color: var(--muted);
}
.nav-item:hover { background: var(--panel-2); color: var(--text); text-decoration: none; }
.nav-item[aria-current="page"] { background: var(--accent-weak); color: var(--accent-strong); }
.nav-item svg { width: 16px; height: 16px; flex: none; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 52px; border-bottom: 1px solid var(--border); display: flex; align-items: center;
  gap: 12px; padding: 0 20px; background: var(--bg);
}
.topbar .spacer { flex: 1; }
.crumb { color: var(--muted); }
select, input[type="password"], input[type="text"] {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--border);
  border-radius: 6px; padding: 6px 10px; font: inherit;
}
select:focus, input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
button, .button {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--border);
  border-radius: 6px; padding: 6px 12px; font: inherit; cursor: pointer;
}
button:hover { border-color: var(--muted); }
button.primary { background: var(--accent); border-color: var(--accent); color: #0b1f15; font-weight: 600; }
button.primary:hover { background: var(--accent-strong); }
.account { display: flex; align-items: center; gap: 8px; color: var(--muted); }

.content { padding: 28px 32px 48px; max-width: 1120px; width: 100%; }
.page-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); margin-bottom: 20px; }
.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; margin-bottom: 20px;
}
.grid .card { margin-bottom: 0; }
.stat { font-size: 24px; font-weight: 600; }
.badge {
  display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px;
  border: 1px solid var(--border); color: var(--muted);
}
.badge.ok { color: var(--accent-strong); border-color: rgba(52, 178, 123, 0.4); background: var(--accent-weak); }
.badge.error { color: var(--danger); border-color: rgba(224, 96, 90, 0.4); background: rgba(224, 96, 90, 0.1); }

.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 16px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { font-size: 12px; font-weight: 500; color: var(--muted); background: var(--panel-2); }
tr:last-child td { border-bottom: none; }
td.wrap { white-space: normal; word-break: break-all; }

.meter { margin-bottom: 14px; }
.meter-head { display: flex; justify-content: space-between; margin-bottom: 4px; }
.meter svg { display: block; width: 100%; height: 8px; border-radius: 4px; overflow: hidden; }
.meter .track { fill: var(--panel-2); }
.meter .fill { fill: var(--accent); }
.meter.warn .fill { fill: var(--warn); }
.meter.full .fill { fill: var(--danger); }
dl.props { display: grid; grid-template-columns: max-content 1fr; gap: 6px 24px; margin: 0; }
dl.props dt { color: var(--muted); }
dl.props dd { margin: 0; }

.pager { display: flex; gap: 8px; align-items: center; }
.empty { text-align: center; padding: 40px 24px; }
.empty h2 { font-size: 16px; }
.steps { text-align: left; max-width: 720px; margin: 20px auto 0; padding-left: 20px; }
.steps li { margin-bottom: 12px; }
pre {
  background: var(--bg); border: 1px solid var(--border); border-radius: 6px;
  padding: 10px 12px; overflow-x: auto; margin: 6px 0 0; white-space: pre-wrap; word-break: break-all;
}
.notice { border-left: 3px solid var(--danger); padding: 8px 12px; background: rgba(224, 96, 90, 0.08); margin-bottom: 14px; }

.login { min-height: 100%; display: grid; place-items: center; padding: 24px; }
.login .card { width: 100%; max-width: 420px; padding: 28px; }
.login form { display: grid; gap: 12px; margin-top: 16px; }
.login input { width: 100%; }

@media (max-width: 760px) {
  .shell { flex-direction: column; }
  .sidebar { width: auto; flex-direction: row; flex-wrap: wrap; border-right: none; border-bottom: 1px solid var(--border); }
  .nav-label { display: none; }
  .content { padding: 20px 16px 40px; }
  .topbar { padding: 0 16px; flex-wrap: wrap; height: auto; min-height: 52px; }
}
