:root {
  --bg: #0b1220;
  --card: #101829;
  --muted: #99a2b3;
  --text: #eef2f8;
  --primary: #4da3ff;
  --primary-600: #2f83df;
  --border: #1f2a44;
  --ok: #31c48d;
  --warn: #f59e0b;
  --err: #ef4444;
  --sidebar-width: 270px;
}

* {
  box-sizing: border-box
}

html,
body {
  min-height: 100%;
  overflow-x: hidden;
  overscroll-behavior-x: none;
  background-color: #000;
  -webkit-overflow-scrolling: touch;
}


body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Inter, Arial, sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #0a0f1a, #0c1220 30%, #0b1220);
  transition: transform .3s ease;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.with-sidebar {
  position: relative
}

main {
  flex: 1 0 auto;
  width: 100%
}

a {
  color: var(--primary);
  text-decoration: none
}

a:hover {
  text-decoration: underline
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 16px
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.menu-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(12, 20, 40, .78);
  color: var(--text);
  cursor: pointer;
  transition: background .3s ease, border-color .3s ease;
}

.menu-toggle:hover {
  background: rgba(12, 20, 40, .92);
  border-color: var(--primary)
}

.menu-toggle__bar {
  display: block;
  width: 24px;
  height: 2px;
  border-radius: 1px;
  background: var(--text);
  transition: transform .3s ease, opacity .3s ease;
}

.menu-toggle__bar:nth-of-type(1),
.menu-toggle__bar:nth-of-type(3) {
  transform-origin: center
}

body.sidebar-open .menu-toggle__bar:nth-of-type(1) {
  transform: translateY(8px) rotate(45deg)
}

body.sidebar-open .menu-toggle__bar:nth-of-type(2) {
  opacity: 0
}

body.sidebar-open .menu-toggle__bar:nth-of-type(3) {
  transform: translateY(-8px) rotate(-45deg)
}

body.sidebar-open .menu-toggle {
  opacity: 0;
  pointer-events: none
}

.site-topbar {
  position: sticky;
  top: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  background: rgba(9, 14, 25, .96);
  backdrop-filter: blur(12px);
}

.site-topbar__brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}

.site-topbar__brand-link:hover {
  text-decoration: none
}

.site-topbar__logo {
  width: 30px;
  height: 30px;
  border-radius: 6px
}

.site-topbar__title {
  font-size: 18px;
  font-weight: 600
}

.site-sidebar__logo-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
}

.site-sidebar__logo-link:hover {
  text-decoration: none
}

.site-sidebar__logo-link img {
  border-radius: 6px
}

.sidebar-reveal {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 20px;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  z-index: 1000;
}

.sidebar-reveal:focus-visible {
  outline: 2px solid var(--primary);
}

body.sidebar-open .sidebar-reveal {
  visibility: hidden;
  pointer-events: none;
}

.site-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1200;
  width: 270px;
  padding: 26px 22px 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid var(--border);
  background: rgba(9, 14, 25, .94);
  backdrop-filter: blur(14px);
  transform: translateX(-100%);
  transition: transform .3s ease;
}

body.sidebar-open .site-sidebar {
  transform: translateX(0)
}

.site-sidebar__scroll {
  display: flex;
  flex-direction: column;
  gap: 28px;
  overflow-y: auto;
  max-height: calc(100% - 80px)
}

.site-sidebar__brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 22px;
  font-weight: 600;
}

.sidebar-handle {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(12, 20, 40, .75);
  color: var(--text);
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease;
}

.sidebar-handle:hover {
  background: rgba(12, 20, 40, .92);
  border-color: var(--primary)
}

.sidebar-handle__bar {
  display: none
}

.sidebar-handle::before,
.sidebar-handle::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
}

.sidebar-handle::before {
  transform: rotate(45deg)
}

.sidebar-handle::after {
  transform: rotate(-45deg)
}

.site-sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 8px
}

.sidebar-link {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text);
  font-weight: 500;
  transition: background .2s ease, color .2s ease;
}

.sidebar-link:hover {
  background: rgba(77, 163, 255, .1);
  text-decoration: none
}

.sidebar-link.is-active {
  background: rgba(77, 163, 255, .16);
  color: var(--primary)
}

.sidebar-link--icon {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
}

.sidebar-link__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: inherit
}

.sidebar-link--danger {
  color: #fca5a5
}

.sidebar-link--danger:hover {
  color: #f87171;
  background: rgba(248, 113, 113, .15)
}

