/* ==========================================================================
   Email Marketing by Softex Tech — dashboard design system
   Brand palette extracted from softex.pk:
     #F20D5A magenta → #F44A6A coral → #F78B3D orange → #FBBF24 gold
   Typography: Exo 2 (headings) · Space Grotesk (body)
   ========================================================================== */

:root {
  /* Softex logo gradient palette */
  --sx-1: #F20D5A;
  --sx-2: #F44A6A;
  --sx-3: #F78B3D;
  --sx-4: #FBBF24;
  --sx-gradient: linear-gradient(135deg, #F20D5A 0%, #F44A6A 35%, #F78B3D 70%, #FBBF24 100%);
  --sx-gradient-soft: linear-gradient(135deg, rgba(242,13,90,.12), rgba(247,139,61,.12));

  --sx-primary: #F20D5A;
  --sx-primary-hover: #d60b4f;
  --sx-orange: #F78B3D;
  --sx-gold: #FBBF24;

  /* Dark sidebar (matches softex.pk's futuristic dark shell) */
  --sx-sidebar-bg: #05080f;
  --sx-sidebar-bg2: #080d1a;
  --sx-sidebar-border: rgba(242, 13, 90, .16);
  --sx-sidebar-text: #94a3b8;
  --sx-sidebar-active: #f1f5f9;

  /* Light application canvas */
  --sx-bg: #f5f6fa;
  --sx-surface: #ffffff;
  --sx-border: #e8eaf1;
  --sx-border-strong: #d8dbe6;

  --sx-text: #16192b;
  --sx-text-muted: #6b7394;
  --sx-text-light: #98a0bd;

  --sx-success: #16a34a;
  --sx-info: #0ea5e9;
  --sx-warning: #f59e0b;
  --sx-danger: #e11d48;

  --sx-radius: 12px;
  --sx-radius-sm: 9px;
  --sx-radius-lg: 18px;

  --sx-shadow-xs: 0 1px 2px rgba(16, 24, 40, .05);
  --sx-shadow-sm: 0 2px 8px rgba(16, 24, 40, .06);
  --sx-shadow: 0 4px 20px rgba(16, 24, 40, .08);
  --sx-shadow-lg: 0 18px 44px rgba(16, 24, 40, .14);

  --sx-sidebar-w: 268px;
  --sx-header-h: 68px;

  --sx-font-head: 'Exo 2', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --sx-font-body: 'Space Grotesk', 'Segoe UI', system-ui, -apple-system, sans-serif;

  --sx-transition: .18s cubic-bezier(.4, 0, .2, 1);
}

/* Self-hosted brand fonts with graceful system fallback */
@font-face {
  font-family: 'Exo 2';
  src: local('Exo 2'), local('Exo2-Regular');
  font-display: swap;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  font-family: var(--sx-font-body);
  background: var(--sx-bg);
  color: var(--sx-text);
  font-size: 14.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  margin: 0;
}

h1, h2, h3, h4, h5, h6, .sx-head {
  font-family: var(--sx-font-head);
  font-weight: 700;
  letter-spacing: -.015em;
  color: var(--sx-text);
}

a { color: var(--sx-primary); text-decoration: none; transition: color var(--sx-transition); }
a:hover { color: var(--sx-primary-hover); }

::selection { background: rgba(242, 13, 90, .18); }

/* Scrollbars */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cfd4e3; border-radius: 10px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #b3bacd; background-clip: content-box; }

/* ==========================================================================
   Layout shell
   ========================================================================== */

.sx-layout { display: flex; min-height: 100vh; }

/* ------------------------------ Sidebar ---------------------------------- */
.sx-sidebar {
  width: var(--sx-sidebar-w);
  flex: 0 0 var(--sx-sidebar-w);
  background: linear-gradient(180deg, var(--sx-sidebar-bg) 0%, var(--sx-sidebar-bg2) 100%);
  border-right: 1px solid var(--sx-sidebar-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1045;
  transition: transform var(--sx-transition);
  overflow: hidden;
}

/* Subtle brand glow, echoing the softex.pk hero */
.sx-sidebar::before {
  content: '';
  position: absolute;
  top: -120px; left: -80px;
  width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(242, 13, 90, .16), transparent 68%);
  pointer-events: none;
}
.sx-sidebar::after {
  content: '';
  position: absolute;
  bottom: -140px; right: -100px;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(247, 139, 61, .12), transparent 70%);
  pointer-events: none;
}

.sx-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 22px;
  min-height: var(--sx-header-h);
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}

