:root {
  --pink: #F4C0D1;
  --pink-deep: #e8a0b8;
  --purple: #CECBF6;
  --purple-deep: #b5b0ef;
  --mint: #9FE1CB;
  --mint-deep: #7fd4b5;
  --ink: #3d3654;
  --muted: #7a7394;
  --bg: #fbf9fc;
  --surface: #ffffff;
  --border: rgba(61, 54, 84, 0.08);
  --shadow: 0 10px 30px rgba(125, 110, 160, 0.12);
  --radius: 18px;
  --font: "Quicksand", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
}

body {
  position: relative;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

.page-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(244, 192, 209, 0.45), transparent 55%),
    radial-gradient(ellipse 70% 45% at 95% 5%, rgba(206, 203, 246, 0.5), transparent 50%),
    radial-gradient(ellipse 60% 40% at 50% 100%, rgba(159, 225, 203, 0.35), transparent 55%),
    var(--bg);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
}

.brand {
  font-weight: 700;
  font-size: 1.45rem;
  letter-spacing: -0.02em;
  background: linear-gradient(120deg, var(--pink-deep), var(--purple-deep), var(--mint-deep));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.topnav {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.topnav a {
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  transition: background 0.2s ease, transform 0.2s ease;
}

.topnav a:hover {
  background: rgba(206, 203, 246, 0.35);
  transform: translateY(-1px);
}

.nav-chat {
  position: relative;
}

.badge-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--pink-deep);
  box-shadow: 0 0 0 2px var(--bg);
}

.container {
  width: min(1100px, calc(100% - 2rem));
  margin: 0 auto 3rem;
}

.page-enter {
  animation: fadeSlide 0.45s ease both;
}

@keyframes fadeSlide {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

h1, h2, h3 {
  margin: 0 0 0.4rem;
  letter-spacing: -0.02em;
  font-weight: 700;
}

h1 { font-size: clamp(1.75rem, 4vw, 2.35rem); }
h2 { font-size: 1.35rem; }

.eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.lead, .muted {
  color: var(--muted);
}

.lead {
  font-size: 1.05rem;
  max-width: 34rem;
}

.small { font-size: 0.85rem; }

.section { margin-top: 0.5rem; }
.section-narrow {
  max-width: 480px;
  margin: 1.5rem auto;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.brand-hero {
  font-size: clamp(3rem, 10vw, 4.5rem);
  background: linear-gradient(120deg, var(--pink-deep), var(--purple-deep), var(--mint-deep));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin: 0.2rem 0 0.8rem;
}

.hero-welcome {
  padding: 3rem 0 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: none;
  border-radius: 999px;
  padding: 0.75rem 1.35rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, filter 0.18s ease, background 0.18s ease;
}

.btn:hover {
  transform: scale(1.03);
  filter: brightness(0.96);
}

.btn:active { transform: scale(0.98); }

.btn-block { width: 100%; }
.btn-sm { padding: 0.45rem 0.9rem; font-size: 0.85rem; }

.btn-pink { background: var(--pink); color: var(--ink); }
.btn-purple { background: var(--purple); color: var(--ink); }
.btn-mint { background: var(--mint); color: var(--ink); }
.btn-ghost {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--ink);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-weight: 600;
  font-size: 0.9rem;
}

.field input,
.field select,
.select,
.chat-composer input,
.checkin-form input[type="time"] {
  border: 1.5px solid var(--border);
  background: var(--surface);
  border-radius: 14px;
  padding: 0.8rem 1rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field input:focus,
.field select:focus,
.select:focus,
.chat-composer input:focus,
.checkin-form input[type="time"]:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 4px rgba(206, 203, 246, 0.35);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(61, 54, 84, 0.28);
  backdrop-filter: blur(6px);
  animation: fadeSlide 0.3s ease;
}

.modal[hidden] { display: none !important; }

.modal-card {
  width: min(420px, 100%);
  background: var(--surface);
  border-radius: 24px;
  padding: 1.75rem;
  box-shadow: var(--shadow);
}

.modal-card-lg { width: min(460px, 100%); }

.modal-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.modal-actions .btn { flex: 1; }

.gender-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1.75rem;
}

.gender-card {
  border: none;
  border-radius: var(--radius);
  padding: 2rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, filter 0.2s ease;
}

