:root {
  --text-color: #222;
}

.dark-mode {
  --text-color: #f5f5f5;
}

.filter .options-container {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: rgba(30, 33, 37, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  margin-top: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  padding: 0;
}

.filter .search-input {
  width: 100%;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 8px;
  margin: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.9);
  font-size: 13px;
  border-radius: 0;
  height: auto;
}

.filter .search-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.filter .search-input:focus {
  outline: none;
  box-shadow: none;
  border-color: rgba(255, 255, 255, 0.2);
}

.filter .options-list {
  max-height: 200px;
  overflow-y: auto;
  padding: 0;
  margin: 0;
}

.filter .option {
  display: flex;
  align-items: center;
  padding: 6px 8px;
  cursor: pointer;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
  margin: 0;
  background: transparent;
}

.filter .option:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.filter .option input[type="checkbox"] {
  margin-right: 8px;
  margin-bottom: 0;
  height: 14px;
  width: 14px;
  min-width: 14px;
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  position: relative;
  cursor: pointer;
  padding: 0;
}

.filter .option input[type="checkbox"]:checked {
  background: #3291ff;
  border-color: #3291ff;
}

.filter .option input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.filter .option input[type="checkbox"]:hover {
  border-color: rgba(255, 255, 255, 0.5);
}

.filter .select-header-container {
  display: flex;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  background-color: rgba(255, 255, 255, 0.05);
  margin: 0;
  padding: 0;
}

.filter .select-header {
  flex: 1;
  padding: 6px 8px;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
  background: transparent;
}

.filter .clear-button {
  padding: 6px 8px;
  font-size: 16px;
  line-height: 1;
  color: rgba(255, 255, 255, 0.4);
  background: none;
  border: none;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  margin: 0;
}

.filter .clear-button:hover {
  color: #ff4444;
  background-color: rgba(255, 255, 255, 0.05);
}

.filter .option.hidden {
  display: none;
}

  .filter .options-container {
    background: white;
    border: 1px solid #ddd;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  }

  .filter .search-input {
    border-bottom: 1px solid #eee;
    color: var(--text-color);
  }

  .filter .search-input::placeholder {
    color: #999;
  }

  .filter .option {
    color: var(--text-color);
  }

  .filter .option:hover {
    background-color: #f5f5f5;
  }

  .filter .select-header-container {
    border: 1px solid #ddd;
    background-color: white;
  }

  .filter .select-header {
    color: #666;
  }

  .filter .clear-button {
    color: #666;
    border-left: 1px solid #ddd;
  }

  .filter .clear-button:hover {
    color: #ff4444;
    background-color: rgba(0, 0, 0, 0.05);
  }

  .filter .option input[type="checkbox"] {
    border: 1px solid rgba(0, 0, 0, 0.2);
    background: rgba(0, 0, 0, 0.05);
  }

  .filter .option input[type="checkbox"]:checked {
    background: #3291ff;
    border-color: #3291ff;
  }

  .filter .option input[type="checkbox"]:hover {
    border-color: rgba(0, 0, 0, 0.4);
  }


.dashboard-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: 100%;
}

.dashboard-wrapper .loading-message {
  opacity: 0;
  text-align: center;
  transition: opacity 0.2s ease;
}

.loading .dashboard-wrapper .loading-message {
  opacity: 1;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.5;
  }
}

.dashboard-wrapper .stats-section {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
}

.dashboard-wrapper .dashboard-grid {
  display: grid;
  grid-template-columns: 50% 50%;
  gap: 0.5rem;
  width: 100%;
}

.dashboard-wrapper .stat-card {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  padding: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: transform 0.2s ease;
  height: 100%;
}

