/* ── RESET & BASE ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #f0f4ff;
  --surface:   rgba(255,255,255,0.75);
  --surface2:  rgba(255,255,255,0.55);
  --border:    rgba(99,102,241,0.12);
  --border2:   rgba(99,102,241,0.22);
  --text:      #1e1b4b;
  --text2:     #6366f1;
  --accent:    #6366f1;
  --accent2:   #4f46e5;
  --green:     #16a34a;
  --gold:      #d97706;
  --radius:    18px;
  --radius-sm: 10px;
  --shadow:    0 8px 32px rgba(99,102,241,0.13);
  --shadow-sm: 0 2px 16px rgba(99,102,241,0.10);
  --transition: 0.2s ease;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', 'Segoe UI', sans-serif;
  background: linear-gradient(135deg, #e0e7ff 0%, #f0f4ff 40%, #fce7f3 100%);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

/* ── HEADER ───────────────────────────────────────────────────── */
header {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
  border-bottom: none;
  padding: 32px 24px 28px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 32px rgba(99,102,241,0.25);
}

header::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(255,255,255,0.18) 0%, transparent 70%);
  pointer-events: none;
}

header::after {
  content: '';
  position: absolute;
  bottom: -80px; left: 15%;
  width: 400px; height: 220px;
  background: radial-gradient(circle, rgba(255,255,255,0.10) 0%, transparent 70%);
  pointer-events: none;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-brand {
  display: block;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
  text-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.header-sub {
  display: block;
  font-size: 0.72rem;
  color: rgba(255,255,255,0.75);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.header-tagline {
  font-size: 0.88rem;
  color: rgba(255,255,255,0.8);
  max-width: 340px;
  text-align: right;
}

/* ── TAB NAV ──────────────────────────────────────────────────── */
.tab-nav {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 18px 24px;
  background: rgba(255,255,255,0.72);
  border-bottom: 1px solid rgba(99,102,241,0.10);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 2px 16px rgba(99,102,241,0.07);
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 26px;
  border: 1.5px solid rgba(99,102,241,0.25);
  background: rgba(255,255,255,0.6);
  color: #6366f1;
  border-radius: 50px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  transition: all var(--transition);
  white-space: nowrap;
  backdrop-filter: blur(8px);
}

.tab-btn:hover {
  border-color: var(--accent);
  color: var(--accent2);
  background: rgba(99,102,241,0.08);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}

.tab-btn.active {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 20px rgba(99,102,241,0.35);
}

/* ── LAYOUT ───────────────────────────────────────────────────── */
.tab-content { display: none; padding: 28px 24px; max-width: 1200px; margin: 0 auto; }
.tab-content.active { display: block; animation: fadeIn 0.3s ease; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.gen-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 900px) { .gen-layout { grid-template-columns: 1fr; } }

/* ── PANELS ───────────────────────────────────────────────────── */
.form-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 90px;
}

.preview-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 18px;
  font-family: 'Space Grotesk', sans-serif;
}

.panel-head svg { color: var(--accent2); flex-shrink: 0; }

.preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text2);
}

.preview-head span { display: flex; align-items: center; gap: 6px; }
.preview-head svg { color: var(--accent2); }

.preview-badge {
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 0.75rem;
  color: var(--text2);
}

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

/* ── FORM FIELDS ──────────────────────────────────────────────── */
.field-group { display: flex; flex-direction: column; gap: 12px; }

.field { display: flex; flex-direction: column; gap: 5px; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

label svg { color: var(--accent2); flex-shrink: 0; }

input[type="text"],
input[type="date"],
select {
  width: 100%;
  padding: 9px 12px;
  background: var(--surface2);
  border: 1.5px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.88rem;
  font-family: 'Inter', sans-serif;
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
  -webkit-appearance: none;
}

input[type="text"]:focus,
input[type="date"]:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239090b0' stroke-width='2.5' stroke-linecap='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
  cursor: pointer;
}

input[type="color"] {
  width: 100%;
  height: 40px;
  border: 1.5px solid var(--border2);
  border-radius: var(--radius-sm);
  background: var(--surface2);
  cursor: pointer;
  padding: 3px;
}

input[type="range"] {
  width: 100%;
  height: 4px;
  accent-color: var(--accent);
  cursor: pointer;
  margin-top: 4px;
}

/* Input with button */
.input-with-btn { display: flex; gap: 6px; }
.input-with-btn input { flex: 1; }

.icon-btn {
  width: 38px; height: 38px;
  background: var(--surface2);
  border: 1.5px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--text2);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition);
}

.icon-btn:hover { border-color: var(--accent); color: var(--accent2); background: rgba(99,102,241,0.1); }

/* Toggle */
.toggle-row { display: flex; align-items: center; gap: 10px; }

.toggle { position: relative; display: inline-block; width: 40px; height: 22px; cursor: pointer; }
.toggle input { opacity: 0; width: 0; height: 0; }

.toggle-track {
  position: absolute; inset: 0;
  background: var(--surface2);
  border: 1.5px solid var(--border2);
  border-radius: 20px;
  transition: all var(--transition);
}