.gender-card:hover { transform: translateY(-4px) scale(1.02); }
.gender-female { background: linear-gradient(160deg, #fde4ec, var(--pink)); }
.gender-male { background: linear-gradient(160deg, #e8e6ff, var(--purple)); }
.gender-icon { font-size: 1.8rem; opacity: 0.7; }

.location-panel {
  background: var(--surface);
  border-radius: 24px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.district-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.district-chip {
  border-radius: 999px;
  padding: 0.7rem 1.1rem;
  font-weight: 650;
  background: rgba(206, 203, 246, 0.35);
  transition: transform 0.18s ease, background 0.18s ease;
}

.district-chip.active:hover {
  transform: scale(1.04);
  background: var(--purple);
}

.district-chip.disabled {
  background: rgba(61, 54, 84, 0.05);
  color: var(--muted);
  cursor: not-allowed;
}

.district-chip small {
  font-weight: 500;
  opacity: 0.75;
}

.venue-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.25rem;
}

.venue-card {
  background: var(--surface);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.venue-card:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow: 0 16px 40px rgba(125, 110, 160, 0.18);
}

.venue-photo {
  height: 160px;
  background-size: cover;
  background-position: center;
  background-color: var(--purple);
}

.venue-body {
  padding: 1rem 1.1rem 1.2rem;
}

.venue-body h3 {
  margin-bottom: 0.25rem;
  font-size: 1.05rem;
}

.venue-body p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.venue-hero {
  position: relative;
  height: 220px;
  border-radius: 24px;
  background-size: cover;
  background-position: center;
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.venue-hero-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.25rem;
  background: linear-gradient(to top, rgba(61, 54, 84, 0.72), transparent 65%);
  color: white;
}

.venue-hero-overlay h1,
.venue-hero-overlay p { color: white; }
.venue-hero-overlay p { margin: 0; opacity: 0.9; }

.back-link {
  position: absolute;
  top: 1rem;
  left: 1rem;
  color: white;
  font-weight: 700;
  background: rgba(255,255,255,0.18);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  backdrop-filter: blur(4px);
}

.checkin-panel,
.overlap-panel,
.pending-panel,
.form-card,
.chat-shell {
  background: var(--surface);
  border-radius: 24px;
  padding: 1.35rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.25rem;
}

.checkin-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.time-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

.user-list,
.pending-list {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.user-row,
.pending-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem;
  border-radius: 16px;
  background: rgba(251, 249, 252, 0.9);
  border: 1px solid var(--border);
}

.user-meta {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.user-meta span,
.pending-item .muted {
  font-size: 0.85rem;
  color: var(--muted);
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.avatar-female { background: var(--pink); }
.avatar-male { background: var(--purple); }

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: rgba(159, 225, 203, 0.55);
  color: var(--ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease;
}

.icon-btn:hover {
  transform: scale(1.08);
  background: var(--mint);
}

.chip {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(206, 203, 246, 0.45);
  color: var(--muted);
}

.pending-actions {
  display: flex;
  gap: 0.4rem;
}

.inline-form { display: inline; }

.empty-state {
  text-align: center;
  padding: 2.5rem 1.5rem;
  background: var(--surface);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.empty-state.soft {
  box-shadow: none;
  background: rgba(159, 225, 203, 0.15);
  margin-top: 1rem;
}

.empty-state .btn { margin-top: 1rem; }

.chat-tabs {
  display: flex;
  gap: 0.55rem;
  overflow-x: auto;
  padding-bottom: 0.75rem;
  margin-bottom: 0.5rem;
  scrollbar-width: thin;
}

.chat-tab {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.65rem 1.1rem;
  border-radius: 999px;
  background: rgba(206, 203, 246, 0.3);
  font-weight: 700;
  border: 2px solid transparent;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.chat-tab.active {
  border-color: var(--purple-deep);
  background: var(--purple);
}

.unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: #d97a96;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
}

.chat-shell {
  display: flex;
  flex-direction: column;
  min-height: 420px;
  padding: 0;
  overflow: hidden;
}

.chat-shell-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-height: 420px;
  background:
    linear-gradient(180deg, rgba(251,249,252,0.4), transparent),
    var(--surface);
}

.bubble {
  max-width: min(78%, 360px);
  padding: 0.75rem 0.95rem;
  border-radius: 18px;
  animation: fadeSlide 0.25s ease;
}

.bubble p {
  margin: 0;
  word-break: break-word;
}

.bubble time {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.72rem;
  opacity: 0.65;
}

.bubble.mine {
  align-self: flex-end;
  background: white;
  border: 1.5px solid var(--border);
  border-bottom-right-radius: 6px;
}

.bubble.theirs {
  align-self: flex-start;
  background: linear-gradient(135deg, rgba(244,192,209,0.55), rgba(206,203,246,0.55));
  border-bottom-left-radius: 6px;
}

.chat-composer {
  display: flex;
  gap: 0.65rem;
  padding: 0.9rem 1rem;
  border-top: 1px solid var(--border);
}

.chat-composer input { flex: 1; }

.toast {
  padding: 0.85rem 1rem;
  border-radius: 14px;
  margin-bottom: 1rem;
  font-weight: 600;
  animation: fadeSlide 0.35s ease;
}

.toast-success {
  background: rgba(159, 225, 203, 0.45);
  color: #1f6b55;
}

.toast-error {
  background: rgba(244, 192, 209, 0.55);
  color: #8a3a55;
}

.admin-table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  text-align: left;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.admin-table th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.admin-thumb {
  width: 56px;
  height: 40px;
  border-radius: 10px;
  background-size: cover;
  background-position: center;
  background-color: var(--purple);
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 600;
}

@media (max-width: 640px) {
  .topbar { padding: 0.85rem 1rem; }
  .section-head { flex-direction: column; }
  .venue-hero { height: 180px; }
  .gender-grid { grid-template-columns: 1fr; }
  .time-row { grid-template-columns: 1fr; }
  .chat-shell { min-height: 360px; }
  .chat-messages { max-height: 320px; }
  .user-row { flex-wrap: wrap; }
}
