/* Mini-Marketer - Design System */

/* === 1. Theme variables === */
:root {
  /* Primary */
  --c-primary:       #16a34a;
  --c-primary-hover: #15803d;
  --c-primary-light: #dcfce7;
  --c-primary-muted: #bbf7d0;
  --c-primary-text:  #14532d;
  --c-primary-ring:  rgba(22,163,74,0.25);

  /* Page surface */
  --c-bg:      #f0fdf4;
  --c-surface: #ffffff;
  --c-border:  #bbf7d0;
  --c-text:    #111827;
  --c-muted:   #374151;
  --c-subtle:  #6b7280;

  /* Sidebar (dark solid per theme) */
  --c-side-bg:      #14532d;
  --c-side-border:  #166534;
  --c-side-text:    rgba(255,255,255,0.9);
  --c-side-muted:   rgba(255,255,255,0.55);
  --c-side-active:  rgba(255,255,255,0.18);
  --c-side-hover:   rgba(255,255,255,0.10);

  /* Font */
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;

  /* Radii */
  --r-sm:  0.5rem;
  --r-md:  0.75rem;
  --r-lg:  1rem;
  --r-xl:  1.25rem;
  --r-2xl: 1.5rem;

  /* Shadows */
  --s-card: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --s-md:   0 4px 12px rgba(0,0,0,0.10);
  --s-lg:   0 10px 24px rgba(0,0,0,0.12);
  --s-xl:   0 20px 48px rgba(0,0,0,0.15);

  --nav-height: 4.5rem;
  --ease: 150ms cubic-bezier(0.4,0,0.2,1);
}

/* === 2. Themes — todos oscuros con acento vivo === */

[data-theme="verde"] {
  --c-primary:       #22c55e;
  --c-primary-hover: #16a34a;
  --c-primary-light: #052e16;
  --c-primary-muted: #14532d;
  --c-primary-text:  #86efac;
  --c-primary-ring:  rgba(34,197,94,0.3);
  --c-bg:            #030f07;
  --c-surface:       #081a0f;
  --c-border:        #14391c;
  --c-text:          #e2e8f0;
  --c-muted:         #94a3b8;
  --c-subtle:        #64748b;
  --c-side-bg:       #020c05;
  --c-side-border:   #0a2410;
  --c-side-text:     rgba(255,255,255,0.92);
  --c-side-muted:    rgba(255,255,255,0.40);
  --c-side-active:   rgba(34,197,94,0.22);
  --c-side-hover:    rgba(34,197,94,0.08);
}

[data-theme="azul"] {
  --c-primary:       #60a5fa;
  --c-primary-hover: #3b82f6;
  --c-primary-light: #0c1f3a;
  --c-primary-muted: #1e3a8a;
  --c-primary-text:  #bfdbfe;
  --c-primary-ring:  rgba(96,165,250,0.3);
  --c-bg:            #03080f;
  --c-surface:       #0a1525;
  --c-border:        #1a3052;
  --c-text:          #e2e8f0;
  --c-muted:         #94a3b8;
  --c-subtle:        #64748b;
  --c-side-bg:       #020611;
  --c-side-border:   #0c1e38;
  --c-side-text:     rgba(255,255,255,0.92);
  --c-side-muted:    rgba(255,255,255,0.40);
  --c-side-active:   rgba(96,165,250,0.22);
  --c-side-hover:    rgba(96,165,250,0.08);
}

[data-theme="naranja"] {
  --c-primary:       #fb923c;
  --c-primary-hover: #f97316;
  --c-primary-light: #2d0f02;
  --c-primary-muted: #431407;
  --c-primary-text:  #fdba74;
  --c-primary-ring:  rgba(251,146,60,0.3);
  --c-bg:            #0c0400;
  --c-surface:       #1a0c04;
  --c-border:        #3d1805;
  --c-text:          #e2e8f0;
  --c-muted:         #94a3b8;
  --c-subtle:        #64748b;
  --c-side-bg:       #080200;
  --c-side-border:   #2a0e02;
  --c-side-text:     rgba(255,255,255,0.92);
  --c-side-muted:    rgba(255,255,255,0.40);
  --c-side-active:   rgba(251,146,60,0.22);
  --c-side-hover:    rgba(251,146,60,0.08);
}

