/* =========================================================================
   PayNex Admin — Self-contained Toggle Switch
   Does NOT depend on Tailwind `peer-checked` variants (those are missing from
   the precompiled app.css). Pure CSS so the thumb always renders + slides.
   ========================================================================= */

.pn-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  cursor: pointer;
}
.pn-switch__input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.pn-switch__track {
  width: 52px;
  height: 30px;
  border-radius: 999px;
  background: #334155; /* OFF — slate / dim */
  display: flex;
  align-items: center;
  padding: 0 3px;
  box-sizing: border-box;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.35);
  transition: background-color 0.25s ease, box-shadow 0.25s ease;
}
.pn-switch__thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  transform: translateX(0); /* OFF — left */
  transition: transform 0.25s ease;
}
.pn-switch__input:checked + .pn-switch__track {
  background: #10b981; /* ON — emerald green */
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.22);
}
.pn-switch__input:checked + .pn-switch__track .pn-switch__thumb {
  transform: translateX(22px); /* ON — right */
}
.pn-switch__input:focus-visible + .pn-switch__track {
  outline: 2px solid #34d399;
  outline-offset: 2px;
}
.pn-switch.is-loading {
  opacity: 0.65;
  cursor: progress;
}
.pn-switch.is-loading .pn-switch__thumb {
  animation: pn-thumb-pulse 0.9s ease-in-out infinite;
}
@keyframes pn-thumb-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(0.82); }
}
@media (prefers-color-scheme: dark) {
  .pn-switch__track { background: #475569; }
}

/* ---- Status pill (next to the switch) ---- */
.pn-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.pn-status--on {
  color: #047857;
  background: #d1fae5;
  border: 1px solid rgba(16, 185, 129, 0.5);
}
.pn-status--off {
  color: #475569;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
}
.pn-status--loading {
  color: #b45309;
  background: #fef3c7;
  border: 1px solid #fcd34d;
}
@media (prefers-color-scheme: dark) {
  .pn-status--on { color: #6ee7b7; background: rgba(16, 185, 129, 0.15); border-color: rgba(16, 185, 129, 0.5); }
  .pn-status--off { color: #94a3b8; background: #1e293b; border-color: #334155; }
  .pn-status--loading { color: #fcd34d; background: rgba(251, 191, 36, 0.12); border-color: rgba(251, 191, 36, 0.4); }
}

/* ---- Card green glow when ON ---- */
.pn-card--on {
  border-color: rgba(16, 185, 129, 0.4) !important;
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.25), 0 10px 30px -14px rgba(16, 185, 129, 0.45);
}
