:root {
  --bg: #0f1419; --panel: #1a2027; --panel2: #232b33; --line: #313a44;
  --text: #e6edf3; --muted: #8b98a5; --accent: #2f81f7; --accent2: #1f6feb;
  --green: #2ea043; --red: #f85149; --amber: #d29922;
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
.hidden { display: none !important; }
.muted { color: var(--muted); } .small { font-size: 12px; }
.err { color: var(--red); min-height: 18px; }

/* login */
.login { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 24px; width: 340px; display: flex; flex-direction: column; gap: 10px; }
.card h1 { margin: 0 0 8px; font-size: 18px; }
input, select, textarea { background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 9px 11px; font: inherit; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
button { cursor: pointer; border: 1px solid var(--line); background: var(--panel2); color: var(--text); border-radius: 6px; padding: 8px 14px; font: inherit; }
button:hover { border-color: var(--accent); }
button.primary { background: var(--accent2); border-color: var(--accent2); }
button.primary:hover { background: var(--accent); }
button.ghost { background: transparent; }
button.danger { color: var(--red); border-color: transparent; }
button.danger:hover { border-color: var(--red); }

/* layout */
header { display: flex; align-items: center; gap: 16px; padding: 0 18px; height: 52px; border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; z-index: 5; }
header nav { display: flex; gap: 4px; }
.tab { background: transparent; border: none; border-bottom: 2px solid transparent; border-radius: 0; padding: 8px 12px; color: var(--muted); }
.tab.active { color: var(--text); border-bottom-color: var(--accent); }
.spacer { flex: 1; }
.tabpane { padding: 22px; max-width: 1000px; margin: 0 auto; }
.row { display: flex; gap: 10px; align-items: center; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
h2 { font-size: 16px; margin: 0 0 14px; }

/* sites table */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
td code { background: var(--panel2); padding: 2px 6px; border-radius: 4px; }
.tag { font-size: 11px; padding: 1px 7px; border-radius: 10px; border: 1px solid var(--line); color: var(--muted); }

/* raw editor */
#rawEditor { width: 100%; height: 56vh; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; white-space: pre; }
.msg { background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; padding: 10px; min-height: 20px; white-space: pre-wrap; margin: 10px 0 0; font-family: ui-monospace, monospace; font-size: 12px; }
.msg.ok { border-color: var(--green); } .msg.bad { border-color: var(--red); color: #ffb4ae; }

/* status */
#statusBox .item { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin-bottom: 10px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 7px; }
.dot.g { background: var(--green); } .dot.r { background: var(--red); } .dot.a { background: var(--amber); }

/* modal */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; z-index: 20; }
.modal-card { width: 460px; max-width: 92vw; }
.modal-card label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.modal-card label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); }
.modal-card input[type=checkbox] { width: auto; }

/* toast */
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); padding: 11px 18px; border-radius: 8px; z-index: 30; border: 1px solid var(--line); background: var(--panel); }
.toast.ok { border-color: var(--green); } .toast.bad { border-color: var(--red); }