[data-theme="morado"] {
  --c-primary:       #a78bfa;
  --c-primary-hover: #8b5cf6;
  --c-primary-light: #1a0a3a;
  --c-primary-muted: #2e1065;
  --c-primary-text:  #ddd6fe;
  --c-primary-ring:  rgba(167,139,250,0.3);
  --c-bg:            #060310;
  --c-surface:       #100820;
  --c-border:        #281048;
  --c-text:          #e2e8f0;
  --c-muted:         #94a3b8;
  --c-subtle:        #64748b;
  --c-side-bg:       #04020c;
  --c-side-border:   #180830;
  --c-side-text:     rgba(255,255,255,0.92);
  --c-side-muted:    rgba(255,255,255,0.40);
  --c-side-active:   rgba(167,139,250,0.22);
  --c-side-hover:    rgba(167,139,250,0.08);
}

[data-theme="rojo"] {
  --c-primary:       #f87171;
  --c-primary-hover: #ef4444;
  --c-primary-light: #280505;
  --c-primary-muted: #450a0a;
  --c-primary-text:  #fca5a5;
  --c-primary-ring:  rgba(248,113,113,0.3);
  --c-bg:            #0c0202;
  --c-surface:       #190606;
  --c-border:        #3a0e0e;
  --c-text:          #e2e8f0;
  --c-muted:         #94a3b8;
  --c-subtle:        #64748b;
  --c-side-bg:       #080101;
  --c-side-border:   #280808;
  --c-side-text:     rgba(255,255,255,0.92);
  --c-side-muted:    rgba(255,255,255,0.40);
  --c-side-active:   rgba(248,113,113,0.22);
  --c-side-hover:    rgba(248,113,113,0.08);
}

/* ── Fondos blancos con neón ───────────────────────────────────── */

[data-theme="lima"] {
  --c-primary:       #65a30d;
  --c-primary-hover: #4d7c0f;
  --c-primary-light: #f7fee7;
  --c-primary-muted: #ecfccb;
  --c-primary-text:  #365314;
  --c-primary-ring:  rgba(101,163,13,0.35);
  --c-bg:            #f9fafb;
  --c-surface:       #ffffff;
  --c-border:        #d9f99d;
  --c-text:          #0f172a;
  --c-muted:         #374151;
  --c-subtle:        #6b7280;
  --c-side-bg:       #080f00;
  --c-side-border:   #182800;
  --c-side-text:     rgba(255,255,255,0.92);
  --c-side-muted:    rgba(255,255,255,0.40);
  --c-side-active:   rgba(163,230,53,0.25);
  --c-side-hover:    rgba(163,230,53,0.10);
}

[data-theme="coral"] {
  --c-primary:       #f43f5e;
  --c-primary-hover: #e11d48;
  --c-primary-light: #fff1f2;
  --c-primary-muted: #ffe4e6;
  --c-primary-text:  #881337;
  --c-primary-ring:  rgba(244,63,94,0.35);
  --c-bg:            #f9fafb;
  --c-surface:       #ffffff;
  --c-border:        #fecdd3;
  --c-text:          #0f172a;
  --c-muted:         #374151;
  --c-subtle:        #6b7280;
  --c-side-bg:       #140007;
  --c-side-border:   #2d0010;
  --c-side-text:     rgba(255,255,255,0.92);
  --c-side-muted:    rgba(255,255,255,0.40);
  --c-side-active:   rgba(244,63,94,0.25);
  --c-side-hover:    rgba(244,63,94,0.10);
}

[data-theme="indigo"] {
  --c-primary:       #6366f1;
  --c-primary-hover: #4f46e5;
  --c-primary-light: #eef2ff;
  --c-primary-muted: #e0e7ff;
  --c-primary-text:  #312e81;
  --c-primary-ring:  rgba(99,102,241,0.35);
  --c-bg:            #f9fafb;
  --c-surface:       #ffffff;
  --c-border:        #c7d2fe;
  --c-text:          #0f172a;
  --c-muted:         #374151;
  --c-subtle:        #6b7280;
  --c-side-bg:       #06041a;
  --c-side-border:   #100e38;
  --c-side-text:     rgba(255,255,255,0.92);
  --c-side-muted:    rgba(255,255,255,0.40);
  --c-side-active:   rgba(99,102,241,0.25);
  --c-side-hover:    rgba(99,102,241,0.10);
}

/* ── Negro puro + amarillo neón ────────────────────────────────── */

