/* =========================================
   NOCTURNE 21 - STATS DASHBOARD
   ========================================= */

.stats-page {
  margin: 0;
  color: #e8ecf4;
  font-family: "Open Sans", sans-serif;
}


/* MAIN WRAPPER */

.stats-dashboard {
  width: min(1400px, calc(100% - 40px));
  margin: 40px auto 80px;
}


/* PAGE HEADING */

.stats-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 28px;
}

.stats-heading h1 {
  margin: 0 0 6px;
  font-family: "Lacquer Regular", sans-serif;
  font-size: clamp(34px, 5vw, 56px);
  font-weight: normal;
  color: #ffffff;
}

.stats-heading p {
  margin: 0;
  color: #aeb7c6;
  font-size: 15px;
}


/* RANGE SELECT */

.stats-range {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #aeb7c6;
  font-size: 14px;
}

.stats-range select {
  background: #121821;
  color: #e8ecf4;
  border: 1px solid #303846;
  border-radius: 6px;
  padding: 10px 14px;
  font: inherit;
}


/* SECTIONS */

.stats-section {
  margin-bottom: 28px;
}

.stats-section h2,
.stats-panel h2 {
  margin: 0 0 18px;
  font-family: "Lacquer Regular", sans-serif;
  font-size: 24px;
  font-weight: normal;
  color: #f5f5f5;
}


/* SUMMARY CARDS */

.stats-card-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.stats-card {
  min-height: 125px;
  padding: 20px;

  background:
    linear-gradient(
      145deg,
      rgba(24, 31, 42, 0.97),
      rgba(12, 16, 23, 0.97)
    );

  border: 1px solid #303846;
  border-radius: 8px;

  box-shadow:
    0 12px 25px rgba(0, 0, 0, 0.25);
}

.stats-card::before {
  content: "";
  display: block;

  width: 34px;
  height: 3px;

  margin-bottom: 16px;

  background: #8e1d2c;
}

.stats-card-label {
  display: block;

  margin-bottom: 8px;

  color: #aeb7c6;

  font-size: 13px;

  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stats-card strong {
  display: block;

  margin-bottom: 6px;

  color: #ffffff;

  font-size: 32px;
  line-height: 1;
}

.stats-card-note {
  color: #7f8998;
  font-size: 12px;
}


/* PANELS */

.stats-panel {
  padding: 22px;

  background:
    linear-gradient(
      145deg,
      rgba(20, 27, 37, 0.97),
      rgba(10, 14, 20, 0.97)
    );

  border: 1px solid #303846;
  border-radius: 8px;

  box-shadow:
    0 12px 25px rgba(0, 0, 0, 0.24);
}


/* LIVE TRAFFIC CHART */

.stats-chart-wrap {
  position: relative;

  width: 100%;
  height: 360px;

  padding: 10px 4px 0;
}

.stats-chart-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}


/* TWO COLUMN AREAS */

.stats-two-column {
  display: grid;
  grid-template-columns: 1fr 1fr;

  gap: 20px;

  margin-bottom: 28px;
}


/* SIMPLE LISTS */

.stats-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stats-list-row {
  display: flex;

  justify-content: space-between;
  align-items: center;

  gap: 16px;

  padding: 12px 14px;

  border-radius: 5px;

  background: #151c26;

  border: 1px solid #252d39;
}

.stats-list-row:hover {
  background: #19222e;
}

.stats-list-name {
  min-width: 0;

  color: #dce3ed;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stats-list-value {
  flex-shrink: 0;

  color: #9aa6b6;

  font-size: 13px;
}

.stats-loading {
  color: #758091;
  font-style: italic;
}


/* =========================================
   RECENT READER SESSIONS
   ========================================= */

.stats-session-heading {
  display: flex;

  justify-content: space-between;
  align-items: flex-start;

  margin-bottom: 18px;
}

.stats-session-heading h2 {
  margin-bottom: 5px;
}

.stats-session-heading p {
  margin: 0;

  color: #7f8998;

  font-size: 13px;
}


.stats-sessions {
  display: flex;
  flex-direction: column;

  gap: 14px;
}


/* ONE SESSION */

.stats-session-card {
  padding: 18px;

  background:
    linear-gradient(
      145deg,
      rgba(23, 30, 41, 0.94),
      rgba(14, 19, 27, 0.94)
    );

  border: 1px solid #2b3441;
  border-radius: 7px;
}


/* HEADER */

.stats-session-top {
  display: flex;

  justify-content: space-between;
  align-items: flex-start;

  gap: 18px;

  margin-bottom: 12px;
}

.stats-session-reader {
  display: flex;
  flex-direction: column;

  gap: 3px;
}

.stats-session-reader strong {
  color: #f0f3f8;

  font-size: 16px;
}

.stats-session-type {
  color: #a55162;

  font-size: 12px;

  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.stats-session-count {
  color: #d6dde7;

  font-size: 14px;

  white-space: nowrap;
}


/* META */

.stats-session-meta {
  display: flex;
  flex-wrap: wrap;

  gap: 8px 15px;

  margin-bottom: 14px;

  color: #7f8998;

  font-size: 12px;
}

.stats-session-meta span {
  display: inline-block;
}


/* PATH */

.stats-session-path {
  padding: 13px 14px;

  background: rgba(9, 13, 19, 0.7);

  border: 1px solid #242c37;
  border-radius: 5px;

  color: #c7d0dc;

  font-size: 13px;
  line-height: 1.8;

  overflow-wrap: anywhere;
}

.stats-session-path .stats-arrow {
  color: #8e1d2c;

  padding: 0 4px;
}


/* SUBTLE RED ACCENT */

.stats-panel,
.stats-card {
  position: relative;
  overflow: hidden;
}

.stats-panel::after,
.stats-card::after {
  content: "";

  position: absolute;
  inset: 0;

  pointer-events: none;

  background:
    linear-gradient(
      110deg,
      rgba(142, 29, 44, 0.035),
      transparent 32%
    );
}


/* TABLET */

@media (max-width: 1050px) {

  .stats-card-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stats-card:last-child {
    grid-column: span 2;
  }
}


/* MOBILE */

@media (max-width: 700px) {

  .stats-dashboard {
    width: calc(100% - 24px);
    margin-top: 24px;
  }

  .stats-heading {
    flex-direction: column;
    align-items: stretch;
  }

  .stats-range {
    justify-content: space-between;
  }

  .stats-range select {
    flex: 1;
  }

  .stats-card-grid {
    grid-template-columns: 1fr;
  }

  .stats-card:last-child {
    grid-column: auto;
  }

  .stats-two-column {
    grid-template-columns: 1fr;
  }

  .stats-chart-wrap {
    height: 280px;
  }

  .stats-card strong {
    font-size: 28px;
  }

  .stats-session-top {
    flex-direction: column;
    gap: 7px;
  }

  .stats-session-meta {
    flex-direction: column;
    gap: 4px;
  }
}
