/* ============================================================
   SETTINGS PAGE — GLASSMORPHISM + AURORA DESIGN
   A completely unique visual language for the settings page
   ============================================================ */

/* ── Aurora Background Orbs ──────────────────────────── */
.stg-aurora-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.stg-aurora-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.15;
  animation: auroraFloat 12s ease-in-out infinite alternate;
}

.stg-aurora-orb--1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #6366f1, #8b5cf6, transparent 70%);
  top: -100px;
  right: -100px;
  animation-duration: 14s;
}

.stg-aurora-orb--2 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, #06b6d4, #0ea5e9, transparent 70%);
  bottom: -80px;
  left: 20%;
  animation-duration: 10s;
  animation-delay: -3s;
}

.stg-aurora-orb--3 {
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, #ec4899, #f43f5e, transparent 70%);
  top: 40%;
  left: -60px;
  animation-duration: 16s;
  animation-delay: -6s;
}

@keyframes auroraFloat {
  0% {
    transform: translate(0, 0) scale(1);
  }

  33% {
    transform: translate(30px, -40px) scale(1.1);
  }

  66% {
    transform: translate(-20px, 20px) scale(0.95);
  }

  100% {
    transform: translate(15px, -15px) scale(1.05);
  }
}

/* ── Page Container ──────────────────────────────────── */
.stg-page {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-bottom: 32px;
  position: relative;
  z-index: 1;
}

/* ── Row Layouts ─────────────────────────────────────── */
.stg-row--main {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 18px;
}

.stg-row--triple {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 18px;
}

/* ── Apple Vision Glass Card ────────────────────────────── */
.stg-card {
  position: relative;
  border-radius: var(--r-xl);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-card);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  box-shadow: var(--shadow-md);
  transition: all var(--dur) var(--ease);
}

.stg-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  pointer-events: none;
}