[data-theme="negro"] {
  --c-primary:       #facc15;
  --c-primary-hover: #eab308;
  --c-primary-light: #1a1600;
  --c-primary-muted: #292200;
  --c-primary-text:  #fde047;
  --c-primary-ring:  rgba(250,204,21,0.3);
  --c-bg:            #050505;
  --c-surface:       #0d0d0d;
  --c-border:        #1e1e1e;
  --c-text:          #e2e8f0;
  --c-muted:         #94a3b8;
  --c-subtle:        #64748b;
  --c-side-bg:       #020202;
  --c-side-border:   #111111;
  --c-side-text:     rgba(255,255,255,0.92);
  --c-side-muted:    rgba(255,255,255,0.40);
  --c-side-active:   rgba(250,204,21,0.22);
  --c-side-hover:    rgba(250,204,21,0.08);
}

[data-theme="cyber"] {
  --c-primary:       #22d3ee;
  --c-primary-hover: #06b6d4;
  --c-primary-light: #0c2a33;
  --c-primary-muted: #164e63;
  --c-primary-text:  #a5f3fc;
  --c-primary-ring:  rgba(34,211,238,0.3);
  --c-bg:            #030712;
  --c-surface:       #0f172a;
  --c-border:        #1e3a4a;
  --c-text:          #e2e8f0;
  --c-muted:         #94a3b8;
  --c-subtle:        #64748b;
  --c-side-bg:       #020617;
  --c-side-border:   #0c2233;
  --c-side-text:     rgba(255,255,255,0.92);
  --c-side-muted:    rgba(255,255,255,0.40);
  --c-side-active:   rgba(34,211,238,0.22);
  --c-side-hover:    rgba(34,211,238,0.08);
}

[data-theme="magenta"] {
  --c-primary:       #ec4899;
  --c-primary-hover: #db2777;
  --c-primary-light: #fce7f3;
  --c-primary-muted: #fbcfe8;
  --c-primary-text:  #831843;
  --c-primary-ring:  rgba(236,72,153,0.3);
  --c-bg:            #fdf2f8;
  --c-border:        #fbcfe8;
  --c-side-bg:       #500724;
  --c-side-border:   #831843;
  --c-side-text:     rgba(255,255,255,0.92);
  --c-side-muted:    rgba(255,255,255,0.50);
  --c-side-active:   rgba(236,72,153,0.22);
  --c-side-hover:    rgba(255,255,255,0.10);
}

[data-theme="oscuro"] {
  --c-primary:       #34d399;
  --c-primary-hover: #10b981;
  --c-primary-light: #064e3b;
  --c-primary-muted: #065f46;
  --c-primary-text:  #6ee7b7;
  --c-primary-ring:  rgba(52,211,153,0.25);
  --c-bg:            #0f172a;
  --c-surface:       #1e293b;
  --c-border:        #334155;
  --c-text:          #f1f5f9;
  --c-muted:         #cbd5e1;
  --c-subtle:        #94a3b8;
  --c-side-bg:       #020617;
  --c-side-border:   #1e293b;
  --c-side-text:     rgba(255,255,255,0.90);
  --c-side-muted:    rgba(255,255,255,0.45);
  --c-side-active:   rgba(52,211,153,0.20);
  --c-side-hover:    rgba(255,255,255,0.07);
}

/* === 3. Global reset + base === */

*, *::before, *::after { box-sizing: border-box }

