:root {
  --bg: #0b1220;
  --card-bg: #101a2c;
  --text: #e8edf7;
  --text-sub: #9aa7bd;
  --blue: #2f6fed;
  --blue-dark: #1e4fb8;
  --red: #e5484d;
  --red-bg: rgba(229, 72, 77, 0.12);
  --amber: #f2b13d;
  --amber-bg: rgba(242, 177, 61, 0.12);
  --green: #33c17f;
  --green-bg: rgba(51, 193, 127, 0.12);
  --border: #223252;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.wrap {
  padding: 24px;
  max-width: 480px;
  margin: 0 auto;
}
.wrap-wide { max-width: 880px; }
.wrap[hidden] { display: none; }

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 20px;
}
.card-narrow { max-width: 360px; margin: 60px auto; }

.brand { display: flex; align-items: center; gap: 8px; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--blue); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700;
}
.brand-name { font-weight: 600; font-size: 15px; color: var(--text-sub); }

.title { font-size: 20px; margin: 20px 0 16px; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; font-size: 13px; color: var(--text-sub); }
.field input, .field select {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 14px;
}
.field-wide { grid-column: 1 / -1; }

.grid-form {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 0 16px;
  align-items: end;
}
.grid-form .btn { grid-column: 1 / -1; }

.row { display: flex; gap: 10px; }
.row input { flex: 1; }

.btn {
  padding: 11px 16px;
  border-radius: 10px;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); }

.link-btn {
  background: none;
  border: none;
  color: var(--text-sub);
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.error-text { color: var(--red); font-size: 13px; margin-top: 8px; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.who { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--text-sub); }
#who-nickname { color: var(--text); font-weight: 600; }

.section-title { font-size: 15px; margin: 0 0 14px; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.search {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
  color: var(--text);
  font-size: 13px;
}

.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th, .table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); }
.table th { color: var(--text-sub); font-weight: 500; font-size: 12px; }
.empty { color: var(--text-sub); text-align: center; padding: 24px 0; }

.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
}
.badge-allowed { background: var(--green-bg); color: var(--green); }
.badge-warning { background: var(--amber-bg); color: var(--amber); }
.badge-blocked { background: var(--red-bg); color: var(--red); }

.row-actions { display: flex; gap: 10px; }
.row-actions button {
  background: none; border: none; color: var(--text-sub);
  cursor: pointer; font-size: 12.5px; text-decoration: underline; padding: 0;
}
.row-actions button.danger { color: var(--red); }
