:root {
  --page-size: 6;
}

.hero-panel,
.exp-card,
.stats-card,
.ranking-card,
.search-panel,
.pagination-panel {
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 1rem;
  backdrop-filter: blur(10px);
}

.hero-panel {
  overflow: hidden;
  position: relative;
}

.hero-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top right, rgba(255,193,7,.14), transparent 32%),
    radial-gradient(circle at left center, rgba(13,110,253,.08), transparent 28%);
  pointer-events: none;
}

.hero-panel .card-body,
.search-panel .card-body,
.stats-card .card-body,
.ranking-card .card-body,
.pagination-panel .card-body,
.exp-card .card-body {
  position: relative;
  z-index: 1;
}

.hero-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .75rem;
}

.hero-kpi {
  padding: .85rem 1rem;
  border-radius: .9rem;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
}

.hero-kpi strong {
  display: block;
  font-size: 1.2rem;
  line-height: 1.1;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1rem;
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1;
}

.search-input-wrap {
  position: relative;
}

.search-input-wrap .form-control {
  padding-left: 2.65rem;
  min-height: 46px;
}

.search-icon {
  position: absolute;
  left: .9rem;
  top: 50%;
  transform: translateY(-50%);
  opacity: .55;
  pointer-events: none;
}

.toolbar-row {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1rem;
  align-items: center;
  justify-content: space-between;
}

.toolbar-left,
.toolbar-right {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: center;
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.filter-pill {
  border: 1px solid rgba(255,255,255,.10);
  background: transparent;
  color: inherit;
  border-radius: 999px;
  padding: .45rem .8rem;
  font-size: .85rem;
}

.filter-pill.active {
  background: rgba(255,193,7,.14);
  border-color: rgba(255,193,7,.38);
}

.exp-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.exp-card {
  height: 100%;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.exp-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 .8rem 2rem rgba(0,0,0,.16);
  border-color: rgba(255,193,7,.20);
}

.exp-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: .85rem;
}

.exp-title {
  font-size: 1.08rem;
  font-weight: 700;
  margin-bottom: .4rem;
  overflow-wrap: anywhere;
}

.exp-desc {
  min-height: 3rem;
  overflow-wrap: anywhere;
}

.exp-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
  padding-top: .9rem;
  margin-top: .9rem;
  border-top: 1px solid rgba(255,255,255,.08);
}

.date-stack {
  display: flex;
  flex-direction: column;
  gap: .1rem;
}

.online-dot {
  display: inline-block;
  width: .55rem;
  height: .55rem;
  border-radius: 999px;
  margin-right: .35rem;
  vertical-align: middle;
  background: #6c757d;
  box-shadow: 0 0 0 .15rem rgba(108,117,125,.15);
}

.online-dot.is-online {
  background: #20c997;
  box-shadow: 0 0 0 .15rem rgba(32,201,151,.18);
}

.ranking-list {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.ranking-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  padding: .8rem .9rem;
  border-radius: .85rem;
  background: rgba(255,255,255,.035);
  border: 1px solid rgba(255,255,255,.06);
}

.ranking-pos {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  background: rgba(255,193,7,.14);
  color: #ffc107;
  flex: 0 0 auto;
}

.ranking-name {
  font-weight: 600;
  line-height: 1.1;
}

.ranking-sub {
  font-size: .82rem;
  opacity: .72;
}

.empty-state {
  padding: 2.5rem 1rem;
  text-align: center;
  border: 1px dashed rgba(255,255,255,.15);
  border-radius: 1rem;
  background: rgba(255,255,255,.02);
}

.section-note {
  font-size: .92rem;
  opacity: .75;
}

.pagination-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.pagination-controls {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
}

.page-btn {
  min-width: 42px;
  height: 42px;
  border-radius: .75rem;
  border: 1px solid rgba(255,255,255,.10);
  background: transparent;
  color: inherit;
  padding: 0 .85rem;
}

.page-btn.active {
  background: rgba(255,193,7,.14);
  border-color: rgba(255,193,7,.38);
  color: #ffc107;
}

.page-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.small-muted {
  font-size: .9rem;
  opacity: .75;
}

.map-panel {
  border-radius: 1rem;
}

.map-summary {
  min-width: 180px;
}

.upcoming-map-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}

.upcoming-map-actions .btn {
  min-width: 4.2rem;
  white-space: nowrap;
}

.upcoming-map-shell {
  position: relative;
  min-height: 460px;
  border-radius: 1rem;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
}

#upcoming-expeditions-map {
  position: relative;
  min-height: 460px;
  width: 100%;
  overflow: hidden;
  background: #07111f;
}

#upcoming-expeditions-map.qsolab-maplibre-map {
  background: transparent;
}

.upcoming-map-empty {
  position: absolute;
  inset: auto 1rem 1rem 1rem;
  padding: .9rem 1rem;
  border-radius: .9rem;
  backdrop-filter: blur(12px);
  background: rgba(10,14,22,.78);
  border: 1px solid rgba(255,255,255,.08);
  color: rgba(255,255,255,.86);
  font-size: .92rem;
  pointer-events: none;
  z-index: 500;
}

.upcoming-map-empty.is-hidden {
  display: none;
}

.upcoming-map-popup-title {
  font-weight: 700;
  margin-bottom: .25rem;
}

.upcoming-map-popup-meta {
  font-size: .82rem;
  color: #6c757d;
  margin-bottom: .4rem;
}

html[data-bs-theme="light"] .upcoming-map-shell {
  background: rgba(248,249,250,.9);
  border-color: rgba(15,23,42,.08);
}

html[data-bs-theme="light"] .upcoming-map-empty {
  background: rgba(255,255,255,.92);
  border-color: rgba(15,23,42,.10);
  color: #334155;
}

@media (max-width: 1399.98px) {
  .stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1199.98px) {
  .hero-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 991.98px) {
  .exp-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 575.98px) {
  .hero-kpis,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .exp-footer,
  .pagination-wrap {
    flex-direction: column;
    align-items: stretch;
  }

  .upcoming-map-actions {
    justify-content: flex-start;
  }

  .upcoming-map-actions .btn {
    flex: 0 0 auto;
  }

  .exp-meta,
  .exp-footer,
  .date-stack {
    min-width: 0;
  }

  .upcoming-map-shell,
  #upcoming-expeditions-map {
    min-height: 380px;
  }
}