body {
  font-family: var(--font-sans);
  background-color: var(--c-bg);
  color: var(--c-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

input, select, textarea {
  font-family: var(--font-sans);
  outline: none;
  transition: border-color var(--ease), box-shadow var(--ease);
}
input:focus, select:focus, textarea:focus {
  box-shadow: 0 0 0 3px var(--c-primary-ring);
}

/* === 4. Tailwind overrides — all themes via CSS vars === */

/* Backgrounds */
.bg-white    { background-color: var(--c-surface) !important }
.bg-gray-50  { background-color: var(--c-primary-light) !important }
.bg-gray-100 { background-color: var(--c-primary-muted) !important }

/* Borders */
.border-gray-100 { border-color: var(--c-border) !important }
.border-gray-200 { border-color: var(--c-border) !important }

/* Text */
.text-gray-900 { color: var(--c-text) !important }
.text-gray-800 { color: var(--c-text) !important }
.text-gray-700 { color: var(--c-muted) !important }
.text-gray-600 { color: var(--c-muted) !important }
.text-gray-500 { color: var(--c-subtle) !important }
.text-gray-400 { color: var(--c-subtle) !important }

/* Primary green → CSS var */
.bg-green-600  { background-color: var(--c-primary) !important }
.bg-green-700  { background-color: var(--c-primary-hover) !important }
.bg-green-50   { background-color: var(--c-primary-light) !important }
.bg-green-100  { background-color: var(--c-primary-muted) !important }
.text-green-600 { color: var(--c-primary) !important }
.text-green-700 { color: var(--c-primary-hover) !important }
.text-green-800 { color: var(--c-primary-text) !important }
.border-green-500 { border-color: var(--c-primary) !important }
.border-green-300 { border-color: var(--c-primary-muted) !important }
.border-green-200 { border-color: var(--c-primary-light) !important }

.hover\:bg-green-700:hover    { background-color: var(--c-primary-hover) !important }
.hover\:bg-green-50:hover     { background-color: var(--c-primary-light) !important }
.hover\:bg-gray-50:hover      { background-color: var(--c-primary-light) !important }
.hover\:bg-gray-100:hover     { background-color: var(--c-primary-muted) !important }
.hover\:text-green-700:hover  { color: var(--c-primary-hover) !important }
.hover\:text-green-800:hover  { color: var(--c-primary-text) !important }
.hover\:border-green-200:hover { border-color: var(--c-primary-muted) !important }
.focus\:border-green-500:focus { border-color: var(--c-primary) !important }

/* Todos los temas: inputs oscuros */
[data-theme] input,
[data-theme] select,
[data-theme] textarea {
  background-color: var(--c-surface) !important;
  color: var(--c-text) !important;
  border-color: var(--c-border) !important;
}

/* === 5. Utility tokens === */

.bg-primary        { background-color: var(--c-primary) }
.bg-primary-light  { background-color: var(--c-primary-light) }
.bg-primary-muted  { background-color: var(--c-primary-muted) }
.text-primary      { color: var(--c-primary) }
.text-primary-text { color: var(--c-primary-text) }
.border-primary    { border-color: var(--c-primary) }

/* === 6. Sidebar (desktop) === */

.sidebar {
  display: none;
  width: 15rem;
  background-color: var(--c-side-bg);
  border-right: 1px solid var(--c-side-border);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 30;
  flex-direction: column;
}
@media (min-width: 768px) { .sidebar { display: flex } }

.sidebar-logo {
  padding: 1.25rem;
  border-bottom: 1px solid var(--c-side-border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(0,0,0,0.25);
}

.sidebar-logo-icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.75rem;
  background: rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-logo-text-main {
  font-size: 0.875rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}
.sidebar-logo-text-sub {
  font-size: 0.7rem;
  color: var(--c-side-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 9rem;
}

.sidebar-nav {
  flex: 1;
  padding: 0.625rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  border-radius: var(--r-lg);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--c-side-text);
  text-decoration: none;
  transition: background var(--ease), color var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.sidebar-nav-item svg {
  width: 1.125rem;
  height: 1.125rem;
  flex-shrink: 0;
  opacity: 0.7;
}
.sidebar-nav-item:hover {
  background: var(--c-side-hover);
}
.sidebar-nav-item.active {
  background: var(--c-side-active);
  color: #fff;
  font-weight: 600;
}
.sidebar-nav-item.active svg { opacity: 1 }

/* accent bar on active item */
.sidebar-nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 1.25rem;
  background: var(--c-primary);
  border-radius: 0 2px 2px 0;
}
.sidebar-nav-item { position: relative }

.sidebar-footer {
  padding: 0.75rem;
  border-top: 1px solid var(--c-side-border);
  background: rgba(0,0,0,0.2);
}

.sidebar-avatar {
  width: 1.875rem;
  height: 1.875rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--c-side-bg);
  background: var(--c-primary);
  flex-shrink: 0;
}

/* === 7. Mobile bottom nav === */

.mobile-nav {
  display: flex;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--nav-height);
  background: var(--c-surface);
  border-top: 2px solid var(--c-primary-muted);
  box-shadow: 0 -4px 24px rgba(0,0,0,0.08);
  align-items: stretch;
  z-index: 30;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (min-width: 768px) { .mobile-nav { display: none } }

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  flex: 1;
  padding: 6px 2px 10px;
  color: var(--c-subtle);
  font-size: 10px;
  font-weight: 600;
  text-decoration: none;
  position: relative;
  transition: color var(--ease);
  -webkit-tap-highlight-color: transparent;
  background: none;
  border: none;
  cursor: pointer;
}
.mobile-nav-item svg { width: 22px; height: 22px; transition: transform var(--ease) }
.mobile-nav-item.active { color: var(--c-primary) }
.mobile-nav-item.active svg { transform: translateY(-1px) }
.mobile-nav-item.active::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 28px; height: 3px;
  background: var(--c-primary);
  border-radius: 0 0 3px 3px;
}
.mobile-nav-item.active .nav-icon-wrap { background: var(--c-primary-light) }

