:root {
  --bg: #0f1420;
  --panel: #161d2e;
  --panel-2: #1e2740;
  --border: #2a3450;
  --text: #e7ecf7;
  --muted: #96a1bd;
  --accent: #5b8def;
  --accent-2: #4a72c9;
  --up: #34d399;
  --down: #f87171;
  --danger: #ef4444;
  --radius: 10px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}
.wrap { max-width: 960px; margin: 0 auto; padding: 32px 20px 80px; }

header.top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 28px;
}
header.top h1 { font-size: 20px; margin: 0; display: flex; align-items: center; gap: 10px; }
header.top h1 .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); display: inline-block; }
button, .btn {
  background: var(--accent); color: white; border: none; border-radius: 8px;
  padding: 10px 16px; font-size: 14px; cursor: pointer; font-weight: 600;
}
button:hover { background: var(--accent-2); }
button.secondary { background: var(--panel-2); color: var(--text); border: 1px solid var(--border); }
button.secondary:hover { background: #26314f; }
button.danger { background: transparent; color: var(--danger); border: 1px solid var(--danger); }
button.danger:hover { background: rgba(239,68,68,0.12); }
button:disabled { opacity: 0.5; cursor: not-allowed; }

.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px;
}

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.tab-btn {
  background: transparent; color: var(--muted); border: none; border-bottom: 2px solid transparent;
  padding: 10px 4px; margin-right: 18px; font-size: 14px; font-weight: 600; cursor: pointer; border-radius: 0;
}
.tab-btn:hover { color: var(--text); background: transparent; }
.tab-btn.active { color: var(--text); border-bottom-color: var(--accent); }
.tab-panel[hidden] { display: none; }
.section-actions { display: flex; gap: 10px; margin-bottom: 6px; }

.progress-bar-wrap {
  height: 6px; background: var(--panel-2); border-radius: 4px; overflow: hidden; margin-top: 10px;
}
.progress-bar { height: 100%; width: 0%; background: var(--accent); transition: width 0.2s ease; }

.mail-grid { display: grid; gap: 14px; margin-top: 18px; }
.mail-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.mail-email { font-weight: 600; font-size: 15px; }
.mail-meta { font-size: 13px; color: var(--muted); margin-top: 2px; }

.sites-grid { display: grid; gap: 14px; margin-top: 18px; }
.site-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.site-info { display: flex; flex-direction: column; gap: 4px; }
.site-domain { font-size: 16px; font-weight: 600; }
.site-domain a { color: var(--text); text-decoration: none; }
.site-domain a:hover { color: var(--accent); }
.site-meta { font-size: 13px; color: var(--muted); }
.badge { font-size: 12px; padding: 3px 9px; border-radius: 20px; font-weight: 600; }
.badge.up { background: rgba(52,211,153,0.15); color: var(--up); }
.badge.down { background: rgba(248,113,113,0.15); color: var(--down); }
.site-actions { display: flex; gap: 8px; }

.empty { text-align: center; color: var(--muted); padding: 40px 0; }

/* modal */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55);
  display: flex; align-items: center; justify-content: center; z-index: 50;
}
.modal { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; width: 100%; max-width: 420px; }
.modal h2 { margin: 0 0 6px; font-size: 18px; }
.modal p.hint { color: var(--muted); font-size: 13px; margin: 0 0 16px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field input {
  width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--panel-2); color: var(--text); font-size: 14px;
}
.field input:focus { outline: none; border-color: var(--accent); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.error-msg { color: var(--down); font-size: 13px; margin-top: 8px; min-height: 18px; }

.spinner {
  width: 16px; height: 16px; border: 2px solid rgba(255,255,255,0.35); border-top-color: white;
  border-radius: 50%; animation: spin 0.7s linear infinite; display: inline-block; vertical-align: -3px; margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.progress-log {
  background: #0b0f19; border: 1px solid var(--border); border-radius: 8px; padding: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--muted);
  max-height: 160px; overflow-y: auto; white-space: pre-wrap; margin-top: 10px;
}

/* login page */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-card { width: 100%; max-width: 340px; padding: 28px; }
.login-card h1 { font-size: 18px; margin: 0 0 4px; }
.login-card p.hint { color: var(--muted); font-size: 13px; margin: 0 0 20px; }
