/* Hero Section */
.dashboard-hero {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(120deg, #6a5acd, #48c6ef);
    color: #fff;
  }
  
  .dashboard-hero h1 {
    font-size: 2.5rem;
  }
  
  .dashboard-hero p {
    font-size: 1.1rem;
  }
  
  /* Main Container */
  .dashboard-container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 20px;
  }
  
  /* Stats Cards */
  .stat-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 40px;
  }
  
  .card {
    background: #ffffff;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    font-weight: bold;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  }
  
  /* Chart Layout */
  .charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
  }
  
  /* .chart-box {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    height: 350px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
  } */
  .chart-box {
    background: #fff;
    padding: 30px;        /* Increased padding to give space inside */
    border-radius: 12px;
    height: 380px;        /* Slightly increased height */
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }
  
  /* FIX the canvas size inside the chart box */
  .chart-box canvas {
    width: 100% !important;
    height: 100% !important;
    max-height: 280px;    /* Safe boundary so the pie chart never overflows */
    margin: auto;         /* Perfect centering */
  }
  
  
  /* Responsive */
  @media (max-width: 1024px) {
    .stat-cards {
      grid-template-columns: repeat(2, 1fr);
    }
  
    .charts-grid {
      grid-template-columns: 1fr;
    }
  }
  
  @media (max-width: 600px) {
    .stat-cards {
      grid-template-columns: 1fr;
    }
  
    .dashboard-hero h1 {
      font-size: 1.9rem;
    }
  
    .chart-box {
      height: 300px;
    }
  }
  



  /* -----------------------------------
   HERO SECTION
----------------------------------- */
.dashboard-hero {
    text-align: center;
    padding: 50px 20px;
    background: linear-gradient(120deg, #6a5acd, #48c6ef);
    color: #fff;
}

.dashboard-hero h1 {
    font-size: 2.8rem;
}

.dashboard-hero p {
    font-size: 1.2rem;
}

/* -----------------------------------
   MAIN CONTAINER
----------------------------------- */
.dashboard-container {
    max-width: 1300px;
    margin: 30px auto;
    padding: 20px;
}

/* -----------------------------------
   STAT CARDS
----------------------------------- */
.stat-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
    margin-bottom: 40px;
}

.card {
    background: #ffffff;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    font-weight: bold;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: 0.3s ease;
}

/* Hover (optional) */
.card:hover {
    transform: translateY(-5px);
}

/* -----------------------------------
   CHART GRID
----------------------------------- */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
}

/* Chart box */
.chart-box {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    height: 380px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Canvas FIXED — prevents overflow */
.chart-box canvas {
    width: 100% !important;
    height: 100% !important;
    max-height: 260px;
    max-width: 260px;
    margin: auto;
    display: block;
}

/* -----------------------------------
   RESPONSIVE MEDIA QUERIES
----------------------------------- */

/* ---------- Large Desktop (1500px+) ---------- */
@media (min-width: 1500px) {
    .dashboard-container {
        max-width: 1500px;
    }
    .chart-box {
        height: 420px;
    }
}

/* ---------- Laptop (1025px to 1499px) ---------- */
@media (max-width: 1499px) and (min-width: 1025px) {
    .chart-box {
        height: 350px;
    }
}

/* ---------- Tablet Landscape (768px - 1024px) ---------- */
@media (max-width: 1024px) {
    .stat-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }

    .chart-box {
        height: 340px;
    }

    .dashboard-hero h1 {
        font-size: 2.3rem;
    }
}

/* ---------- Tablet Portrait & Large Mobile (600px - 767px) ---------- */
@media (max-width: 767px) {
    .stat-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .chart-box {
        height: 320px;
        padding: 20px;
    }

    .dashboard-hero h1 {
        font-size: 2rem;
    }

    .chart-box canvas {
        max-height: 220px;
        max-width: 220px;
    }
}

/* ---------- Standard Mobile (480px - 599px) ---------- */
@media (max-width: 599px) {
    .stat-cards {
        grid-template-columns: 1fr;
    }

    .chart-box {
        height: 300px;
    }

    .chart-box canvas {
        max-height: 200px;
        max-width: 200px;
    }

    .dashboard-hero h1 {
        font-size: 1.8rem;
    }
}

/* ---------- Small Mobile (320px - 479px) ---------- */
@media (max-width: 479px) {
    .dashboard-hero h1 {
        font-size: 1.6rem;
    }

    .chart-box {
        height: 280px;
        padding: 15px;
    }

    .chart-box canvas {
        max-height: 180px;
        max-width: 180px;
    }

    .card {
        padding: 18px;
    }
}