.nav-icon-wrap {
  width: 38px; height: 30px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--ease);
}
.nav-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  display: block;
}

/* === 8. Mobile topbar === */

.mobile-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--c-side-bg);
  position: sticky;
  top: 0; z-index: 20;
}
@media (min-width: 768px) { .mobile-topbar { display: none } }

/* === 9. Content area === */

.content-area {
  padding: 1.25rem 1rem 6rem;
  min-height: 100vh;
}
@media (min-width: 768px) { .content-area { padding: 2rem } }

/* === 10. Components === */

.card {
  background: var(--c-surface);
  border-radius: var(--r-2xl);
  border: 1px solid var(--c-border);
  box-shadow: var(--s-card);
}

.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  background: var(--c-primary); color: #fff;
  border-radius: var(--r-lg); font-size: 0.875rem; font-weight: 600;
  border: none; cursor: pointer; min-height: 44px;
  font-family: var(--font-sans);
  transition: background var(--ease), transform var(--ease), box-shadow var(--ease);
}
.btn-primary:hover  { background: var(--c-primary-hover); box-shadow: var(--s-md) }
.btn-primary:active { transform: scale(0.98) }

.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  background: transparent; border: 1.5px solid var(--c-border);
  color: var(--c-muted); border-radius: var(--r-lg);
  font-size: 0.875rem; font-weight: 500; cursor: pointer; min-height: 44px;
  font-family: var(--font-sans);
  transition: background var(--ease), color var(--ease), border-color var(--ease);
}
.btn-ghost:hover { background: var(--c-primary-light); color: var(--c-primary-text); border-color: var(--c-primary-muted) }

/* === 11. Spinner === */

.spinner {
  display: inline-block; width: 1.125rem; height: 1.125rem;
  border: 2px solid rgba(255,255,255,0.3); border-top-color: #fff;
  border-radius: 50%; animation: spin 0.7s linear infinite; flex-shrink: 0;
}
.spinner.dark { border-color: var(--c-primary-muted); border-top-color: var(--c-primary) }
@keyframes spin { to { transform: rotate(360deg) } }

/* === 12. Alerts === */