.dashboard-wrapper .stat-label {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.5rem;
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.dashboard-wrapper .stat-value {
  font-size: 1rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
}

.dashboard-wrapper .card {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}

.dashboard-wrapper .card h2 {
  margin-bottom: 1rem;
  font-size: 1.1rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
}

.dashboard-wrapper .chart-container {
  flex: 1;
  position: relative;
  height: 140px;
}

.dashboard-wrapper .chart-container canvas {
  max-height: 100%;
  width: 100%;
}

.dashboard-wrapper .bar-graph {
  margin-top: 1rem;
}

.dashboard-wrapper .bar-row {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
}

.dashboard-wrapper .bar-label {
  width: 150px;
  text-align: right;
  padding-right: 1rem;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dashboard-wrapper .bar-container {
  flex: 1;
  height: 24px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.dashboard-wrapper .bar {
  height: 100%;
  background: #85e394;
  border-radius: 4px;
  position: relative;
  transition: width 0.3s ease;
}

.dashboard-wrapper .bar-value {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.8rem;
  color: rgba(0, 0, 0, 0.8);
}

.dashboard-wrapper .no-data {
  text-align: center;
  padding: 2rem;
  color: rgba(255, 255, 255, 0.5);
  font-style: italic;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
  padding-bottom: 0;
}

.content {
  max-width: 1200px;
  margin: 0 auto;
}

.filters-section {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.filters {
  margin-bottom: 2rem;
  background: #f5f5f5;
  border-radius: 4px;
}

.filter-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: flex-start;
}

.filter {
  flex: 1;
  min-width: 150px;
  position: relative;
}

.filter-label {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
  color: #666;
}

.custom-select {
  position: relative;
  width: 100%;
}

.select-header-container {
  display: flex;
  align-items: center;
  border: 1px solid #ddd;
  border-radius: 4px;
  background-color: white;
}

.select-header {
  flex: 1;
  padding: 0.4rem 0.5rem;
  font-size: 0.8rem;
  cursor: pointer;
  user-select: none;
}

.clear-button {
  padding: 0.4rem 0.5rem;
  font-size: 1rem;
  line-height: 1;
  color: #666;
  background: none;
  border: none;
  border-left: 1px solid #ddd;
  cursor: pointer;
  display: none;
}

.clear-button:hover {
  color: #ff4444;
  background-color: rgba(0, 0, 0, 0.05);
}

.options-container {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #ddd;
  border-radius: 4px;
  margin-top: 4px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.custom-select.active .options-container {
  display: block;
}

.option {
  display: flex;
  align-items: center;
  padding: 0.35rem 0.5rem;
  cursor: pointer;
  transition: background-color 0.2s;
  font-size: 0.8rem;
}

.option:hover {
  background-color: #f5f5f5;
}

.option input[type="checkbox"] {
  margin-right: 0.5rem;
  transform: scale(0.9);
}

.time-filter {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  background: white;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
}

.calendar-icon {
  font-size: 1.1rem;
}

.dropdown-arrow {
  font-size: 0.8rem;
  color: #666;
}

#dashboard-content {
  min-height: 200px;
  width: 100%;
}

#dashboard-content.loading .dashboard-wrapper {
  filter: grayscale(1) opacity(0.7);
  pointer-events: none;
  transition: filter 0.2s ease;
}

.interval-selector {
  margin-bottom: 1rem;
}

.interval-options {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
}

.preset-selector,
.custom-range {
  flex: 1;
}

.preset-selector label,
.custom-range label {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
  color: #666;
}

.preset-selector select {
  width: 100%;
  padding: 0.4rem 0.5rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  background-color: white;
  font-size: 0.9rem;
}

.date-inputs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.date-inputs input[type="date"] {
  padding: 0.4rem 0.5rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.9rem;
  background-color: white;
}

.date-inputs span {
  color: #666;
  font-size: 0.9rem;
}

.interval-dropdown {
  position: relative;
  display: inline-block;
}
.interval-dropdown-trigger {
  padding: 0.5rem 1rem;
  font-size: 1rem;
  border: 1px solid #bbb;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  min-width: 180px;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.interval-dropdown-menu {
  position: absolute;
  top: 110%;
  left: 0;
  min-width: 220px;
  background: #fff;
  border: 1px solid #bbb;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  z-index: 1000;
  padding: 0.5rem 0.75rem;
}
.interval-options-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.interval-options-list li {
  padding: 0.4rem 0.2rem;
  cursor: pointer;
  border-radius: 3px;
  font-size: 1rem;
}
.interval-options-list li:hover {
  background: #f0f0f0;
}
.interval-custom-range {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.interval-custom-range label {
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.interval-custom-range input[type="date"] {
  margin-left: 0.5rem;
  padding: 0.2rem 0.4rem;
  font-size: 1rem;
}
.interval-custom-range button {
  margin-top: 0.5rem;
  padding: 0.4rem 0.8rem;
  font-size: 1rem;
  border-radius: 4px;
  border: none;
  background: #f5b041;
  color: #222;
  cursor: pointer;
}
.interval-custom-range button:hover {
  background: #f39c12;
}
.dropdown-arrow {
  margin-left: 0.5rem;
  font-size: 0.9em;
}

  .interval-dropdown-trigger {
    background: #23272f;
    color: #f5f5f5;
    border: 1px solid #444;
  }
  .interval-dropdown-menu {
    background: #23272f;
    color: #f5f5f5;
    border: 1px solid #444;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  }
  .interval-options-list li {
    color: #f5f5f5;
  }
  .interval-options-list li:hover {
    background: #2c313a;
  }
  .interval-custom-range label {
    color: #f5f5f5;
  }
  .interval-custom-range input[type="date"] {
    background: #181b20;
    color: #f5f5f5;
    border: 1px solid #444;
  }
  .interval-custom-range button {
    background: #f5b041;
    color: #23272f;
  }
  .interval-custom-range button:hover {
    background: #f39c12;
  }
  .dropdown-arrow {
    color: #f5f5f5;
  }


.compact-options-list {
  max-height: 220px;
  overflow-y: auto;
  font-size: 0.97rem;
  padding-bottom: 0.2rem;
}
.compact-options-list li {
  padding: 0.25rem 0.2rem;
  font-size: 0.97rem;
}
.interval-dropdown-menu {
  min-width: 210px;
  padding: 0.3rem 0.5rem 0.5rem 0.5rem;
}
.interval-custom-range {
  margin-top: 0.3rem;
  padding-bottom: 0.1rem;
}