.stg-card:hover {
  border-color: var(--border-light);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

/* Accent bar top */
.stg-card__accent {
  height: 2.5px;
  background: linear-gradient(90deg, #0071e3, #47a3ff);
}

.stg-card__accent--ai {
  background: linear-gradient(90deg, #8b5cf6, #ec4899);
}

.stg-card__accent--orange {
  background: linear-gradient(90deg, #f59e0b, #ef4444);
}

.stg-card__accent--cyan {
  background: linear-gradient(90deg, #06b6d4, #0071e3);
}

.stg-card__accent--green {
  background: linear-gradient(90deg, #10b981, #06b6d4);
}

.stg-card__inner {
  background: transparent;
  border: none;
  padding: 22px;
}

/* ── Card Header ─────────────────────────────────────── */
.stg-card__head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.stg-card__head--sm {
  margin-bottom: 16px;
}

.stg-card__title {
  font-size: 15px;
  font-weight: 700;
  color: #f8fafc;
  margin: 0;
  letter-spacing: -0.2px;
}

.stg-card__sub {
  font-size: 11px;
  color: #64748b;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  font-weight: 500;
}

/* ── Icon Circle ─────────────────────────────────────── */
.stg-icon-circle {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 16px;
  flex-shrink: 0;
  position: relative;
}

.stg-icon-circle::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 14px;
  opacity: 0.25;
  z-index: -1;
  filter: blur(8px);
}

.stg-icon-circle--fb {
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: #fff;
}

.stg-icon-circle--fb::after {
  background: #3b82f6;
}

.stg-icon-circle--ai {
  background: linear-gradient(135deg, #a855f7, #ec4899);
  color: #fff;
}

.stg-icon-circle--ai::after {
  background: #a855f7;
}

.stg-icon-circle--orange {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
}

.stg-icon-circle--orange::after {
  background: #f59e0b;
}

.stg-icon-circle--cyan {
  background: linear-gradient(135deg, #06b6d4, #3b82f6);
  color: #fff;
}

.stg-icon-circle--cyan::after {
  background: #06b6d4;
}

.stg-icon-circle--green {
  background: linear-gradient(135deg, #10b981, #06b6d4);
  color: #fff;
}

.stg-icon-circle--green::after {
  background: #10b981;
}

/* ── Status Pill ─────────────────────────────────────── */
.stg-status-pill {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.04);
  padding: 3px 10px;
  height: 24px;
  line-height: 24px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-weight: 600;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}

.stg-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.6);
  flex-shrink: 0;
}

.stg-status-pill.connected .stg-status-dot {
  background: #22c55e;
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.6);
}

.stg-status-pill.error .stg-status-dot {
  background: #ef4444;
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.6);
}

/* ── Tag ─────────────────────────────────────────────── */
.stg-tag {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 0 9px;
  height: 24px;
  line-height: 24px;
  border-radius: 6px;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}

.stg-tag--purple {
  color: #c084fc;
  background: rgba(168, 85, 247, 0.12);
  border: 1px solid rgba(168, 85, 247, 0.2);
}

/* Global Anti-Squish & Razor-Sharp Micro-Tags */
#heroRoleBadge,
#schedulerStatusBadge,
#twoFaStatusBadge,
#tikhubStatusBadge,
#tgBotStatus,
#fbConnectionStatus {
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  border-radius: 6px !important;
  height: 24px !important;
  line-height: 24px !important;
  padding: 0 10px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
}

/* ── Highlight Box ───────────────────────────────────── */
.stg-highlight-box {
  background: rgba(99, 102, 241, 0.06);
  border: 1px solid rgba(99, 102, 241, 0.12);
  border-radius: 12px;
  display: flex;
  overflow: hidden;
  margin-bottom: 18px;
}

.stg-highlight-box__bar {
  width: 3px;
  flex-shrink: 0;
  background: linear-gradient(180deg, #6366f1, #06b6d4);
}

.stg-highlight-box__content {
  padding: 16px 18px;
  flex: 1;
}

/* ── Labels ──────────────────────────────────────────── */
.stg-label-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #a5b4fc;
  margin-bottom: 6px;
}

.stg-label-row i {
  font-size: 13px;
}

.stg-label-row--sub {
  color: #94a3b8;
  margin-bottom: 12px;
}

.stg-help-text {
  font-size: 11.5px;
  color: #64748b;
  margin-bottom: 12px;
  line-height: 1.5;
}

.stg-help-text a {
  color: #818cf8;
  text-decoration: none;
  border-bottom: 1px dashed rgba(129, 140, 248, 0.3);
  transition: border-color 0.2s;
}

.stg-help-text a:hover {
  border-color: #818cf8;
}

/* ── Apple Vision Glass Inputs ──────────────────────────── */
.stg-input {
  width: 100%;
  padding: 9px 14px;
  height: 40px;
  background: rgba(8, 11, 20, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--r-md);
  color: #f8fafc;
  font-size: 13px;
  font-family: var(--font);
  outline: none;
  transition: all var(--dur) var(--ease);
  box-sizing: border-box;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.stg-input:focus {
  border-color: #47a3ff;
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.22), 0 0 20px rgba(0, 113, 227, 0.15);
  background: rgba(12, 16, 28, 0.85);
}

.stg-input::placeholder {
  color: #64748b;
}

.stg-textarea {
  resize: vertical;
  min-height: 70px;
  height: auto;
  line-height: 1.5;
}

.stg-select {
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2347a3ff' viewBox='0 0 16 16'%3E%3Cpath d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

/* ── Input Row ───────────────────────────────────────── */
.stg-input-row {
  display: flex;
  gap: 8px;
}

.stg-input-row .stg-input {
  flex: 1;
}

/* ── Input + Unit ────────────────────────────────────── */
.stg-input-unit {
  display: flex;
  align-items: stretch;
}

.stg-input-unit .stg-input {
  border-radius: 6px 0 0 6px;
  border-right: none;
  max-width: 90px;
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  color: #f1f5f9;
}

.stg-unit {
  display: grid;
  place-items: center;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: none;
  border-radius: 0 6px 6px 0;
  font-size: 12px;
  font-weight: 500;
  color: #64748b;
  white-space: nowrap;
}

/* ── Grid ────────────────────────────────────────────── */
.stg-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* ── Fields ──────────────────────────────────────────── */
.stg-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stg-field label {
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.stg-hint {
  font-size: 11px;
  color: #475569;
}

.stg-hint a {
  color: #818cf8;
  text-decoration: none;
}

.stg-hint a:hover {
  text-decoration: underline;
}

/* ── Badge ───────────────────────────────────────────── */
.stg-badge-free {
  display: inline-flex;
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
  margin-left: 4px;
}

/* ── Linear Buttons ──────────────────────────────────── */
.stg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 16px;
  height: 38px;
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid transparent;
  white-space: nowrap;
  box-sizing: border-box;
}

.stg-btn i {
  font-size: 12.5px !important;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stg-btn--primary {
  background: #5e6ad2;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 2px 6px rgba(94, 106, 210, 0.35);
}

.stg-btn--primary:hover {
  background: #6875e5;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 4px 12px rgba(94, 106, 210, 0.5);
  transform: translateY(-1px);
}

.stg-btn--ghost {
  background: rgba(255, 255, 255, 0.04);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.stg-btn--ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.stg-btn--outline {
  background: transparent;
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.stg-btn--outline:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

/* ── Separator ───────────────────────────────────────── */
.stg-separator {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent);
  margin: 18px 0;
}

/* ── Verify Bar ──────────────────────────────────────── */
.stg-verify-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}

/* ── Presets ──────────────────────────────────────────── */
.stg-presets {
  display: flex;
  gap: 6px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.stg-chip {
  padding: 5px 14px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.2s ease;
}

.stg-chip:hover {
  color: #c7d2fe;
  border-color: rgba(99, 102, 241, 0.3);
  background: rgba(99, 102, 241, 0.08);
}

.stg-chip.active {
  color: #a5b4fc;
  border-color: rgba(99, 102, 241, 0.4);
  background: rgba(99, 102, 241, 0.12);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.15);
}

/* ── Info List (System Card) ─────────────────────────── */
.stg-info-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.stg-info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 12px;
}

.stg-info-item:last-child {
  border-bottom: none;
}

.stg-info-item>span:first-child {
  color: #64748b;
  font-weight: 500;
}

.stg-info-val {
  color: #94a3b8;
  font-weight: 600;
  font-family: var(--font-mono);
  font-size: 11px;
}

.stg-info-val--ok {
  color: #4ade80;
}

.stg-info-val--ok i {
  font-size: 6px;
  vertical-align: middle;
  margin-right: 4px;
  animation: pulse-glow 2s infinite;
}

/* ── AI Demo Section ─────────────────────────────────── */
.stg-ai-demo {
  background: rgba(168, 85, 247, 0.04);
  border: 1px solid rgba(168, 85, 247, 0.1);
  border-radius: 10px;
  overflow: hidden;
}

.stg-ai-demo__header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 600;
  color: #c084fc;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(168, 85, 247, 0.08);
}

.stg-ai-demo__body {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
}

.stg-ai-demo__body .stg-input {
  flex: 1;
}

.stg-ai-demo__result {
  padding: 12px 14px;
  border-top: 1px solid rgba(168, 85, 247, 0.08);
}

.stg-ai-demo__result pre {
  font-family: var(--font);
  font-size: 12px;
  color: #e2e8f0;
  white-space: pre-wrap;
  line-height: 1.6;
  margin: 0;
}

/* ── Save Bar ────────────────────────────────────────── */
.stg-save-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: rgba(10, 14, 28, 0.92);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: 20px;
  padding: 12px 24px;
  position: fixed !important;
  bottom: 24px !important;
  left: calc(var(--sidebar-w, 260px) + (100vw - var(--sidebar-w, 260px)) / 2) !important;
  transform: translateX(-50%) !important;
  width: auto !important;
  min-width: 520px !important;
  max-width: min(760px, calc(100vw - var(--sidebar-w, 260px) - 48px)) !important;
  z-index: 9990 !important;
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.75), 0 0 35px rgba(99, 102, 241, 0.25);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.stg-save-bar:hover {
  border-color: rgba(99, 102, 241, 0.6);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85), 0 0 45px rgba(99, 102, 241, 0.4);
}

