*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, sans-serif;
  color: #1a1a2e;
  background: #f8f9fa;
}
a { color: #4361ee; }
button {
  cursor: pointer;
  padding: 0.5rem 1.25rem;
  border-radius: 6px;
  font-size: 1rem;
  border: none;
  background: #4361ee;
  color: white;
}
button:hover { background: #3451d1; }
button.secondary {
  background: white;
  border: 1px solid #ccc;
  color: #333;
}
button.secondary:hover { background: #f0f0f0; }
a.btn {
  display: inline-block;
  cursor: pointer;
  padding: 0.5rem 1.25rem;
  border-radius: 6px;
  font-size: 1rem;
  text-decoration: none;
  background: #4361ee;
  color: white;
}
a.btn:hover { background: #3451d1; }
a.btn.secondary {
  background: white;
  border: 1px solid #ccc;
  color: #333;
}
a.btn.secondary:hover { background: #f0f0f0; }
input, textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
  font-family: inherit;
}
input[type="checkbox"] {
  width: auto;
  accent-color: #4361ee;
}
input:focus, textarea:focus {
  outline: none;
  border-color: #4361ee;
}
label { display: block; margin-bottom: 1rem; font-weight: 500; }
label input, label textarea { margin-top: 0.25rem; font-weight: normal; }
.error { color: #e63946; margin: 0.5rem 0; }
.flashes { margin-bottom: 1rem; }
.flash {
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}
.flash.error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}
.flash.info {
  background: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
}
.dev-notice {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 6px;
  font-size: 0.95rem;
}
.dev-notice a { word-break: break-all; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.5rem 0.75rem; border-bottom: 1px solid #eee; }
th { font-weight: 600; }

@media (max-width: 600px) {
  .responsive-table thead { display: none; }
  .responsive-table tbody tr {
    display: block;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    background: white;
    padding: 0.25rem 0;
  }
  .responsive-table tbody td {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem;
    border-bottom: 1px solid #f5f5f5;
  }
  .responsive-table tbody td:last-child { border-bottom: none; }
  .responsive-table tbody td[data-label]::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: 0.82rem;
    color: #555;
    min-width: 80px;
    flex-shrink: 0;
  }
  .responsive-table .rsvp-actions { flex-wrap: wrap; }
  .responsive-table .counts { flex-wrap: wrap; }
}
.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}
.badge.accepted { background: #d4edda; color: #155724; }
.badge.declined { background: #f8d7da; color: #721c24; }
.badge.pending  { background: #e2e3e5; color: #383d41; }

header {
  background: #1a1a2e;
  color: white;
  padding: 0.75rem 1.5rem;
  box-shadow: 0 2px 4px rgba(0,0,0,.15);
}
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 860px;
  margin: 0 auto;
}
.brand {
  color: white;
  text-decoration: none;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.user-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.9rem;
}
.user-info button {
  padding: 0.3rem 0.9rem;
  font-size: 0.85rem;
  background: transparent;
  border: 1px solid rgba(255,255,255,.5);
  color: white;
}
.user-info button:hover { background: rgba(255,255,255,.1); }
.nav-link {
  color: rgba(255,255,255,.85);
  text-decoration: none;
  font-size: 0.9rem;
}
.nav-link:hover { color: white; }
main {
  max-width: 860px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}
.card {
  max-width: 440px;
  margin: 5rem auto;
  padding: 2rem;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,.08);
}
.card h1 { margin-top: 0; }
.btn-sm {
  padding: 0.2rem 0.7rem;
  font-size: 0.82rem;
  border-radius: 5px;
}
.rsvp-actions { display: flex; gap: 0.5rem; }
.counts { white-space: nowrap; }
.count { font-size: 0.82rem; font-weight: 600; padding: 0.15rem 0.45rem; border-radius: 4px; }
.count.accepted { background: #d4edda; color: #155724; }
.count.declined { background: #f8d7da; color: #721c24; }
.count.pending  { background: #fff3cd; color: #856404; }
.rsvp-summary { display: flex; gap: .5rem; margin-bottom: .75rem; }
.empty { color: #666; }
section { margin-bottom: 2.5rem; }
.blocked-badge {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.1rem 0.4rem;
  font-size: 0.7rem;
  font-weight: 600;
  background: #e74c3c;
  color: white;
  border-radius: 3px;
  vertical-align: middle;
}
tr.self td { background: #f0f4ff; }
tr.blocked td { opacity: 0.6; }
.btn-block { background: #e74c3c !important; }
.btn-block:hover:not(:disabled) { background: #c0392b !important; }
.btn-unblock { background: #27ae60 !important; }
.btn-unblock:hover:not(:disabled) { background: #1e8449 !important; }
button:disabled { background: #aaa; cursor: default; }
dt { font-weight: 600; margin-top: .5rem; }
dd { margin: 0 0 .25rem 0; }
.event-actions {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.rsvp-btn-group {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: .75rem;
}
@media (max-width: 480px) {
  .rsvp-btn-group button { flex: 1; }
  .event-actions { width: 100%; }
  .event-actions .btn, .event-actions button { flex: 1; text-align: center; }
}
