* { box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  margin: 0;
  background: #f4f5f7;
  color: #1a1a1a;
}
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Centered auth forms (login.html) ---- */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.auth-card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  padding: 32px;
  width: 100%;
  max-width: 360px;
}
.auth-card h1 { font-size: 20px; margin: 0 0 20px; }
.auth-switch { margin-top: 16px; font-size: 13px; text-align: center; }

/* ---- Dashboard shell ---- */
header.topbar {
  background: #fff;
  border-bottom: 1px solid #e2e4e8;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
header.topbar .who { font-size: 13px; color: #555; }
main {
  max-width: 980px;
  margin: 24px auto;
  padding: 0 16px;
}
section.panel {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  padding: 20px;
  margin-bottom: 20px;
}
section.panel h2 { margin: 0 0 14px; font-size: 16px; }
section.panel h3 { margin: 18px 0 8px; font-size: 14px; color: #444; }

/* ---- Forms / inputs ---- */
label { display: block; font-size: 12px; color: #555; margin-bottom: 4px; margin-top: 10px; }
input[type=text], input[type=email], input[type=password], input[type=file], select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #d0d3d9;
  border-radius: 6px;
  font-size: 14px;
}
.radio-row { display: flex; gap: 16px; margin-top: 4px; }
.radio-row label { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 13px; color: #1a1a1a; }
.radio-row input { width: auto; }

button {
  cursor: pointer;
  border: none;
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  background: #2563eb;
  color: #fff;
}
button:hover { background: #1d4ed8; }
button.secondary { background: #e5e7eb; color: #1a1a1a; }
button.secondary:hover { background: #d1d5db; }
button.danger { background: #dc2626; }
button.danger:hover { background: #b91c1c; }
button:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

/* ---- Lists / rows ---- */
.row-list { display: flex; flex-direction: column; gap: 8px; }
.row {
  border: 1px solid #e2e4e8;
  border-radius: 8px;
  padding: 12px;
}
.row-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.row-head .title { font-weight: 600; font-size: 14px; }
.row-meta { font-size: 12px; color: #666; margin-top: 4px; line-height: 1.5; }
.row-meta code {
  background: #f1f2f4;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 11px;
}
.empty-hint { color: #777; font-size: 13px; padding: 8px 0; }

.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
}
.badge.active { background: #dcfce7; color: #166534; }
.badge.pending { background: #fef3c7; color: #92400e; }
.badge.blacklisted { background: #fee2e2; color: #991b1b; }

.group-detail { margin-top: 10px; border-top: 1px dashed #e2e4e8; padding-top: 10px; }

#toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #1a1a1a;
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .15s, transform .15s;
  pointer-events: none;
  max-width: 320px;
}
#toast.show { opacity: 1; transform: translateY(0); }
#toast.error { background: #991b1b; }