.stg-save-bar__left {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: #94a3b8;
  min-width: 0;
  flex: 1;
}

.stg-save-bar__left i {
  color: #10b981;
  font-size: 16px;
  flex-shrink: 0;
}

.stg-save-bar__left span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stg-btn--save {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  border: none;
  padding: 11px 28px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);
  letter-spacing: 0.2px;
}

.stg-btn--save:hover {
  box-shadow: 0 6px 24px rgba(99, 102, 241, 0.5);
  transform: translateY(-1px);
}

/* ===================== DASHBOARD STAT CARDS ===================== */
.stg-row--quad {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.stg-stat-card {
  transition: transform 0.3s ease;
}

.stg-stat-card:hover {
  transform: translateY(-3px);
}

.stg-stat-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
}

.stg-stat-data {
  display: flex;
  flex-direction: column;
}

.stg-stat-label {
  font-size: 11px;
  color: #64748b;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.stg-stat-value {
  font-size: 28px;
  font-weight: 800;
  color: #f1f5f9;
  line-height: 1.1;
  letter-spacing: -1px;
  margin: 0;
}

/* ===================== GLASS TOPBAR ===================== */
.topbar {
  position: relative !important;
  z-index: 1000 !important;
  background: rgba(12, 15, 30, 0.6) !important;
  backdrop-filter: blur(16px) saturate(1.3) !important;
  -webkit-backdrop-filter: blur(16px) saturate(1.3) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04) !important;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.2) !important;
}