.sidebar-link--muted {
  color: var(--muted);
  font-size: 14px
}

.sidebar-link--muted:hover {
  color: var(--text)
}

.site-sidebar__footer {
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, .05);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.site-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1098;
  background: rgba(3, 6, 12, .55);
  backdrop-filter: blur(4px);
  transition: opacity .3s ease;
}

.site-backdrop[hidden] {
  opacity: 0;
  pointer-events: none
}

.site-backdrop:not([hidden]) {
  opacity: 1
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 18px 0;
  text-align: center;
  color: var(--muted);
  margin-top: auto;
  flex-shrink: 0;
}

.hero {
  padding: 80px 0;
  text-align: center
}

.hero h2 {
  font-size: 34px;
  margin: 0 0 8px
}

.hero p {
  color: var(--muted);
  margin: 0 0 20px
}

.cta {
  display: flex;
  gap: 12px;
  justify-content: center
}


.auth-wrapper {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px
}

.card {
  width: min(460px, 92vw);
  background: linear-gradient(180deg, #111a2e, #0f1830);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .35)
}

.card h2 {
  margin: 6px 0 14px
}

.field {
  margin-bottom: 14px
}

.field.inline {
  display: flex;
  align-items: center;
  justify-content: space-between
}

.field label {
  display: block;
  margin-bottom: 6px;
  color: #cdd6e6;
  font-size: 14px
}

input,
select {
  width: 100%;
  padding: 12px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #0c1428;
  color: var(--text);
  outline: none;
  transition: border-color .2s
}

input:focus,
select:focus {
  border-color: var(--primary)
}

.checkbox {
  display: flex;
  gap: 10px;
  align-items: center;
  cursor: pointer;
  user-select: none
}

.checkbox input {
  width: auto
}

.small-link {
  font-size: 14px;
  color: var(--muted)
}

.error {
  display: block;
  min-height: 16px;
  font-size: 12px;
  color: var(--err);
  margin-top: 6px
}

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

@media (max-width:640px) {
  .grid-2 {
    grid-template-columns: 1fr
  }
}

.btn {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 10px;
  border: 2px solid var(--primary-600);
  background: var(--primary-600);
  color: #fff;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  transition: background .2s, color .2s, border-color .2s, box-shadow .2s;
}

.btn:hover {
  background: #fff;
  color: var(--primary-600);
  border-color: var(--primary-600);
  box-shadow: 0 4px 16px rgba(77, 163, 255, 0.18);
  text-decoration: none;
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--primary-600);
  color: var(--primary-600);
  font-weight: 700;
}

.btn-outline:hover {
  background: var(--primary-600);
  color: #fff;
  border-color: var(--primary-600);
}

.btn-lg {
  padding: 12px 16px;
  width: 100%
}

.btn-sm {
  padding: 8px 12px;
  font-size: 14px
}

.muted {
  color: var(--muted)
}

.form-alert {
  margin-top: 12px;
  padding: 10px;
  border-radius: 10px;
  font-size: 14px;
  border: 1px solid var(--border);
  background: #0c1428
}

.form-alert.ok {
  border-color: rgba(49, 196, 141, .4);
  color: #a7f3d0
}

.form-alert.err {
  border-color: rgba(239, 68, 68, .4);
  color: #fecaca
}

.oauth-separator {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  color: var(--muted);
  font-size: 14px;
}

.oauth-separator::before,
.oauth-separator::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  border-radius: 10px;
  background: #fff;
  color: #333;
  font-weight: 600;
  font-size: 15px;
  border: 1px solid #ddd;
  cursor: pointer;
  transition: background .2s, box-shadow .2s;
  text-decoration: none;
}

.btn-google:hover {
  background: #f5f5f5;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
  text-decoration: none;
}

.user-location-marker {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #4285f4;
  border: 3px solid #fff;
  box-shadow: 0 0 0 4px rgba(66, 133, 244, .3);
  animation: userLocPulse 2s infinite;
}

@keyframes userLocPulse {

  0%,
  100% {
    box-shadow: 0 0 0 4px rgba(66, 133, 244, .3)
  }

  50% {
    box-shadow: 0 0 0 10px rgba(66, 133, 244, .1)
  }
}

.no-link {
  color: inherit;
  text-decoration: none;
}

.no-link:hover {
  text-decoration: none;
  color: white;
}

@media (max-width: 768px) {
  body.sidebar-open {
    overflow: hidden
  }
}

