/* Global Light/Dark theme overrides - scoped by [data-mode="dark"] on body */
:root{
  --dm-bg:#0b1220;        /* page background */
  --dm-bg2:#111827;       /* gradient end */
  --dm-surface:#0f172a;   /* cards */
  --dm-border:#1f2a3a;    /* borders */
  --dm-text:#e5e7eb;      /* main text */
  --dm-muted:#97a6ba;     /* muted text */
}

/* Base */
body[data-mode="dark"]{
  color:var(--dm-text);
  background:linear-gradient(135deg,var(--dm-bg),var(--dm-bg2)) !important;
}

/***** Common containers *****/
body[data-mode="dark"] .page-card,
body[data-mode="dark"] .container-card,
body[data-mode="dark"] .card{
  background:var(--dm-surface) !important;
  color:var(--dm-text) !important;
  border-color:var(--dm-border) !important;
}

body[data-mode="dark"] .list-group-item{
  background:var(--dm-surface) !important;
  color:var(--dm-text) !important;
  border-color:transparent !important;
}

/* Tables */
body[data-mode="dark"] table,
body[data-mode="dark"] .table{
  color:var(--dm-text) !important;
}
body[data-mode="dark"] .table thead th{ color:var(--dm-muted) }

/* Text helpers */
body[data-mode="dark"] .text-muted{ color:var(--dm-muted) !important; }

/* Inputs */
body[data-mode="dark"] .form-control,
body[data-mode="dark"] .form-select,
body[data-mode="dark"] .input-group-text{
  background:#0b1526; color:var(--dm-text); border-color:#243142;
}

/* Buttons */
body[data-mode="dark"] .btn-light{
  background:#374151; color:var(--dm-text); border-color:#4b5563;
}
body[data-mode="dark"] .btn-outline-light{
  color:var(--dm-text); border-color:#6b7280;
}