.sx-brand-mark {
  width: 40px; height: 40px;
  border-radius: 11px;
  background: var(--sx-gradient);
  display: grid;
  place-items: center;
  color: #fff;
  font-family: var(--sx-font-head);
  font-weight: 900;
  font-size: 19px;
  flex-shrink: 0;
  box-shadow: 0 6px 18px rgba(242, 13, 90, .4);
}

.sx-brand-text { min-width: 0; line-height: 1.2; }
.sx-brand-title {
  font-family: var(--sx-font-head);
  font-weight: 800;
  font-size: 15px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sx-brand-sub {
  font-size: 10.5px;
  color: var(--sx-orange);
  text-transform: uppercase;
  letter-spacing: .1em;
  font-weight: 600;
  white-space: nowrap;
}

.sx-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 12px 24px;
  position: relative;
  z-index: 1;
}
.sx-nav::-webkit-scrollbar { width: 5px; }
.sx-nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .12); border: none; }

.sx-nav-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .13em;
  color: #475569;
  font-weight: 700;
  padding: 16px 12px 8px;
}

.sx-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10.5px 13px;
  border-radius: 10px;
  color: var(--sx-sidebar-text);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 3px;
  position: relative;
  transition: all var(--sx-transition);
  white-space: nowrap;
}
.sx-nav-item i { font-size: 17px; width: 21px; text-align: center; flex-shrink: 0; opacity: .85; }
.sx-nav-item span { overflow: hidden; text-overflow: ellipsis; }

.sx-nav-item:hover {
  background: rgba(255, 255, 255, .055);
  color: #e2e8f0;
  transform: translateX(2px);
}

.sx-nav-item.active {
  background: linear-gradient(90deg, rgba(242, 13, 90, .19), rgba(247, 139, 61, .07));
  color: #fff;
  font-weight: 600;
}
.sx-nav-item.active::before {
  content: '';
  position: absolute;
  left: -13px; top: 50%;
  transform: translateY(-50%);
  width: 3.5px; height: 24px;
  background: var(--sx-gradient);
  border-radius: 0 4px 4px 0;
}
.sx-nav-item.active i { opacity: 1; color: var(--sx-orange); }

.sx-nav-badge {
  margin-left: auto;
  background: var(--sx-gradient);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  line-height: 1.5;
}

.sx-sidebar-footer {
  padding: 14px;
  border-top: 1px solid rgba(255, 255, 255, .06);
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}
.sx-queue-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .06);
  color: var(--sx-sidebar-text);
  font-size: 12px;
}
.sx-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.sx-dot.live { background: #22c55e; box-shadow: 0 0 0 0 rgba(34, 197, 94, .6); animation: sx-pulse 2s infinite; }
.sx-dot.idle { background: #64748b; }
@keyframes sx-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(34, 197, 94, .6); }
  70%  { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* ------------------------------ Main ------------------------------------- */
.sx-main {
  flex: 1;
  min-width: 0;
  margin-left: var(--sx-sidebar-w);
  display: flex;
  flex-direction: column;
}

.sx-topbar {
  height: var(--sx-header-h);
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--sx-border);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 1030;
}

.sx-page-title { font-size: 19px; font-weight: 700; margin: 0; line-height: 1.2; }
.sx-page-sub { font-size: 12.5px; color: var(--sx-text-muted); margin: 0; }

.sx-content { padding: 24px; flex: 1; }

.sx-burger {
  display: none;
  background: none;
  border: 1px solid var(--sx-border);
  border-radius: 9px;
  width: 38px; height: 38px;
  color: var(--sx-text);
  font-size: 18px;
}

.sx-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 15, .5);
  z-index: 1040;
  backdrop-filter: blur(2px);
}
.sx-backdrop.show { display: block; }

/* ==========================================================================
   Cards & surfaces
   ========================================================================== */

.sx-card {
  background: var(--sx-surface);
  border: 1px solid var(--sx-border);
  border-radius: var(--sx-radius);
  box-shadow: var(--sx-shadow-xs);
  transition: box-shadow var(--sx-transition), transform var(--sx-transition);
}
.sx-card:hover { box-shadow: var(--sx-shadow-sm); }

