:root {
  --bg-main: #FDFBF7;
  --bg-sidebar: #F7F4EF;
  --border-natural: #E8E1D5;
  --text-main: #34495E;
  --text-muted: #7F8C8D;
  --sage-green: #8BA889;
  --forest-green: #4A5D4B;
  --tan-beige: #B38B6D;
}

* {
  margin: 0;
  padding: 0;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: "Noto Sans Thai";
}

#root {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100vh;
  position: relative;
  overflow: hidden;
}

.root-content {
  display: flex;
  position: relative;
  height: 100vh;
  color: #34495e;
  background-color: #fdfbf7;
}

#main-view.root-content {
  overflow: hidden;
}

#details-view.root-content {
  overflow: auto;
}

.hidden {
  display: none !important;
}

.w-100,
.w-full {
  width: 100% !important;
}

.h-100,
.h-full {
  height: 100% !important;
}

button,
select,
input {
  font-family: "Noto Sans Thai", sans-serif;
}

button,
select {
  cursor: pointer;
}

/* Location */
.loc-section {
  display: flex;
  flex-direction: column;
  z-index: 40;
  height: 100%;
  width: 100%;
  padding: 0.75rem;
  border-right: 3px solid #E8E1D5;
  background-color: #F7F4EF;
  overflow: hidden;
}

.loc-section header {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  flex-shrink: 0;
  margin-bottom: 1.5rem;
  padding-left: 0.25rem;
  padding-right: 0.25rem;
  padding-bottom: 0.8rem;
  border-bottom: 0.1rem solid #E8E1D5;
}

.loc-section header .icon {
  margin-right: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  color: #ffffff;
  background-color: #8BA889;
  box-shadow: 0 2px 2px 0 #E8E1D5;
}

.loc-section header .title {
  display: flex;
  flex-direction: column;
  font-weight: bold;
  color: #4A5D4B;
  font-size: 1.25rem;
  letter-spacing: -0.05em;
}

.loc-section header .title span {
  font-weight: 500;
  color: #7F8C8D;
  font-size: 0.875rem;
}

.loc-section .note {
  padding-left: 0.25rem;
  font-size: 0.875rem;
  font-weight: bold;
  color: #7F8C8D;
  margin-bottom: 1rem;
}

.user-displayname {
  display: flex;
  align-items: center;
  padding: 0.22rem 0.8rem 0.25rem 0.7rem;
  border-radius: 50px;
  max-width: 180px;
  margin-right: 0.5rem;
  overflow: hidden;
  border: 1px solid #E3DCCE;
  background-color: #F6F5F2;
}

.user-displayname>div {
  width: 0.6rem;
  height: 0.6rem;
  margin-right: 0.4rem;
  border-radius: 100%;
  flex-shrink: 0;
  background-color: #22c55e;
}

.user-displayname>span {
  font-size: 0.7rem;
  font-weight: 600;
  color: #4A5D4B;
  padding-top: 0.05rem;
}

.logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 100%;
  width: 1.7rem;
  height: 1.7rem;
  font-size: 0.75rem;
  padding-left: 0.15rem;
  color: #f43f5e;
  border: 1px solid #E3DCCE;
  background-color: #ffffff80;
}

.loc-box {
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  border-radius: 20px;
  border: 0.1rem solid #e2e8f0;
  background-color: #ffffff;
}

.loc-box:not(.active):hover {
  border-color: #8ba88966;
  box-shadow: 0 2px 2px 0 rgba(207, 210, 207, 0.50);
}

.loc-box.active {
  border: 0.15rem solid #8ba889;
  box-shadow: 0 2px 2px 0 rgba(207, 210, 207, 0.50);
}

.loc-box:hover .name {
  color: #708c6e;
}

.loc-box .region,
.loc-box .status {
  line-height: initial;
  border-radius: 50rem;
  font-weight: bold;
  padding: 0.2rem 0.6rem;
}

.loc-box .region {
  font-size: 10px;
  text-wrap: nowrap;
  border: 1px solid rgba(128, 128, 128, 0.11);
}

.loc-box .status {
  display: flex;
  align-items: center;
  background-color: #f8fafc;
  border: 1px solid #f1f5f9;
}

.loc-box .status>div {
  width: 0.5rem;
  height: 0.5rem;
  margin-bottom: 0.05rem;
  border-radius: 50rem;
}

.loc-box .status>span {
  font-size: 9px;
  color: #64748b;
  text-transform: uppercase;
  margin-left: 0.25rem;
}

