:root {
  --bg: #0f1420;
  --bg-panel: #171f2f;
  --border: #2a3446;
  --text: #e6ebf5;
  --text-dim: #93a0b8;
  --accent: #4f8cff;
  --accent-hover: #6ba0ff;
  --danger: #ff5d6c;
  --ok: #34c77b;
  --warn: #e8b339;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

.wrap {
  max-width: 1600px;
  margin: 0 auto;
  padding: 40px 48px 80px;
}
.wrap.narrow {
  max-width: 680px;
}

@media (max-width: 1024px) {
  .wrap {
    padding: 24px 20px 60px;
  }
}

header.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}

header.top h1 {
  font-size: 20px;
  margin: 0;
}

a { color: var(--accent); }

.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 9px 16px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: var(--accent-hover); }
.btn.secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn.secondary:hover { border-color: var(--accent); }
.btn.danger { background: var(--danger); }
.btn.small { padding: 5px 10px; font-size: 13px; }

.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
}

table { width: 100%; border-collapse: collapse; table-layout: fixed; }
th, td { text-align: left; padding: 14px 12px; border-bottom: 1px solid var(--border); vertical-align: top; overflow-wrap: break-word; }
th { color: var(--text-dim); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: 0.03em; }
tr:last-child td { border-bottom: none; }

.address { font-weight: 600; }
.alias-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #1f2a3f;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 13px;
  margin: 2px 4px 2px 0;
}
.alias-chip form { display: inline; }
.alias-chip button {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 13px;
  padding: 0;
}
.alias-chip button:hover { color: var(--danger); }

.badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 600; }
.badge.ok { background: rgba(52,199,123,0.15); color: var(--ok); }
.badge.off { background: rgba(255,93,108,0.15); color: var(--danger); }
.badge.warn { background: rgba(232,179,57,0.15); color: var(--warn); }

form.inline { display: inline; }

.field { margin-bottom: 16px; }
.field label { display: block; margin-bottom: 6px; color: var(--text-dim); font-size: 13px; }
.field input, .field select {
  width: 100%;
  background: #10161f;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 10px;
  border-radius: 6px;
  font-size: 14px;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--accent); }
.checkbox-row { display: flex; gap: 20px; align-items: center; }
.checkbox-row label { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 14px; }
.checkbox-row input { width: auto; }

.alias-rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.alias-rows .row { display: flex; gap: 8px; }
.alias-rows .row input { flex: 1; }
.alias-rows .row button { flex-shrink: 0; }

.flash {
  background: rgba(52,199,123,0.12);
  border: 1px solid var(--ok);
  color: var(--ok);
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 14px;
}
.error {
  background: rgba(255,93,108,0.12);
  border: 1px solid var(--danger);
  color: var(--danger);
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 14px;
}

.muted { color: var(--text-dim); font-size: 13px; }

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-box { width: 340px; }
.login-box h1 { text-align: center; font-size: 18px; margin-bottom: 20px; }

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.section-title h2 { font-size: 16px; margin: 0; }