.sx-card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--sx-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.sx-card-title { font-size: 15.5px; font-weight: 700; margin: 0; display: flex; align-items: center; gap: 9px; }
.sx-card-title i { color: var(--sx-primary); }
.sx-card-body { padding: 20px; }
.sx-card-footer { padding: 14px 20px; border-top: 1px solid var(--sx-border); background: #fbfbfd; border-radius: 0 0 var(--sx-radius) var(--sx-radius); }

/* ------------------------------ Stat cards -------------------------------- */
.sx-stat {
  background: var(--sx-surface);
  border: 1px solid var(--sx-border);
  border-radius: var(--sx-radius);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
  height: 100%;
  transition: transform var(--sx-transition), box-shadow var(--sx-transition);
}
.sx-stat:hover { transform: translateY(-2px); box-shadow: var(--sx-shadow); }
.sx-stat::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--sx-gradient);
  opacity: .9;
}
.sx-stat-icon {
  width: 42px; height: 42px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-size: 19px;
  margin-bottom: 13px;
  background: var(--sx-gradient-soft);
  color: var(--sx-primary);
}
.sx-stat-icon.g-success { background: rgba(22, 163, 74, .1); color: var(--sx-success); }
.sx-stat-icon.g-info    { background: rgba(14, 165, 233, .1); color: var(--sx-info); }
.sx-stat-icon.g-warning { background: rgba(245, 158, 11, .12); color: var(--sx-warning); }
.sx-stat-icon.g-danger  { background: rgba(225, 29, 72, .1); color: var(--sx-danger); }
.sx-stat-icon.g-gold    { background: rgba(251, 191, 36, .15); color: #d97706; }

.sx-stat-value { font-family: var(--sx-font-head); font-size: 26px; font-weight: 800; line-height: 1.1; letter-spacing: -.02em; }
.sx-stat-label { font-size: 12.5px; color: var(--sx-text-muted); font-weight: 500; margin-top: 3px; }
.sx-stat-trend { font-size: 11.5px; font-weight: 600; margin-top: 9px; display: inline-flex; align-items: center; gap: 4px; }
.sx-stat-trend.up { color: var(--sx-success); }
.sx-stat-trend.down { color: var(--sx-danger); }
.sx-stat-trend.flat { color: var(--sx-text-light); }

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  font-family: var(--sx-font-body);
  font-weight: 600;
  font-size: 13.8px;
  border-radius: var(--sx-radius-sm);
  padding: .5rem 1rem;
  transition: all var(--sx-transition);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid transparent;
  line-height: 1.5;
}
.btn:focus-visible { outline: 2px solid rgba(242, 13, 90, .4); outline-offset: 2px; box-shadow: none; }

.btn-primary {
  background: var(--sx-gradient);
  border: none;
  color: #fff;
  background-size: 160% 160%;
  background-position: 0% 50%;
  box-shadow: 0 3px 12px rgba(242, 13, 90, .26);
}
.btn-primary:hover, .btn-primary:focus {
  background-position: 100% 50%;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(242, 13, 90, .34);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: .6; transform: none; box-shadow: none; }

