:root {
  --bg: #10131a;
  --panel: #181d27;
  --panel2: #202638;
  --text: #eef3ff;
  --muted: #9aa8c7;
  --accent: #d7b46a;
  --ok: #46d381;
  --bad: #ff6868;
  --warn: #f6c04d;
  --line: #31384d;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, Segoe UI, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--accent); text-decoration: none; }
.layout { min-height: 100vh; display: flex; }
.sidebar { width: 230px; background: #0c0f15; border-right: 1px solid var(--line); padding: 22px 16px; position: sticky; top: 0; height: 100vh; }
.brand { font-weight: 800; font-size: 24px; line-height: 1; margin-bottom: 28px; letter-spacing: .5px; }
.brand span { color: var(--accent); font-size: 18px; }
nav { display: flex; flex-direction: column; gap: 8px; }
nav a { color: var(--text); padding: 10px 12px; border-radius: 10px; background: transparent; }
nav a:hover { background: var(--panel2); }
.logout-form { position: absolute; bottom: 18px; left: 16px; right: 16px; }
.content { flex: 1; padding: 28px; max-width: 1500px; }
.centered { display: grid; place-items: center; max-width: none; }
h1 { margin: 0 0 18px; font-size: 34px; }
h2 { margin: 0 0 12px; font-size: 19px; }
.card, .login-card { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 18px; box-shadow: 0 12px 40px rgba(0,0,0,.25); }
.login-card { width: min(420px, 92vw); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
.wide { margin-top: 16px; overflow-x: auto; }
.muted { color: var(--muted); }
.badge { display: inline-block; padding: 4px 10px; border-radius: 999px; background: var(--panel2); font-weight: 700; }
.badge.ok { color: #06160b; background: var(--ok); }
.badge.bad { color: #2c0303; background: var(--bad); }
.flash-wrap { margin-bottom: 16px; }
.flash { padding: 12px 14px; border-radius: 12px; margin-bottom: 8px; background: var(--panel2); border: 1px solid var(--line); }
.flash.success { border-color: var(--ok); }
.flash.danger { border-color: var(--bad); }
.flash.warning { border-color: var(--warn); }
input, select { background: #0c0f15; border: 1px solid var(--line); color: var(--text); border-radius: 10px; padding: 9px 10px; min-height: 40px; }
label { display: block; color: var(--muted); margin: 12px 0 6px; }
button, .button-link { background: var(--accent); border: none; color: #1b1305; border-radius: 10px; padding: 10px 14px; font-weight: 800; cursor: pointer; display: inline-block; }
button:hover, .button-link:hover { filter: brightness(1.07); }
button.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); width: 100%; }
.danger-button { background: var(--bad); color: #fff; }
.inline-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.inline-form.mini { gap: 6px; margin: 4px 0; }
.inline-form.mini input, .inline-form.mini select { min-height: 32px; padding: 5px 8px; }
.inline-form.mini button { padding: 6px 9px; }
.button-row { display: flex; gap: 8px; flex-wrap: wrap; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 700; }
.logbox { background: #070a0f; border: 1px solid var(--line); border-radius: 12px; padding: 14px; overflow: auto; max-height: 70vh; white-space: pre-wrap; color: #dce6ff; }
@media (max-width: 800px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: relative; }
  .logout-form { position: static; margin-top: 16px; }
  .content { padding: 18px; }
}