.loc-box .name {
  font-size: 1.1rem;
  font-weight: bold;
  color: #456143;
  letter-spacing: -0.025em;
}

.loc-box .addr {
  display: flex;
  align-items: baseline;
  font-size: 13px;
  color: #64748b;
  font-weight: 500;
  margin-top: 0.2rem;
}

.loc-box .addr i {
  margin-right: 0.25rem;
  opacity: 60%;
}

.stat-box {
  position: relative;
  padding: 0.8rem 0.5rem 0.85rem 1rem;
  border-radius: 8px;
  overflow: hidden;
  flex-grow: 1;
  transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-box.inside {
  background: linear-gradient(to bottom right, #F9FBFA, #ffffff);
  border: 1px solid #EDF2EE;
}

.stat-box.inside:hover {
  border-color: rgba(139, 168, 137, 0.3);
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.stat-box.inside h4 {
  color: #8BA889;
}

.stat-box.outside {
  background: linear-gradient(to bottom right, #FAF9F6, #ffffff);
  border: 1px solid #F2F1ED;
}

.stat-box.outside:hover {
  border-color: rgba(179, 139, 109, 0.3);
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.stat-box.outside h4 {
  color: #B38B6D;
}

.stat-box .header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
  position: relative;
  z-index: 10;
}

.stat-box .header>h4 {
  display: flex;
  align-items: baseline;
  font-size: 12px;
  font-weight: 600;
}

.stat-box .header>h4 i {
  margin-right: 0.25rem;
}

.stat-box .header button {
  font-size: 0.68rem;
  display: flex;
  align-items: baseline;
  padding: 0.2rem 0.5rem;
  font-weight: 600;
  border: 0;
  background-color: transparent;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
  transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
}

.stat-box .header button i {
  font-size: 9px;
  margin-left: 0.4rem;
}

.update-group {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-top: 0.5rem;
  margin-bottom: 0.4rem;
  padding-right: 0.5rem;
}

.details.btn-inside {
  color: #8BA889;
}

.details.btn-outside {
  color: #B38B6D;
}

.stat-label {
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.15rem;
}

.stat-unit {
  color: #94a3b8;
  font-weight: 400;
  text-transform: lowercase;
}

.stat-value {
  font-size: 1.45rem;
  line-height: 2rem;
  font-weight: 800;
  letter-spacing: -0.05em;
}

.small-stat-box-inside {
  padding: 0.75rem;
  background-color: #F9FBFA;
  border-radius: 0.75rem;
  border: 1px solid #EDF2EE;
}

.small-stat-box-outside {
  padding: 0.75rem;
  background-color: #FAF9F6;
  border-radius: 0.75rem;
  border: 1px solid #F2F1ED;
}

.small-stat-label {
  font-size: 9px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
}

.small-stat-value {
  font-size: 0.875rem;
  line-height: 1.5rem;
  font-weight: 900;
}

#map-stats {
  max-width: calc(100% - 3rem);
}

/* Details */
#detail-header {
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 0.9rem 1rem;
  font-weight: bold;
  background-color: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  box-shadow: 0 2px 2px 0 #e8e1d580;
}

#back-main,
#close-stats-btn {
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 100%;
  color: #64748b;
  border: 1px solid #e2e8f0;
  background-color: #f8fafc;
}

#back-main {
  width: 2rem;
  min-width: 2rem;
  height: 2rem;
  margin-right: 0.75rem;
}

#back-main i {
  font-size: 1rem;
}

#close-stats-btn {
  position: absolute;
  width: 1.75rem;
  min-width: 1.75rem;
  height: 1.75rem;
  top: 1rem;
  right: 1rem;
}

button:hover {
  filter: saturate(1.8);
}

#detail-filter-container {
  display: flex;
  align-items: center;
  justify-content: end;
  flex-wrap: wrap;
  font-size: 0.875rem;
  gap: 0.75rem;
  padding: 0.2rem;
  margin-bottom: 1.25rem;
  overflow: hidden;
}

.input {
  border-radius: 0.4rem;
  color: #334155;
  border: 1px solid #e2e8f0;
  outline: none !important;
  cursor: pointer;
  padding: 0.45rem 1rem;
}

input.input {
  padding-left: 6.5rem;
}

select.input {
  appearance: none;
  background: #ffffff url(arrow-down.svg) calc(100% - 0.5rem) 50% no-repeat;
  background-size: 0.9rem;
  padding-right: 2rem;
  font-size: 0.85rem;
}

