:root {
  color-scheme: dark;
  --green: #9dff7a;
  --green-soft: rgba(157,255,122,.08);
  --ink: #e8eee9;
  --muted: #849188;
  --dim: #4d5a51;
  --line: #243128;
  --panel: #0b100c;
  --bg: #060907;
  font-family: "DM Mono", Consolas, monospace;
}
* { box-sizing: border-box; }
body { min-width: 320px; min-height: 100vh; margin: 0; color: var(--ink); background: radial-gradient(circle at 70% 0, rgba(92,155,86,.09), transparent 34rem), var(--bg); }
button, input, textarea { font: inherit; }
a { color: inherit; }
.scanlines { position: fixed; inset: 0; z-index: 10; pointer-events: none; opacity: .18; background: repeating-linear-gradient(to bottom, transparent 0, transparent 3px, rgba(255,255,255,.025) 4px); }
.brand { display: inline-flex; align-items: center; gap: .75rem; color: inherit; text-decoration: none; }
.brand > span:last-child { display: grid; }
.brand strong { font: 700 .9rem "Space Mono", monospace; letter-spacing: .12em; }
.brand small { color: var(--muted); font-size: .5rem; letter-spacing: .13em; }
.brand-mark { display: grid; width: 2.5rem; height: 2.5rem; place-items: center; border-radius: .2rem; color: #09100b; background: var(--green); box-shadow: 0 0 1.5rem rgba(157,255,122,.15); font: 700 1rem "Space Mono", monospace; transform: skew(-3deg); }
.eyebrow { margin: 0 0 .7rem; color: var(--dim); font-size: .58rem; letter-spacing: .14em; }
.login-shell { display: grid; min-height: 100vh; place-items: center; padding: 1.25rem; }
.login-panel { width: min(100%, 28rem); padding: 1.5rem; border: 1px solid var(--line); background: rgba(9,14,10,.94); box-shadow: 0 2rem 7rem #000; }
.login-panel .brand { margin-bottom: 3.5rem; }
h1, h2 { margin: 0; font-family: "Space Mono", monospace; }
.login-panel h1 { font-size: clamp(1.35rem, 6vw, 2rem); }
.intro { margin: .8rem 0 1.6rem; color: var(--muted); font-size: .78rem; line-height: 1.7; }
.login-form { display: grid; gap: .65rem; }
.login-form label, .field > span { color: var(--muted); font-size: .58rem; letter-spacing: .11em; }
input, textarea { width: 100%; border: 1px solid #344038; border-radius: .2rem; color: var(--ink); background: #0b110d; outline: 0; transition: 150ms ease; }
input { min-height: 2.9rem; padding: .65rem .75rem; }
textarea { padding: .8rem; resize: vertical; line-height: 1.6; }
input:focus, textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(157,255,122,.05); }
.login-form button, .form-actions button { min-height: 3rem; margin-top: .7rem; border: 0; border-radius: .2rem; color: #09100b; background: var(--green); cursor: pointer; font-size: .68rem; font-weight: 700; letter-spacing: .08em; }
.login-form button span, .form-actions button span { margin-left: .8rem; }
.login-form button:hover, .form-actions button:hover { background: #bdff97; box-shadow: 0 0 1.5rem rgba(157,255,122,.18); }
.back-link { display: inline-block; margin-top: 1.3rem; color: var(--dim); font-size: .62rem; text-decoration: none; }
.back-link:hover { color: var(--green); }
.alert { margin: 0 0 1.2rem; padding: .75rem .9rem; border: 1px solid; font-size: .68rem; line-height: 1.5; }
.alert.error { color: #ff9d8c; border-color: #713d35; background: rgba(113,61,53,.12); }
.alert.success { color: var(--green); border-color: #315938; background: var(--green-soft); }
.admin-header { display: flex; height: 4.5rem; align-items: center; justify-content: space-between; padding: .8rem 1rem; border-bottom: 1px solid var(--line); background: rgba(7,11,8,.94); }
.admin-header nav { display: flex; gap: .35rem; }
.admin-header nav a { padding: .55rem .65rem; color: var(--muted); border: 1px solid var(--line); text-decoration: none; font-size: .58rem; }
.admin-header nav a:hover { color: var(--green); border-color: #3b6942; }
.admin-shell { min-height: calc(100vh - 4.5rem); }
.admin-sidebar { padding: 1.5rem 1rem; border-bottom: 1px solid var(--line); background: #080c09; }
.admin-sidebar h1 { font-size: 1.25rem; }
.admin-sidebar > p:not(.eyebrow) { max-width: 34rem; color: var(--muted); font-size: .7rem; line-height: 1.7; }
.system-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; margin: 1.5rem 0 0; }
.system-stats div { min-width: 0; padding: .6rem; border: 1px solid var(--line); }
.system-stats dt { margin-bottom: .3rem; color: var(--dim); font-size: .48rem; }
.system-stats dd { overflow: hidden; margin: 0; color: #b9c5bc; font-size: .55rem; text-overflow: ellipsis; white-space: nowrap; }
.system-stats i, .form-actions i { display: inline-block; width: .4rem; height: .4rem; margin-right: .3rem; border-radius: 50%; background: var(--green); box-shadow: 0 0 .5rem var(--green); }
.system-stats .health-error i { background: #ff7a7a; box-shadow: 0 0 .5rem #ff7a7a; }
.health-detail { margin: .75rem 0 0; color: var(--dim); font-size: .58rem; }
.admin-content { padding: 1.5rem 1rem 3rem; }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.page-heading h2 { font-size: 1.2rem; }
.page-heading > span { padding: .4rem .5rem; color: var(--green); border: 1px solid #315938; font-size: .48rem; white-space: nowrap; }
.config-form { display: grid; gap: 1rem; }
fieldset { min-width: 0; margin: 0; padding: 1rem; border: 1px solid var(--line); background: rgba(10,15,11,.78); }
legend { padding: 0 .5rem; color: #cbd5ce; font: 700 .68rem "Space Mono", monospace; }
legend span { margin-right: .6rem; color: var(--green); }
.field-grid { display: grid; gap: 1rem; }
.field { display: grid; gap: .45rem; min-width: 0; }
.field small { color: var(--dim); font-size: .54rem; line-height: 1.5; }
.check { display: flex; align-items: flex-start; gap: .6rem; color: var(--muted); font-size: .58rem; line-height: 1.5; }
.check input { width: 1rem; min-height: 1rem; margin: .1rem 0 0; accent-color: var(--green); }
.form-actions { display: flex; flex-direction: column; align-items: stretch; gap: .7rem; }
.form-actions p { margin: 0; color: var(--dim); font-size: .58rem; }
.form-actions button { padding-inline: 1.2rem; }
@media (min-width: 42rem) {
  .login-panel { padding: 2rem; }
  .field-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .field.full, .check.full { grid-column: 1 / -1; }
  .wide-first { grid-template-columns: 2fr 1fr; }
  .form-actions { flex-direction: row; align-items: center; justify-content: space-between; }
}
@media (min-width: 60rem) {
  .admin-header { padding-inline: 1.5rem; }
  .admin-shell { display: grid; grid-template-columns: 18rem minmax(0,1fr); }
  .admin-sidebar { padding: 2.4rem 1.5rem; border-right: 1px solid var(--line); border-bottom: 0; }
  .system-stats { grid-template-columns: 1fr; }
  .admin-content { padding: 2.4rem clamp(2rem,5vw,5rem) 4rem; }
  .page-heading h2 { font-size: 1.45rem; }
  fieldset { padding: 1.4rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition-duration: .01ms !important; } }
.logout-btn { background: none; border: 1px solid #555; color: #aaa; padding: 0.4rem 0.8rem; border-radius: 6px; cursor: pointer; font: inherit; font-size: 0.85rem; }
.logout-btn:hover { color: #ff6b6b; border-color: #ff6b6b; }