/* ===================== BULK TOOLBAR (QUEUE) ===================== */
.bulk-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  margin-bottom: 12px;
}

.bulk-toolbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bulk-toolbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.bulk-check-all-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #94a3b8;
  cursor: pointer;
}

/* ── Modern iOS-Style Toggle Switch ────────────────── */
.stg-toggle-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
  background: #080a10;
  padding: 0 14px;
  height: 38px;
  width: 100%;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.15s ease;
  box-sizing: border-box;
}

.stg-toggle-wrap:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(238, 77, 45, 0.35);
}

/* Toggle switch styles inherited from components.css */

/* ── Shopee Card Special Enhancements ──────────────── */
.stg-card--shopee {
  border: 1px solid rgba(238, 77, 45, 0.2);
  background: rgba(15, 18, 36, 0.7);
  box-shadow: 0 8px 32px rgba(238, 77, 45, 0.08);
}

.stg-card--shopee:hover {
  box-shadow: 0 12px 40px rgba(238, 77, 45, 0.16), 0 0 0 1px rgba(238, 77, 45, 0.35);
}

.stg-cookie-box {
  background: rgba(238, 77, 45, 0.04);
  border: 1px dashed rgba(238, 77, 45, 0.25);
  border-radius: 12px;
  padding: 14px 16px;
  margin-top: 14px;
  transition: all 0.2s ease;
}

.stg-cookie-box:hover,
.stg-cookie-box:focus-within {
  background: rgba(238, 77, 45, 0.07);
  border-color: rgba(238, 77, 45, 0.45);
  box-shadow: 0 0 20px rgba(238, 77, 45, 0.1);
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 1200px) {
  .stg-row--quad {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 1024px) {
  .stg-row--main {
    grid-template-columns: 1fr;
  }

  .stg-row--triple {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .stg-row--quad {
    grid-template-columns: 1fr;
  }

  .stg-row--triple {
    grid-template-columns: 1fr;
  }

  .stg-grid-2 {
    grid-template-columns: 1fr;
  }

  .stg-input-row {
    flex-direction: column;
  }

  .stg-save-bar {
    flex-direction: column;
    gap: 12px;
  }
}

/* ── Settings Category Tabs ───────────────────────────── */
.settings-tabs-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  overflow-x: auto;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.settings-tabs-bar::-webkit-scrollbar {
  height: 4px;
}

.settings-tabs-bar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.settings-tab-btn {
  background: rgba(255, 255, 255, 0.03);
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.settings-tab-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #f1f5f9;
  border-color: rgba(255, 255, 255, 0.15);
}

.settings-tab-btn.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(168, 85, 247, 0.2));
  color: #ffffff;
  border-color: rgba(168, 85, 247, 0.5);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.25);
}

.settings-tab-pane {
  display: none;
  animation: fadeInPane 0.25s ease-out forwards;
}

.settings-tab-pane.active {
  display: block;
}

@keyframes fadeInPane {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Modern Premium Toggle Switch ─────────────────────── */
.ui-switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.ui-switch-row:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
}