.btn-outline-primary { border-color: var(--sx-primary); color: var(--sx-primary); background: #fff; }
.btn-outline-primary:hover { background: var(--sx-primary); border-color: var(--sx-primary); color: #fff; }

.btn-light-soft { background: #f2f3f8; border-color: #f2f3f8; color: var(--sx-text); }
.btn-light-soft:hover { background: #e8eaf2; color: var(--sx-text); }

.btn-outline-secondary { border-color: var(--sx-border-strong); color: var(--sx-text-muted); background: #fff; }
.btn-outline-secondary:hover { background: #f6f7fb; color: var(--sx-text); border-color: var(--sx-border-strong); }

.btn-sm { padding: .32rem .7rem; font-size: 12.6px; border-radius: 8px; }
.btn-lg { padding: .68rem 1.4rem; font-size: 15px; border-radius: 11px; }

.btn-icon {
  width: 33px; height: 33px;
  padding: 0;
  justify-content: center;
  border-radius: 8px;
  background: transparent;
  border: 1px solid var(--sx-border);
  color: var(--sx-text-muted);
}
.btn-icon:hover { background: #f5f6fa; color: var(--sx-primary); border-color: var(--sx-border-strong); }
.btn-icon.danger:hover { background: rgba(225, 29, 72, .08); color: var(--sx-danger); border-color: rgba(225, 29, 72, .3); }

/* ==========================================================================
   Forms
   ========================================================================== */

.form-label { font-size: 13px; font-weight: 600; color: var(--sx-text); margin-bottom: 6px; }
.form-text { font-size: 12px; color: var(--sx-text-muted); }

.form-control, .form-select {
  border: 1px solid var(--sx-border-strong);
  border-radius: var(--sx-radius-sm);
  padding: .52rem .8rem;
  font-size: 14px;
  font-family: var(--sx-font-body);
  color: var(--sx-text);
  transition: border-color var(--sx-transition), box-shadow var(--sx-transition);
  background-color: #fff;
}
.form-control:focus, .form-select:focus {
  border-color: var(--sx-primary);
  box-shadow: 0 0 0 3.5px rgba(242, 13, 90, .11);
}
.form-control::placeholder { color: var(--sx-text-light); }
.form-control:disabled, .form-select:disabled { background: #f6f7fb; color: var(--sx-text-muted); }
.form-control-sm, .form-select-sm { padding: .32rem .62rem; font-size: 13px; border-radius: 8px; }

.form-check-input { border-color: var(--sx-border-strong); cursor: pointer; }
.form-check-input:checked { background-color: var(--sx-primary); border-color: var(--sx-primary); }
.form-check-input:focus { box-shadow: 0 0 0 3px rgba(242, 13, 90, .12); border-color: var(--sx-primary); }
.form-switch .form-check-input:checked { background-color: var(--sx-primary); }

.input-group-text { background: #f6f7fb; border-color: var(--sx-border-strong); color: var(--sx-text-muted); font-size: 13.5px; border-radius: var(--sx-radius-sm); }

.sx-search {
  position: relative;
}
.sx-search i {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--sx-text-light);
  font-size: 14px;
  pointer-events: none;
}
.sx-search .form-control { padding-left: 34px; }

.is-invalid { border-color: var(--sx-danger) !important; }
.invalid-feedback { font-size: 12px; }

/* ==========================================================================
   Tables
   ========================================================================== */

.sx-table-wrap { overflow-x: auto; border-radius: var(--sx-radius); }

.table { margin: 0; color: var(--sx-text); }
.table > :not(caption) > * > * { padding: 12px 16px; background: transparent; }

.table thead th {
  background: #fafbfd;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .055em;
  color: var(--sx-text-muted);
  border-bottom: 1px solid var(--sx-border);
  white-space: nowrap;
  vertical-align: middle;
}
.table tbody td { border-bottom: 1px solid #f1f2f7; vertical-align: middle; font-size: 13.8px; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background var(--sx-transition); }
.table tbody tr:hover { background: #fafbfe; }
.table tbody tr.selected { background: rgba(242, 13, 90, .045); }

.sx-th-sort { cursor: pointer; user-select: none; }
.sx-th-sort:hover { color: var(--sx-primary); }
.sx-th-sort i { font-size: 11px; opacity: .55; }

/* ==========================================================================
   Badges & pills
   ========================================================================== */

.badge {
  font-weight: 600;
  font-size: 11.2px;
  padding: .32em .66em;
  border-radius: 6px;
  letter-spacing: .01em;
}

.sx-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3.5px 9px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}
.sx-badge i { font-size: 10px; }

.sx-badge-active,    .sx-badge-completed { background: rgba(22, 163, 74, .1);  color: #15803d; }
.sx-badge-unsubscribed, .sx-badge-paused { background: rgba(245, 158, 11, .13); color: #b45309; }
.sx-badge-bounced,   .sx-badge-failed    { background: rgba(225, 29, 72, .1);  color: #be123c; }
.sx-badge-complained                     { background: rgba(190, 18, 60, .12); color: #9f1239; }
.sx-badge-draft,     .sx-badge-cancelled { background: #eef0f6; color: #64748b; }
.sx-badge-scheduled                      { background: rgba(139, 92, 246, .12); color: #6d28d9; }
.sx-badge-sending,   .sx-badge-queued    { background: rgba(14, 165, 233, .12); color: #0369a1; }
.sx-badge-pending                        { background: rgba(148, 163, 184, .18); color: #475569; }
.sx-badge-skipped                        { background: #f1f5f9; color: #94a3b8; }
.sx-badge-sent                           { background: rgba(22, 163, 74, .1); color: #15803d; }

.sx-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2.5px 9px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  background: var(--sx-gradient-soft);
  color: var(--sx-primary);
  border: 1px solid rgba(242, 13, 90, .16);
}
.sx-tag-dot { width: 7px; height: 7px; border-radius: 50%; }

/* ==========================================================================
   Avatars
   ========================================================================== */

.sx-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  background: var(--sx-gradient);
  flex-shrink: 0;
  font-family: var(--sx-font-head);
  text-transform: uppercase;
}
.sx-avatar-sm { width: 30px; height: 30px; font-size: 11.5px; }
.sx-avatar-lg { width: 52px; height: 52px; font-size: 18px; }

/* ==========================================================================
   Alerts
   ========================================================================== */

.alert {
  border: none;
  border-left: 3.5px solid;
  border-radius: var(--sx-radius-sm);
  font-size: 13.8px;
  padding: 13px 16px;
  display: flex;
  align-items: flex-start;
  gap: 11px;
  box-shadow: var(--sx-shadow-xs);
}
.alert i { font-size: 17px; flex-shrink: 0; margin-top: 1px; }
.alert-success { background: #f0fdf4; border-color: var(--sx-success); color: #14532d; }
.alert-danger  { background: #fff1f2; border-color: var(--sx-danger);  color: #881337; }
.alert-warning { background: #fffbeb; border-color: var(--sx-warning); color: #78350f; }
.alert-info    { background: #f0f9ff; border-color: var(--sx-info);    color: #0c4a6e; }

/* Toast container */
.sx-toasts {
  position: fixed;
  top: 18px; right: 18px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 380px;
  pointer-events: none;
}
.sx-toast {
  pointer-events: auto;
  background: #fff;
  border-radius: var(--sx-radius-sm);
  box-shadow: var(--sx-shadow-lg);
  padding: 13px 16px;
  display: flex;
  align-items: flex-start;
  gap: 11px;
  font-size: 13.8px;
  border-left: 3.5px solid var(--sx-primary);
  animation: sx-slide-in .28s cubic-bezier(.16, 1, .3, 1);
}
.sx-toast.success { border-left-color: var(--sx-success); }
.sx-toast.danger  { border-left-color: var(--sx-danger); }
.sx-toast.warning { border-left-color: var(--sx-warning); }
.sx-toast.info    { border-left-color: var(--sx-info); }
.sx-toast i { font-size: 17px; }
.sx-toast.success i { color: var(--sx-success); }
.sx-toast.danger i  { color: var(--sx-danger); }
.sx-toast.warning i { color: var(--sx-warning); }
.sx-toast.info i    { color: var(--sx-info); }
.sx-toast.hiding { animation: sx-slide-out .22s ease forwards; }

@keyframes sx-slide-in  { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes sx-slide-out { to { opacity: 0; transform: translateX(28px); } }

/* ==========================================================================
   Modals, dropdowns, tabs
   ========================================================================== */

.modal-content { border: none; border-radius: var(--sx-radius-lg); box-shadow: var(--sx-shadow-lg); }
.modal-header { border-bottom: 1px solid var(--sx-border); padding: 18px 22px; }
.modal-title { font-family: var(--sx-font-head); font-weight: 700; font-size: 17px; }
.modal-body { padding: 22px; }
.modal-footer { border-top: 1px solid var(--sx-border); padding: 14px 22px; background: #fbfbfd; border-radius: 0 0 var(--sx-radius-lg) var(--sx-radius-lg); }

.dropdown-menu {
  border: 1px solid var(--sx-border);
  border-radius: var(--sx-radius);
  box-shadow: var(--sx-shadow-lg);
  padding: 6px;
  font-size: 13.8px;
  min-width: 190px;
}
.dropdown-item { border-radius: 7px; padding: 7.5px 11px; display: flex; align-items: center; gap: 9px; color: var(--sx-text); }
.dropdown-item:hover, .dropdown-item:focus { background: #f5f6fa; color: var(--sx-primary); }
.dropdown-item i { font-size: 15px; width: 17px; }
.dropdown-item.text-danger:hover { background: rgba(225, 29, 72, .07); color: var(--sx-danger); }
.dropdown-divider { margin: 5px 0; border-color: var(--sx-border); }

.nav-tabs { border-bottom: 1px solid var(--sx-border); gap: 3px; }
.nav-tabs .nav-link {
  border: none;
  border-bottom: 2.5px solid transparent;
  color: var(--sx-text-muted);
  font-weight: 600;
  font-size: 14px;
  padding: 10px 15px;
  border-radius: 0;
  display: flex;
  align-items: center;
  gap: 7px;
}
.nav-tabs .nav-link:hover { color: var(--sx-primary); border-bottom-color: rgba(242, 13, 90, .25); background: transparent; }
.nav-tabs .nav-link.active { color: var(--sx-primary); border-bottom-color: var(--sx-primary); background: transparent; }

.nav-pills .nav-link { color: var(--sx-text-muted); font-weight: 600; font-size: 13.5px; border-radius: 8px; padding: 7px 13px; }
.nav-pills .nav-link.active { background: var(--sx-gradient); color: #fff; }

/* ==========================================================================
   Pagination
   ========================================================================== */

.pagination { gap: 4px; margin: 0; }
.page-link {
  border: 1px solid var(--sx-border);
  border-radius: 8px !important;
  color: var(--sx-text-muted);
  font-size: 13.5px;
  font-weight: 600;
  padding: 6px 12px;
  min-width: 36px;
  text-align: center;
  transition: all var(--sx-transition);
}
.page-link:hover { background: #f5f6fa; color: var(--sx-primary); border-color: var(--sx-border-strong); }
.page-item.active .page-link { background: var(--sx-gradient); border-color: transparent; color: #fff; }
.page-item.disabled .page-link { opacity: .45; background: #fff; }

/* ==========================================================================
   Progress
   ========================================================================== */

.progress { height: 7px; border-radius: 20px; background: #eef0f6; overflow: hidden; }
.progress-bar { background: var(--sx-gradient); border-radius: 20px; transition: width .5s cubic-bezier(.4, 0, .2, 1); }
.progress-bar.bg-success { background: var(--sx-success) !important; }
.progress-bar.bg-danger  { background: var(--sx-danger) !important; }
.progress-bar.bg-warning { background: var(--sx-warning) !important; }
.progress-bar.bg-info    { background: var(--sx-info) !important; }
.progress-sm { height: 5px; }
.progress-lg { height: 11px; }

/* ==========================================================================
   Empty state
   ========================================================================== */

.sx-empty { text-align: center; padding: 54px 24px; }
.sx-empty-icon {
  width: 74px; height: 74px;
  border-radius: 20px;
  background: var(--sx-gradient-soft);
  color: var(--sx-primary);
  display: grid;
  place-items: center;
  font-size: 32px;
  margin: 0 auto 18px;
}
.sx-empty h5 { font-weight: 700; margin-bottom: 7px; }
.sx-empty p { color: var(--sx-text-muted); font-size: 13.8px; max-width: 420px; margin: 0 auto 18px; }

/* ==========================================================================
   Auth pages
   ========================================================================== */

.sx-auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  background: var(--sx-bg);
}

.sx-auth-brand {
  background: linear-gradient(150deg, #05080f 0%, #0d1525 55%, #162340 100%);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 56px;
  color: #fff;
}
.sx-auth-brand::before {
  content: '';
  position: absolute;
  top: -180px; right: -140px;
  width: 520px; height: 520px;
  background: radial-gradient(circle, rgba(242, 13, 90, .30), transparent 66%);
}
.sx-auth-brand::after {
  content: '';
  position: absolute;
  bottom: -220px; left: -140px;
  width: 560px; height: 560px;
  background: radial-gradient(circle, rgba(247, 139, 61, .22), transparent 68%);
}
.sx-auth-brand > * { position: relative; z-index: 1; }

.sx-auth-logo { display: flex; align-items: center; gap: 14px; margin-bottom: 42px; }
.sx-auth-logo .sx-brand-mark { width: 50px; height: 50px; font-size: 23px; border-radius: 14px; }

.sx-auth-headline {
  font-family: var(--sx-font-head);
  font-size: clamp(28px, 3.2vw, 40px);
  font-weight: 800;
  line-height: 1.16;
  margin-bottom: 18px;
  color: #fff;
  letter-spacing: -.02em;
}
.sx-gradient-text {
  background: var(--sx-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.sx-auth-lead { color: #94a3b8; font-size: 15px; max-width: 440px; line-height: 1.75; }

.sx-auth-features { list-style: none; padding: 0; margin: 36px 0 0; display: grid; gap: 14px; }
.sx-auth-features li { display: flex; align-items: center; gap: 12px; color: #cbd5e1; font-size: 14px; }
.sx-auth-features i {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: rgba(247, 139, 61, .14);
  color: var(--sx-orange);
  display: grid;
  place-items: center;
  font-size: 14px;
  flex-shrink: 0;
}

.sx-auth-form { display: flex; align-items: center; justify-content: center; padding: 44px 28px; }
.sx-auth-card { width: 100%; max-width: 408px; }

.sx-auth-stats { display: flex; gap: 34px; margin-top: 44px; }
.sx-auth-stat-value { font-family: var(--sx-font-head); font-size: 26px; font-weight: 800; color: #fff; }
.sx-auth-stat-label { font-size: 11.5px; color: #64748b; text-transform: uppercase; letter-spacing: .09em; font-weight: 600; }

/* ==========================================================================
   Email editor
   ========================================================================== */

.sx-editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  padding: 9px 11px;
  background: #fafbfd;
  border: 1px solid var(--sx-border-strong);
  border-bottom: none;
  border-radius: var(--sx-radius-sm) var(--sx-radius-sm) 0 0;
  align-items: center;
  position: sticky;
  top: var(--sx-header-h);
  z-index: 20;
}
.sx-tool {
  width: 31px; height: 31px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 7px;
  color: var(--sx-text-muted);
  display: grid;
  place-items: center;
  font-size: 14.5px;
  transition: all var(--sx-transition);
  cursor: pointer;
  padding: 0;
}
.sx-tool:hover { background: #fff; color: var(--sx-primary); border-color: var(--sx-border); }
.sx-tool.active { background: var(--sx-gradient-soft); color: var(--sx-primary); border-color: rgba(242, 13, 90, .22); }
.sx-tool-sep { width: 1px; height: 20px; background: var(--sx-border-strong); margin: 0 5px; }
.sx-tool-wide { width: auto; padding: 0 9px; gap: 5px; font-size: 12.5px; font-weight: 600; }

.sx-editor-canvas {
  min-height: 460px;
  max-height: 70vh;
  overflow-y: auto;
  padding: 26px;
  border: 1px solid var(--sx-border-strong);
  border-radius: 0 0 var(--sx-radius-sm) var(--sx-radius-sm);
  background: #fff;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
  line-height: 1.65;
  color: #1f2937;
  outline: none;
}
.sx-editor-canvas:focus { box-shadow: inset 0 0 0 2px rgba(242, 13, 90, .1); }
.sx-editor-canvas img { max-width: 100%; height: auto; }
.sx-editor-canvas table { max-width: 100%; }
.sx-editor-canvas a { color: var(--sx-primary); }
.sx-editor-canvas:empty::before {
  content: attr(data-placeholder);
  color: var(--sx-text-light);
  pointer-events: none;
}

.sx-code-editor {
  width: 100%;
  min-height: 460px;
  max-height: 70vh;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 12.8px;
  line-height: 1.7;
  border: 1px solid var(--sx-border-strong);
  border-radius: 0 0 var(--sx-radius-sm) var(--sx-radius-sm);
  padding: 16px;
  background: #0d1525;
  color: #e2e8f0;
  resize: vertical;
  tab-size: 2;
}
.sx-code-editor:focus { outline: none; border-color: var(--sx-primary); box-shadow: 0 0 0 3px rgba(242, 13, 90, .12); }

/* Preview frames */
.sx-preview-shell { background: #eef0f6; border-radius: var(--sx-radius); padding: 22px; display: flex; justify-content: center; }
.sx-preview-frame {
  background: #fff;
  border: none;
  width: 100%;
  min-height: 560px;
  border-radius: 10px;
  box-shadow: var(--sx-shadow);
  transition: max-width var(--sx-transition);
}
.sx-preview-frame.mobile { max-width: 380px; min-height: 620px; border-radius: 26px; border: 9px solid #1e293b; }
.sx-preview-frame.desktop { max-width: 100%; }

.sx-var-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: 'SFMono-Regular', Consolas, monospace;
  font-size: 11.8px;
  padding: 4px 9px;
  border-radius: 7px;
  background: var(--sx-gradient-soft);
  color: var(--sx-primary);
  border: 1px solid rgba(242, 13, 90, .18);
  cursor: pointer;
  transition: all var(--sx-transition);
  font-weight: 600;
}
.sx-var-chip:hover { background: var(--sx-primary); color: #fff; border-color: var(--sx-primary); transform: translateY(-1px); }

/* Template gallery */
.sx-template-card { cursor: pointer; overflow: hidden; height: 100%; display: flex; flex-direction: column; }
.sx-template-thumb {
  height: 168px;
  background: #f4f5fa;
  overflow: hidden;
  position: relative;
  border-bottom: 1px solid var(--sx-border);
  flex-shrink: 0;
}
.sx-template-thumb iframe { width: 200%; height: 336px; border: 0; transform: scale(.5); transform-origin: top left; pointer-events: none; background: #fff; }
.sx-template-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(5, 8, 15, 0) 40%, rgba(5, 8, 15, .78));
  opacity: 0;
  transition: opacity var(--sx-transition);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  gap: 8px;
}
.sx-template-card:hover .sx-template-overlay { opacity: 1; }

/* ==========================================================================
   Charts
   ========================================================================== */

.sx-chart { position: relative; width: 100%; }
.sx-chart-sm { height: 230px; }
.sx-chart-md { height: 292px; }
.sx-chart-lg { height: 372px; }

.sx-legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 12.5px; color: var(--sx-text-muted); }
.sx-legend-item { display: flex; align-items: center; gap: 6px; }
.sx-legend-swatch { width: 10px; height: 10px; border-radius: 3px; }

/* ==========================================================================
   Misc utilities
   ========================================================================== */

.sx-text-muted { color: var(--sx-text-muted) !important; }
.sx-text-light { color: var(--sx-text-light) !important; }
.sx-fw-700 { font-weight: 700; }
.sx-fs-12 { font-size: 12px; }
.sx-fs-13 { font-size: 13px; }
.sx-mono { font-family: 'SFMono-Regular', Consolas, Menlo, monospace; font-size: 12.5px; }

.sx-divider { height: 1px; background: var(--sx-border); margin: 20px 0; border: none; }

.sx-skeleton {
  background: linear-gradient(90deg, #eef0f6 25%, #f6f7fb 50%, #eef0f6 75%);
  background-size: 200% 100%;
  animation: sx-shimmer 1.4s infinite;
  border-radius: 6px;
}
@keyframes sx-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.sx-spinner {
  width: 15px; height: 15px;
  border: 2px solid rgba(255, 255, 255, .35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: sx-spin .62s linear infinite;
  display: inline-block;
}
@keyframes sx-spin { to { transform: rotate(360deg); } }

.sx-gradient-bar { height: 3.5px; background: var(--sx-gradient); border-radius: 4px; }

.sx-clamp-1 { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.sx-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.sx-sticky-actions {
  position: sticky;
  bottom: 0;
  background: rgba(255, 255, 255, .95);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--sx-border);
  padding: 14px 20px;
  margin: 24px -20px -20px;
  border-radius: 0 0 var(--sx-radius) var(--sx-radius);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  z-index: 10;
}

/* Public pages (unsubscribe etc.) */
.sx-public {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 26px;
  background: linear-gradient(150deg, #f5f6fa 0%, #eef0f6 100%);
}
.sx-public-card {
  max-width: 540px;
  width: 100%;
  background: #fff;
  border-radius: var(--sx-radius-lg);
  box-shadow: var(--sx-shadow-lg);
  overflow: hidden;
}
.sx-public-head { background: linear-gradient(150deg, #05080f, #0d1525); padding: 34px; text-align: center; color: #fff; position: relative; overflow: hidden; }
.sx-public-head::before {
  content: '';
  position: absolute;
  top: -100px; right: -70px;
  width: 260px; height: 260px;
  background: radial-gradient(circle, rgba(242, 13, 90, .3), transparent 68%);
}
.sx-public-head > * { position: relative; z-index: 1; }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1199.98px) {
  .sx-stat-value { font-size: 23px; }
}

@media (max-width: 991.98px) {
  .sx-sidebar { transform: translateX(-100%); box-shadow: var(--sx-shadow-lg); }
  .sx-sidebar.open { transform: translateX(0); }
  .sx-main { margin-left: 0; }
  .sx-burger { display: grid; place-items: center; }
  .sx-content { padding: 18px; }
  .sx-topbar { padding: 0 16px; }
  .sx-auth { grid-template-columns: 1fr; }
  .sx-auth-brand { display: none; }
}

@media (max-width: 767.98px) {
  body { font-size: 14px; }
  .sx-page-title { font-size: 17px; }
  .sx-content { padding: 14px; }
  .sx-card-body { padding: 16px; }
  .sx-card-header { padding: 14px 16px; }
  .sx-stat { padding: 15px 16px; }
  .sx-stat-value { font-size: 21px; }
  .sx-stat-icon { width: 36px; height: 36px; font-size: 16px; margin-bottom: 10px; }
  .table > :not(caption) > * > * { padding: 10px 12px; }
  .sx-toasts { left: 12px; right: 12px; max-width: none; }
  .sx-editor-toolbar { position: static; }
  .sx-preview-shell { padding: 12px; }
  .sx-sticky-actions { margin: 16px -16px -16px; padding: 12px 16px; flex-wrap: wrap; }
  .sx-sticky-actions .btn { flex: 1 1 auto; justify-content: center; }
  .modal-body { padding: 18px; }
}

/* Settings page: vertical tab column.
   Uses position:sticky so the tab list and Save button follow the user down
   long panes, without the negative margins of .sx-sticky-actions (which is a
   full-width bottom action bar and collapses this narrow column). */
.sx-settings-nav {
  position: sticky;
  top: 84px;
}
.sx-settings-nav .nav-pills .nav-link {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 12px;
  margin-bottom: 2px;
  border-radius: 9px;
  color: var(--sx-text-muted);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  background: transparent;
  border: 0;
  transition: background .18s ease, color .18s ease;
}
.sx-settings-nav .nav-pills .nav-link i { flex: 0 0 auto; font-size: 15px; }
.sx-settings-nav .nav-pills .nav-link:hover {
  background: rgba(242, 13, 90, .06);
  color: var(--sx-text);
}
.sx-settings-nav .nav-pills .nav-link.active {
  background: linear-gradient(135deg, var(--sx-primary), var(--sx-orange));
  color: #fff;
  box-shadow: 0 4px 12px rgba(242, 13, 90, .25);
}
.sx-settings-nav .sx-card-footer .btn { white-space: nowrap; }

@media (max-width: 991.98px) {
  .sx-settings-nav { position: static; }
  .sx-settings-nav .nav-pills { flex-direction: row !important; flex-wrap: wrap; gap: 6px; }
  .sx-settings-nav .nav-pills .nav-link { width: auto; }
}

@media (max-width: 575.98px) {
  .sx-hide-xs { display: none !important; }
  .btn { font-size: 13.2px; }
}

@media print {
  .sx-sidebar, .sx-topbar, .sx-sticky-actions, .btn, .sx-burger { display: none !important; }
  .sx-main { margin-left: 0; }
  .sx-card { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
  body { background: #fff; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
