:root {
    --bg: #0f1115;
    --panel: #171a21;
    --line: #262b36;
    --text: #d7dbe3;
    --muted: #8b93a3;
    --accent: #6c8cff;
    --ok: #2fbf71;
    --warn: #e0b341;
    --bad: #e5484d;
    color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { height: 100%; margin: 0; }
body {
    background: var(--bg);
    color: var(--text);
    font: 14px/1.5 system-ui, -apple-system, "Segoe UI", "Malgun Gothic", sans-serif;
}

button, input { font: inherit; }
button {
    border: 1px solid var(--line);
    background: #222734;
    color: var(--text);
    padding: 7px 14px;
    border-radius: 8px;
    cursor: pointer;
}
button:hover { background: #2a3040; }
button:disabled { opacity: .6; cursor: wait; }
button.ok { border-color: #235c3e; color: #7ee2aa; }
button.danger { border-color: #6b2a2d; color: #ff9a9d; }
button.ghost { background: transparent; color: var(--muted); }

input {
    background: #0b0d11;
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 9px 12px;
    outline: none;
}
input:focus { border-color: var(--accent); }

/* ---------- 로그인 / 회원가입 / 관리자 확인 */
.center { min-height: 100%; display: grid; place-items: center; padding: 24px; }
.card {
    width: 100%;
    max-width: 360px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: center;
}
.logo { font-size: 34px; }
.card h1 { margin: 0; font-size: 20px; }
.sub { margin: 0 0 6px; color: var(--muted); }
.primary { background: var(--accent); border-color: var(--accent); color: #fff; padding: 10px; }
.primary:hover { background: var(--accent); filter: brightness(1.1); }
.msg { margin: 0; min-height: 1.5em; color: var(--bad); }

/* ---------- 콘솔 */
.app { height: 100%; display: flex; flex-direction: column; }
.bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 18px;
    padding: 10px 16px;
    background: var(--panel);
    border-bottom: 1px solid var(--line);
}
.title { display: flex; align-items: center; gap: 8px; }
.title strong { font-size: 16px; }
.state { color: var(--muted); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.dot.on { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.dot.wait { background: var(--warn); }
.dot.off { background: var(--bad); }
.stats { color: var(--muted); font-size: 13px; flex: 1; min-width: 0; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }

.log {
    flex: 1;
    overflow: auto;
    padding: 10px 16px;
    background: #0b0d11;
    font: 13px/1.45 ui-monospace, "Cascadia Mono", Consolas, "D2Coding", monospace;
    white-space: pre-wrap;
    word-break: break-word;
}
.ln { min-height: 1.45em; }
.b { font-weight: 700; }
.note.cmd { color: #9fb4ff; }
.note.info { color: var(--muted); }
.note.error { color: #ff8a8d; }

.cmd {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--panel);
    border-top: 1px solid var(--line);
}
.prompt { color: var(--accent); font-weight: 700; font-family: ui-monospace, Consolas, monospace; }
.cmd input { flex: 1; min-width: 0; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }

@media (max-width: 600px) {
    .bar { padding: 8px 10px; }
    .log { padding: 8px 10px; font-size: 12px; }
    .cmd { padding: 8px 10px; }
    .actions button { padding: 6px 10px; }
}

/* 로그인 탭, 폼 */
.card form { display: flex; flex-direction: column; gap: 10px; }
.tabs { display: flex; gap: 4px; background: #0b0d11; border: 1px solid var(--line); border-radius: 10px; padding: 4px; }
.tab { flex: 1; border: 0; background: transparent; color: var(--muted); padding: 7px; }
.tab:hover { background: #1c2029; }
.tab.active { background: #262c3a; color: var(--text); }
.link { border: 0; background: transparent; color: var(--muted); text-decoration: underline; padding: 4px; }
.link:hover { background: transparent; color: var(--text); }
.who { color: var(--muted); font-size: 13px; align-self: center; margin-left: 6px; }
