/* STATS view: the original #stats-v inline layout, plus its card, ranking column and metrics explorer rules. */
#stats-v .stats-header {
  background: var(--c-grey-222);
  color: var(--c-orange-stats);
  padding: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#stats-month-select {
  background: var(--c-black);
  color: var(--c-orange-stats);
  border: 1px solid var(--c-orange-stats);
  font-family: monospace;
  padding: 3px 8px;
  font-size: 0.8rem;
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

#stats-dashboard {
  padding: 15px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
}

#stats-rankings {
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 15px;
  margin-top: 5px;
}

#stats-rankings-extra,
#stats-rankings-airports {
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 15px;
  margin-top: 15px;
}

.stats-none {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--c-grey-666);
}

/*
 * The !important flags are kept from the original: they outrank the inline border colours on cards and ranking
 * headers, so the card top border takes the text colour and ranking headers keep a #222 underline.
 */
.leader-col {
  background: var(--c-grey-050505) !important;
  border: 1px solid var(--c-grey-111) !important;
  border-radius: 4px !important;
  overflow: hidden !important;
  box-shadow: 0 0 15px rgba(0,0,0,0.5) !important;
  height: fit-content !important;
  margin-bottom: 10px;
}

.leader-col .section-header {
  position: relative !important;
  border-top: none !important;
  border-bottom: 2px solid var(--c-grey-222) !important;
  margin-top: 0 !important;
}

.stats-card {
  background: var(--c-grey-050505) !important;
  border: 1px solid var(--c-grey-111) !important;
  border-radius: 4px !important;
  padding: 18px 12px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6) !important;
  border-top: 3px solid !important;
  cursor: pointer !important;
  transition: all 0.2s ease-in-out !important;
}

.stats-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.8) !important;
}

.stats-card-val {
  font-size: 2.1rem !important;
  font-weight: bold !important;
  margin-bottom: 6px !important;
  font-family: var(--font-mono) !important;
}

.stats-card-lbl {
  font-size: 0.6rem !important;
  color: var(--c-grey-888) !important;
  text-transform: uppercase !important;
  letter-spacing: 1px !important;
  font-weight: bold !important;
}

#stats-modal-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: none;
  z-index: 7000;
}

#stats-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--c-grey-080808);
  padding: 20px;
  border: 2px solid var(--c-orange-stats);
  border-radius: 6px;
  display: none;
  z-index: 7001;
  width: 92%;
  max-width: 950px;
  height: 82%;
  max-height: 650px;
  flex-direction: column;
  color: var(--c-white);
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.85);
  font-family: var(--font-mono);
}

.stats-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--c-grey-333);
  padding-bottom: 12px;
  margin-bottom: 15px;
  flex-shrink: 0;
}

#stats-modal-title {
  margin: 0;
  font-size: 1.3rem;
  letter-spacing: 1.5px;
  font-weight: bold;
  text-transform: uppercase;
}

.stats-modal-close {
  background: var(--c-grey-111);
  border: 1px solid var(--c-grey-444);
  color: var(--c-white);
  padding: 6px 14px;
  cursor: pointer;
  border-radius: 3px;
  font-family: inherit;
  font-size: 0.85rem;
  transition: all 0.2s;
  font-weight: bold;
  text-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
}

#stats-modal-content {
  flex-grow: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-right: 5px;
}
