/* ===== RESET ===== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Kanit', sans-serif;
  background: linear-gradient(180deg, #f5f5f7 0%, #ffffff 100%);
  color: #1d1d1f;
  -webkit-font-smoothing: antialiased;
}

/* ===== GLOBAL GLOW BG ===== */
body::before {
  content: '';
  position: fixed;
  width: 600px;
  height: 600px;
  top: -200px;
  left: -200px;
  background: radial-gradient(circle, rgba(0,113,227,0.15), transparent 70%);
  z-index: -1;
}

body::after {
  content: '';
  position: fixed;
  width: 500px;
  height: 500px;
  bottom: -200px;
  right: -200px;
  background: radial-gradient(circle, rgba(255,45,85,0.12), transparent 70%);
  z-index: -1;
}

/* ===== CONTAINER ===== */
.container {
  max-width: 1600px;
  margin: 40px auto;
  padding: 36px;

  background: rgba(255,255,255,0.65);
  backdrop-filter: blur(25px);

  border-radius: 28px;

  border: 1px solid rgba(255,255,255,0.4);

  box-shadow:
    0 20px 60px rgba(0,0,0,0.06),
    inset 0 1px 0 rgba(255,255,255,0.6);
}

/* ===== TITLE ===== */
h1 {
  text-align: center;
  font-size: 36px;
  font-weight: 600;
  letter-spacing: -0.4px;
  margin-bottom: 35px;

  background: linear-gradient(90deg, #1d1d1f, #6e6e73);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ===== FILTER ===== */
.year-filter {
  display: flex;
  gap: 10px;
  margin-bottom: 25px;
}

.year-filter select {
  padding: 10px 18px;
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,0.08);

  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(10px);

  transition: all 0.25s ease;
}

.year-filter select:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.year-filter select:focus {
  outline: none;
  border-color: #0071e3;
  box-shadow: 0 0 0 4px rgba(0,113,227,0.15);
}

/* ===== KPI ===== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px,1fr));
  gap: 24px;
  margin-bottom: 40px;
}

.kpi-card {
  position: relative;
  padding: 28px;
  border-radius: 24px;

  background: linear-gradient(145deg, rgba(255,255,255,0.9), rgba(255,255,255,0.6));

  backdrop-filter: blur(15px);

  box-shadow:
    0 10px 30px rgba(0,0,0,0.05),
    inset 0 1px 0 rgba(255,255,255,0.7);

  transition: all 0.3s ease;
}

.kpi-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow:
    0 20px 40px rgba(0,0,0,0.08);
}

/* glow line */
.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  height: 3px;
  width: 100%;
  background: linear-gradient(90deg, #0071e3, #5ac8fa, #34c759);
  border-radius: 24px 24px 0 0;
}

.kpi-card i {
  font-size: 28px;
  margin-bottom: 12px;
  color: #0071e3;
}

.kpi-card h2 {
  font-size: 36px;
  font-weight: 600;
}

.kpi-card p {
  font-size: 14px;
  color: #6e6e73;
}

/* ===== TABLE ===== */
.table-wrapper {
  margin-top: 20px;
  border-radius: 20px;
  overflow: hidden;

  box-shadow:
    0 10px 30px rgba(0,0,0,0.05);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(255,255,255,0.9);
}

/* header */
thead {
  background: rgba(245,245,247,0.9);
  backdrop-filter: blur(10px);
}

thead th {
  padding: 14px;
  font-weight: 500;
  font-size: 13px;
  color: #6e6e73;
}

/* body */
tbody td {
  padding: 12px;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  text-align: center;
}

tbody td:first-child {
  text-align: left;
  font-weight: 500;
}

tbody tr {
  transition: all 0.2s ease;
}

tbody tr:hover {
  background: rgba(0,113,227,0.04);
  transform: scale(1.002);
}

/* footer */
tfoot td {
  padding: 12px;
  font-weight: 600;
  background: rgba(245,245,247,0.8);
}

/* ===== CHART ===== */
.chart-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin-top: 45px;
}

.chart-box {
  position: relative;
  width: 100%;
  height: 320px;
  min-height: 260px;
  max-height: 420px;

  background: rgba(255,255,255,0.75);
  border-radius: 24px;
  padding: 20px;

  box-sizing: border-box;
}

.chart-box:hover {
  transform: translateY(-4px);
}

.chart-box h3 {
  font-size: 15px;
  margin-bottom: 10px;
  color: #1d1d1f;
}

.chart-box canvas {
  width: 100% !important;
  height: 100% !important;
}

/* ===== BREADCRUMB ===== */
.breadcrumb-section {
  padding: 16px 24px;
  font-weight: 500;
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(10px);
}

.breadcrumb-nav {
  padding: 10px 24px;
  font-size: 14px;
  color: #6e6e73;
}

.breadcrumb-nav a {
  color: #0071e3;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {

  .container {
    margin: 20px;
    padding: 24px;
  }

  h1 {
    font-size: 26px;
  }

  .chart-section {
    grid-template-columns: 1fr;
  }
 .chart-box {
    height: 260px;
  }

}

/* ===== DARK MODE PRO ===== */
@media (prefers-color-scheme: dark) {

  body {
    background: linear-gradient(180deg, #1c1c1e, #000);
    color: #f5f5f7;
  }

  .container {
    background: rgba(28,28,30,0.65);
    border: 1px solid rgba(255,255,255,0.08);
  }

  .kpi-card {
    background: rgba(44,44,46,0.7);
  }

  table {
    background: rgba(44,44,46,0.9);
  }

  thead {
    background: rgba(58,58,60,0.9);
  }

  tbody tr:hover {
    background: rgba(0,113,227,0.15);
  }

  .chart-box {
    background: rgba(44,44,46,0.7);
  }
}
/* =========================
   📱 MOBILE (≤ 480px)
========================= */
@media (max-width: 480px) {

  body {
    font-size: 14px;
  }

  .container {
    margin: 10px;
    padding: 18px;
    border-radius: 18px;
  }

  h1 {
    font-size: 22px;
    line-height: 1.4;
  }

  /* KPI */
  .kpi-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .kpi-card {
    padding: 18px;
  }

  .kpi-card h2 {
    font-size: 24px;
  }

  /* TABLE */
  table {
    font-size: 12px;
  }

  thead th,
  tbody td {
    padding: 8px;
  }

  /* Chart */
  .chart-section {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .chart-box canvas {
    height: 240px !important;
  }

  /* Filter */
  .year-filter {
    flex-direction: column;
    align-items: flex-start;
  }

  .year-filter select {
    width: 100%;
  }
}


/* =========================
   📲 TABLET (iPad) (481px - 1024px)
========================= */
@media (min-width: 481px) and (max-width: 1024px) {

  .container {
    margin: 20px;
    padding: 24px;
  }

  h1 {
    font-size: 28px;
  }

  /* KPI */
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
  }

  .kpi-card h2 {
    font-size: 28px;
  }

  /* TABLE */
  table {
    font-size: 13px;
  }

  /* CHART */
  .chart-section {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .chart-box canvas {
    height: 260px !important;
  }
}


/* =========================
   💻 NOTEBOOK (1025px - 1440px)
========================= */
@media (min-width: 1025px) and (max-width: 1440px) {

  .container {
    max-width: 1100px;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .chart-section {
    grid-template-columns: 1fr 1fr;
  }
}


/* =========================
   🖥️ LARGE DESKTOP (≥ 1441px)
========================= */
@media (min-width: 1441px) {

  .container {
    max-width: 1300px;
  }

  .kpi-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .chart-section {
    gap: 30px;
  }
}