.input:focus {
  border-color: #8BA889;
  box-shadow: 0 0 0 1px #8BA889;
}

.input-date {
  position: relative;
}

.input-date label,
.input-date i {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

.input-date label {
  left: 2rem;
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 500;
}

.input-date i {
  left: 0.75rem;
  color: #94a3b8;
}

#details-content table th:not(:first-child),
#details-content table td:not(:first-child) {
  text-align: center;
}

#details-content table td {
  font-size: 0.8rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table thead tr {
  position: sticky;
  top: 0;
  background-color: #F7F4EF;
  color: #7F8C8D;
  font-size: 0.75rem;
  box-shadow: 0 2px 3px #00000010;
  z-index: 20;
}

.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background-color: #ffffff;
  padding: 0.75rem;
  line-height: initial;
}

.data-table th:first-child,
.data-table td:first-child {
  padding-left: 1.25rem;
  width: 6rem;
}

.data-table th:last-child,
.data-table td:last-child {
  padding-right: 1.25rem;
}

.data-table thead th:first-child {
  z-index: 3;
  left: 0;
}

.data-table tbody td:first-child {
  left: 0;
  position: sticky;
  z-index: 1;
  background-color: #ffffff;
}

.data-table th,
.data-table td {
  font-weight: bold;
}

.data-table tbody td {
  padding: 0.5rem 0.75rem;
  white-space: nowrap;
  vertical-align: top;
}

.data-table tbody tr {
  border-bottom: 1px dashed #f7f4ef;
}

.data-table tbody tr:hover td {
  background-color: #fbfaf9 !important;
}

.th-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
}

.sub-table {
  color: #93aeb0;
  margin: 0 0.2rem;
  font-weight: 500;
  font-size: 0.68rem;
  line-height: 1.25;
}

.chart-box {
  height: 300px;
  padding: 1rem;
  border-radius: 1rem;
  position: relative;
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 4px #00000014;
}

.table-box {
  border-radius: 1rem;
  background-color: #ffffff;
  border: 1px solid #E8E1D5;
  box-shadow: 0 2px 4px #00000014;
  overflow: hidden;
}

.table-box .header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.4rem;
  border-bottom: 1px solid #E8E1D5;
  background-color: #F7F4EF50;
}

/* Daterangepicker Customization */
.daterangepicker {
  border-radius: 1rem;
  border: none;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  font-family: "Noto Sans Thai", sans-serif;
  margin-top: 8px;
  padding: 8px;
}

.daterangepicker .calendar-table {
  border: none;
}

.daterangepicker td.active,
.daterangepicker td.active:hover {
  background-color: #8BA889;
  color: #fff;
}

.daterangepicker td.available:not(.active):hover,
.daterangepicker th.available:hover {
  background-color: rgba(139, 168, 137, 0.1);
}

.daterangepicker .drp-buttons .btn {
  border-radius: 0.5rem;
  font-weight: 600;
  padding: 4px 12px;
  border: 0;
}

.daterangepicker .drp-buttons .btn-primary {
  color: #ffffff;
  background-color: #8BA889;
  border-color: #8BA889;
}

.daterangepicker .month select {
  color: #455145;
  font-weight: 700;
  margin: 0 0.2rem;
  border: 1px solid #8ba88982;
  border-radius: 0.25rem;
  padding-left: 0.25rem;
}


/* Map Custom Styles */
.thailand-map-svg {
  filter: drop-shadow(0 10px 25px rgba(139, 168, 137, 0.15));
  transition: transform 0.5s ease;
  width: 100%;
  height: 100%;
}

.map-pins-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.map-pin {
  position: absolute;
  width: 24px;
  height: 24px;
  background-color: #ffffff;
  border: 3px solid var(--sage-green);
  border-radius: 100%;
  cursor: pointer;
  transform: translate(-50%, -50%);
  transition: all 400ms cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  pointer-events: auto !important;
}

.map-pin::after {
  content: '';
  width: 11px;
  height: 11px;
  border: 3px solid white;
  background-color: var(--sage-green);
  border-radius: 100%;
  transition: all 400ms ease;
}

.map-pin:hover {
  transform: translate(-50%, -50%) scale(1.2);
  background-color: #ffffff;
  border-color: var(--forest-green);
  z-index: 35;
  box-shadow: 0 8px 16px rgba(45, 79, 30, 0.2);
}

.map-pin:hover::after {
  background-color: var(--forest-green);
}

