:root {
      --red:     #C0392B;
      --red-dk:  #922B21;
      --near-blk:#1A1A18;
      --cream:   #F5F0E8;
      --green:   #3D6B4F;
      --white:   #FFFFFF;
      --grey-lt: #F0EDE8;
      --grey-md: #B0A99A;
      --grey-bd: #7A746B;
      --radius:  10px;
      --shadow:  0 8px 40px rgba(0,0,0,0.22);
    }

    /* ─── RESET & BASE ──────────────────────────────────────────── */
    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
    body {
      font-family: 'Helvetica Neue', Arial, sans-serif;
      background: var(--grey-lt);
      color: var(--near-blk);
    }

    /* ─── DEV NAV ───────────────────────────────────────────────── */
    .dev-nav {
      position: sticky; top: 0; z-index: 9999;
      background: var(--near-blk);
      display: flex; gap: 0; align-items: stretch;
      border-bottom: 3px solid var(--red);
    }
    .dev-nav span {
      padding: 10px 18px;
      color: var(--grey-md);
      font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
      display: flex; align-items: center;
    }
    .dev-nav button {
      padding: 12px 22px;
      background: transparent; border: none; border-right: 1px solid #333;
      color: var(--cream); cursor: pointer;
      font-size: 13px; font-weight: 600; letter-spacing: .04em;
      transition: background .15s;
    }
    .dev-nav button:hover, .dev-nav button.active { background: var(--red); color: var(--white); }
    .dev-nav .badge {
      background: var(--red); color: var(--white);
      font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 20px;
      margin-left: 6px; letter-spacing: .04em;
    }

    /* ─── SECTION WRAPPERS ──────────────────────────────────────── */
    .section {
      display: none;
      min-height: calc(100vh - 46px);
    }
    .section.visible { display: block; }

    /* ═══════════════════════════════════════════════════════════════
       FRONTEND SECTION
    ═══════════════════════════════════════════════════════════════ */
    .fe-page {
      min-height: 100vh;
      background: var(--cream);
      position: relative;
      overflow: hidden;
    }

    /* Simulated homepage hero */
    .hero {
      background: linear-gradient(135deg, var(--near-blk) 0%, #2c2c2a 100%);
      padding: 80px 40px 100px;
      text-align: center;
      position: relative;
    }
    .hero::before {
      content: '';
      position: absolute; inset: 0;
      background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23C0392B' fill-opacity='0.06'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
      opacity: 1;
    }
    .hero-logo {
      font-size: 38px; font-weight: 900;
      color: var(--white); letter-spacing: -.02em;
      position: relative;
    }
    .hero-logo span { color: var(--red); }
    .hero-tagline {
      margin-top: 12px;
      color: var(--grey-md); font-size: 14px; letter-spacing: .06em;
      text-transform: uppercase; position: relative;
    }
    .hero-cta {
      margin-top: 36px; display: inline-block;
      background: var(--red); color: var(--white);
      padding: 14px 36px; border-radius: 6px;
      font-weight: 700; font-size: 15px; text-decoration: none;
      position: relative;
    }

    /* Simulated nav strip */
    .fake-nav {
      background: var(--white);
      padding: 14px 40px;
      display: flex; gap: 28px; align-items: center;
      border-bottom: 1px solid #e0dbd3;
      font-size: 14px; font-weight: 500; color: var(--grey-bd);
    }
    .fake-nav strong { color: var(--near-blk); font-weight: 800; font-size: 20px; }
    .fake-nav a { color: var(--grey-bd); text-decoration: none; }

    /* Simulated product rows */
    .page-body { padding: 40px; }
    .section-label {
      font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
      color: var(--grey-bd); margin-bottom: 8px;
    }
    .section-title { font-size: 26px; font-weight: 800; margin-bottom: 24px; }
    .cards { display: flex; gap: 16px; flex-wrap: wrap; }
    .card {
      background: var(--white);
      border-radius: var(--radius); padding: 20px;
      width: 200px; border: 1px solid #e8e3da;
    }
    .card-img {
      width: 100%; height: 110px; border-radius: 6px;
      background: linear-gradient(135deg, #e0dbd3 0%, #cfc9bf 100%);
      margin-bottom: 12px; display: flex; align-items: center; justify-content: center;
      color: var(--grey-md); font-size: 28px;
    }
    .card h4 { font-size: 13px; font-weight: 700; margin-bottom: 4px; }
    .card p { font-size: 12px; color: var(--grey-bd); }
    .card-price { font-size: 15px; font-weight: 800; color: var(--red); margin-top: 8px; }

    /* ── POPUP OVERLAY ───────────────────────────────────────────── */
    .popup-overlay {
      position: fixed; inset: 0;
      background: rgba(15,15,13,.72);
      backdrop-filter: blur(3px);
      z-index: 1000;
      display: flex; align-items: center; justify-content: center;
      opacity: 0; pointer-events: none;
      transition: opacity .35s ease;
    }
    .popup-overlay.show { opacity: 1; pointer-events: all; }

    .popup {
      background: var(--white);
      border-radius: 14px;
      overflow: hidden;
      width: 520px; max-width: calc(100vw - 32px);
      box-shadow: var(--shadow);
      transform: translateY(24px) scale(.97);
      transition: transform .38s cubic-bezier(.22,1,.36,1);
      position: relative;
    }
    .popup-overlay.show .popup { transform: translateY(0) scale(1); }

    .popup-header {
      background: linear-gradient(135deg, var(--red) 0%, var(--red-dk) 100%);
      padding: 28px 32px 24px;
      position: relative;
    }
    .popup-eyebrow {
      font-size: 11px; font-weight: 700; letter-spacing: .14em;
      text-transform: uppercase; color: rgba(255,255,255,.7);
      margin-bottom: 6px;
    }
    .popup-headline {
      font-size: 28px; font-weight: 900; color: var(--white);
      line-height: 1.15; letter-spacing: -.02em;
    }
    .popup-headline em { color: #FFD580; font-style: normal; }
    .popup-subline {
      margin-top: 8px; font-size: 14px;
      color: rgba(255,255,255,.8); line-height: 1.5;
    }

    .popup-close {
      position: absolute; top: 14px; right: 16px;
      background: rgba(255,255,255,.2); border: none;
      width: 30px; height: 30px; border-radius: 50%;
      color: var(--white); font-size: 17px; cursor: pointer;
      display: flex; align-items: center; justify-content: center;
      transition: background .15s;
    }
    .popup-close:hover { background: rgba(255,255,255,.35); }

    /* decorative badge */
    .popup-badge {
      position: absolute; top: 20px; right: 56px;
      background: #FFD580; color: var(--near-blk);
      font-size: 11px; font-weight: 800;
      padding: 5px 12px; border-radius: 20px;
      letter-spacing: .04em; text-transform: uppercase;
    }

    .popup-body { padding: 24px 32px 28px; }

    /* mini product grid inside popup */
    .popup-products {
      display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
      margin-bottom: 20px;
    }
    .pp {
      border: 1.5px solid #ede8df;
      border-radius: 8px; padding: 12px 10px;
      text-align: center; cursor: pointer;
      transition: border-color .15s, box-shadow .15s;
      position: relative;
    }
    .pp:hover { border-color: var(--red); box-shadow: 0 2px 12px rgba(192,57,43,.15); }
    .pp.featured { border-color: var(--red); background: #fdf3f2; }
    .pp-emoji { font-size: 28px; margin-bottom: 6px; display: block; }
    .pp-name { font-size: 11px; font-weight: 700; color: var(--near-blk); }
    .pp-orig { font-size: 10px; color: var(--grey-md); text-decoration: line-through; }
    .pp-sale { font-size: 13px; font-weight: 800; color: var(--red); }
    .pp-ribbon {
      position: absolute; top: -1px; left: -1px;
      background: var(--red); color: var(--white);
      font-size: 9px; font-weight: 800; letter-spacing: .05em;
      padding: 3px 8px; border-radius: 7px 0 7px 0;
      text-transform: uppercase;
    }

    .popup-cta {
      width: 100%; padding: 15px;
      background: var(--red); color: var(--white);
      border: none; border-radius: 8px;
      font-size: 16px; font-weight: 800; cursor: pointer;
      letter-spacing: .02em;
      transition: background .15s, transform .1s;
    }
    .popup-cta:hover { background: var(--red-dk); transform: translateY(-1px); }
    .popup-cta:active { transform: translateY(0); }

    .popup-footer {
      margin-top: 12px; text-align: center;
      font-size: 12px; color: var(--grey-bd);
    }
    .popup-footer a { color: var(--grey-bd); text-decoration: underline; cursor: pointer; }

    /* countdown pill */
    .countdown-pill {
      display: inline-flex; align-items: center; gap: 6px;
      background: var(--near-blk); color: var(--cream);
      padding: 4px 12px; border-radius: 20px;
      font-size: 12px; font-weight: 700;
      margin-bottom: 16px;
    }
    .countdown-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: #4CAF50; animation: blink 1.2s infinite; }
    @keyframes blink { 0%,100%{opacity:1} 50%{opacity:.3} }

    /* trigger info for devs */
    .trigger-note {
      background: var(--near-blk);
      color: var(--cream);
      padding: 6px 14px;
      font-size: 11px; font-family: 'SF Mono', monospace;
      text-align: center;
    }
    .trigger-note span { color: #FFD580; }

    /* ── DEMO CONTROLS ───────────────────────────────────────────── */
    .demo-controls {
      position: fixed; bottom: 20px; right: 20px; z-index: 9998;
      display: flex; flex-direction: column; gap: 8px;
    }
    .demo-controls.hidden { display: none; }
    .dc-btn {
      background: var(--near-blk); color: var(--white);
      border: none; padding: 10px 18px; border-radius: 8px;
      font-size: 12px; font-weight: 700; cursor: pointer;
      box-shadow: 0 4px 16px rgba(0,0,0,.25);
      transition: background .15s;
      white-space: nowrap;
    }
    .dc-btn:hover { background: var(--red); }
    .dc-btn.primary { background: var(--red); }
    .dc-btn.primary:hover { background: var(--red-dk); }

    /* timer bar */
    .timer-bar-wrap {
      position: fixed; bottom: 0; left: 0; right: 0;
      height: 4px; background: rgba(0,0,0,.1);
      z-index: 9997;
      display: none;
    }
    .timer-bar-wrap.active { display: block; }
    .timer-bar {
      height: 100%; width: 100%;
      background: var(--red);
      transition: width linear;
    }

    /* ═══════════════════════════════════════════════════════════════
       ADMIN PANEL SECTION
    ═══════════════════════════════════════════════════════════════ */
    .admin-layout {
      display: flex; min-height: calc(100vh - 46px);
    }

    .admin-sidebar {
      width: 220px; flex-shrink: 0;
      background: var(--near-blk);
      padding: 24px 0;
    }
    .sidebar-brand {
      padding: 0 20px 24px;
      font-size: 18px; font-weight: 900; color: var(--white);
      border-bottom: 1px solid #2e2e2c;
    }
    .sidebar-brand span { color: var(--red); }
    .sidebar-section {
      padding: 16px 20px 8px;
      font-size: 10px; letter-spacing: .12em; text-transform: uppercase;
      color: #555;
    }
    .sidebar-item {
      padding: 10px 20px; display: flex; align-items: center; gap: 10px;
      font-size: 13px; color: #aaa; cursor: pointer;
      transition: background .12s, color .12s;
    }
    .sidebar-item:hover { background: #262624; color: var(--white); }
    .sidebar-item.active { background: #1f1f1d; color: var(--white); border-left: 3px solid var(--red); }
    .sidebar-item .ico { font-size: 15px; }

    .admin-main { flex: 1; overflow: auto; background: #F7F4F0; }

    .admin-topbar {
      background: var(--white);
      padding: 16px 28px;
      display: flex; align-items: center; justify-content: space-between;
      border-bottom: 1px solid #e8e3da;
    }
    .admin-topbar h1 { font-size: 20px; font-weight: 800; }
    .admin-topbar p { font-size: 13px; color: var(--grey-bd); margin-top: 2px; }
    .topbar-actions { display: flex; gap: 10px; }
    .btn { padding: 9px 20px; border-radius: 7px; border: none; font-size: 13px; font-weight: 700; cursor: pointer; transition: all .15s; }
    .btn-primary { background: var(--red); color: var(--white); }
    .btn-primary:hover { background: var(--red-dk); }
    .btn-secondary { background: var(--grey-lt); color: var(--near-blk); border: 1.5px solid #ddd; }
    .btn-secondary:hover { border-color: var(--red); }
    .btn-ghost { background: transparent; color: var(--red); border: 1.5px solid var(--red); }
    .btn-ghost:hover { background: var(--red); color: var(--white); }

    .admin-content { padding: 28px; }

    /* status chips */
    .chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 12px; border-radius: 20px; font-size: 11px; font-weight: 700; }
    .chip-active { background: #d4edda; color: #1a6630; }
    .chip-draft  { background: #fff3cd; color: #7a5a00; }
    .chip-ended  { background: #f0ede8; color: var(--grey-bd); }
    .chip .dot   { width: 5px; height: 5px; border-radius: 50%; }
    .chip-active .dot { background: #1a6630; }
    .chip-draft  .dot { background: #c8920a; }
    .chip-ended  .dot { background: var(--grey-md); }

    /* campaign cards */
    .campaign-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 28px; }
    .campaign-card {
      background: var(--white); border-radius: var(--radius);
      border: 1.5px solid #e8e3da;
      overflow: hidden;
      transition: box-shadow .15s;
    }
    .campaign-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,.08); }
    .cc-header {
      padding: 16px 20px 14px;
      display: flex; justify-content: space-between; align-items: flex-start;
      border-bottom: 1px solid #f0ede8;
    }
    .cc-title { font-size: 15px; font-weight: 800; margin-bottom: 3px; }
    .cc-meta { font-size: 11px; color: var(--grey-bd); }
    .cc-body { padding: 16px 20px; }
    .cc-row { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 13px; }
    .cc-row label { color: var(--grey-bd); }
    .cc-row value { font-weight: 600; }
    .cc-footer { padding: 12px 20px; border-top: 1px solid #f0ede8; display: flex; gap: 8px; align-items: center; }

    /* stats row */
    .stats-row { display: flex; gap: 16px; margin-bottom: 28px; }
    .stat-card {
      background: var(--white); border-radius: var(--radius);
      border: 1.5px solid #e8e3da;
      padding: 18px 22px; flex: 1;
    }
    .stat-label { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--grey-bd); margin-bottom: 6px; }
    .stat-val { font-size: 28px; font-weight: 900; color: var(--near-blk); }
    .stat-sub { font-size: 12px; color: var(--green); margin-top: 4px; font-weight: 600; }

    /* editor form */
    .editor-card {
      background: var(--white); border-radius: var(--radius);
      border: 1.5px solid #e8e3da; overflow: hidden; margin-bottom: 24px;
    }
    .editor-card-header {
      padding: 16px 22px; border-bottom: 1px solid #f0ede8;
      font-size: 14px; font-weight: 800; display: flex; align-items: center; gap: 8px;
    }
    .editor-card-body { padding: 22px; }

    .form-row { display: flex; gap: 16px; margin-bottom: 16px; }
    .form-group { display: flex; flex-direction: column; flex: 1; }
    .form-group label { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--grey-bd); margin-bottom: 6px; }
    .form-group input, .form-group select, .form-group textarea {
      padding: 10px 13px; border-radius: 7px; border: 1.5px solid #ddd;
      font-size: 14px; color: var(--near-blk);
      transition: border-color .15s;
      font-family: inherit;
    }
    .form-group input:focus, .form-group select:focus, .form-group textarea:focus {
      outline: none; border-color: var(--red);
    }
    .form-group textarea { resize: vertical; min-height: 80px; }

    .toggle-row {
      display: flex; align-items: center; justify-content: space-between;
      padding: 14px 0; border-bottom: 1px solid #f0ede8;
    }
    .toggle-row:last-child { border-bottom: none; }
    .toggle-info h4 { font-size: 14px; font-weight: 700; margin-bottom: 2px; }
    .toggle-info p { font-size: 12px; color: var(--grey-bd); }
    .toggle {
      width: 44px; height: 24px; border-radius: 12px;
      background: #ddd; position: relative; cursor: pointer;
      transition: background .2s; flex-shrink: 0;
    }
    .toggle.on { background: var(--green); }
    .toggle::after {
      content: ''; position: absolute;
      width: 18px; height: 18px; border-radius: 50%; background: white;
      top: 3px; left: 3px; transition: left .2s;
      box-shadow: 0 1px 4px rgba(0,0,0,.2);
    }
    .toggle.on::after { left: 23px; }

    /* product selector */
    .product-selector { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 4px; }
    .ps-item {
      border: 1.5px solid #e8e3da; border-radius: 8px;
      padding: 10px; text-align: center; cursor: pointer;
      transition: border-color .15s;
      font-size: 12px;
    }
    .ps-item:hover, .ps-item.selected { border-color: var(--red); background: #fdf3f2; }
    .ps-item .ps-emoji { font-size: 24px; margin-bottom: 4px; display: block; }
    .ps-item .ps-name { font-weight: 700; color: var(--near-blk); }
    .ps-item .ps-price { color: var(--grey-bd); margin-top: 2px; font-size: 11px; }
    .check-overlay {
      display: none; position: absolute; top: 4px; right: 4px;
      width: 16px; height: 16px; border-radius: 50%;
      background: var(--red); color: white; font-size: 9px;
      align-items: center; justify-content: center;
    }
    .ps-item { position: relative; }
    .ps-item.selected .check-overlay { display: flex; }

    /* trigger options */
    .trigger-options { display: flex; gap: 12px; margin-top: 6px; }
    .trigger-opt {
      flex: 1; border: 1.5px solid #e8e3da; border-radius: 8px;
      padding: 12px; cursor: pointer; transition: all .15s;
      text-align: center;
    }
    .trigger-opt:hover, .trigger-opt.selected { border-color: var(--red); background: #fdf3f2; }
    .trigger-opt .t-icon { font-size: 20px; margin-bottom: 4px; }
    .trigger-opt .t-name { font-size: 12px; font-weight: 700; }
    .trigger-opt .t-desc { font-size: 11px; color: var(--grey-bd); margin-top: 2px; }

    /* preview pane in admin */
    .admin-preview-pane {
      background: var(--near-blk); border-radius: 12px;
      overflow: hidden; position: relative;
    }
    .preview-topbar {
      background: #111; padding: 8px 14px;
      display: flex; align-items: center; gap: 6px;
    }
    .preview-topbar .dot-r { width: 10px; height: 10px; border-radius: 50%; background: #FF5F56; }
    .preview-topbar .dot-y { width: 10px; height: 10px; border-radius: 50%; background: #FFBD2E; }
    .preview-topbar .dot-g { width: 10px; height: 10px; border-radius: 50%; background: #27C93F; }
    .preview-url {
      flex: 1; background: #1e1e1c; border-radius: 4px;
      padding: 4px 10px; font-size: 11px; color: #888; font-family: monospace;
    }
    .preview-frame { padding: 20px; }

    /* mini popup in admin preview */
    .mini-popup {
      background: var(--white); border-radius: 10px;
      overflow: hidden; box-shadow: var(--shadow);
      max-width: 320px; margin: 0 auto;
    }
    .mini-popup-header {
      background: linear-gradient(135deg, var(--red) 0%, var(--red-dk) 100%);
      padding: 16px 18px;
    }
    .mini-popup-header p { font-size: 9px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: rgba(255,255,255,.7); }
    .mini-popup-header h3 { font-size: 17px; font-weight: 900; color: var(--white); margin-top: 2px; line-height: 1.2; }
    .mini-popup-header h3 em { color: #FFD580; font-style: normal; }
    .mini-popup-body { padding: 14px; }
    .mini-pp-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-bottom: 12px; }
    .mini-pp { border: 1.5px solid #ede8df; border-radius: 6px; padding: 8px 6px; text-align: center; font-size: 10px; }
    .mini-pp .em { font-size: 18px; display: block; margin-bottom: 3px; }
    .mini-pp .nm { font-weight: 700; color: var(--near-blk); }
    .mini-pp .pr { color: var(--red); font-weight: 800; margin-top: 2px; }
    .mini-pp-cta {
      width: 100%; padding: 10px;
      background: var(--red); color: var(--white);
      border: none; border-radius: 6px;
      font-size: 13px; font-weight: 800; cursor: pointer;
    }

    /* sections tabs in admin */
    .admin-tabs { display: flex; gap: 0; margin-bottom: 24px; border-bottom: 2px solid #e8e3da; }
    .admin-tab {
      padding: 10px 20px; font-size: 13px; font-weight: 600;
      cursor: pointer; color: var(--grey-bd);
      border-bottom: 2px solid transparent; margin-bottom: -2px;
      transition: all .15s;
    }
    .admin-tab:hover { color: var(--near-blk); }
    .admin-tab.active { color: var(--red); border-bottom-color: var(--red); }

    .admin-tab-content { display: none; }
    .admin-tab-content.active { display: block; }

    /* table */
    .data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
    .data-table th { padding: 10px 14px; text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--grey-bd); background: var(--grey-lt); border-bottom: 1px solid #e8e3da; }
    .data-table td { padding: 13px 14px; border-bottom: 1px solid #f0ede8; vertical-align: middle; }
    .data-table tr:last-child td { border-bottom: none; }
    .data-table tr:hover td { background: #faf8f5; }

    /* section header */
    .sec-hdr { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
    .sec-hdr h2 { font-size: 17px; font-weight: 800; }