.alert {
  padding: 0.75rem 1rem; border-radius: var(--r-lg);
  font-size: 0.875rem; font-weight: 500; margin-bottom: 1rem;
  animation: slideDown 0.2s ease;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-6px) }
  to   { opacity: 1; transform: translateY(0) }
}
.alert-success { background:#dcfce7; color:#166534; border:1px solid #bbf7d0 }
.alert-danger  { background:#fee2e2; color:#991b1b; border:1px solid #fecaca }
.alert-info    { background:#dbeafe; color:#1e40af; border:1px solid #bfdbfe }
.alert-warning { background:#fef3c7; color:#92400e; border:1px solid #fde68a }

/* === 13. Badges === */

.badge-ok      { background:#dcfce7; color:#166534 }
.badge-warning { background:#fef3c7; color:#92400e }
.badge-danger  { background:#fee2e2; color:#991b1b }

/* === 14. Modal bottom sheet === */

.modal-overlay {
  position: fixed; inset: 0; z-index: 40;
  display: flex; align-items: flex-end;
  background: rgba(0,0,0,0);
  transition: background 0.25s;
}
.modal-overlay.open { background: rgba(0,0,0,0.5) }
@media (min-width: 768px) { .modal-overlay { align-items: center; justify-content: center } }

.modal-sheet {
  background: var(--c-surface); width: 100%;
  border-radius: 1.5rem 1.5rem 0 0;
  max-height: 92vh; overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
  box-shadow: var(--s-xl);
  border-top: 3px solid var(--c-primary);
}
.modal-overlay.open .modal-sheet { transform: translateY(0) }
@media (min-width: 768px) {
  .modal-sheet {
    border-radius: var(--r-2xl); max-width: 28rem; max-height: 90vh;
    transform: scale(0.95); opacity: 0;
    transition: transform 0.2s cubic-bezier(0.34,1.56,0.64,1), opacity 0.2s;
    border-top: none; border-left: 3px solid var(--c-primary);
  }
  .modal-overlay.open .modal-sheet { transform: scale(1); opacity: 1 }
}
.modal-handle {
  width: 2.5rem; height: 0.25rem;
  background: var(--c-border); border-radius: 9999px; margin: 0.75rem auto 0;
}

/* === 15. Skeleton loader === */

.skeleton {
  background: linear-gradient(90deg, var(--c-border) 25%, var(--c-primary-light) 50%, var(--c-border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite; border-radius: var(--r-md);
}
@keyframes shimmer { 0% { background-position: 200% 0 } 100% { background-position: -200% 0 } }

/* === 16. Theme & font swatches === */

.theme-swatch {
  width: 2.5rem; height: 2.5rem; border-radius: 50%;
  border: 3px solid transparent; cursor: pointer; position: relative;
  transition: transform var(--ease), box-shadow var(--ease);
}
.theme-swatch:hover { transform: scale(1.15) }
.theme-swatch.selected {
  border-color: var(--c-text);
  box-shadow: 0 0 0 2px var(--c-surface), 0 0 0 4px var(--c-primary);
}

.font-card {
  padding: 0.75rem 1rem;
  border: 2px solid var(--c-border);
  border-radius: var(--r-xl);
  cursor: pointer;
  transition: border-color var(--ease), background var(--ease), transform var(--ease);
  background: var(--c-surface);
  text-align: center;
}
.font-card:hover { border-color: var(--c-primary); background: var(--c-primary-light); transform: translateY(-1px) }
.font-card.selected {
  border-color: var(--c-primary);
  background: var(--c-primary-light);
  box-shadow: 0 0 0 1px var(--c-primary);
}
.font-card-name { font-size: 0.8rem; font-weight: 600; color: var(--c-muted) }
.font-card-sample { font-size: 1.1rem; font-weight: 600; color: var(--c-text); line-height: 1.3 }

/* === 17. More menu === */

.more-overlay {
  display: none; position: fixed; inset: 0; z-index: 50;
  align-items: flex-end; background: rgba(0,0,0,0);
  transition: background 0.25s;
}
.more-overlay.open { display: flex; background: rgba(0,0,0,0.5) }

.more-sheet {
  width: 100%; background: var(--c-surface);
  border-radius: 1.5rem 1.5rem 0 0;
  padding-bottom: env(safe-area-inset-bottom, 1rem);
  box-shadow: var(--s-xl);
  animation: sheetUp 0.28s cubic-bezier(0.34,1.56,0.64,1);
  border-top: 3px solid var(--c-primary);
}
@keyframes sheetUp { from { transform: translateY(100%) } to { transform: translateY(0) } }

.more-handle {
  width: 2.5rem; height: 0.25rem;
  background: var(--c-border); border-radius: 9999px; margin: 0.75rem auto 0;
}
.more-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.25rem 0.5rem;
}
.more-close {
  width: 2rem; height: 2rem; border-radius: 50%;
  background: var(--c-primary-light); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--c-primary); transition: background var(--ease);
}
.more-close:hover { background: var(--c-primary-muted) }

.more-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  padding: 0.75rem 1rem 1.25rem;
}
.more-item {
  display: flex; flex-direction: column; align-items: center; gap: 0.375rem;
  padding: 0.75rem 0.25rem; border-radius: var(--r-xl);
  text-decoration: none; cursor: pointer; background: none; border: none;
  transition: background var(--ease); -webkit-tap-highlight-color: transparent;
}
.more-item:hover { background: var(--c-primary-light) }
.more-item.active { background: var(--c-primary-muted) }

.more-item-icon {
  width: 3rem; height: 3rem; border-radius: var(--r-xl);
  background: var(--c-primary-light);
  display: flex; align-items: center; justify-content: center;
  color: var(--c-primary);
  transition: background var(--ease), color var(--ease);
}
.more-item.active .more-item-icon { background: var(--c-primary); color: #fff }
.more-item:hover .more-item-icon   { background: var(--c-primary-muted) }

.more-item-label {
  font-size: 0.7rem; font-weight: 600;
  color: var(--c-muted); text-align: center; line-height: 1.2;
}
.more-item.active .more-item-label { color: var(--c-primary-text) }

/* === 18. Page Header === */

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.page-header-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--c-text);
  line-height: 1.25;
  /* On mobile the topbar already shows the title */
  display: none;
}
.page-header-title small {
  display: block;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--c-subtle);
  margin-top: 1px;
}
@media (min-width: 768px) {
  .page-header-title {
    display: block;
    font-size: 1.5rem;
  }
}

/* When there's no button, collapse the header on mobile */
.page-header:empty,
.page-header:not(:has(.page-header-btn)):not(:has(a)) {
  display: none;
}
@media (max-width: 767px) {
  .page-header {
    justify-content: flex-end;
    margin-bottom: 1rem;
  }
}

/* Compact icon-only on mobile, full text on desktop */
.page-header-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.875rem;
  background: var(--c-primary);
  color: #fff;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: background var(--ease), box-shadow var(--ease);
  font-family: var(--font-sans);
}
.page-header-btn:hover { background: var(--c-primary-hover); box-shadow: var(--s-md) }
.page-header-btn:active { transform: scale(0.96) }
.page-header-btn .btn-label { display: none }
@media (min-width: 768px) {
  .page-header-btn { width: auto; padding: 0 1.125rem; }
  .page-header-btn .btn-label { display: inline }
}

/* Secondary variant (gray) */
.page-header-btn-secondary {
  background: var(--c-surface);
  color: var(--c-text);
  border: 1.5px solid var(--c-border);
}
.page-header-btn-secondary:hover { background: var(--c-primary-light); border-color: var(--c-primary-muted) }

/* Tab group in header */
.page-header-tabs {
  display: flex;
  gap: 0.25rem;
  background: var(--c-primary-light);
  border: 1.5px solid var(--c-primary-muted);
  padding: 0.25rem;
  border-radius: 0.875rem;
}
.page-header-tab {
  padding: 0.375rem 0.875rem;
  border-radius: 0.625rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--c-primary-text);
  cursor: pointer;
  transition: background var(--ease), color var(--ease), box-shadow var(--ease);
  background: transparent;
  border: none;
  font-family: var(--font-sans);
  white-space: nowrap;
}
.page-header-tab.active {
  background: var(--c-surface);
  color: var(--c-text);
  box-shadow: var(--s-card);
}

/* === 19. Global mobile touch targets ===
   Ensures every interactive element inside modals and forms
   meets the 44px minimum touch target on mobile. */

/* All inputs/selects/textareas in forms: min 48px height */
.modal-sheet input,
.modal-sheet select,
.modal-sheet textarea,
#modal input,
#modal select,
#modal textarea {
  min-height: 48px;
}

/* Buttons inside modals */
.modal-sheet button[type="submit"],
.modal-sheet button[type="button"].flex-1,
#modal button[type="submit"],
#modal button.flex-1 {
  min-height: 48px;
}