/* Alerts */
body[data-mode="dark"] .alert-info{ background:#0b1526; color:var(--dm-text); border-color:#233246; }

/* Progress/Badges subtle */
body[data-mode="dark"] .badge.bg-light, body[data-mode="dark"] .bg-light{ background:#1f2937 !important; color:var(--dm-text) !important; }

/* Theme dots visibility */
body[data-mode="dark"] .theme-dot, body[data-mode="dark"] .theme-chip{ box-shadow:0 2px 6px rgba(0,0,0,.35); border-color:#1f2937; }

/* Dark-mode toggle minimal reset (in case pages have global filters) */
#global-dark-toggle{ all:unset; }



/* Subscriber dashboard custom blocks */
body[data-mode="dark"] .stats-card{ background:var(--dm-surface) !important; color:var(--dm-text) !important; border:1px solid var(--dm-border) !important; box-shadow:0 10px 30px rgba(0,0,0,.35) !important; }
body[data-mode="dark"] .glass-card{ background:rgba(15,23,42,.75) !important; color:var(--dm-text) !important; border:1px solid var(--dm-border) !important; }
body[data-mode="dark"] .logout-btn-top{ background:#b91c1c !important; color:#fff !important; box-shadow:0 6px 16px rgba(0,0,0,.4) !important; }
body[data-mode="dark"] .text-white-50, body[data-mode="dark"] .text-white-75{ color:var(--dm-muted) !important; }
body[data-mode="dark"] .badge.bg-secondary{ background:#334155 !important; color:#e5e7eb !important; }

/* ===================== Color Themes (light & shared) ===================== */
/* Base theme variables (default: blue) */
:root{
  --th-primary:#0ea5e9;        /* primary brand */
  --th-primary-600:#0284c7;    /* hover/darker */
  --th-primary-700:#0369a1;    /* border */
  --th-on-primary:#ffffff;     /* text on primary */
}

/* Theme palettes */
body[data-theme="blue"]{
  --th-primary:#0ea5e9;
  --th-primary-600:#0284c7;
  --th-primary-700:#0369a1;
  --th-on-primary:#ffffff;
}
body[data-theme="emerald"]{
  --th-primary:#10b981;
  --th-primary-600:#059669;
  --th-primary-700:#047857;
  --th-on-primary:#ffffff;
}
body[data-theme="purple"]{
  --th-primary:#8b5cf6;
  --th-primary-600:#7c3aed;
  --th-primary-700:#6d28d9;
  --th-on-primary:#ffffff;
}
body[data-theme="rose"]{
  --th-primary:#f43f5e;
  --th-primary-600:#e11d48;
  --th-primary-700:#be123c;
  --th-on-primary:#ffffff;
}
body[data-theme="amber"]{
  --th-primary:#f59e0b;
  --th-primary-600:#d97706;
  --th-primary-700:#b45309;
  --th-on-primary:#0f172a;
}
body[data-theme="indigo"]{
  --th-primary:#6366f1;
  --th-primary-600:#4f46e5;
  --th-primary-700:#4338ca;
  --th-on-primary:#ffffff;
}
body[data-theme="teal"]{
  --th-primary:#14b8a6;
  --th-primary-600:#0d9488;
  --th-primary-700:#0f766e;
  --th-on-primary:#ffffff;
}
body[data-theme="slate"]{
  --th-primary:#64748b;
  --th-primary-600:#475569;
  --th-primary-700:#334155;
  --th-on-primary:#ffffff;
}

/* Primary color overrides (kept subtle) */
.btn-primary,
.btn.btn-primary{
  background-color:var(--th-primary) !important;
  border-color:var(--th-primary-700) !important;
  color:var(--th-on-primary) !important;
}
.btn-primary:hover,
.btn.btn-primary:hover{
  background-color:var(--th-primary-600) !important;
  border-color:var(--th-primary-700) !important;
}

.btn-outline-primary{ border-color:var(--th-primary) !important; color:var(--th-primary) !important; }
.btn-outline-primary:hover{ background-color:var(--th-primary) !important; color:var(--th-on-primary) !important; }

.badge-primary, .bg-primary{ background-color:var(--th-primary) !important; color:var(--th-on-primary) !important; }
.border-primary{ border-color:var(--th-primary) !important; }
.text-primary{ color:var(--th-primary) !important; }

/* Theme chips (picker) */
.theme-chip{ width:18px; height:18px; border-radius:50%; display:inline-block; border:2px solid #fff; box-shadow:0 2px 6px rgba(0,0,0,.15); cursor:pointer; margin:0 2px; }
.theme-chip.active{ outline:2px solid rgba(0,0,0,.15); transform:scale(1.08); }
/* Ensure the nav trigger button is clickable and visually compact */
.nav-theme-trigger{ line-height:1; padding:.25rem .5rem; }
.theme-chip[data-set-theme="blue"], .theme-chip[data-theme="blue"]{ background:linear-gradient(135deg,#0ea5e9,#4dabf7); }
.theme-chip[data-set-theme="emerald"], .theme-chip[data-theme="emerald"]{ background:linear-gradient(135deg,#10b981,#34d399); }
.theme-chip[data-set-theme="purple"], .theme-chip[data-theme="purple"]{ background:linear-gradient(135deg,#8b5cf6,#a78bfa); }
.theme-chip[data-set-theme="rose"], .theme-chip[data-theme="rose"]{ background:linear-gradient(135deg,#f43f5e,#fb7185); }
.theme-chip[data-set-theme="amber"], .theme-chip[data-theme="amber"]{ background:linear-gradient(135deg,#f59e0b,#fbbf24); }
.theme-chip[data-set-theme="indigo"], .theme-chip[data-theme="indigo"]{ background:linear-gradient(135deg,#6366f1,#818cf8); }
.theme-chip[data-set-theme="teal"], .theme-chip[data-theme="teal"]{ background:linear-gradient(135deg,#14b8a6,#2dd4bf); }
.theme-chip[data-set-theme="slate"], .theme-chip[data-theme="slate"]{ background:linear-gradient(135deg,#64748b,#94a3b8); }

/* Brand variable mapping for public/landing pages */
body[data-theme="blue"]{
  --brand-primary:#0ea5e9;
  --brand-secondary:#22d3ee;
  --brand-accent:#ff6b6b;
}
body[data-theme="emerald"]{
  --brand-primary:#10b981;
  --brand-secondary:#34d399;
  --brand-accent:#0ea5e9;
}
body[data-theme="purple"]{
  --brand-primary:#8b5cf6;
  --brand-secondary:#a78bfa;
  --brand-accent:#b23cf2;
}
body[data-theme="rose"]{
  --brand-primary:#f43f5e;
  --brand-secondary:#fb7185;
  --brand-accent:#f59e0b;
}
body[data-theme="amber"]{
  --brand-primary:#f59e0b;
  --brand-secondary:#fbbf24;
  --brand-accent:#22d3ee;
}
body[data-theme="indigo"]{
  --brand-primary:#6366f1;
  --brand-secondary:#818cf8;
  --brand-accent:#10b981;
}
body[data-theme="teal"]{
  --brand-primary:#14b8a6;
  --brand-secondary:#2dd4bf;
  --brand-accent:#8b5cf6;
}
body[data-theme="slate"]{
  --brand-primary:#64748b;
  --brand-secondary:#94a3b8;
  --brand-accent:#22d3ee;
}