.toggle-track::after {
  content: '';
  position: absolute;
  left: 3px; top: 50%;
  transform: translateY(-50%);
  width: 14px; height: 14px;
  background: var(--text2);
  border-radius: 50%;
  transition: all var(--transition);
}

.toggle input:checked + .toggle-track { background: var(--accent); border-color: var(--accent); }
.toggle input:checked + .toggle-track::after { left: calc(100% - 17px); background: #fff; }

#barcodeShowTextLabel { font-size: 0.85rem; color: var(--text2); }

/* Color row */
.color-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-top: 12px; }

/* ── STYLE PICKER ─────────────────────────────────────────────── */
.style-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.style-card {
  background: var(--surface2);
  border: 2px solid var(--border2);
  border-radius: 10px;
  padding: 8px 6px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: all var(--transition);
  font-family: 'Inter', sans-serif;
}

.style-card:hover { border-color: var(--accent2); transform: translateY(-2px); }
.style-card.active { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99,102,241,0.2); }

.style-card span { font-size: 0.72rem; font-weight: 600; color: var(--text2); }
.style-card.active span { color: var(--accent2); }

.style-thumb {
  width: 100%; height: 32px;
  border-radius: 5px;
  overflow: hidden;
}

.classic-thumb  { background: linear-gradient(90deg, #6366f1 40%, #4f46e5 40%); }
.modern-thumb   { background: linear-gradient(135deg, #ec4899, #8b5cf6); }
.minimal-thumb  { background: #fff; border: 1.5px solid #e5e7eb; }
.luxury-thumb   { background: linear-gradient(135deg, #1a1a2e, #2d2d44); position: relative; overflow: hidden; }
.luxury-thumb::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(45deg, rgba(245,158,11,0.3) 0px, rgba(245,158,11,0.3) 2px, transparent 2px, transparent 8px); }
.festival-thumb { background: linear-gradient(135deg, #f97316, #ef4444, #ec4899); }
.neon-thumb     { background: #0a0a0f; border: 1.5px solid #00ff88; box-shadow: inset 0 0 8px rgba(0,255,136,0.2); }
.saree-thumb    { background: linear-gradient(135deg, #c0392b, #8e44ad, #f39c12); }
.grocery-thumb  { background: linear-gradient(135deg, #f9a825, #388e3c); }
.vegetable-thumb{ background: linear-gradient(135deg, #2e7d32, #a5d6a7); }
.fruit-thumb    { background: linear-gradient(135deg, #e53935, #fb8c00, #fdd835); }
.homefood-thumb { background: linear-gradient(135deg, #bf360c, #ff8f00); }
.dairy-thumb    { background: linear-gradient(135deg, #e3f2fd, #90caf9, #fff); border: 1px solid #90caf9; }
.driedveg-thumb { background: linear-gradient(135deg, #795548, #bcaaa4); }
.nuts-thumb     { background: linear-gradient(135deg, #6d4c41, #d7ccc8, #a1887f); }
.herbal-thumb   { background: linear-gradient(135deg, #1b5e20, #a5d6a7, #f9fbe7); }
.seeds-thumb    { background: linear-gradient(135deg, #f57f17, #827717, #33691e); }

/* ── BUTTONS ──────────────────────────────────────────────────── */
.btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 16px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all var(--transition);
  margin-top: 10px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  color: #fff;
  box-shadow: 0 4px 16px rgba(99,102,241,0.35);
}

.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(99,102,241,0.5); }

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border2);
  color: var(--text2);
}

.btn-outline:hover { border-color: var(--accent2); color: var(--accent2); background: rgba(99,102,241,0.08); }

.btn-whatsapp {
  background: linear-gradient(135deg, #25D366, #128C7E);
  color: #fff;
  box-shadow: 0 4px 16px rgba(37,211,102,0.3);
}

.btn-whatsapp:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(37,211,102,0.45); }

.btn-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 0;
}

.btn-row .btn { margin-top: 0; }

/* ── CANVAS / PREVIEW ─────────────────────────────────────────── */
.canvas-wrap {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}

#couponCanvas {
  max-width: 100%;
  border-radius: 10px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
  display: block;
}

/* Barcode preview */
#barcodePreviewBox {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 30px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  gap: 12px;
}

#barcodePreviewBox svg { max-width: 100%; border-radius: 6px; }

#barcodeLabelText {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text2);
  text-align: center;
}

/* QR preview */
#qrPreviewBox {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 30px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  gap: 14px;
}

#qrcode-output canvas,
#qrcode-output img {
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

#qrLabelText {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text2);
  text-align: center;
}

/* ── WHATSAPP SHARE MODAL ─────────────────────────────────────── */
#waShareModal {
  position: fixed; inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.wsm-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
}

.wsm-box {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 20px;
  padding: 28px;
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
  z-index: 1;
  animation: modalIn 0.25s ease;
}

@keyframes modalIn { from { opacity: 0; transform: scale(0.94) translateY(10px); } to { opacity: 1; transform: scale(1) translateY(0); } }

.wsm-box h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.2rem;
  color: var(--text);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.wsm-sub { font-size: 0.84rem; color: var(--text2); margin-bottom: 20px; }

.wsm-steps { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }

.wsm-step {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
}

.wsm-num {
  background: linear-gradient(135deg, var(--green), #128C7E);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.wsm-step strong { display: block; font-size: 0.88rem; color: var(--text); margin-bottom: 8px; }

.wsm-btn-dl, .wsm-btn-copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: all var(--transition);
}

.wsm-btn-dl   { background: linear-gradient(135deg, var(--accent), #8b5cf6); color: #fff; }
.wsm-btn-copy { background: linear-gradient(135deg, var(--green), #128C7E); color: #fff; }
.wsm-btn-dl:hover, .wsm-btn-copy:hover { opacity: 0.88; transform: translateY(-1px); }

.wsm-preview {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 16px;
}

.wsm-preview img {
  width: 130px;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  flex-shrink: 0;
}

.wsm-preview pre {
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  white-space: pre-wrap;
  color: var(--text2);
  line-height: 1.7;
  margin: 0;
}

.wsm-close {
  width: 100%;
  padding: 10px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  color: var(--text2);
  cursor: pointer;
  transition: all var(--transition);
}

.wsm-close:hover { border-color: #ef4444; color: #ef4444; }

/* ── SCROLLBAR ────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ── RESPONSIVE ───────────────────────────────────────────────── */

/* ── APP BODY (sidebar + content) ────────────────────────────── */
.app-body {
  display: flex;
  min-height: calc(100vh - 100px);
  align-items: stretch;
}

.main-content { flex: 1; min-width: 0; overflow-x: hidden; }

/* ── SIDEBAR ──────────────────────────────────────────────────── */
.sidebar {
  width: 230px;
  flex-shrink: 0;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid rgba(99,102,241,0.12);
  padding: 22px 14px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  box-shadow: 2px 0 20px rgba(99,102,241,0.07);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 4px 12px;
}

.sidebar-logo-img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(99,102,241,0.18);
  background: #fff;
  padding: 4px;
}

.sidebar-brand {
  display: block;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.1rem;
  font-weight: 800;
  background: linear-gradient(135deg, #6366f1, #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
}

.sidebar-sub {
  display: block;
  font-size: 0.67rem;
  color: #9ca3af;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  font-weight: 600;
}

.sidebar-divider { height: 1px; background: rgba(99,102,241,0.1); margin: 6px 0; }

.sidebar-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: #9ca3af;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 0 6px;
  margin-bottom: 2px;
}

/*/* -- SIDEBAR CATEGORY CARDS -- */
.sidebar-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 12px 6px 10px;
  border: 1.5px solid transparent;
  background: transparent;
  border-radius: 14px;
  cursor: pointer;
  text-align: center;
  font-family: 'Inter', sans-serif;
  transition: all 0.2s ease;
  width: 100%;
}
.sidebar-card:hover {
  background: rgba(99,102,241,0.07);
  border-color: rgba(99,102,241,0.2);
  transform: translateY(-2px);
}
.sidebar-card.active {
  background: linear-gradient(135deg, rgba(99,102,241,0.13), rgba(139,92,246,0.10));
  border-color: rgba(99,102,241,0.38);
  box-shadow: 0 2px 14px rgba(99,102,241,0.13);
}
.sidebar-card-img-wrap {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  overflow: hidden;
  flex-shrink: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  position: relative;
}
.sidebar-card.active .sidebar-card-img-wrap {
  box-shadow: none;
}
.sidebar-card-img-wrap img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 16px;
  z-index: 2;
}
.sidebar-card-svg {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  color: #6366f1;
  z-index: 1;
}
.sidebar-card.active .sidebar-card-svg { color: #4f46e5; }
.sidebar-card-info { width: 100%; }
.sidebar-card-title {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: #1e1b4b;
  line-height: 1.3;
  text-align: center;
  margin-top: 2px;
}
.sidebar-card.active .sidebar-card-title { color: #4f46e5; }
.sidebar-card-desc { display: none; }
.sidebar-card-arrow { display: none; }

.sidebar-footer {
  margin-top: auto;
  padding: 12px 6px 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.7rem;
  color: #a5b4fc;
  font-weight: 600;
}

/* hide old tab-nav */
.tab-nav { display: none !important; }

/* ── SCROLLBAR ────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(99,102,241,0.25); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #6366f1; }

/* ════════════════════════════════════════════════════════════════
   RESPONSIVE — DESKTOP ≥ 1024px
════════════════════════════════════════════════════════════════ */
@media (min-width: 1024px) {
  .app-body { flex-direction: row; }
  .sidebar {
    width: 230px;
    height: 100vh;
    position: sticky;
    top: 0;
    flex-direction: column;
    overflow-y: auto;
    border-right: 1px solid rgba(99,102,241,0.12);
    border-bottom: none;
  }
  .sidebar-logo, .sidebar-divider, .sidebar-label, .sidebar-footer { display: flex; }
  .sidebar-label { display: block; }
  .sidebar-footer { display: flex; }
  .sidebar-card { flex-direction: row; min-width: unset; }
  .sidebar-card-arrow { display: block; }
  .gen-layout { grid-template-columns: 360px 1fr; }
  .form-panel { position: sticky; top: 24px; }
  .tab-content { padding: 28px 28px; }
  header { padding: 28px 32px 24px; }
  .header-tagline { display: block; }
}

/* ════════════════════════════════════════════════════════════════
   RESPONSIVE — TABLET 768px – 1023px
════════════════════════════════════════════════════════════════ */
@media (min-width: 768px) and (max-width: 1023px) {
  .app-body { flex-direction: column; }
  .sidebar {
    width: 100%; height: auto; position: sticky; top: 0; z-index: 99;
    flex-direction: row; flex-wrap: nowrap;
    overflow-x: auto; padding: 12px 16px;
    gap: 10px; border-right: none;
    border-bottom: 1px solid rgba(99,102,241,0.12);
  }
  .sidebar-logo { padding-bottom: 0; border-right: 1px solid rgba(99,102,241,0.15); padding-right: 14px; margin-right: 4px; }
  .sidebar-logo-img { width: 38px; height: 38px; }
  .sidebar-brand { font-size: 0.9rem; }
  .sidebar-sub { display: none; }
  .sidebar-divider, .sidebar-label, .sidebar-footer { display: none; }
  .sidebar-card { min-width: 140px; flex-direction: row; padding: 8px 10px; }
  .sidebar-card-img-wrap { width: 36px; height: 36px; background: transparent; box-shadow: none; }
  .sidebar-card-arrow { display: none; }
  .sidebar-card:hover { transform: translateY(-2px); }
  .gen-layout { grid-template-columns: 1fr; }
  .form-panel { position: static; }
  .tab-content { padding: 20px 16px; }
  .header-tagline { display: none; }
  header { padding: 20px 16px; }
}

/* ════════════════════════════════════════════════════════════════
   RESPONSIVE — MOBILE ≤ 767px  (Blinkit-style 430px base)
════════════════════════════════════════════════════════════════ */
@media (max-width: 767px) {

  /* Header — compact */
  header { padding: 14px 16px 12px; }
  .header-inner { gap: 8px; }
  .header-tagline { display: none; }
  .header-brand { font-size: 1.1rem; }
  .header-sub { font-size: 0.6rem; }

  /* Sidebar — bottom tab bar like Blinkit */
  .app-body { flex-direction: column-reverse; min-height: 100vh; }

  .sidebar {
    width: 100%;
    height: 68px;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    top: auto;
    z-index: 200;
    flex-direction: row;
    align-items: center;
    justify-content: space-around;
    padding: 0 8px;
    gap: 0;
    border-right: none;
    border-top: 1px solid rgba(99,102,241,0.15);
    border-bottom: none;
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 -4px 24px rgba(99,102,241,0.12);
    overflow: visible;
  }

  /* Hide non-card elements in bottom bar */
  .sidebar-logo,
  .sidebar-divider,
  .sidebar-label,
  .sidebar-footer { display: none !important; }

  /* Each tab item — icon + label stacked */
  .sidebar-card {
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 4px;
    border-radius: 12px;
    min-width: unset;
    border: none;
    background: transparent;
  }

  .sidebar-card.active {
    background: rgba(99,102,241,0.08);
    border: none;
    box-shadow: none;
  }

  .sidebar-card:hover { transform: translateY(-2px); }

  .sidebar-card-img-wrap {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    box-shadow: none;
  }

  .sidebar-card.active .sidebar-card-img-wrap {
    box-shadow: none;
  }

  .sidebar-card-title {
    font-size: 0.68rem;
    font-weight: 700;
    color: #6b7280;
  }

  .sidebar-card.active .sidebar-card-title { color: #4f46e5; }
  .sidebar-card-desc, .sidebar-card-arrow { display: none; }

  /* Main content — add bottom padding for fixed tab bar */
  .main-content { padding-bottom: 76px; }

  /* Tab content */
  .tab-content { padding: 14px 12px; }

  /* Gen layout — single column */
  .gen-layout { grid-template-columns: 1fr; gap: 14px; }

  /* Panels */
  .form-panel, .preview-panel {
    padding: 16px 14px;
    border-radius: 14px;
    position: static;
  }

  /* Fields */
  .field-group { gap: 10px; }
  .field-row { grid-template-columns: 1fr 1fr; gap: 8px; }
  .color-row { grid-template-columns: 1fr 1fr 1fr; gap: 6px; }

  input[type="text"],
  input[type="date"],
  select { padding: 8px 10px; font-size: 0.85rem; }

  /* Style grid — 3 cols on mobile */
  .style-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .style-thumb { height: 26px; }
  .style-card span { font-size: 0.65rem; }

  /* Buttons */
  .btn { padding: 10px 12px; font-size: 0.85rem; }
  .btn-row { grid-template-columns: 1fr 1fr; gap: 6px; }

  /* Canvas */
  .canvas-wrap { padding: 12px; }
  #couponCanvas { border-radius: 8px; }

  /* Barcode / QR preview */
  #barcodePreviewBox, #qrPreviewBox { padding: 20px 12px; min-height: 160px; }

  /* WhatsApp modal */
  .wsm-box { padding: 20px 16px; border-radius: 16px; }
  .wsm-preview { flex-direction: column; }
  .wsm-preview img { width: 100%; max-width: 260px; margin: 0 auto; }
  .wsm-box h3 { font-size: 1rem; }
}

/* ── Sidebar card image + SVG fallback ───────────────────────── */
.sidebar-card-img-wrap { position: relative; }
.sidebar-card-img-wrap img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; border-radius: 12px;
  z-index: 2;
}
.sidebar-card-svg {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  color: #6366f1;
  z-index: 1;
}
.sidebar-card.active .sidebar-card-svg { color: #4f46e5; }

/* ── Header free badge & highlights ──────────────────────────── */
.header-tagline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.9rem;
  color: rgba(255,255,255,0.88);
  max-width: 420px;
  text-align: right;
  justify-content: flex-end;
  line-height: 1.6;
}

.header-free-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255,255,255,0.22);
  border: 1px solid rgba(255,255,255,0.4);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.header-highlight {
  font-weight: 700;
  color: #fde68a;
  text-decoration: underline;
  text-decoration-color: rgba(253,230,138,0.4);
  text-underline-offset: 3px;
}

@media (max-width: 767px) {
  .header-tagline { font-size: 0.78rem; max-width: 100%; justify-content: flex-start; }
}

/* ── Hide category name text — images contain names ─────────── */
.sidebar-card-info { display: none !important; }
.sidebar-card-arrow { display: none !important; }
.sidebar-card-desc  { display: none !important; }

/* ── PREMIUM SIDEBAR BUTTON ───────────────────────────────────── */
.sidebar-premium-btn {
  width: 100%;
  margin-top: 8px;
  padding: 10px 14px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border: none;
  border-radius: 12px;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 4px 14px rgba(245,158,11,0.4);
  transition: all 0.2s ease;
  letter-spacing: 0.5px;
}
.sidebar-premium-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(245,158,11,0.55); }

/* ── PREMIUM MODAL ────────────────────────────────────────────── */
#premiumOverlay { display: none; }
#premiumOverlay.open { display: flex !important; }

.prem-box {
  background: #fff;
  border-radius: 20px;
  padding: 28px 24px;
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0,0,0,0.5);
  animation: modalIn 0.25s ease;
}

.prem-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: #1e1b4b;
  margin-bottom: 6px;
}
.prem-head span { flex: 1; }
.prem-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  color: #9ca3af;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}
.prem-close:hover { color: #ef4444; }

.prem-sub { font-size: 0.84rem; color: #6b7280; margin-bottom: 18px; }

.prem-features { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.prem-feat {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: #374151;
  background: #f0f4ff;
  border-radius: 8px;
  padding: 8px 12px;
}

.prem-price-box {
  text-align: center;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border-radius: 14px;
  padding: 14px;
}
.prem-price { font-size: 2.2rem; font-weight: 800; color: #fff; font-family: 'Space Grotesk', sans-serif; }
.prem-period { font-size: 0.9rem; color: rgba(255,255,255,0.8); margin-left: 4px; }

.prem-btn-buy {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 10px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 16px rgba(99,102,241,0.35);
}
.prem-btn-buy:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(99,102,241,0.5); }

.prem-btn-code {
  width: 100%;
  padding: 10px;
  background: transparent;
  border: 1.5px solid rgba(99,102,241,0.3);
  border-radius: 12px;
  font-size: 0.84rem;
  font-weight: 600;
  color: #6366f1;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: all 0.2s ease;
}
.prem-btn-code:hover { background: rgba(99,102,241,0.06); border-color: #6366f1; }

.prem-btn-back {
  width: 100%;
  padding: 9px;
  background: transparent;
  border: none;
  font-size: 0.84rem;
  color: #9ca3af;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
}
.prem-btn-back:hover { color: #6366f1; }

/* UPI section */
.prem-upi-box {
  background: #f0fdf4;
  border: 1.5px solid #bbf7d0;
  border-radius: 14px;
  padding: 16px;
  text-align: center;
  margin-bottom: 16px;
}
.prem-upi-label { font-size: 0.78rem; font-weight: 600; color: #16a34a; margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.5px; }
.prem-qr { display: flex; justify-content: center; margin-bottom: 10px; }
.prem-qr canvas, .prem-qr img { border-radius: 8px; box-shadow: 0 2px 12px rgba(0,0,0,0.15); }
.prem-upi-id-row { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 6px; }
.prem-upi-id { font-size: 0.78rem; font-weight: 700; color: #1e1b4b; word-break: break-all; }
.prem-copy-btn {
  display: flex; align-items: center; gap: 4px;
  padding: 4px 10px; background: #fff; border: 1.5px solid #bbf7d0;
  border-radius: 8px; font-size: 0.75rem; font-weight: 600; color: #16a34a;
  cursor: pointer; white-space: nowrap; font-family: 'Inter', sans-serif;
}
.prem-copy-btn:hover { background: #dcfce7; }
.prem-amount-tag { font-size: 0.82rem; font-weight: 700; color: #16a34a; }

/* Fields */
.prem-field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.prem-field label { font-size: 0.75rem; font-weight: 600; color: #6366f1; text-transform: uppercase; letter-spacing: 0.5px; }
.prem-field input {
  padding: 9px 12px;
  border: 1.5px solid rgba(99,102,241,0.25);
  border-radius: 10px;
  font-size: 0.88rem;
  font-family: 'Inter', sans-serif;
  color: #1e1b4b;
  background: #f8f9ff;
  transition: border-color 0.2s;
}
.prem-field input:focus { outline: none; border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,0.12); }

/* Success screen */
.prem-success-box {
  background: #f0fdf4;
  border: 1.5px solid #bbf7d0;
  border-radius: 14px;
  padding: 20px;
  text-align: center;
  margin-bottom: 18px;
}
.prem-success-icon { font-size: 2.5rem; margin-bottom: 10px; }
.prem-success-box p { font-size: 0.88rem; color: #374151; margin-bottom: 8px; line-height: 1.6; }
.prem-order-id { font-size: 0.78rem; color: #6b7280; margin-top: 10px; font-weight: 600; }

/* Active premium badge in header */
.prem-active-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 0.5px;
}

/* ── COUPON SPLIT LAYOUT ─────────────────────────────────────── */
#coupon .gen-layout {
  grid-template-columns: 360px 1fr;
}

.coupon-right-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.style-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}

.style-panel .style-grid {
  grid-template-columns: repeat(8, 1fr);
}

@media (max-width: 1200px) {
  .style-panel .style-grid { grid-template-columns: repeat(6, 1fr); }
}
@media (max-width: 900px) {
  #coupon .gen-layout { grid-template-columns: 1fr; }
  .style-panel .style-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 767px) {
  .style-panel .style-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ═══════════════════════════════════════════════════════════════
   PREMIUM DARK MODE THEME
═══════════════════════════════════════════════════════════════ */
body.dark-premium {
  --bg:        #0d0d1a;
  --surface:   rgba(22,22,40,0.95);
  --surface2:  rgba(30,30,55,0.85);
  --border:    rgba(139,92,246,0.25);
  --border2:   rgba(139,92,246,0.4);
  --text:      #e2e8f0;
  --text2:     #a78bfa;
  --accent:    #8b5cf6;
  --accent2:   #7c3aed;
  --green:     #10b981;
  --gold:      #f59e0b;
  --radius:    18px;
  --radius-sm: 10px;
  --shadow:    0 8px 32px rgba(139,92,246,0.25);
  --shadow-sm: 0 2px 16px rgba(139,92,246,0.18);
}

body.dark-premium {
  background: linear-gradient(135deg, #0d0d1a 0%, #1a0a2e 40%, #0a1628 100%);
  background-attachment: fixed;
  color: var(--text);
}

/* Header */
body.dark-premium header {
  background: linear-gradient(135deg, #1a0a2e 0%, #0d0d1a 50%, #0a1628 100%);
  border-bottom: 1px solid rgba(139,92,246,0.3);
  box-shadow: 0 4px 32px rgba(139,92,246,0.2);
}

body.dark-premium header::before {
  background: radial-gradient(circle, rgba(139,92,246,0.15) 0%, transparent 70%);
}

body.dark-premium .header-brand { color: #a78bfa; }
body.dark-premium .header-sub   { color: rgba(167,139,250,0.7); }
body.dark-premium .header-highlight { color: #f59e0b; }
body.dark-premium .header-free-badge {
  background: rgba(139,92,246,0.25);
  border-color: rgba(139,92,246,0.5);
}

/* Sidebar */
body.dark-premium .sidebar {
  background: rgba(13,13,26,0.97);
  border-right: 1px solid rgba(139,92,246,0.2);
  box-shadow: 2px 0 20px rgba(139,92,246,0.1);
}

body.dark-premium .sidebar-brand {
  background: linear-gradient(135deg, #a78bfa, #f59e0b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

body.dark-premium .sidebar-sub   { color: #6b7280; }
body.dark-premium .sidebar-label { color: #6b7280; }
body.dark-premium .sidebar-divider { background: rgba(139,92,246,0.15); }

body.dark-premium .sidebar-card:hover {
  background: rgba(139,92,246,0.12);
  border-color: rgba(139,92,246,0.35);
}

body.dark-premium .sidebar-card.active {
  background: linear-gradient(135deg, rgba(139,92,246,0.2), rgba(245,158,11,0.1));
  border-color: rgba(139,92,246,0.5);
  box-shadow: 0 2px 14px rgba(139,92,246,0.2);
}

body.dark-premium .sidebar-card-img-wrap {
  background: linear-gradient(135deg, #1a0a2e, #0a1628);
  box-shadow: 0 3px 12px rgba(139,92,246,0.25);
}

body.dark-premium .sidebar-card-title { color: #e2e8f0; }
body.dark-premium .sidebar-card.active .sidebar-card-title { color: #a78bfa; }
body.dark-premium .sidebar-footer { color: #6b7280; }

/* Panels */
body.dark-premium .form-panel,
body.dark-premium .preview-panel,
body.dark-premium .style-panel {
  background: rgba(22,22,40,0.95);
  border-color: rgba(139,92,246,0.2);
  box-shadow: 0 8px 32px rgba(139,92,246,0.12);
}

body.dark-premium .panel-head { color: #e2e8f0; }
body.dark-premium .panel-head svg { color: #a78bfa; }
body.dark-premium .preview-head { color: #a78bfa; }
body.dark-premium .preview-badge {
  background: rgba(139,92,246,0.15);
  border-color: rgba(139,92,246,0.3);
  color: #a78bfa;
}
body.dark-premium .divider { background: rgba(139,92,246,0.15); }

/* Form fields */
body.dark-premium label { color: #a78bfa; }

body.dark-premium input[type="text"],
body.dark-premium input[type="date"],
body.dark-premium select {
  background: rgba(30,30,55,0.85);
  border-color: rgba(139,92,246,0.3);
  color: #e2e8f0;
}

body.dark-premium input[type="text"]:focus,
body.dark-premium input[type="date"]:focus,
body.dark-premium select:focus {
  border-color: #8b5cf6;
  box-shadow: 0 0 0 3px rgba(139,92,246,0.2);
}

body.dark-premium input[type="color"] {
  background: rgba(30,30,55,0.85);
  border-color: rgba(139,92,246,0.3);
}

body.dark-premium .icon-btn {
  background: rgba(30,30,55,0.85);
  border-color: rgba(139,92,246,0.3);
  color: #a78bfa;
}

body.dark-premium .icon-btn:hover {
  border-color: #8b5cf6;
  background: rgba(139,92,246,0.15);
}

/* Style cards */
body.dark-premium .style-card {
  background: rgba(30,30,55,0.7);
  border-color: rgba(139,92,246,0.2);
}

body.dark-premium .style-card:hover {
  border-color: #a78bfa;
  transform: translateY(-2px);
}

body.dark-premium .style-card.active {
  border-color: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245,158,11,0.2);
}

body.dark-premium .style-card span { color: #a78bfa; }
body.dark-premium .style-card.active span { color: #f59e0b; }

/* Buttons */
body.dark-premium .btn-primary {
  background: linear-gradient(135deg, #7c3aed, #a78bfa);
  box-shadow: 0 4px 16px rgba(139,92,246,0.4);
}

body.dark-premium .btn-outline {
  border-color: rgba(139,92,246,0.4);
  color: #a78bfa;
}

body.dark-premium .btn-outline:hover {
  border-color: #a78bfa;
  background: rgba(139,92,246,0.12);
}

/* Canvas wrap */
body.dark-premium .canvas-wrap {
  background: rgba(13,13,26,0.8);
  border-color: rgba(139,92,246,0.2);
}

/* Barcode / QR preview */
body.dark-premium #barcodePreviewBox,
body.dark-premium #qrPreviewBox {
  background: rgba(13,13,26,0.8);
  border-color: rgba(139,92,246,0.2);
}

body.dark-premium #barcodeLabelText,
body.dark-premium #qrLabelText { color: #a78bfa; }

/* Toggle */
body.dark-premium .toggle-track {
  background: rgba(30,30,55,0.85);
  border-color: rgba(139,92,246,0.3);
}

/* Scrollbar */
body.dark-premium ::-webkit-scrollbar-track { background: #0d0d1a; }
body.dark-premium ::-webkit-scrollbar-thumb { background: rgba(139,92,246,0.4); }
body.dark-premium ::-webkit-scrollbar-thumb:hover { background: #8b5cf6; }

/* Premium dark mode toggle button */
.prem-dark-toggle {
  display: none;
  width: 100%;
  margin-top: 6px;
  padding: 9px 14px;
  background: linear-gradient(135deg, rgba(139,92,246,0.15), rgba(245,158,11,0.1));
  border: 1.5px solid rgba(139,92,246,0.35);
  border-radius: 12px;
  color: #a78bfa;
  font-size: 0.8rem;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.prem-dark-toggle:hover {
  background: linear-gradient(135deg, rgba(139,92,246,0.25), rgba(245,158,11,0.15));
  border-color: #a78bfa;
}

body.dark-premium .prem-dark-toggle {
  background: linear-gradient(135deg, rgba(245,158,11,0.15), rgba(139,92,246,0.1));
  border-color: rgba(245,158,11,0.4);
  color: #f59e0b;
}

/* Show toggle only for premium users */
.prem-dark-toggle.visible { display: flex; }

/* ── HEADER DARK MODE BUTTON ─────────────────────────────────── */
.header-dark-btn {
  width: 42px; height: 42px;
  background: rgba(255,255,255,0.15);
  border: 1.5px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
}
.header-dark-btn:hover {
  background: rgba(255,255,255,0.25);
  border-color: rgba(255,255,255,0.6);
  transform: scale(1.08);
}
body.dark-premium .header-dark-btn {
  background: rgba(245,158,11,0.15);
  border-color: rgba(245,158,11,0.4);
  color: #f59e0b;
}
body.dark-premium .header-dark-btn:hover {
  background: rgba(245,158,11,0.25);
}

/* ── LOGO UPLOAD ─────────────────────────────────────────────── */
.logo-upload-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.logo-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.logo-upload-btn:hover { opacity: 0.88; transform: translateY(-1px); }

.logo-file-name {
  font-size: 0.75rem;
  color: var(--text2);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logo-preview-wrap {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-preview-wrap img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: 10px;
  border: 1.5px solid var(--border2);
  background: #fff;
  padding: 3px;
}

body.dark-premium .logo-file-name { color: #a78bfa; }
body.dark-premium .logo-preview-wrap img { background: rgba(30,30,55,0.85); border-color: rgba(139,92,246,0.3); }

/* ── GENERATION COUNTER BADGE ────────────────────────────────── */
.gen-counter-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  padding: 5px 10px;
  background: var(--surface2);
  border: 1.5px solid var(--border2);
  border-radius: 20px;
  margin-bottom: 6px;
  transition: color 0.2s;
}
body.dark-premium .gen-counter-badge {
  background: rgba(30,30,55,0.85);
  border-color: rgba(139,92,246,0.3);
}

/* ═══════════════════════════════════════════════════════════════
   PREMIUM COLORFUL LIGHT THEME (active when premium, not dark)
═══════════════════════════════════════════════════════════════ */
body.prem-active:not(.dark-premium) {
  background: linear-gradient(135deg, #e0e7ff 0%, #fce7f3 30%, #fef3c7 60%, #d1fae5 100%);
  background-attachment: fixed;
}

/* Header — vibrant rainbow gradient */
body.prem-active:not(.dark-premium) header {
  background: linear-gradient(135deg, #a9f7dd 0%, #f3a2cb 35%, #f09dbd 70%, #eea2c5 100%);
  box-shadow: 0 4px 32px rgba(99,102,241,0.3);
}

/* Sidebar — colorful accent */
body.prem-active:not(.dark-premium) .sidebar {
  background: rgba(255,255,255,0.92);
  border-right: 2px solid transparent;
  background-clip: padding-box;
  box-shadow: 2px 0 24px rgba(99,102,241,0.12), inset -1px 0 0 rgba(236,72,153,0.15);
}

body.prem-active:not(.dark-premium) .sidebar-brand {
  background: linear-gradient(135deg, #5c5d99, #ec4899, #f59e0b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

body.prem-active:not(.dark-premium) .sidebar-card.active {
  background: linear-gradient(135deg, rgba(99,102,241,0.12), rgba(236,72,153,0.08), rgba(245,158,11,0.06));
  border-color: rgba(99,102,241,0.4);
  box-shadow: 0 2px 14px rgba(99,102,241,0.15);
}

body.prem-active:not(.dark-premium) .sidebar-card-img-wrap {
  background: linear-gradient(135deg, #e0e7ff, #fce7f3, #fef3c7);
  box-shadow: 0 3px 12px rgba(99,102,241,0.2);
}

/* Panels — colorful borders */
body.prem-active:not(.dark-premium) .form-panel,
body.prem-active:not(.dark-premium) .preview-panel,
body.prem-active:not(.dark-premium) .style-panel {
  border: 1.5px solid transparent;
  background: rgba(255,255,255,0.85);
  box-shadow: 0 8px 32px rgba(99,102,241,0.1), 0 0 0 1.5px rgba(99,102,241,0.1);
  position: relative;
}

body.prem-active:not(.dark-premium) .form-panel::before,
body.prem-active:not(.dark-premium) .preview-panel::before,
body.prem-active:not(.dark-premium) .style-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  padding: 1.5px;
  background: linear-gradient(135deg, #6366f1, #ec4899, #f59e0b, #10b981);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* Buttons — rainbow gradient */
body.prem-active:not(.dark-premium) .btn-primary {
  background: linear-gradient(135deg, #6366f1, #ec4899, #f59e0b);
  box-shadow: 0 4px 20px rgba(99,102,241,0.4);
}

body.prem-active:not(.dark-premium) .btn-primary:hover {
  box-shadow: 0 6px 28px rgba(99,102,241,0.55);
}

/* Style cards — colorful active */
body.prem-active:not(.dark-premium) .style-card.active {
  border-color: #ec4899;
  box-shadow: 0 0 0 3px rgba(236,72,153,0.2);
}

body.prem-active:not(.dark-premium) .style-card.active span { color: #ec4899; }

/* Canvas wrap — colorful shadow */
body.prem-active:not(.dark-premium) .canvas-wrap {
  box-shadow: 0 4px 24px rgba(99,102,241,0.15);
}

/* Premium badge in header */
body.prem-active:not(.dark-premium) .header-dark-btn {
  background: rgba(255,255,255,0.25);
  border-color: rgba(255,255,255,0.5);
}

/* Scrollbar colorful */
body.prem-active:not(.dark-premium) ::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #6366f1, #ec4899);
}
