/* Data Explorer — admin report styles */
/* Nav tabs, date range form, chart containers, CSV links, table sections */

/* --------------------------------------------------------------------------- */
/* Sub-navigation tabs */
/* --------------------------------------------------------------------------- */
.data-explorer-nav {
  border-bottom: 2px solid var(--border-gray);
  margin-bottom: 1.5rem;
}
.data-explorer-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0;
  list-style: none;
  margin: 0;
  padding: 0;
}
.data-explorer-nav li {
  margin-bottom: -2px; /* overlap the border */
}
.data-explorer-nav a {
  border-bottom: 2px solid transparent;
  color: var(--gray);
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  text-decoration: none;
}
.data-explorer-nav a:hover {
  color: var(--dark-gray);
}
.data-explorer-nav a.active {
  border-bottom-color: var(--light-blue);
  color: var(--light-blue);
}

/* --------------------------------------------------------------------------- */
/* Date range form */
/* --------------------------------------------------------------------------- */
.data-explorer-form {
  background-color: var(--faint-gray);
  border-radius: 4px;
  margin-bottom: 1.5rem;
  padding: 1rem;
}

.data-explorer-form-fields {
  align-items: flex-end;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.data-explorer-form-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.data-explorer-form-field label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray);
}
.data-explorer-form-field input,
.data-explorer-form-field select {
  background-color: var(--white);
  border: 1px solid var(--border-gray);
  border-radius: 3px;
  font-size: 0.875rem;
  padding: 0.4rem 0.5rem;
}
.data-explorer-form-field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-position: right 0.5rem center;
  background-repeat: no-repeat;
  padding-right: 1.75rem;
}
.data-explorer-form-field input[type="date"] {
  appearance: auto;
  -moz-appearance: auto;
  -webkit-appearance: auto;
  color-scheme: light;
}
.data-explorer-form-field
  input[type="date"]::-webkit-calendar-picker-indicator {
  position: static;
  opacity: 1;
  cursor: pointer;
}
.data-explorer-form-field input:focus,
.data-explorer-form-field select:focus {
  box-shadow: inset 0 0 0 2px var(--light-blue);
  outline: none;
}
.data-explorer-form-field .btn {
  font-size: 0.875rem;
  padding: 0.4rem 1.25rem;
}

.data-explorer-presets {
  font-size: 0.75rem;
  margin: 0.75rem 0 0;
}
.data-explorer-presets a {
  color: var(--light-blue);
  text-decoration: none;
}
.data-explorer-presets a:hover {
  text-decoration: underline;
}

/* --------------------------------------------------------------------------- */
/* Chart container */
/* --------------------------------------------------------------------------- */
.data-explorer-chart {
  margin-bottom: 1.5rem;
  position: relative;
  width: 100%;
}

/* --------------------------------------------------------------------------- */
/* Table sections and CSV link */
/* --------------------------------------------------------------------------- */
.data-explorer-table-section {
  margin-bottom: 2rem;
}
.data-explorer-table-section h3 {
  margin: 0 0 0.5rem;
}
.data-explorer-table-section .admin-table {
  font-size: 0.875rem;
}

.csv-download-link {
  color: var(--light-blue);
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
}
.csv-download-link:hover {
  text-decoration: underline;
}
.csv-download-link::before {
  content: "\2193 "; /* ↓ */
}

/* --------------------------------------------------------------------------- */
/* Responsive */
/* --------------------------------------------------------------------------- */
@media only screen and (max-width: 600px) {
  .data-explorer-form-fields {
    flex-direction: column;
  }

  .data-explorer-table-section {
    overflow-x: auto;
  }
}
