:root{--brand:#c8102e;--gold:#d4a017;--bg:#f6f4f1;--text:#1f1a17;--muted:#7a6e65;}
body{font-family:'Poppins',sans-serif;background:var(--bg);color:var(--text);font-size:14px;}
.app{display:flex;min-height:100vh;}

/* ===== Sidebar ===== */
.sidebar{width:250px;background:linear-gradient(180deg,#4a0808,#1f0303);color:#f3e3cf;position:fixed;top:0;bottom:0;left:0;display:flex;flex-direction:column;z-index:1040;transition:transform .25s;}
.brand{display:flex;align-items:center;gap:12px;padding:22px 20px;border-bottom:1px solid rgba(255,255,255,.08);}
.brand-mark{width:42px;height:42px;border-radius:12px;background:linear-gradient(135deg,#c8102e,#ff5a3c);display:grid;place-items:center;font-weight:800;color:#fff;font-size:20px;box-shadow:0 6px 16px rgba(200,16,46,.45);}
.brand-name{font-weight:700;color:#fff;line-height:1.1;font-size:16px}
.brand small{color:#e8c98a;font-size:10px;letter-spacing:2px}
.sidebar nav{padding:16px 12px;flex:1;overflow-y:auto}
.nav-link-s{display:flex;align-items:center;gap:12px;padding:11px 14px;border-radius:10px;color:#e9d6c2;text-decoration:none;margin-bottom:4px;font-weight:500;transition:.2s}
.nav-link-s i{font-size:17px}
.nav-link-s:hover{background:rgba(255,255,255,.07);color:#fff}
.nav-link-s.active{background:linear-gradient(90deg,rgba(212,160,23,.28),rgba(212,160,23,.04));color:#fff;box-shadow:inset 3px 0 0 var(--gold)}
.sidebar-foot{padding:16px 20px;font-size:12px;border-top:1px solid rgba(255,255,255,.08);color:#d9c3ac}
.dot{display:inline-block;width:8px;height:8px;border-radius:50%;margin-right:6px}

/* ===== Main layout ===== */
.main{flex:1;margin-left:250px;min-width:0}
.topbar{background:#fff;padding:14px 28px;display:flex;align-items:center;gap:14px;border-bottom:1px solid #eee5da;position:sticky;top:0;z-index:1030}
.page-title{font-size:20px;font-weight:600;margin:0}
.content{padding:26px 28px}

/* ===== Cards ===== */
.card-x{background:#fff;border:1px solid #efe7dc;border-radius:16px;box-shadow:0 6px 20px rgba(60,30,10,.05)}
.card-head{padding:16px 20px;border-bottom:1px solid #f1ebe2;display:flex;align-items:center;justify-content:space-between;font-weight:600;gap:10px;flex-wrap:wrap}
.card-body-x{padding:20px}
.stat{padding:18px;display:flex;gap:14px;align-items:center;height:100%}
.stat-icon{width:50px;height:50px;border-radius:14px;display:grid;place-items:center;font-size:21px;flex-shrink:0}
.stat-val{font-size:22px;font-weight:700;line-height:1}
.stat-lbl{color:var(--muted);font-size:12px;margin-top:5px}
.bg-soft-red{background:#fdecee;color:#c8102e}
.bg-soft-green{background:#e8f8ee;color:#16a34a}
.bg-soft-amber{background:#fff4dc;color:#c58a00}
.bg-soft-blue{background:#e6f3ff;color:#0b78d0}
.bg-soft-purple{background:#f1ebff;color:#7c3aed}
.bg-soft-gray{background:#f1efec;color:#6b625b}

/* ===== Buttons ===== */
.btn-brand{background:linear-gradient(180deg,#e0213f,#b00d27);color:#fff;border:0;font-weight:500}
.btn-brand:hover,.btn-brand:focus{color:#fff;filter:brightness(1.08)}
.btn-outline-brand{border:1.5px solid var(--brand);color:var(--brand);font-weight:500}
.btn-outline-brand:hover,.btn-outline-brand.active{background:var(--brand);color:#fff}

/* ===== Tables & badges ===== */
.table-x{margin:0}
.table-x th{font-size:11.5px;text-transform:uppercase;letter-spacing:.5px;color:var(--muted);font-weight:600;background:#faf7f3;border-bottom:1px solid #efe7dc;padding:12px 16px;white-space:nowrap}
.table-x td{padding:12px 16px;vertical-align:middle;border-color:#f3eee7}
.badge-s{padding:4px 10px;border-radius:20px;font-weight:600;font-size:11px;white-space:nowrap}
.b-sent,.b-completed,.b-active{background:#e8f8ee;color:#15803d}
.b-pending,.b-queued{background:#fff4dc;color:#a16207}
.b-failed,.b-bounced{background:#fdecee;color:#b91c1c}
.b-skipped,.b-unsubscribed,.b-paused{background:#f1efec;color:#57534e}
.b-running{background:#e6f3ff;color:#0b78d0}

/* ===== Forms ===== */
.form-control,.form-select{border-radius:10px;border-color:#e6ded3;padding:9px 12px;font-size:14px}
.form-control:focus,.form-select:focus{border-color:#e7a3ad;box-shadow:0 0 0 .2rem rgba(200,16,46,.12)}
.form-label{font-weight:500;font-size:13px;color:#4a403a}
.code-area{font-family:ui-monospace,Consolas,monospace;font-size:12.5px;line-height:1.5}
.list-check{border:1px solid #efe7dc;border-radius:10px;padding:10px 14px;max-height:200px;overflow:auto}
.mode-pills .btn{border-radius:30px;padding:8px 18px}
.chip{display:inline-block;background:#f6efe5;border-radius:8px;padding:2px 8px;font-size:12px;font-family:ui-monospace,Consolas,monospace;margin:2px}

/* ===== Preview / templates ===== */
.preview-frame{width:100%;height:680px;border:1px solid #efe7dc;border-radius:12px;background:#fff}
.tpl-thumb{height:230px;overflow:hidden;border-bottom:1px solid #f1ebe2;background:#f6efe5;display:flex;justify-content:center}
.tpl-thumb iframe{width:600px;height:900px;border:0;transform:scale(.45);transform-origin:top center;pointer-events:none;flex-shrink:0}

/* ===== Progress ===== */
.progress{height:8px;border-radius:10px;background:#f1ebe2}
.progress-bar{background:linear-gradient(90deg,#c8102e,#ff7b00)}

/* ===== Inbox ===== */
.mail-row{cursor:pointer}
.mail-row:hover td{background:#fbf8f4}
.mail-row.unread td{font-weight:600}
.folder-link{display:flex;align-items:center;gap:10px;padding:9px 12px;border-radius:10px;color:#4a403a;text-decoration:none;font-weight:500}
.folder-link:hover{background:#f8f3ec}
.folder-link.active{background:#fdecee;color:#c8102e}

/* ===== Misc ===== */
.empty{padding:50px 20px;text-align:center;color:var(--muted)}
.empty i{font-size:42px;display:block;margin-bottom:10px;color:#d6c8b8}
.login-wrap{min-height:100vh;display:grid;place-items:center;background:radial-gradient(circle at 30% 20%,#9c1414,#3d0606 60%,#1a0202);padding:20px}

/* ===== Mobile ===== */
@media(max-width:991px){
  .sidebar{transform:translateX(-100%)}
  .sidebar.open{transform:none}
  .main{margin-left:0}
  .content{padding:18px}
}