*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f4f6f9;
  color: #333;
  min-height: 100vh;
}

header {
  background: #2c3e50;
  color: #fff;
  padding: 1.25rem 2rem;
}

header h1 {
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

main {
  max-width: 960px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.status-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  padding: 1.5rem 2rem;
}

.status-card h2 {
  font-size: 1.2rem;
  margin-bottom: 0.75rem;
  color: #2c3e50;
}

.db-status {
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  background: #e74c3c;
  color: #fff;
}

.db-status.connected {
  background: #27ae60;
}

/* ── Header nav ─────────────────────────────────────────────────────────────── */
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-user {
  font-size: 0.9rem;
  opacity: 0.85;
}

/* ── Buttons ────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 0.5rem 1.2rem;
  border-radius: 5px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: none;
}

.btn-primary {
  background: #2c3e50;
  color: #fff;
  width: 100%;
  padding: 0.65rem;
  font-size: 1rem;
  margin-top: 0.5rem;
}

.btn-primary:hover {
  background: #1a252f;
}

.btn-outline {
  background: transparent;
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, 0.6);
  font-size: 0.85rem;
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* ── Form card ──────────────────────────────────────────────────────────────── */
.form-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  padding: 2rem;
  max-width: 440px;
  margin: 0 auto;
}

.form-card h2 {
  font-size: 1.3rem;
  color: #2c3e50;
  margin-bottom: 1.25rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: #555;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1.5px solid #ddd;
  border-radius: 5px;
  font-size: 0.95rem;
  transition: border-color 0.15s;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #2c3e50;
}

.optional {
  font-weight: 400;
  color: #999;
  font-size: 0.8rem;
}

.form-footer {
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.9rem;
  color: #666;
}

.form-footer a {
  color: #2c3e50;
  font-weight: 600;
}

/* ── Alerts ─────────────────────────────────────────────────────────────────── */
.alert {
  padding: 0.65rem 0.9rem;
  border-radius: 5px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.alert-error {
  background: #fdecea;
  color: #c0392b;
  border: 1px solid #f5c6cb;
}

/* ── Dashboard info table ───────────────────────────────────────────────────── */
.info-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.75rem;
}

.info-table th,
.info-table td {
  text-align: left;
  padding: 0.6rem 0.5rem;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.95rem;
}

.info-table th {
  color: #777;
  font-weight: 600;
  width: 30%;
}

.role-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: capitalize;
}

.role-resident  { background: #eaf4fb; color: #2980b9; }
.role-council   { background: #fef9e7; color: #d4ac0d; }
.role-manager   { background: #eafaf1; color: #1e8449; }

/* ── Multi-card spacing ─────────────────────────────────────────────────────── */
.status-card + .status-card {
  margin-top: 1.5rem;
}
