*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: #f8fafc;
  overflow-x: hidden;
  width: 100%;
}

body {
  background: #f8fafc;
  color: #0f172a;
  font-family: Kanit, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  margin: 0;
  min-width: 0;
  overflow-x: hidden;
  padding: 0;
  width: 100%;
}

header-component,
footer-component {
  display: block;
  width: 100%;
}

header-component header,
header-component nav,
footer-component footer {
  max-width: 100%;
  min-width: 0;
  width: 100%;
}

.gradient-navbar {
  background: rgb(46, 188, 76);
  background: linear-gradient(90deg, rgba(46, 188, 76, 1) 19%, rgba(47, 178, 156, 1) 72%, rgba(47, 178, 156, 1) 82%);
}

.glass {
  background: #fff;
  backdrop-filter: blur(12px);
}

.shadow-soft {
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.10), 0 2px 4px -2px rgb(0 0 0 / 0.10);
}

.scrollbar::-webkit-scrollbar {
  height: 8px;
  width: 8px;
}

.scrollbar::-webkit-scrollbar-thumb {
  background: #2FAC66;
  border-radius: 999px;
}

canvas {
  height: 260px;
  width: 100%;
}

.dashboard-main {
  margin: 0 auto;
  max-width: 100%;
  min-width: 0;
  padding: 12px;
  width: 100%;
}

.top-actions-bar {
  background: #fff;
  box-shadow: 0 2px 6px rgb(15 23 42 / 0.18);
  position: relative;
  z-index: 20;
}

.top-actions-inner {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
  justify-items: center;
  min-height: 58px;
  padding: 8px 12px;
  position: relative;
}

.dataset-tabs {
  align-items: center;
  display: inline-flex;
  gap: 8px;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding: 0;
  scrollbar-width: thin;
  width: 100%;
}

.last-updated {
  align-items: center;
  color: #6b7280;
  display: inline-flex;
  font-size: 12px;
  font-style: italic;
  gap: 4px;
  justify-self: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-grid {
  align-items: stretch;
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}

.course-combobox {
  min-width: 0;
  position: relative;
}

.course-combobox>.relative {
  margin-top: 0;
}

.course-options {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
  left: 0;
  max-height: 320px;
  overflow-y: auto;
  padding: 6px;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 50;
}

.course-option {
  background: #fff;
  border: 0;
  border-radius: 6px;
  color: #0f172a;
  cursor: pointer;
  display: block;
  font-size: 14px;
  line-height: 1.35;
  padding: 10px 12px;
  text-align: left;
  width: 100%;
}

.course-option:hover,
.course-option[aria-selected="true"] {
  background: #2FAC66;
  color: #fff;
}

.course-empty {
  color: #6b7280;
  font-size: 13px;
  padding: 12px;
}

.tab-button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: #0f172a;
  cursor: pointer;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 600;
  gap: 8px;
  min-height: 40px;
  justify-content: center;
  padding: 10px 12px;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.tab-button:hover {
  background: #f3f4f6;
}

.tab-button--active,
.tab-button--active:hover {
  background: #16a34a;
  color: #fff;
}

.tab-icon {
  font-size: 16px;
}

.profile-icon {
  font-size: 16px;
}

.filter-card {
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  display: block;
  min-width: 0;
  padding: 0;
  position: relative;
}

.filter-label {
  color: #0f315f;
  display: block;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.2;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.filter-select {
  background: #fff;
  border: 1px solid #cfd8e3;
  border-radius: 7px;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.04);
  color: #0f172a;
  display: block;
  font-size: 14px;
  height: 46px;
  line-height: 1.2;
  margin-top: 0;
  outline: none;
  padding: 0 16px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  width: 100%;
}

.filter-select.is-enhanced {
  display: none;
}

.filter-select:focus {
  border-color: #89b7d7;
  box-shadow: 0 0 0 3px rgb(46 188 76 / 0.12);
  color: #0f172a;
}

select.filter-select option {
  background: #fff;
  color: #0f172a;
}

select.filter-select option:hover,
select.filter-select option:focus,
select.filter-select option:checked {
  background: #2FAC66;
  box-shadow: 0 0 10px 100px #2FAC66 inset;
  color: #fff;
}

.custom-select {
  position: relative;
}

.custom-select-button {
  align-items: center;
  background: #fff;
  border: 1px solid #cfd8e3;
  border-radius: 7px;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.04);
  color: #0f172a;
  cursor: pointer;
  display: flex;
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  gap: 10px;
  height: 46px;
  justify-content: space-between;
  margin-top: 0;
  outline: none;
  padding: 0 16px;
  text-align: left;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  width: 100%;
}

