/* ── Reset & Variables ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #f5f6f8;
  --surface:     #ffffff;
  --nav-bg:      #ffffff;
  --border:      #e8eaed;
  --text-primary:#1a1a2e;
  --text-muted:  #8a8fa8;
  --accent:      rgb(60, 60, 60);
  --accent-hover:#000000;
  --badge-bg:    #e8eeff;
  --badge-text:  #3b5bdb;
  --green:       #22c55e;
  --red:         #ef4444;
  --blue:        #3b82f6;
  --shadow-sm:   0 1px 3px rgba(0,0,0,.08);
  --shadow-md:   0 8px 16px rgba(0,0,0,.10);
  --shadow-lg:   0 16px 40px rgba(0,0,0,.13);
  --radius:      12px;
  --radius-sm:   6px;
  --nav-h:       62px;
  font-family: ui-sans-serif,system-ui;
}

body {
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
}

/* ── Nav ─────────────────────────────────────────────────────────────────── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-logo {
  width: 40px;
  height: 40px;
  background: #2b3de7;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-logo svg {
  width: 22px;
  height: 22px;
  stroke: white;
  fill: none;
  stroke-width: 2;
}

.nav-brand-text h1 {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.3px;
  color: var(--text-primary);
}

.nav-brand-text p {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 1px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-icon-btn {
  position: relative;
  width: 38px;
  height: 38px;
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: background .15s, color .15s;
}

.nav-icon-btn:hover {
  background: var(--bg);
  color: var(--text-primary);
}

.nav-icon-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
}

.notif-dot {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 17px;
  height: 17px;
  background: #ef4444;
  border-radius: 50%;
  border: 2px solid var(--nav-bg);
  font-size: 9px;
  font-weight: 700;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px 5px 5px;
  border-radius: 20px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background .15s;
  background: transparent;
  margin-left: 4px;
}

.user-chip:hover { background: var(--bg); }

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #9333ea;
  color: white;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-chip-text { display: flex; flex-direction: column; line-height: 1; }
.user-chip-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.user-chip-rating { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.user-chip-caret { color: var(--text-muted); font-size: 10px; margin-left: 2px; }

/* Notification Panel */
.notif-panel {
  position: absolute;
  top: calc(var(--nav-h) + 6px);
  right: 120px;
  width: 280px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 12px 0;
  z-index: 200;
  animation: fadeDown .15s ease;
}

.notif-panel.hidden { display: none; }

