/* ============================================================
   Xetiko professional light/dark theme toggle button
   Styled for BOTH modes. Loaded on every layout.
   ============================================================ */
.xe-theme-toggle {
  --xe-tg-w: 58px;
  --xe-tg-h: 30px;
  --xe-tg-pad: 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  line-height: 0;
  flex: 0 0 auto;
  -webkit-tap-highlight-color: transparent;
}

.xe-theme-toggle__track {
  position: relative;
  width: var(--xe-tg-w);
  height: var(--xe-tg-h);
  border-radius: 999px;
  background: linear-gradient(145deg, #1c2334, #0d1320);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.55);
  transition: background 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

.xe-theme-toggle__thumb {
  position: absolute;
  top: var(--xe-tg-pad);
  left: var(--xe-tg-pad);
  width: calc(var(--xe-tg-h) - var(--xe-tg-pad) * 2);
  height: calc(var(--xe-tg-h) - var(--xe-tg-pad) * 2);
  border-radius: 50%;
  background: linear-gradient(145deg, #303852, #161c2b);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
  transition: transform 0.4s cubic-bezier(0.4, 0.1, 0.2, 1),
    background 0.35s ease, color 0.35s ease, box-shadow 0.35s ease;
}

.xe-theme-toggle .xe-ic {
  position: absolute;
  top: 50%;
  left: 50%;
  font-size: 14px;
  transform: translate(-50%, -50%);
  transition: opacity 0.25s ease;
}

.xe-theme-toggle .xe-ic--moon {
  color: #cbd5e1;
  opacity: 1;
}

.xe-theme-toggle .xe-ic--sun {
  color: #f59e0b;
  opacity: 0;
}

/* Light state */
.xe-theme-toggle.is-light .xe-theme-toggle__track {
  background: linear-gradient(145deg, #dbeafe, #bfdbfe);
  border-color: rgba(15, 23, 42, 0.1);
  box-shadow: inset 0 1px 3px rgba(15, 23, 42, 0.12);
}

.xe-theme-toggle.is-light .xe-theme-toggle__thumb {
  transform: translateX(calc(var(--xe-tg-w) - var(--xe-tg-h)));
  background: linear-gradient(145deg, #ffffff, #fde68a);
  box-shadow: 0 1px 4px rgba(245, 158, 11, 0.5);
}

.xe-theme-toggle.is-light .xe-ic--moon {
  opacity: 0;
}

.xe-theme-toggle.is-light .xe-ic--sun {
  opacity: 1;
}

.xe-theme-toggle:focus-visible {
  outline: 2px solid hsl(216 100% 60%);
  outline-offset: 3px;
  border-radius: 999px;
}

/* Placement helpers */
.xe-theme-toggle--header {
  margin-right: 10px;
}
@media (max-width: 991px) {
  .xe-theme-toggle--header {
    margin-right: 6px;
  }
}
.dashboard-header__left .xe-theme-toggle {
  margin: 0;
}

/* Neutralize the template's legacy theme switch.
   Kept in the DOM so the existing baseline JS keeps working,
   but hidden so users only see the new professional toggle. */
.theme-switch-wrapper,
.theme-switch {
  display: none !important;
}