/* Search inputs */
input[type="search"],
input[type="text"][id*="search"],
input[id*="search"] {
  min-height: 48px;
}

/* Action icon buttons (edit/delete) inside lists */
.action-btn {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.75rem;
  transition: background var(--ease), color var(--ease);
  cursor: pointer;
  border: none;
  background: transparent;
}

/* Pagination buttons */
.page-btn {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--ease), color var(--ease);
}

/* Scrollable rows (like payment methods) */
.scroll-row {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.scroll-row::-webkit-scrollbar { display: none }

/* === 19. Smart Pagination === */

.pag-btn {
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.375rem;
  border-radius: 0.625rem;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1.5px solid var(--c-border);
  background: var(--c-surface);
  color: var(--c-muted);
  cursor: pointer;
  transition: background var(--ease), color var(--ease), border-color var(--ease);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
}
.pag-btn:hover {
  background: var(--c-primary-light);
  border-color: var(--c-primary-muted);
  color: var(--c-primary);
}
.pag-btn.pag-active {
  background: var(--c-primary);
  color: #fff;
  border-color: var(--c-primary);
  box-shadow: 0 2px 8px var(--c-primary-ring);
}
.pag-ellipsis {
  min-width: 1.25rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--c-subtle);
  font-size: 0.75rem;
  user-select: none;
}
@media (min-width: 768px) {
  .pag-btn {
    min-width: 2.25rem;
    height: 2.25rem;
    font-size: 0.8125rem;
    border-radius: 0.75rem;
  }
  .pag-ellipsis {
    min-width: 1.75rem;
    height: 2.25rem;
  }
}

/* === 20. Theme swatch cards (configuracion) === */

.theme-swatch-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  border: none;
  background: none;
  padding: 3px;
  border-radius: 10px;
  transition: transform 0.15s;
  font-family: var(--font-sans);
}
.theme-swatch-card:hover { transform: translateY(-2px) }