.custom-select-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-select-button:focus {
  border-color: #89b7d7;
  box-shadow: 0 0 0 3px rgb(46 188 76 / 0.12);
  color: #0f172a;
}

.custom-select-arrow {
  color: #0f172a;
  flex: 0 0 auto;
  font-size: 16px;
  line-height: 1;
}

.custom-select-options {
  background: #fff;
  border: 1px solid #cfd8e3;
  border-radius: 7px;
  box-shadow: 0 18px 34px -18px rgb(15 23 42 / 0.35);
  left: 0;
  max-height: 260px;
  overflow-y: auto;
  padding: 4px;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 60;
}

.custom-select-options.hidden {
  display: none;
}

.custom-select-option {
  background: #fff;
  border: 0;
  border-radius: 5px;
  color: #0f172a;
  cursor: pointer;
  display: block;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.25;
  min-height: 29px;
  padding: 6px 8px;
  text-align: left;
  width: 100%;
}

.custom-select-option:hover,
.custom-select-option.is-active {
  background: #bbf7d0;
  color: #0f172a;
}

.custom-select-option[aria-selected="true"] {
  background: #0f8f4f;
  color: #fff;
}

.custom-select-option[aria-selected="true"]:hover,
.custom-select-option[aria-selected="true"].is-active {
  background: #0f8f4f;
  color: #fff;
}

.kpi-card {
  align-items: center;
  background: #fbfdff;
  border: 1px solid #d9e9f2;
  border-radius: 16px;
  box-shadow: 0 8px 18px -18px rgb(15 23 42 / 0.45);
  display: flex;
  gap: 14px;
  min-height: 88px;
  min-width: 0;
  padding: 18px 48px 18px 16px;
  position: relative;
}

.kpi-icon {
  align-items: center;
  background: linear-gradient(135deg, #0aa86a, #007a43);
  border-radius: 11px;
  box-shadow: 0 10px 18px -10px rgb(0 122 67 / 0.75);
  color: #fff;
  display: inline-flex;
  flex: 0 0 auto;
  height: 38px;
  justify-content: center;
  width: 38px;
}

.kpi-icon svg {
  fill: currentColor;
  height: 21px;
  width: 21px;
}

.kpi-content {
  min-width: 0;
}

.kpi-label {
  color: #007f55;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.1;
  margin: 0 0 2px;
  text-transform: uppercase;
  word-break: normal;
}

.kpi-value {
  color: #08753f;
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
  margin: 0;
}

.kpi-trend {
  font-size: 12px;
  line-height: 1.2;
  margin: 6px 0 0;
}

.kpi-trend span {
  color: #64748b;
}

.kpi-info {
  align-items: center;
  background: #6b7280;
  border-radius: 50%;
  color: #fff;
  display: inline-flex;
  font-family: Arial, sans-serif;
  font-size: 10px;
  font-weight: 700;
  height: 12px;
  justify-content: center;
  line-height: 1;
  position: absolute;
  right: 12px;
  top: 14px;
  width: 12px;
}

.dashboard-layout {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr);
}

.kpi-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr);
}

.chart-frame {
  height: 230px;
  min-width: 0;
  position: relative;
  width: 100%;
}

.chart-frame--donut {
  height: 220px;
  margin-inline: auto;
  max-width: 240px;
}

.chart-frame--top {
  height: 270px;
}

.chart-frame canvas {
  display: block;
  height: 100% !important;
  width: 100% !important;
}

.map-card[hidden],
.profile-card[hidden] {
  display: none;
}

.map-frame {
  align-items: center;
  border-radius: 10px;
  display: flex;
  justify-content: center;
  min-height: 320px;
  min-width: 0;
  overflow: hidden;
  padding: 12px;
}

.map-frame svg {
  display: block;
  height: 100%;
  max-height: 620px;
  max-width: 100%;
  width: 100%;
}

.map-fallback {
  color: #64748b;
  font-size: 13px;
  text-align: center;
}

#modalityLegend {
  min-width: 0;
}

.profile-chart-section+.profile-chart-section {
  border-top: 1px solid #e5e7eb;
  margin-top: 14px;
  padding-top: 12px;
}

.profile-chart-title {
  color: #374151;
  font-size: 12px;
  font-weight: 600;
  margin: 0 0 4px;
}

.profile-chart-frame {
  min-width: 0;
  position: relative;
  width: 100%;
}

.profile-chart-frame--status {
  height: 148px;
}

.profile-chart-frame canvas {
  display: block;
  height: 100% !important;
  width: 100% !important;
}

.profile-chart-summary {
  color: #374151;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  margin: 4px 0 0;
  overflow-wrap: anywhere;
}

.profile-chart-note {
  color: #6b7280;
  font-size: 10px;
  line-height: 1.4;
  margin: 2px 0 0;
}

