:root {
  --primary-blue: #1e3a8a;
  --light-blue: #3b82f6;
  --accent-orange: #f59e0b;
  --accent-yellow: #fbbf24;
  --bg-light: #f8fafc;
  --text-dark: #1e293b;
  --border-color: #e2e8f0;
}

body {
  background-color: var(--bg-light);
  color: var(--text-dark);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.dashboard-header {
  background: white;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.dashboard-title {
  font-size: 24px;
  font-weight: 600;
  margin: 0;
  color: var(--primary-blue);
  letter-spacing: -0.5px;
}

/* Filter Section */
.filter-section {
  background: white;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
}

.filter-row {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 180px;
}

.filter-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #64748b;
}

.form-select, .form-control {
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 14px;
  padding: 8px 12px;
}

.form-select:focus, .form-control:focus {
  border-color: var(--light-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Period Section */
.period-section {
  background: white;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
}

.period-row {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.period-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.time-period-buttons {
  display: flex;
  gap: 8px;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 6px;
  width: fit-content;
}

.btn-period {
  background: white;
  border: 1px solid var(--border-color);
  padding: 6px 16px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #64748b;
}

.btn-period:hover {
  border-color: var(--light-blue);
}

.btn-period.active {
  background: var(--light-blue);
  border-color: var(--light-blue);
  color: white;
}

.date-group {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.btn-ok {
  background: var(--light-blue);
  color: white;
  border: none;
  padding: 8px 24px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease;
}

.btn-ok:hover {
  background: #2563eb;
}

/* Main Content */
.dashboard-content {
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.chart-container {
  background: white;
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.chart-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-dark);
}

.chart-controls {
  display: flex;
  gap: 12px;
}

.chart-control-btn {
  background: #f1f5f9;
  border: 1px solid var(--border-color);
  width: 32px;
  height: 32px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  transition: all 0.2s ease;
  font-size: 14px;
}

.chart-control-btn:hover {
  background: var(--light-blue);
  color: white;
  border-color: var(--light-blue);
}

/* Download Dropdown */
.download-dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-menu {
  display: none;
  position: absolute;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  min-width: 180px;
  top: 100%;
  right: 0;
  margin-top: 4px;
}

.dropdown-menu.show {
  display: block;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 16px;
  border: none;
  background: none;
  text-align: left;
  cursor: pointer;
  color: var(--text-dark);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.dropdown-item:hover {
  background: var(--bg-light);
  color: var(--light-blue);
}

.dropdown-item i {
  width: 16px;
  text-align: center;
}

/* Chart */
.chart-wrapper {
  position: relative;
  flex: 1;
  min-height: 300px;
}

.chart-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
}

/* Legend */
.legend-container {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
  justify-content: center;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #64748b;
}

.legend-color {
  width: 12px;
  height: 12px;
  border-radius: 2px;
}

/* Toast */
.toast-container {
  z-index: 1055;
}

/* Responsive */
@media (max-width: 768px) {
  .filter-row, .period-row, .date-group {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-group, .period-group {
    min-width: auto;
  }

  .chart-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .time-period-buttons {
    width: 100%;
    justify-content: space-between;
  }

  .dashboard-title {
    font-size: 20px;
  }

  .chart-wrapper {
    height: 280px;
  }
}