.theme-swatch-preview {
  width: 100%;
  height: 46px;
  border-radius: 8px;
  display: flex;
  flex-direction: row;
  overflow: hidden;
  border: 2.5px solid transparent;
  transition: border-color 0.15s, box-shadow 0.15s;
}
@media (min-width: 1280px) {
  .theme-swatch-preview { height: 40px; }
  .theme-swatch-label   { font-size: 9px; }
}
.theme-swatch-card.selected .theme-swatch-preview {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px var(--c-primary-ring);
}
.theme-swatch-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--c-muted);
  letter-spacing: 0.02em;
}
.theme-swatch-card.selected .theme-swatch-label {
  color: var(--c-primary);
}

/* === 21. Notification Center === */

.notif-badge {
  position: absolute;
  top: -5px; right: -5px;
  min-width: 16px; height: 16px;
  border-radius: 9999px;
  background: #ef4444; color: #fff;
  font-size: 9px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
  border: 2px solid var(--c-side-bg);
  pointer-events: none; line-height: 1;
}

/* Modal — mobile: bottom sheet / desktop: centrado */
.notif-modal {
  background: var(--c-surface);
  width: 100%;
  border-radius: 1.5rem 1.5rem 0 0;
  border-top: 3px solid var(--c-primary);
  display: flex; flex-direction: column;
  box-shadow: 0 -8px 40px rgba(0,0,0,0.25);
  animation: sheetUp 0.28s cubic-bezier(0.34,1.56,0.64,1);
}
@media (min-width: 768px) {
  .notif-modal {
    width: 380px;
    max-height: 85vh;
    border-radius: 0 0 1.5rem 1.5rem;
    border-top: none;
    border-left: 3px solid var(--c-primary);
    animation: notifSlideDown 0.22s cubic-bezier(0.34,1.56,0.64,1);
  }
}
@keyframes notifSlideDown {
  from { transform: translateY(-10px); opacity: 0 }
  to   { transform: translateY(0);     opacity: 1 }
}

/* Items */
.notif-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--c-border);
  cursor: pointer; transition: background var(--ease);
  position: relative;
}
.notif-item:hover      { background: var(--c-primary-light) }
.notif-item:last-child { border-bottom: none }
.notif-unread          { background: var(--c-primary-light) }

.notif-icon-wrap {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--c-primary-muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; flex-shrink: 0;
}
.notif-body  { flex: 1; min-width: 0; padding-right: 14px }
.notif-title { font-size: 0.8125rem; font-weight: 600; color: var(--c-text); line-height: 1.3 }
.notif-desc  { font-size: 0.75rem; color: var(--c-subtle); margin-top: 2px; line-height: 1.4 }
.notif-time  { font-size: 0.7rem; color: var(--c-subtle); margin-top: 4px }
.notif-dot {
  position: absolute; right: 16px; top: 50%;
  transform: translateY(-50%);
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--c-primary);
}

/* === 22. Scrollbar === */

/* old === 20 (scrollbar, renumbered) */
::-webkit-scrollbar { width: 4px; height: 4px }
::-webkit-scrollbar-track { background: transparent }
::-webkit-scrollbar-thumb { background: var(--c-primary-muted); border-radius: 9999px }
::-webkit-scrollbar-thumb:hover { background: var(--c-primary) }

/* === 19. FAB === */

.fab {
  position: fixed;
  bottom: calc(var(--nav-height) + 1rem); right: 1rem;
  width: 3.25rem; height: 3.25rem; border-radius: 50%;
  background: var(--c-primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--s-lg); border: none; cursor: pointer; z-index: 20;
  transition: background var(--ease), transform var(--ease), box-shadow var(--ease);
}
.fab:hover  { background: var(--c-primary-hover); transform: scale(1.05) }
.fab:active { transform: scale(0.95) }
@media (min-width: 768px) { .fab { display: none } }

/* === 24. Category pills === */
.scrollbar-hide { scrollbar-width: none }
.scrollbar-hide::-webkit-scrollbar { display: none }

.cat-pill {
  background: var(--c-surface);
  border-color: var(--c-border);
  color: var(--c-muted);
  transition: background var(--ease), color var(--ease), border-color var(--ease);
}
.cat-pill.active,
.cat-pill:hover {
  background: var(--c-primary);
  border-color: var(--c-primary);
  color: #fff;
}
