:root{--sidebar-width:270px;--sidebar-bg:#0f172a;--sidebar-bg2:#1e293b;--primary:#0ea5e9;--accent:#38bdf8;--text-muted:#94a3b8}
body{background:#f1f5f9;font-family:'Inter',system-ui,-apple-system,sans-serif}
.sidebar{width:var(--sidebar-width);min-height:100vh;position:fixed;top:0;left:0;background:linear-gradient(180deg,var(--sidebar-bg) 0%,var(--sidebar-bg2) 100%);overflow-y:auto;overflow-x:hidden;z-index:1040;border-right:1px solid #1e293b}
.sidebar::-webkit-scrollbar{width:6px}
.sidebar::-webkit-scrollbar-thumb{background:#334155;border-radius:3px}
.sidebar .brand{padding:1.2rem 1rem;border-bottom:1px solid #1e293b;background:rgba(255,255,255,0.02)}
.sidebar .brand a{font-size:1.15rem;letter-spacing:-0.02em}
.sidebar .nav-section{padding:0.9rem 0 0.3rem}
.sidebar .nav-section-title{font-size:.62rem;letter-spacing:.12em;text-transform:uppercase;color:var(--text-muted);padding:0 1rem;margin-bottom:.35rem;font-weight:700;display:flex;align-items:center;gap:.4rem}
.sidebar .nav-section-title::after{content:'';flex:1;height:1px;background:#1e293b;margin-left:.5rem}
.sidebar .nav-link{color:#cbd5e1;padding:.45rem 1rem .45rem 1.25rem;margin:1px 8px;border-radius:8px;font-size:.88rem;display:flex;align-items:center;gap:.6rem;transition:all .15s;border-left:3px solid transparent}
.sidebar .nav-link i{font-size:1rem;opacity:.9;min-width:18px;text-align:center}
.sidebar .nav-link:hover{color:#fff;background:#1e293b;transform:translateX(2px)}
.sidebar .nav-link.active{color:#fff;background:#0ea5e9;background:linear-gradient(90deg,#0ea5e9 0%,#0284c7 100%);border-left-color:#7dd3fc;box-shadow:0 4px 12px rgba(14,165,233,.35);font-weight:600}
.sidebar .nav-link.active i{opacity:1}
.sidebar .nav-group{border-left:2px solid #1e293b;margin:0 0 0 1.1rem;padding-left:.2rem}
.sidebar .nav-workflow-badge{font-size:.6rem;background:#334155;color:#e2e8f0;padding:1px 5px;border-radius:10px;margin-left:auto}
.sidebar .nav-link.active .nav-workflow-badge{background:rgba(255,255,255,.25);color:#fff}
.main-content{margin-left:var(--sidebar-width);min-height:100vh}
.main-content .navbar{background:#fff!important;box-shadow:0 1px 3px rgba(0,0,0,.06);backdrop-filter:blur(8px)}
.card{border:0;box-shadow:0 1px 3px rgba(0,0,0,.06),0 4px 12px rgba(0,0,0,.03);border-radius:12px}
.card-header{background:#fff;border-bottom:1px solid #f1f5f9;font-weight:600}
.table thead th{font-size:.72rem;letter-spacing:.06em;text-transform:uppercase;color:#64748b;background:#f8fafc;border-bottom:1px solid #e2e8f0;font-weight:700}
.btn-primary{background:linear-gradient(90deg,#0ea5e9,#0284c7);border:0;box-shadow:0 2px 8px rgba(14,165,233,.3)}
.btn-primary:hover{transform:translateY(-1px);box-shadow:0 4px 12px rgba(14,165,233,.4)}
.badge{font-weight:600;letter-spacing:.02em}
@media(max-width:992px){.sidebar{position:relative;width:100%;min-height:auto}.main-content{margin-left:0}.sidebar .nav-section-title::after{display:none}}

/* ── Dashboard KPI Cards ─────────────────────────────────── */
.dash-kpi-card{background:#fff;border-radius:14px;padding:1.25rem 1.1rem 1rem;box-shadow:0 1px 3px rgba(0,0,0,.06),0 4px 16px rgba(0,0,0,.04);border-top:3px solid var(--kpi-clr,#0ea5e9);transition:transform .18s,box-shadow .18s;position:relative;overflow:hidden}
.dash-kpi-card::before{content:'';position:absolute;inset:0;background:linear-gradient(135deg,rgba(255,255,255,0) 60%,color-mix(in srgb,var(--kpi-clr,#0ea5e9) 8%,transparent));pointer-events:none}
a:hover .dash-kpi-card{transform:translateY(-3px);box-shadow:0 6px 24px rgba(0,0,0,.1)}
.kpi-top{display:flex;align-items:center;justify-content:space-between;margin-bottom:.35rem}
.kpi-icon-wrap{width:38px;height:38px;border-radius:10px;background:color-mix(in srgb,var(--kpi-clr,#0ea5e9) 12%,#fff);display:flex;align-items:center;justify-content:center;font-size:1.15rem;color:var(--kpi-clr,#0ea5e9)}
.kpi-value{font-size:1.9rem;font-weight:700;color:#0f172a;line-height:1}
.kpi-label{font-size:.75rem;font-weight:600;text-transform:uppercase;letter-spacing:.07em;color:#64748b;margin-bottom:.5rem}
.kpi-pills{display:flex;gap:.35rem;flex-wrap:wrap;margin-bottom:.6rem}
.kpi-pill{font-size:.65rem;font-weight:600;padding:2px 7px;border-radius:20px}
.pill-green{background:#dcfce7;color:#15803d}
.pill-red{background:#fee2e2;color:#dc2626}
.pill-yellow{background:#fef9c3;color:#a16207}
.pill-blue{background:#dbeafe;color:#1d4ed8}
.kpi-bar-bg{height:4px;background:#f1f5f9;border-radius:4px;overflow:hidden}
.kpi-bar{height:4px;border-radius:4px;background:var(--kpi-clr,#0ea5e9);transition:width .6s ease}

/* ── Email Delivery Strip ─────────────────────────────────── */
.dash-email-strip{background:#fff;border-radius:14px;padding:1.1rem 1.5rem;box-shadow:0 1px 3px rgba(0,0,0,.06),0 4px 16px rgba(0,0,0,.04);display:flex;align-items:center;gap:2rem;flex-wrap:wrap}
.strip-left{display:flex;align-items:center;gap:.85rem;flex:0 0 auto}
.strip-total{font-size:2rem;font-weight:700;color:#0f172a;line-height:1;margin-left:.5rem}
.strip-pills{display:flex;gap:1.5rem;flex:1 1 auto;flex-wrap:wrap}
.strip-pill-item{display:flex;align-items:center;gap:.4rem}
.dot{display:inline-block;width:9px;height:9px;border-radius:50%;flex-shrink:0}
.pill-count{font-size:1.1rem;font-weight:700;color:#0f172a;line-height:1}
.pill-label{font-size:.72rem;color:#64748b;font-weight:500}
.strip-bar-wrap{flex:0 0 180px}
.strip-stacked-bar{height:8px;border-radius:4px;overflow:hidden;display:flex;background:#f1f5f9}
.strip-stacked-bar>div{height:100%;transition:width .6s ease;min-width:0}

/* ── Status Pills ─────────────────────────────────────────── */
.status-pill{display:inline-flex;align-items:center;gap:.3rem;font-size:.7rem;font-weight:600;padding:2px 8px;border-radius:20px;text-transform:capitalize}
.sp-completed,.sp-sent{background:#dcfce7;color:#15803d}
.sp-processing{background:#dbeafe;color:#1d4ed8}
.sp-failed{background:#fee2e2;color:#dc2626}
.sp-pending{background:#f1f5f9;color:#64748b}
.sp-draft,.sp-queued{background:#fef9c3;color:#a16207}

/* ── Dashboard table tweaks ───────────────────────────────── */
.dash-table tbody tr:hover{background:#f8fafc}
.dash-table td{padding:.55rem .75rem;vertical-align:middle}

/* ── Small button ─────────────────────────────────────────── */
.btn-xs-sm{font-size:.72rem;padding:2px 10px;border-radius:6px}

/* ── Date Filter Bar ─────────────────────────────────────── */
.dash-filter-bar{background:#fff;border-radius:14px;padding:.85rem 1.25rem;box-shadow:0 1px 3px rgba(0,0,0,.06),0 4px 16px rgba(0,0,0,.04);display:flex;align-items:center;flex-wrap:wrap;gap:.75rem}
.filter-label{font-size:.72rem;font-weight:700;text-transform:uppercase;letter-spacing:.08em;color:#64748b;display:flex;align-items:center;gap:.35rem;white-space:nowrap}
.filter-presets{display:flex;gap:.4rem;flex-wrap:wrap;flex:1}
.filter-preset-btn{display:inline-flex;align-items:center;gap:.3rem;font-size:.78rem;font-weight:500;padding:4px 13px;border-radius:20px;border:1.5px solid #e2e8f0;background:#f8fafc;color:#475569;cursor:pointer;text-decoration:none;transition:all .15s;white-space:nowrap}
.filter-preset-btn:hover{border-color:#0ea5e9;color:#0ea5e9;background:#f0f9ff}
.filter-preset-btn.active{background:linear-gradient(90deg,#0ea5e9,#0284c7);border-color:transparent;color:#fff;font-weight:600;box-shadow:0 2px 8px rgba(14,165,233,.35)}
.filter-custom-form{width:100%;max-height:0;overflow:hidden;opacity:0;transition:max-height .25s ease,opacity .2s ease;pointer-events:none}
.filter-custom-form.visible{max-height:80px;opacity:1;pointer-events:auto}
.custom-date-fields{display:flex;align-items:flex-end;gap:.6rem;flex-wrap:wrap;padding-top:.4rem}
.date-field-wrap{display:flex;flex-direction:column;gap:2px}
.date-field-wrap label{font-size:.68rem;font-weight:600;text-transform:uppercase;letter-spacing:.06em;color:#64748b}
.date-field-wrap .form-control{min-width:140px;border-color:#e2e8f0;border-radius:8px;font-size:.82rem}
.date-arrow{color:#94a3b8;font-size:.9rem;padding-bottom:.35rem}