.map-pin.active {
  background-color: var(--sage-green);
  border-color: #ffffff;
  width: 28px;
  height: 28px;
  transform: translate(-50%, -50%) scale(1.1);
  box-shadow: 0 0 0 4px rgba(139, 168, 137, 0.3);
  animation: pulse-pin 2s infinite;
  z-index: 40;
}

.map-pin.active::after {
  background-color: #8ba889;
  border: 0;
  width: 7px;
  height: 7px;
}

.map-pin.group-pin::after {
  display: none;
}

.map-pin.group-pin {
  border-width: 2px;
  width: 24px;
  height: 24px;
  color: var(--sage-green);
  background-color: #ffffff;
}

.map-pin.group-pin:hover {
  background-color: var(--sage-green);
  color: #ffffff;
  border-color: #ffffff;
}

.map-pin.group-pin:hover span {
  color: #ffffff;
}

@keyframes pulse-pin {
  0% {
    box-shadow: 0 0 0 0 rgba(139, 168, 137, 0.6);
  }

  70% {
    box-shadow: 0 0 0 15px rgba(139, 168, 137, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(139, 168, 137, 0);
  }
}

.map-overlay-root {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: radial-gradient(circle at center, #ffffff 0%, var(--bg-main) 100%);
}

.map-overlay-root object {
  width: 100%;
  user-select: none;
  -webkit-user-select: none;
}

/* Loader */
.modal-overlay {
  display: flex;
  justify-content: center;
  align-items: center;
  position: fixed;
  visibility: hidden;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 2000;
  opacity: 0;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay:not(.hidden) {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  aspect-ratio: auto;
  width: 90%;
  max-width: 25rem;
  padding: 2.5rem 2rem 2rem;
  border-radius: 0.75rem;
  color: #333;
  background-color: #fff;
  box-shadow: 0 0.3125rem 1.25rem rgba(0, 0, 0, 0.3);
}

.modal-content h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  margin-top: 0.25rem;
}

.confirm-icon {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 2.25rem;
  margin-bottom: 1rem;
}

.confirm-icon {
  background-color: #fef2f2;
  color: #ef4444;
}

.confirm-text {
  color: #7f8c8d;
  font-size: 0.85rem;
  line-height: 1.6;
  max-width: 90%;
}

.modal-footer {
  display: flex;
  width: 100%;
  margin-top: 2rem;
}

/* Button */
.form-action-btn {
  padding: 0.55rem 1.5rem;
  border: none;
  border-radius: 5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50%;
  margin: auto;
  background-color: #00a99d;
  color: #ffffff;
}


/* Custom scrollbar */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

::-webkit-scrollbar-track {
  background: var(--bg-sidebar);
}

::-webkit-scrollbar-thumb {
  background: var(--border-natural);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* =================================== */
.hidden {
  display: none !important;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bg-green-500 {
  background-color: #22c55e !important;
}

.bg-slate-300 {
  background-color: #cbd5e1 !important;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: .5;
  }
}

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Login View Styling */
#login-view {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background-color: var(--bg-main);
  width: 100%;
  height: 100vh;
}

#login-view.hidden {
  display: none !important;
}

.login-card {
  width: 100%;
  max-width: 384px;
  background-color: #ffffff;
  padding: 2rem;
  border-radius: 1rem;
  border: 1px solid var(--border-natural);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  box-sizing: border-box;
}

.login-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 1.5rem;
  text-align: center;
}

.login-logo {
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.75rem;
  color: #ffffff;
  background-color: var(--sage-green);
  margin-bottom: 1rem;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.login-logo i {
  font-size: 1.5rem;
}

.login-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--forest-green);
}

.login-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  line-height: 1.4;
  text-wrap: balance;
}

#login-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.input-block {
  display: flex;
  flex-direction: column;
}

.input-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: #475569;
  margin-bottom: 0.375rem;
}

.input-relative {
  position: relative;
}

.input-icon {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  padding-left: 0.75rem;
  color: #94a3b8;
  pointer-events: none;
}

.input-icon i {
  font-size: 0.875rem;
}

.login-input {
  width: 100%;
  border-radius: 0.5rem;
  border: 1px solid #e2e8f0;
  padding: 0.625rem 1rem 0.625rem 2.5rem;
  outline: none;
  font-size: 0.875rem;
  color: #334155;
  background-color: #ffffff;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  box-sizing: border-box;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.login-input:focus {
  border-color: var(--sage-green);
  box-shadow: 0 0 0 1px var(--sage-green);
}

.login-submit-container {
  padding-top: 0.5rem;
}