@media (min-width: 900px) {
  .site-backdrop {
    display: none
  }

  body.with-sidebar.sidebar-open {
    padding-left: var(--sidebar-width)
  }

  body.with-sidebar.sidebar-open main,
  body.with-sidebar.sidebar-open .auth-wrapper,
  body.with-sidebar.sidebar-open .site-footer {
    margin-left: 0;
    width: 100%;
  }
}

/* -------------------------------------------------------
   ADMIN PANEL STYLES
   ------------------------------------------------------- */

.admin-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.admin-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-card__value {
  font-size: 32px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.1;
}

.stat-card__label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.stat-card__detail {
  font-size: 12px;
  color: var(--muted);
}

.admin-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.admin-table th {
  text-align: left;
  padding: 10px 12px;
  color: var(--muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.admin-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, .05);
  white-space: nowrap;
}

.admin-table tbody tr:hover {
  background: rgba(77, 163, 255, .04);
}

.admin-search {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.admin-search__form {
  display: flex;
  gap: 8px;
  flex: 1;
  min-width: 200px;
}

.admin-search__input {
  flex: 1;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 14px;
  outline: none;
}

.admin-search__input:focus {
  border-color: var(--primary);
}

.admin-search__filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

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

.inline-form {
  display: inline
}

.admin-select {
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}

.admin-pagination {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 20px;
}

.admin-pagination__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 14px;
  text-decoration: none;
}

.admin-pagination__link:hover {
  border-color: var(--primary);
  text-decoration: none;
}

.admin-pagination__link.is-active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* Badges */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  background: rgba(255, 255, 255, .08);
  color: var(--muted);
}

.badge:hover {
  text-decoration: none
}

.badge--student {
  color: #4da3ff;
  background: rgba(77, 163, 255, .12)
}

.badge--organizer {
  color: #a78bfa;
  background: rgba(167, 139, 250, .12)
}

.badge--admin {
  color: #ef4444;
  background: rgba(239, 68, 68, .12)
}

.badge--active {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

/* Buttons */
.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
  border-radius: 8px;
}

.btn-danger {
  background: rgba(239, 68, 68, .15);
  color: var(--err);
  border: 1px solid rgba(239, 68, 68, .3);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, .25);
}

/* Download app button */
.btn-download-app {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  margin-bottom: 10px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(77, 163, 255, .15), rgba(47, 131, 223, .1));
  border: 1px solid rgba(77, 163, 255, .3);
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background .2s, border-color .2s;
}

.btn-download-app:hover {
  background: linear-gradient(135deg, rgba(77, 163, 255, .25), rgba(47, 131, 223, .18));
  border-color: var(--primary);
  text-decoration: none;
}

.btn-download-app svg {
  flex-shrink: 0
}

@media (max-width: 768px) {
  .admin-grid {
    grid-template-columns: repeat(2, 1fr)
  }

  .admin-grid-2 {
    grid-template-columns: 1fr
  }

  .admin-search {
    flex-direction: column;
    align-items: stretch
  }

  .admin-search__form {
    width: 100%
  }

  .admin-actions-cell {
    flex-wrap: wrap
  }
}

/* ============================================
   MAPBOX POPUP STYLES (GLOBAL)
   ============================================ */
.mapboxgl-popup-content {
  background: rgba(16, 24, 41, 0.95) !important;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px !important;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5) !important;
  padding: 14px 16px !important;
}

.mapboxgl-popup-tip {
  border-top-color: rgba(16, 24, 41, 0.95) !important;
}

.mapboxgl-popup-close-button {
  color: var(--muted) !important;
  font-size: 18px;
}

.mapboxgl-popup-close-button:hover {
  color: var(--text) !important;
  background: transparent !important;
}

.events-map__popup h3 {
  margin: 0 0 8px;
  font-size: 18px;
  color: var(--text);
  font-weight: 700
}

.events-map__popup p {
  margin: 0 0 6px;
  font-size: 14px;
  color: var(--muted)
}

.events-map__popup strong {
  color: var(--text)
}

.events-map__popup-link {
  color: #4da3ff;
  font-weight: 600
}

.events-map__popup-link:hover {
  text-decoration: underline
}

.events-map__popup-link--primary {
  display: inline-block;
  background: #4da3ff;
  color: #061326 !important;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-top: 4px;
}

.events-map__popup-link--primary:hover {
  background: #2f83df;
  text-decoration: none;
}