@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.notif-header {
  padding: 4px 16px 10px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.notif-item {
  padding: 10px 16px;
  font-size: 13px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .12s;
}

.notif-item:hover { background: var(--bg); }
.notif-item:last-child { border-bottom: none; }
.notif-item small { display: block; font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.notif-empty {
  padding: 18px 16px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 56px 24px 40px;
}

.hero h2 {
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 800;
  letter-spacing: -.5px;
  color: var(--text-primary);
}

.hero p {
  margin-top: 10px;
  font-size: 15px;
  color: var(--text-muted);
}

/* ── Main ─────────────────────────────────────────────────────────────────── */
main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 28px 60px;
}

/* ── Section Header ───────────────────────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 24px;
}

.section-title { font-size: 19px; font-weight: 700; }
.section-sub   { font-size: 13px; color: var(--text-muted); margin-top: 3px; }

.count-badge {
  background: var(--badge-bg);
  color: var(--badge-text);
  font-size: 13px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.count-badge::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--badge-text);
}

/* ── Cards Grid ───────────────────────────────────────────────────────────── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 22px;
}

/* ── Event Card ───────────────────────────────────────────────────────────── */
.event-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow .2s, transform .2s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.event-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

/* Card image */
.card-image {
  position: relative;
  height: 195px;
  background-size: cover;
  background-position: center;
  background-color: #dbeafe;
  flex-shrink: 0;
}

.card-image--placeholder {
  background: linear-gradient(135deg, #2b3de7 0%, #6366f1 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.card-image--placeholder svg {
  width: 44px;
  height: 44px;
  stroke: rgba(255,255,255,.7);
}

.placeholder-label {
  font-size: 18px;
  font-weight: 700;
  color: white;
}

.placeholder-sub {
  font-size: 13px;
  color: rgba(255,255,255,.65);
}

.card-date {
  position: absolute;
  bottom: 10px;
  left: 12px;
  background: rgba(0,0,0,.55);
  color: white;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  backdrop-filter: blur(4px);
}

/* Card body */
.card-body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.card-row--meta {
  justify-content: flex-start;
  gap: 10px;
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.airport-badge {
  font-size: 11.5px;
  font-weight: 700;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: .5px;
}

.card-meta-date {
  font-size: 12px;
  color: var(--text-muted);
}

.card-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.55;
  flex: 1;
}

/* Status icons */
.status-icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.status-icon svg {
  width: 20px;
  height: 20px;
}

.status-registered { color: var(--green); }
.status-declined   { color: var(--red); }
.status-upcoming   { color: var(--blue); }

/* Card button */
.card-btn {
  margin-top: 4px;
  padding: 8px 0;
  width: 100%;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, box-shadow .15s;
}

.card-btn--register {
  background: rgb(60, 60, 60);
  color: white;
}

.card-btn--register:hover {
  background: #000;
  box-shadow: var(--shadow-md);
}

.card-btn--withdraw {
  background: #fee2e2;
  color: #b91c1c;
}

.card-btn--withdraw:hover {
  background: #fecaca;
  box-shadow: var(--shadow-sm);
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  nav { padding: 0 14px; }
  main { padding: 0 14px 40px; }
  .hero { padding: 36px 14px 28px; }
  .notif-panel { right: 14px; }
  .user-chip-text { display: none; }
}
/* ── User chip dropdown ────────────────────────────────────────────────────── */
.user-chip { position: relative; }

.user-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: var(--surface, #fff);
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,.14);
  min-width: 220px;
  z-index: 200;
  overflow: hidden;
}

.user-dropdown.hidden { display: none; }

.user-dropdown-header {
  padding: 14px 16px 12px;
  border-bottom: 1px solid #e2e8f0;
}

.user-dropdown-name   { font-weight: 700; font-size: 15px; color: #0f172a; }
.user-dropdown-cid    { font-size: 12px; color: #64748b; margin-top: 2px; }
.user-dropdown-rating { font-size: 12px; color: #64748b; }

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  color: #334155;
  text-align: left;
  transition: background .1s;
}
.user-dropdown-item:hover { background: #f1f5f9; }
.user-dropdown-item svg { width: 16px; height: 16px; flex-shrink: 0; }

.admin-panel-btn { color: #2b3de7; font-weight: 600; }
.logout-btn      { color: #c0392b; }

/* ── Admin modal ──────────────────────────────────────────────────────────── */
.admin-modal {
  width: min(900px, 95vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.admin-modal-body {
  overflow-y: auto;
  padding: 0 24px 24px;
  flex: 1;
}

.admin-section { margin-top: 16px; }
.admin-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.admin-section-header h3 { font-size: 16px; font-weight: 700; color: #0f172a; }

.admin-event-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin-bottom: 8px;
  background: #f8fafc;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-event-info  { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.admin-event-actions { display: flex; gap: 8px; }

.admin-btn {
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #fff;
  font-size: 13px;
  cursor: pointer;
  font-weight: 500;
  transition: background .1s;
}
.admin-btn:hover     { background: #f1f5f9; }
.admin-btn--create   { background: #2b3de7; color: #fff; border-color: #2b3de7; }
.admin-btn--create:hover { background: #1f2ec4; }
.admin-btn--del      { color: #c0392b; border-color: #fca5a5; }
.admin-btn--del:hover { background: #fef2f2; }
.admin-btn--edit     { color: #2b3de7; }
.admin-btn--regs     { color: #16a34a; border-color: #86efac; }
.admin-btn--save-reg { background: #16a34a; color: #fff; border-color: #16a34a; }
.admin-btn--save-reg:hover { background: #15803d; }

.admin-event-form {
  margin-top: 20px;
  padding: 20px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
}
.admin-event-form h3 { font-size: 16px; font-weight: 700; margin-bottom: 16px; color: #0f172a; }
.admin-event-form.hidden { display: none; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }

.stations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
  margin-top: 6px;
}
.stations-grid > div { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; color: #475569; }

/* Registrations table */
.reg-status-sel {
  font-size: 12px;
  padding: 2px 4px;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
}