.login-submit-btn {
  width: 100%;
  padding: 0.625rem 1rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  background-color: var(--sage-green);
  color: #ffffff;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: background-color 0.15s ease-in-out;
}

.login-submit-btn:hover {
  background-color: var(--forest-green);
}

/* Main View Styling & Responsiveness */
#main-view {
  display: flex;
  flex-direction: column;
}

@media (min-width: 1024px) {
  #main-view {
    flex-direction: row;
  }

  .loc-section {
    width: 650px;
  }
}

@media (min-width: 768px) {
  .loc-section {
    padding: 1.75rem;
  }
}

.loc-section header {
  padding-top: 0.25rem;
}

@media (min-width: 1024px) {
  .loc-section header {
    padding-top: 0;
  }
}

.header-title-wrap {
  display: flex;
  align-items: center;
}

.header-user-container {
  display: flex;
  align-items: center;
  margin-left: auto;
  flex-shrink: 0;
  margin-top: 0.5rem;
}

.loc-section section {
  flex: 1;
  overflow-y: auto;
  padding-left: 0.25rem;
  padding-right: 0.5rem;
  padding-bottom: 0.5rem;
  box-sizing: border-box;
}

@media (min-width: 768px) {
  .loc-section section {
    padding-right: 1rem;
  }
}

main {
  flex: 1;
  position: relative;
  height: 100%;
  display: none;
}

@media (min-width: 768px) {
  main {
    display: flex;
  }
}

#map-container {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
}

.map-wrapper {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateX(-6%);
  max-height: 100%;
}

.map-pins-layer {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}

/* Map Stats Popup Overlay Styling */
#map-stats {
  position: absolute;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 10;
}

#map-stats.hidden {
  display: none !important;
}

.map-stats-box {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  padding: 1.25rem 1.5rem;
  width: 440px;
  max-width: 100%;
}

.stats-header {
  padding-right: 2rem;
  border-bottom: 1px solid var(--border-natural);
  padding-bottom: 0.625rem;
}

.stats-title {
  font-size: 0.875rem;
  font-weight: bold;
  color: #1e293b;
  line-height: 1.25;
  letter-spacing: -0.025em;
}

.stats-address {
  font-size: 11px;
  color: #64748b;
  margin-top: 0.25rem;
  display: flex;
  align-items: start;
  gap: 0.25rem;
}

.stats-address i {
  margin-top: 0.125rem;
  opacity: 0.7;
}

.status-indicator-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50rem;
}

.stat-box .grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.5rem;
}

.stat-box .grid>div {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Logout Actions Confirmation Modal styling */
.modal-buttons-group {
  display: flex;
  gap: 0.75rem;
  width: 100%;
  margin-top: 1.5rem;
}

.modal-btn-cancel {
  flex: 1;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  font-weight: 600;
  border: 1px solid #e2e8f0;
  color: #475569;
  background-color: transparent;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-btn-cancel:hover {
  background-color: #f1f5f9;
}

.modal-btn-confirm {
  flex: 1;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  font-weight: 600;
  border: none;
  color: #ffffff;
  background-color: #dc2626;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-btn-confirm:hover {
  background-color: #b91c1c;
}

/* Details Page styling */
#details-view {
  display: flex;
  flex-direction: column;
}

#details-view.hidden {
  display: none !important;
}

#detail-header h1 {
  font-size: 1rem;
  color: #1e293b;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (min-width: 768px) {
  #detail-header h1 {
    font-size: 1.125rem;
  }
}

.details-container {
  width: 100%;
  max-width: 80rem;
  margin-left: auto;
  margin-right: auto;
  padding: 1rem;
  flex: 1;
  box-sizing: border-box;
}

@media (min-width: 768px) {
  .details-container {
    padding: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .details-container {
    padding: 2rem;
  }
}

#detail-filter-container .input,
#detail-filter-container .input-date {
  width: 100%;
}

@media (min-width: 768px) {
  #detail-filter-container .input:not(#detail-date-select) {
    width: auto;
  }

  #detail-filter-container .input-date {
    width: 13rem;
  }
}

.chart-grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

@media (min-width: 1280px) {
  .chart-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .xl\:col-span-2 {
    grid-column: span 2 / span 2;
  }
}

.table-box .header h2 {
  font-weight: bold;
  color: var(--forest-green);
  font-size: 1.125rem;
}

.table-scroll-container {
  overflow: auto;
  max-height: 500px;
  position: relative;
}