.ui-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.ui-switch input {
  opacity: 0 !important;
  width: 0 !important;
  height: 0 !important;
  position: absolute !important;
  pointer-events: none !important;
}

.ui-switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 30px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ui-switch-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ui-switch input:checked+.ui-switch-slider {
  background: linear-gradient(135deg, #10b981, #06b6d4);
  border-color: #10b981;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
}

.ui-switch input:checked+.ui-switch-slider:before {
  transform: translateX(22px);
  background: #ffffff;
}

/* Color variations */
.ui-switch--blue input:checked+.ui-switch-slider {
  background: linear-gradient(135deg, #0071e3, #38bdf8) !important;
  border-color: #38bdf8 !important;
  box-shadow: 0 0 14px rgba(0, 113, 227, 0.45) !important;
}

.ui-switch--orange input:checked+.ui-switch-slider {
  background: linear-gradient(135deg, #ff5722, #f59e0b);
  border-color: #ff5722;
  box-shadow: 0 0 12px rgba(255, 87, 34, 0.4);
}

.ui-switch--purple input:checked+.ui-switch-slider {
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
  border-color: #8b5cf6;
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.4);
}

/* ── Password & Secret Key Input Wrapper ──────────────── */
.stg-password-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.stg-password-wrap .stg-input {
  width: 100%;
  padding-right: 44px !important;
}

.stg-toggle-pwd {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: #64748b;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
  padding: 0;
  outline: none;
  z-index: 2;
}

.stg-toggle-pwd:hover {
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.08);
}

.stg-toggle-pwd:active {
  transform: translateY(-50%) scale(0.92);
}

/* ── Fanpage Toggle Switch Matrix ─────────────────────── */
.fanpage-switch-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 18px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  margin-bottom: 9px;
  cursor: pointer;
  user-select: none;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.fanpage-switch-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}

.fanpage-switch-card.active {
  background: linear-gradient(135deg, rgba(0, 113, 227, 0.14), rgba(56, 189, 248, 0.06)) !important;
  border-color: rgba(56, 189, 248, 0.45) !important;
  box-shadow: 0 4px 20px rgba(0, 113, 227, 0.16), inset 0 0 16px rgba(56, 189, 248, 0.06);
}

.fanpage-switch-card--master {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 16px;
  margin-bottom: 12px;
  padding: 14px 18px;
}

.fanpage-switch-card--master.active {
  background: linear-gradient(135deg, rgba(0, 113, 227, 0.22), rgba(99, 102, 241, 0.18)) !important;
  border-color: rgba(56, 189, 248, 0.6) !important;
  box-shadow: 0 6px 25px rgba(0, 113, 227, 0.25);
}

.fanpage-switch-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(24, 119, 242, 0.15);
  color: #1877f2;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.fanpage-switch-card.active .fanpage-switch-icon {
  background: linear-gradient(135deg, #0071e3, #1877f2);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(24, 119, 242, 0.4);
}

.fanpage-toggle-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  padding: 3px 9px;
  border-radius: 6px;
  text-transform: uppercase;
  transition: all 0.2s ease;
}

.fanpage-toggle-badge.badge--on {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.35);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

.fanpage-toggle-badge.badge--off {
  background: rgba(148, 163, 184, 0.08);
  color: #64748b;
  border: 1px solid rgba(148, 163, 184, 0.15);
}

.fanpage-switch-btn {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
  flex-shrink: 0;
  cursor: pointer;
  margin: 0;
}

.fanpage-switch-btn input {
  opacity: 0 !important;
  width: 0 !important;
  height: 0 !important;
  position: absolute !important;
  pointer-events: none !important;
}

.fanpage-switch-slider {
  position: absolute;
  inset: 0;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 34px;
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.fanpage-switch-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background: #ffffff;
  border-radius: 50%;
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}

.fanpage-switch-btn input:checked + .fanpage-switch-slider {
  background: linear-gradient(135deg, #0071e3, #38bdf8) !important;
  border-color: #38bdf8 !important;
  box-shadow: 0 0 16px rgba(0, 113, 227, 0.5) !important;
}

.fanpage-switch-btn input:checked + .fanpage-switch-slider:before {
  transform: translateX(22px) !important;
  background: #ffffff !important;
}