:root {
  --gpsmax-primary: #0b3d2e;
  --gpsmax-accent: #1a8f5c;
  --gpsmax-light: #e8f5ef;
}

.bg-gpsmax {
  background-color: var(--gpsmax-primary) !important;
}

.btn-gpsmax {
  background-color: var(--gpsmax-accent);
  border-color: var(--gpsmax-accent);
  color: #fff;
}

.btn-gpsmax:hover {
  background-color: #157a4f;
  border-color: #157a4f;
  color: #fff;
}

.text-gpsmax {
  color: var(--gpsmax-primary) !important;
}

.login-page {
  background: linear-gradient(135deg, var(--gpsmax-light), #fff);
}

.stat-card {
  border-left: 4px solid var(--gpsmax-accent);
}

.sb-sidenav .nav-link {
  padding: 0.45rem 1rem;
  font-size: 0.9rem;
}

.sb-sidenav-menu-heading {
  font-size: 0.7rem;
  letter-spacing: 0.05em;
}

/* ── Page load progress & overlay ── */
#gpsmax-page-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  width: 0;
  z-index: 20060;
  background: linear-gradient(90deg, var(--gpsmax-accent), #2ecc71, var(--gpsmax-accent));
  box-shadow: 0 0 12px rgba(26, 143, 92, 0.65);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

html.gpsmax-page-loading #gpsmax-page-progress {
  opacity: 1;
}

#gpsmax-page-progress.is-active {
  animation: gpsmax-progress-indeterminate 1.4s ease-in-out infinite;
}

#gpsmax-page-progress.is-complete {
  width: 100% !important;
  animation: none;
  transition: width 0.25s ease;
}

@keyframes gpsmax-progress-indeterminate {
  0% { width: 0; margin-left: 0; }
  50% { width: 65%; margin-left: 15%; }
  100% { width: 0; margin-left: 100%; }
}

#gpsmax-page-overlay {
  position: fixed;
  inset: 0;
  z-index: 20050;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(11, 61, 46, 0.42);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  pointer-events: all;
}

html.gpsmax-page-loading #gpsmax-page-overlay {
  display: flex;
}

html.gpsmax-page-nav.gpsmax-page-loading #gpsmax-page-overlay {
  background: rgba(11, 61, 46, 0.52);
}

.gpsmax-page-overlay-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  padding: 1.85rem 2.5rem;
  background: #fff;
  border-radius: 0.75rem;
  box-shadow: 0 16px 48px rgba(11, 61, 46, 0.28);
  border: 2px solid rgba(26, 143, 92, 0.35);
  min-width: 12rem;
}

html.gpsmax-page-loading .gpsmax-spinner {
  width: 2.75rem;
  height: 2.75rem;
  border-width: 4px;
}

.gpsmax-page-overlay-text {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--gpsmax-primary);
  letter-spacing: 0.01em;
}

/* ── Shared spinner ── */
.gpsmax-spinner {
  width: 2.25rem;
  height: 2.25rem;
  border: 3px solid var(--gpsmax-light);
  border-top-color: var(--gpsmax-accent);
  border-radius: 50%;
  animation: gpsmax-spin 0.75s linear infinite;
}

.gpsmax-btn-spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  margin-right: 0.35rem;
  vertical-align: -0.15em;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: gpsmax-spin 0.65s linear infinite;
}

@keyframes gpsmax-spin {
  to { transform: rotate(360deg); }
}

/* ── Modal loading overlay ── */
.modal-body.gpsmax-modal-body-loading {
  position: relative;
  min-height: 8rem;
}

.gpsmax-modal-loading {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.92);
  border-radius: inherit;
  border: 1px solid rgba(26, 143, 92, 0.2);
}

.gpsmax-modal-loading-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  color: var(--gpsmax-primary);
  font-size: 0.9rem;
  font-weight: 500;
}

.modal-body.gpsmax-modal-body-loading > :not(.gpsmax-modal-loading) {
  visibility: hidden;
}

.btn-gpsmax:disabled,
.btn-gpsmax.disabled {
  opacity: 0.72;
  cursor: not-allowed;
}
