:root {
  color-scheme: dark;
  --bg: #0d0d0f;
  --panel: #151517;
  --panel-2: #1b1b1e;
  --line: #303035;
  --text: #f2eff1;
  --muted: #969098;
  --red: #d31b3d;
  --red-dark: #82152b;
  --green: #55d69b;
  --yellow: #e8b75e;
  --danger: #ff6877;
  font-family: Inter, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 14px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 50% 0%, #30131d 0, var(--bg) 52%); }
.auth-card { width: min(420px, 100%); padding: 42px; background: #171518f5; border: 1px solid #48202c; border-radius: 18px; box-shadow: 0 24px 90px #0009; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; background: var(--red); color: white; font-weight: 800; font-size: 23px; border-radius: 12px; }
.auth-card .brand-mark { margin-bottom: 28px; }
.eyebrow { color: var(--red); font-size: 10px; letter-spacing: 2px; font-weight: 700; margin: 0 0 10px; }
h1, h2, p { margin-top: 0; }
h1 { font-size: 28px; margin-bottom: 10px; }
h2 { font-size: 16px; margin-bottom: 0; }
.muted { color: var(--muted); }
.error { color: var(--danger); min-height: 20px; margin: 16px 0 0; }
.app { display: flex; min-height: 100vh; }
.sidebar { width: 232px; flex: 0 0 232px; min-height: 100vh; padding: 25px 15px; border-right: 1px solid var(--line); background: #111113; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 10px; }
.brand strong { display: block; letter-spacing: 2px; font-size: 14px; }
.brand span { display: block; color: var(--muted); font-size: 9px; letter-spacing: 1.5px; margin-top: 4px; }
.kana { color: var(--red); opacity: .65; line-height: 1.8; text-align: center; font-size: 22px; margin: 30px 0 20px; }
nav { display: grid; gap: 6px; }
.nav { color: var(--muted); background: transparent; border: 1px solid transparent; text-align: left; padding: 13px 15px; border-radius: 8px; }
.nav:hover { color: var(--text); background: var(--panel-2); }
.nav.active { color: white; background: #3b1521; border-color: #702037; box-shadow: inset 3px 0 var(--red); }
.sidebar-bottom { margin-top: auto; padding: 18px 10px 0; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 12px; }
.text-button { color: var(--muted); background: none; border: 0; padding: 0; }
.text-button:hover { color: white; }
.content { flex: 1; min-width: 0; max-width: 1600px; padding: 30px 38px 50px; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.topbar h1 { margin: 0; }
.user-badge { border: 1px solid var(--line); padding: 9px 13px; border-radius: 8px; color: var(--muted); }
.page { display: grid; gap: 20px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 22px; min-width: 0; }
.card-head { display: flex; justify-content: space-between; gap: 15px; align-items: center; margin-bottom: 20px; }
.card-head p { margin: 7px 0 0; }
.grid { display: grid; gap: 20px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 17px; }
.stat span { color: var(--muted); font-size: 11px; display: block; }
.stat b { font-size: 26px; display: block; margin-top: 8px; }
.stat.red b { color: var(--red); }
.stat.green b { color: var(--green); }
.stat.yellow b { color: var(--yellow); }
.form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; align-items: end; }
.form-grid.compact { grid-template-columns: repeat(6, minmax(0, 1fr)); }
label { color: var(--muted); font-size: 11px; display: grid; gap: 7px; }
label small { color: #6f6971; }
input, select, textarea { width: 100%; color: var(--text); background: #0f0f11; border: 1px solid #373239; border-radius: 6px; padding: 10px 11px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--red); box-shadow: 0 0 0 2px #d31b3d25; }
input[type=file] { padding: 8px; }
textarea { min-height: 100px; resize: vertical; font-family: Consolas, monospace; }
.check { display: flex; align-items: center; gap: 8px; }
.check input { width: auto; accent-color: var(--red); }
fieldset { border: 1px solid var(--line); border-radius: 7px; display: flex; flex-wrap: wrap; gap: 8px; }
legend { color: var(--muted); font-size: 11px; }
.button { color: var(--text); background: #29262b; border: 1px solid #4a3e47; border-radius: 6px; padding: 10px 15px; white-space: nowrap; }
.button:hover { background: #3a2c34; }
.button.primary { background: var(--red); border-color: #ec3556; color: white; }
.button.primary:hover { background: #e52a4e; }
.button.small { padding: 6px 10px; font-size: 11px; }
.button.danger { color: var(--danger); border-color: #77313b; background: #30171d; }
.button.wide { width: 100%; margin-top: 18px; }
.auth form { display: grid; gap: 14px; margin-top: 22px; }
.setup-note { color: var(--yellow); font-size: 12px; line-height: 1.5; }
.notice { border: 1px solid #4d3c29; background: #302519; color: var(--yellow); padding: 12px 16px; border-radius: 7px; margin-bottom: 20px; white-space: pre-wrap; }
.notice.error { border-color: #702b38; background: #30171d; color: var(--danger); }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; min-width: 650px; }
th { color: var(--muted); font-size: 10px; font-weight: 600; text-align: left; text-transform: uppercase; letter-spacing: 1px; padding: 10px 8px; border-bottom: 1px solid var(--line); }
td { padding: 11px 8px; border-bottom: 1px solid #29262b; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td code { color: #f1b7c3; font-family: Consolas, monospace; font-size: 12px; }
.actions { display: flex; flex-wrap: wrap; gap: 5px; }
.status { display: inline-block; padding: 4px 7px; border-radius: 4px; font-size: 10px; background: #2a292c; color: var(--muted); }
.status.active { color: var(--green); background: #143a2c; }
.status.frozen { color: var(--yellow); background: #3a2b16; }
.status.banned, .status.revoked { color: var(--danger); background: #3c1821; }
.status.expired { color: #b9a5b0; background: #30232b; }
.group-actions { display: flex; gap: 8px; margin: 0 0 15px; }
.inline-form { display: flex; gap: 10px; max-width: 600px; }
.chart { height: 190px; display: flex; gap: 6px; align-items: end; padding: 20px 4px 0; }
.chart-bar { flex: 1; min-width: 8px; height: 100%; display: flex; flex-direction: column; justify-content: end; align-items: center; gap: 7px; }
.chart-bar i { display: block; width: 100%; min-height: 3px; background: var(--red); border-radius: 3px 3px 0 0; }
.chart-bar small { color: var(--muted); font-size: 9px; }
.build-current { padding: 14px; border: 1px solid #54202e; background: #24151b; border-radius: 8px; margin-bottom: 20px; font-family: Consolas, monospace; line-height: 1.7; overflow-wrap: anywhere; }
.detail { position: fixed; inset: 0; background: #000b; padding: 30px; overflow: auto; z-index: 10; }
.detail-card { max-width: 1050px; margin: auto; background: var(--panel); border: 1px solid #642337; border-radius: 12px; padding: 25px; }
.detail-meta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 18px 0; }
.detail-meta div { background: var(--panel-2); border-radius: 6px; padding: 12px; }
.detail-meta span { display: block; color: var(--muted); font-size: 10px; margin-bottom: 5px; }
.log { max-height: 350px; overflow: auto; background: #0d0d0f; border: 1px solid var(--line); padding: 10px; font-family: Consolas, monospace; font-size: 11px; white-space: pre-wrap; }
@media (max-width: 1100px) { .stats { grid-template-columns: repeat(3, 1fr); } .form-grid, .form-grid.compact { grid-template-columns: repeat(3, 1fr); } .content { padding: 24px; } }
@media (max-width: 700px) { .sidebar { width: 65px; flex-basis: 65px; padding: 15px 7px; } .brand { padding: 0; justify-content: center; } .brand > div:last-child, .kana, .nav { font-size: 0; } .nav { text-align: center; padding: 12px 0; } .nav::first-letter { font-size: 15px; } .sidebar-bottom { display: block; text-align: center; } .sidebar-bottom span { display: none; } .content { padding: 18px 12px; } .grid.two { grid-template-columns: 1fr; } .form-grid, .form-grid.compact { grid-template-columns: 1fr 1fr; } .stats { grid-template-columns: 1fr 1fr; } .user-badge { display: none; } .auth-card { padding: 28px; } }