.data-table thead tr {
  letter-spacing: 0.05em;
}

.logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 100%;
  width: 1.7rem;
  height: 1.7rem;
  font-size: 0.75rem;
  padding-left: 0.15rem;
  color: #f43f5e;
  border: 1px solid #E3DCCE;
  background-color: #ffffff80;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.logout-btn:hover {
  color: #ffffff;
  background-color: #f43f5e;
  border-color: #f43f5e;
}

/* =============================== */
.flex {
  display: flex !important;
}

.flex-col {
  flex-direction: column !important;
}

.flex-row {
  flex-direction: row !important;
}

.flex-wrap {
  flex-wrap: wrap !important;
}

.items-center {
  align-items: center !important;
}

.items-start {
  align-items: flex-start !important;
}

.justify-center {
  justify-content: center !important;
}

.justify-between {
  justify-content: space-between !important;
}

.grid {
  display: grid !important;
}

.gap-3 {
  gap: 0.75rem !important;
}

.gap-4 {
  gap: 1rem !important;
}

.gap-6 {
  gap: 1.5rem !important;
}

.relative {
  position: relative !important;
}

.absolute {
  position: absolute !important;
}

.inset-0 {
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}

.z-10 {
  z-index: 10 !important;
}

.z-20 {
  z-index: 20 !important;
}

.mb-2 {
  margin-bottom: 0.5rem !important;
}

.mt-4 {
  margin-top: 1rem !important;
}

.text-2xl {
  font-size: 1.5rem !important;
  line-height: 2rem;
}

.text-left {
  text-align: left !important;
}

#location-list {
  display: grid !important;
  gap: 1.5rem !important;
}

.loc-box:not(.map-stats-box) {
  padding: 1.25rem !important;
}

@media (min-width: 768px) {
  .loc-box:not(.map-stats-box) {
    padding: 1.5rem !important;
  }
}

.region.region-north {
  background-color: rgba(234, 240, 234, 0.8) !important;
  color: #556b2f !important;
  border-color: rgba(85, 107, 47, 0.2) !important;
}

.region.region-northeast {
  background-color: rgba(249, 236, 224, 0.8) !important;
  color: #a0522d !important;
  border-color: rgba(160, 82, 45, 0.2) !important;
}

.region.region-east {
  background-color: rgba(230, 244, 241, 0.8) !important;
  color: #2c7b8d !important;
  border-color: rgba(44, 123, 141, 0.2) !important;
}

.region.region-other {
  background-color: rgba(234, 232, 249, 0.8) !important;
  color: #483d8b !important;
  border-color: rgba(72, 61, 139, 0.2) !important;
}

.update-timestamp {
  font-size: 10px !important;
  color: #64748b !important;
  font-weight: 500 !important;
}

.group-pin-close {
  position: absolute;
  background-color: var(--sage-green);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  cursor: pointer;
  z-index: 20;
  transition: transform 0.15s ease-in-out;
}

.group-pin-close:hover {
  transform: translate(-50%, -50%) scale(1.25) !important;
}

.loc-stats-grid {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 0.75rem !important;
}

@media (min-width: 768px) {
  .loc-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    column-gap: 1.25rem !important;
  }
}

.stat-values-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 1rem !important;
  position: relative !important;
  z-index: 10 !important;
}

/* Responsive Layout for Mobile - Show Map Below Locations List */
@media (max-width: 1023px) {
  #main-view.root-content {
    overflow-y: auto !important;
    height: auto !important;
    min-height: 100vh;
  }

  .loc-section {
    height: auto !important;
    overflow: visible !important;
    border-right: none !important;
    border-bottom: 3px solid #E8E1D5 !important;
  }

  .loc-section section {
    flex: none !important;
    overflow-y: visible !important;
    height: auto !important;
    padding-bottom: 1.5rem !important;
  }

  main {
    display: flex !important;
    min-height: 100vh !important;
    position: relative !important;
    flex-shrink: 0 !important;
    padding: 2rem 0 4rem;
  }

  #map-container {
    position: relative !important;
    height: 100% !important;
  }

  .map-wrapper {
    height: 100% !important;
    max-height: 100% !important;
    transform: translateX(0) !important;
  }

  #map-stats {
    position: absolute !important;
    bottom: 0.5rem !important;
    right: 1rem !important;
    z-index: 50 !important;
  }
}

@media (max-width: 320px) {
  .loc-section header .title {
    font-size: 1rem;
  }

  .loc-box .name {
    font-size: 0.9rem;
  }
}