.capacity-summary-grid {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.capacity-summary-item {
  background: #f3f4f6;
  border-radius: 6px;
  display: grid;
  flex: 1 0 112px;
  gap: 2px;
  min-width: 112px;
  padding: 8px;
}

.capacity-summary-item--primary {
  background: #ecfdf5;
}

.capacity-summary-label {
  color: #6b7280;
  font-size: 9px;
  font-weight: 600;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.capacity-summary-value {
  color: #0f766e;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.capacity-summary-detail {
  color: #6b7280;
  font-size: 9px;
  font-weight: 600;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.capacity-summary-detail-value {
  color: #6b7280;
  font-size: 9px;
  font-weight: 400;
  line-height: 1.2;
  max-width: 100%;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 639px) {
  .capacity-summary-grid {
    margin-right: -4px;
  }
}

#modalityLegend>div {
  min-width: 0;
}

#modalityLegend span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.dashboard-layout--activities .year-card {
  order: 1;
}

.dashboard-layout--activities .map-card {
  order: 2;
}

.dashboard-layout--activities .top-courses-card {
  order: 3;
}

.dashboard-layout--activities .modality-card {
  order: 4;
}

.dashboard-layout--activities .profile-card {
  order: 5;
}

@media (min-width: 768px) {
  .top-actions-inner {
    grid-template-columns: 1fr auto 1fr;
  }

  .dataset-tabs {
    grid-column: 2;
  }

  .last-updated {
    grid-column: 3;
    justify-self: end;
  }

  .tab-button {
    font-size: 13px;
    padding-inline: 14px;
  }

  .chart-frame {
    height: 280px;
  }
}

@media (min-width: 640px) {
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1180px) {
  .kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .filter-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .dashboard-layout {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .year-card,
  .top-courses-card {
    grid-column: span 2;
  }

  .dashboard-layout--activities {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .dashboard-layout--activities .year-card {
    grid-column: span 4;
  }

  .dashboard-layout--activities .top-courses-card,
  .dashboard-layout--activities .modality-card {
    grid-column: span 2;
  }

  .dashboard-layout--activities .map-card {
    grid-column: span 2;
    grid-row: span 2;
  }

  .dashboard-layout--activities .map-frame {
    min-height: 690px;
  }
}

@media (min-width: 1900px) {
  .kpi-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

@media (max-width: 479px) {
  .dashboard-main {
    padding: 8px;
  }

  .top-actions-inner {
    min-height: 0;
    padding: 6px 8px;
  }

  .dataset-tabs {
    gap: 4px;
  }

  .tab-button {
    font-size: 10px;
    gap: 4px;
    min-height: 32px;
    padding: 7px 8px;
  }

  .tab-icon {
    font-size: 12px;
  }

  .last-updated {
    font-size: 10px;
  }

  .filter-label,
  .kpi-label {
    font-size: 11px;
  }

  .filter-select,
  .custom-select-button {
    font-size: 12px;
    height: 40px;
    padding-inline: 10px;
  }

  .kpi-card {
    border-radius: 12px;
    gap: 10px;
    min-height: 72px;
    padding: 12px 34px 12px 12px;
  }

  .kpi-icon {
    border-radius: 9px;
    height: 30px;
    width: 30px;
  }

  .kpi-icon svg {
    height: 17px;
    width: 17px;
  }

  .kpi-value {
    font-size: 24px;
  }

  .kpi-trend {
    font-size: 10px;
  }

  .chart-frame {
    height: 210px;
  }

  .chart-frame--donut {
    height: 190px;
    max-width: 200px;
  }

  .chart-frame--top {
    height: 240px;
  }

  .map-frame {
    min-height: 260px;
  }
}

.dashboard-card {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.07), 0 1px 2px -1px rgb(0 0 0 / 0.07);
  min-width: 0;
  padding: 18px;
}

.card-title {
  color: #1e293b;
  font-size: 15px;
  font-weight: 700;
}

.card-subtitle {
  color: #94a3b8;
  font-size: 12px;
  margin-bottom: 14px;
  margin-top: 2px;
}

@media (max-width: 479px) {
  .dashboard-card {
    border-radius: 10px;
    padding: 12px;
  }

  .card-title {
    font-size: 13px;
  }

  .card-subtitle {
    font-size: 11px;
  }
}

#map-tooltip {
  position: fixed;
  display: none;
  padding: 6px 10px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  color: #0f172a;
  pointer-events: none;
  z-index: 9999;
  white-space: nowrap;
}

#map-tooltip>div+div {
  color: #475569;
  font-weight: 400;
  font-size: 12px;
}

.map-frame svg path {
  cursor: pointer;
}

.map-frame svg path[data-info]:hover {
  filter: brightness(0.9);
  transition: filter 0.15s ease;
}