@import url('https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,600;9..40,700&family=DM+Mono:wght@400;500&display=swap');

:root {
  --bg: #0a0a09;
  --surface: #141311;
  --surface-2: #1c1a17;
  --surface-3: #242220;
  --border: #2b2824;
  --border-soft: #1e1c19;
  --text: rgba(255,255,255,0.92);
  --text-dim: rgba(255,255,255,0.56);
  --text-faint: rgba(255,255,255,0.34);
  --amber: #f59e0b;
  --amber-soft: rgba(245,158,11,0.14);
  --amber-border: rgba(245,158,11,0.4);
  --green: #34d399;
  --green-soft: rgba(52,211,153,0.13);
  --red: #f87171;
  --red-soft: rgba(248,113,113,0.13);
  --radius: 8px;
  --radius-sm: 5px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 14.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--amber-soft); color: var(--amber); }

.layout { display: flex; min-height: 100vh; }

/* ---------- Sidebar ---------- */
.sidebar {
  width: 232px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border-soft);
  padding: 22px 0 20px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px 20px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--border-soft);
}
.brand-mark {
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  background: var(--amber-soft);
  border: 1px solid var(--amber-border);
  color: var(--amber);
  display: flex; align-items: center; justify-content: center;
  font-family: "DM Mono", monospace;
  font-weight: 500;
  font-size: 13px;
  flex-shrink: 0;
}
.brand-text { line-height: 1.25; }
.brand-text .name { font-weight: 700; font-size: 15px; letter-spacing: -0.01em; }
.brand-text .tag {
  display: block; font-size: 10.5px; color: var(--text-faint);
  text-transform: uppercase; letter-spacing: 0.06em; margin-top: 1px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 20px;
  margin: 1px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: background .12s ease, color .12s ease;
}
.nav-item svg { width: 17px; height: 17px; flex-shrink: 0; opacity: 0.85; }
a.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--amber-soft); color: var(--amber); }
.nav-item.active svg { opacity: 1; }
.nav-item.disabled { color: var(--text-faint); cursor: default; }
.nav-item.disabled svg { opacity: 0.35; }
.nav-item .spacer { flex: 1; }
.nav-item .tag {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text-faint);
  text-transform: uppercase;
}

/* ---------- Main ---------- */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  display: flex; justify-content: flex-end; align-items: center;
  gap: 6px; padding: 20px 44px 0;
  font-size: 12.5px; color: var(--text-faint);
}
.topbar a { color: var(--text-dim); text-decoration: none; }
.topbar a:hover { color: var(--amber); }
.page { width: 100%; max-width: 900px; margin: 0 auto; padding: 14px 44px 60px; }

h1 {
  font-size: 1.5rem; font-weight: 700; letter-spacing: -0.015em;
  margin: 0 0 4px;
}
.subtitle { color: var(--text-dim); margin-bottom: 16px; font-size: 13.5px; }

h3 {
  font-size: 0.95rem; font-weight: 600; margin: 26px 0 10px;
  color: var(--text);
}

.explainer {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--amber-soft);
  border: 1px solid var(--amber-border);
  border-radius: var(--radius);
  padding: 11px 14px;
  margin-bottom: 22px;
  font-size: 12.8px;
  color: rgba(255,255,255,0.85);
}
.explainer svg { width: 16px; height: 16px; color: var(--amber); flex-shrink: 0; margin-top: 1px; }
.explainer b { color: var(--amber); font-weight: 600; }
.explainer a { color: var(--amber); }

.notice {
  font-size: 11.8px;
  color: var(--text-faint);
  margin: -12px 0 18px;
}
.notice.warn { color: #d9a441; }

.card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 12px;
}
.card.legacy { border-style: dashed; }
.card h4 { margin: 0 0 12px; font-size: 13px; font-weight: 600; color: var(--text); }

.badge {
  display: inline-flex; align-items: center;
  font-size: 10px; font-weight: 600; letter-spacing: 0.02em;
  padding: 2px 8px; border-radius: 999px; margin-left: 6px;
  text-transform: uppercase;
}
.badge.on { background: var(--green-soft); color: var(--green); }
.badge.off { background: var(--surface-3); color: var(--text-faint); }
.badge.legacy { background: var(--amber-soft); color: var(--amber); }

.row { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.meta { font-size: 12px; color: var(--text-dim); margin-top: 5px; }
.next { font-size: 11.5px; color: var(--amber); margin-top: 4px; font-weight: 500; }
.legacy-note {
  font-size: 11.5px; color: var(--text-dim);
  background: var(--surface-2); border-left: 2px solid var(--amber-border);
  padding: 7px 10px; border-radius: 4px; margin-top: 9px;
}

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  font-size: 13px; font-weight: 500;
  text-decoration: none;
  font-family: inherit;
  transition: background .12s ease, border-color .12s ease;
}
.btn:hover { background: var(--surface-3); border-color: var(--text-faint); }
.btn.primary { background: var(--amber); border-color: var(--amber); color: #17140c; font-weight: 600; }
.btn.primary:hover { background: #ffb020; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-dim); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.danger { color: var(--red); }
.btn.danger:hover { background: var(--red-soft); border-color: var(--red); }
.btn.small { padding: 5px 11px; font-size: 12px; }

.top-actions { margin-bottom: 16px; }
form.inline { display: inline; }

.field { margin-bottom: 15px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 6px; color: var(--text-dim); }
.field input[type=text], .field input[type=password], .field input[type=date], .field input[type=time], .field input[type=number],
.field select, .field textarea {
  width: 100%;
  padding: 9px 11px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-family: inherit;
  color: var(--text);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--amber);
}
.field .hint { font-size: 11.5px; color: var(--text-faint); margin-top: 5px; }
.checkbox-row { display: flex; align-items: flex-start; gap: 9px; margin-bottom: 12px; cursor: pointer; }
.checkbox-row input { margin-top: 3px; accent-color: var(--amber); }
.checkbox-row .ct { font-size: 13px; color: var(--text); font-weight: 500; }
.checkbox-row .cd { font-size: 11.8px; color: var(--text-faint); margin-top: 1px; }

.error {
  background: var(--red-soft); color: var(--red);
  padding: 10px 14px; border-radius: var(--radius-sm);
  margin-bottom: 16px; font-size: 13px; border: 1px solid rgba(248,113,113,0.3);
}

.login-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-box {
  background: var(--surface); border: 1px solid var(--border-soft);
  padding: 34px 32px; border-radius: 12px; width: 310px;
}
.login-box .brand-mark { margin: 0 auto 14px; }
.login-box h1 { text-align: center; margin-bottom: 22px; font-size: 1.2rem; }

.empty { color: var(--text-faint); font-size: 13px; padding: 6px 0 4px; }
