* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f5f5f5;
  padding: 20px;
}

/* Keyframe Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes barGrow {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  background-color: white;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  animation: fadeIn 0.6s ease-out;
}

h1 {
  text-align: center;
  color: #333;
  margin-bottom: 30px;
  font-size: 2.5em;
  animation: fadeInDown 0.8s ease-out;
}

/* Filter Controls */
.filter-controls {
  display: none;
  gap: 20px;
  margin-bottom: 40px;
  flex-wrap: wrap;
  align-items: center;
  animation: fadeInUp 0.8s ease-out 0.2s backwards;
}

.filter-group {
  position: relative;
}

.filter-label {
  display: inline-block;
  margin-right: 10px;
  color: #666;
  font-weight: 500;
}

.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-btn {
  background-color: #7b8dbe;
  color: white;
  padding: 10px 15px;
  font-size: 14px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background-color 0.3s;
}

.dropdown-btn:hover {
  background-color: #6a7cad;
}

.dropdown-btn::after {
  content: '▼';
  font-size: 10px;
}

.dropdown-content {
  display: none;
  position: absolute;
  background-color: white;
  min-width: 200px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
  border: 1px solid #ddd;
  border-radius: 4px;
  z-index: 1000;
  top: 100%;
  left: 0;
}

.dropdown-content a {
  color: black;
  padding: 12px 16px;
  text-decoration: none;
  display: block;
  cursor: pointer;
  transition: background-color 0.2s;
}

.dropdown-content a:hover {
  background-color: #f1f1f1;
}

.dropdown-content a.active {
  background-color: #7b8dbe;
  color: white;
}

.dropdown.active .dropdown-content {
  display: block;
}

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  grid-template-rows: auto auto auto;
  gap: 30px;
  margin-top: 30px;
}

/* Visual Hierarchy Layout */
/* Low Stock Alerts - Left top, 50% width (2 columns) */
.dashboard-grid > .card:nth-child(1) {
  grid-column: 1 / 3;
  grid-row: 1 / 2;
  order: 1;
}

/* Weekly Revenue - Right top, 50% width (2 columns) */
.dashboard-grid > .card:nth-child(2) {
  grid-column: 3 / 5;
  grid-row: 1 / 2;
  order: 2;
}

/* Daily Financial Overview - Second row, 2 columns (half width) */
.dashboard-grid > .card:nth-child(3) {
  grid-column: 1 / 3;
  grid-row: 2 / 3;
  order: 3;
}

/* Payment Methods - Third row, 1.5 columns */
.dashboard-grid > .card:nth-child(4) {
  grid-column: 2 / 4;
  grid-row: 3 / 4;
  order: 6;
  opacity: 0.9;
}

/* Top Products - Second row, 2 columns */
.dashboard-grid > .card:nth-child(5) {
  grid-column: 3 / 5;
  grid-row: 2 / 3;
  order: 5;
}

.card {
  background-color: #fafafa;
  border-radius: 8px;
  padding: 25px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s, box-shadow 0.3s;
  animation: slideInUp 0.6s ease-out forwards;
  opacity: 0;
}

.card:nth-child(1) {
  animation-delay: 0.1s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.card:nth-child(2) {
  animation-delay: 0.25s;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
}

.card:nth-child(3) {
  animation-delay: 0.4s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.card:nth-child(4) {
  animation-delay: 0.55s;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.card:nth-child(5) {
  animation-delay: 0.7s;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 2px solid #e0e0e0;
  padding-bottom: 15px;
}

.card-title {
  font-size: 1.3em;
  font-weight: 600;
  color: #333;
}

.card-filters {
  display: flex;
  gap: 10px;
}

/* Low Stock Alerts */
#lowStockChart {
  margin-top: 20px;
  position: relative;
  height: 300px;
}

/* Weekly Revenue Trend */
#revenueChart {
  margin-top: 20px;
  position: relative;
  height: 300px;
}

.line-chart {
  width: 100%;
  height: 100%;
  position: relative;
  padding: 20px 0;
}

canvas {
  max-width: 100%;
  height: auto;
}

/* Daily Financial Overview */
#financialChart {
  margin-top: 20px;
  position: relative;
  height: 350px;
}

.bar-group-chart {
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
  height: 280px;
  margin-top: 20px;
  padding: 20px;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  background: linear-gradient(to top, #f9f9f9, white);
}

.chart-column {
  text-align: center;
  flex: 1;
}

.column-bars {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 10px;
}

.bar {
  width: 40px;
  background-color: #4CAF50;
  border-radius: 4px 4px 0 0;
  position: relative;
}

.bar.yesterday {
  background-color: #666;
}

.column-label {
  font-weight: 600;
  color: #333;
  font-size: 0.9em;
}

.chart-y-axis {
  position: absolute;
  left: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 280px;
  font-size: 0.8em;
  color: #999;
}

.chart-y-axis span {
  writing-mode: horizontal-tb;
}

/* Payment Methods Pie Chart */
#paymentChart {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  height: 320px;
}

.pie-chart-container {
  position: relative;
  width: 250px;
  height: 250px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.pie-slice {
  position: absolute;
  width: 250px;
  height: 250px;
  border-radius: 50%;
}

svg.pie-chart {
  width: 250px;
  height: 250px;
}

.pie-legend {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.9em;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
}

.legend-color {
  width: 16px;
  height: 16px;
  border-radius: 3px;
}

/* Top Products Performance */
#productsChart {
  margin-top: 20px;
  position: relative;
  height: 350px;
}
  font-weight: 500;
  color: #666;
}

/* Responsive */
@media (max-width: 1200px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-grid > .card:nth-child(1) {
    grid-column: 1;
    grid-row: auto;
  }

  .dashboard-grid > .card:nth-child(2) {
    grid-column: 1;
    grid-row: auto;
  }

  .dashboard-grid > .card:nth-child(3) {
    grid-column: 1;
    grid-row: auto;
  }

  .dashboard-grid > .card:nth-child(4) {
    grid-column: 1;
    grid-row: auto;
  }

  .dashboard-grid > .card:nth-child(5) {
    grid-column: 1;
    grid-row: auto;
  }
}

@media (max-width: 768px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .filter-controls {
    flex-direction: column;
    align-items: flex-start;
  }

  .card {
    padding: 15px;
  }

  h1 {
    font-size: 1.8em;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 15px;
  }

  .card {
    padding: 12px;
  }

  .card-title {
    font-size: 1.1em;
  }

  .bar-chart-container {
    font-size: 0.85em;
  }
}

/* Utility Classes */
.legend {
  display: flex;
  gap: 20px;
  margin-top: 15px;
  flex-wrap: wrap;
  font-size: 0.9em;
}

.legend-item-inline {
  display: flex;
  align-items: center;
  gap: 6px;
}

.color-box {
  width: 14px;
  height: 14px;
  border-radius: 2px;
}
