/* ==========================================================================
   NUZN Reach — Bulk Email Automation  |  UI theme (NUZN PEOPLE styled)
   ========================================================================== */
:root {
    --nz-navy-900: #0d1b45;
    --nz-navy-800: #14265e;
    --nz-navy-700: #1b3a7a;
    --nz-blue:     #2a3f8f;
    --nz-cyan:     #19c6ea;
    --nz-red:      #e8241f;
    --nz-ink:      #1f2637;
    --nz-muted:    #6b7280;
    --nz-border:   #e6e9f2;
    --nz-bg:       #eef1f7;
    --sidebar-w:   264px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    background: var(--nz-bg);
    color: var(--nz-ink);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ---- Brand accents on stock Bootstrap components ---------------------- */
.btn-primary { background: var(--nz-navy-800); border-color: var(--nz-navy-800); }
.btn-primary:hover, .btn-primary:focus { background: var(--nz-navy-900); border-color: var(--nz-navy-900); }
.btn-outline-primary { color: var(--nz-navy-800); border-color: var(--nz-navy-800); }
.btn-outline-primary:hover { background: var(--nz-navy-800); border-color: var(--nz-navy-800); color: #fff; }
.text-primary { color: var(--nz-navy-800) !important; }
.form-control:focus, .form-select:focus {
    border-color: var(--nz-navy-700);
    box-shadow: 0 0 0 .2rem rgba(27, 58, 122, .15);
}

.card { border: none; box-shadow: 0 1px 3px rgba(20, 30, 60, .08); border-radius: .85rem; }
.table > :not(caption) > * > * { vertical-align: middle; }

/* ==========================================================================
   AUTHENTICATED APP SHELL (sidebar + topbar)
   ========================================================================== */
.app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-w);
    background: linear-gradient(180deg, #0d1b45 0%, #14265e 60%, #172d68 100%);
    color: #c5cfe8;
    display: flex;
    flex-direction: column;
    z-index: 1040;
    overflow-y: auto;
}
.sidebar-brand { padding: 1.15rem 1.15rem .5rem; }
.sidebar-logo-chip {
    display: block;
    background: #fff;
    border-radius: 14px;
    padding: 10px 14px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .25);
}
.sidebar-logo-chip img.nuzn-brand-img { width: 100%; max-width: 176px; height: auto; display: block; }

.sidebar-nav { padding: .5rem .75rem 1rem; flex: 1; }
.sidebar-section {
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: #7f8db5;
    font-weight: 700;
    padding: 1rem .65rem .35rem;
}
.sidebar-link {
    display: flex;
    align-items: center;
    gap: .8rem;
    padding: .62rem .7rem;
    margin-bottom: .12rem;
    border-radius: 10px;
    color: #c5cfe8;
    text-decoration: none;
    font-weight: 500;
    font-size: .95rem;
    border-left: 3px solid transparent;
    transition: background .15s ease, color .15s ease;
}
.sidebar-link i { font-size: 1.1rem; width: 1.35rem; text-align: center; }
.sidebar-link:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.sidebar-link.active {
    background: rgba(25, 198, 234, .16);
    color: #fff;
    border-left-color: var(--nz-cyan);
}
.sidebar-foot {
    padding: .9rem 1.15rem 1.2rem;
    border-top: 1px solid rgba(255, 255, 255, .08);
    font-size: .82rem;
}
.sidebar-foot-user { color: #e7ecfb; font-weight: 600; display: flex; align-items: center; gap: .5rem; }
.sidebar-foot-user i { color: var(--nz-cyan); }
.sidebar-foot-brand { color: #7f8db5; font-size: .74rem; margin-top: .25rem; }

.app-main {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    height: 64px;
    background: #fff;
    border-bottom: 1px solid var(--nz-border);
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0 1.5rem;
}
.topbar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--nz-navy-800);
    padding: 0;
    line-height: 1;
}
.topbar-crumbs { display: flex; align-items: center; gap: .5rem; color: var(--nz-muted); font-size: .95rem; }
.topbar-crumbs .crumb-sep { font-size: .7rem; }
.topbar-crumbs .crumb-current { color: var(--nz-navy-800); font-weight: 700; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 1rem; }
.topbar-user { display: flex; align-items: center; gap: .55rem; }
.topbar-avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: linear-gradient(135deg, var(--nz-navy-700), var(--nz-blue));
    color: #fff; font-weight: 700; font-size: .95rem;
    display: grid; place-items: center;
}
.topbar-user-name { color: var(--nz-ink); font-weight: 600; font-size: .92rem; }
.btn-logout {
    display: inline-flex; align-items: center; gap: .4rem;
    background: #f3f5fa; border: 1px solid var(--nz-border);
    color: #4a5468; border-radius: 9px; padding: .42rem .8rem;
    font-size: .9rem; font-weight: 600; cursor: pointer;
    transition: all .15s ease;
}
.btn-logout:hover { background: var(--nz-red); border-color: var(--nz-red); color: #fff; }

.app-content { flex: 1; padding: 1.6rem 1.9rem; }
.app-footer { text-align: center; color: #9aa3b8; padding: 1rem; border-top: 1px solid var(--nz-border); }

.sidebar-backdrop {
    display: none;
    position: fixed; inset: 0;
    background: rgba(13, 27, 69, .45);
    z-index: 1035;
}

/* ---- Mobile: collapsible sidebar -------------------------------------- */
@media (max-width: 991.98px) {
    .app-sidebar { transform: translateX(-100%); transition: transform .25s ease; }
    body.sidebar-open .app-sidebar { transform: translateX(0); }
    body.sidebar-open .sidebar-backdrop { display: block; }
    .app-main { margin-left: 0; }
    .topbar-toggle { display: inline-flex; }
    .app-content { padding: 1.1rem 1rem; }
}

/* ==========================================================================
   DASHBOARD — hero banner + stat tiles
   ========================================================================== */
.hero-banner {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    padding: 1.9rem 2.1rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(120deg, #12224f 0%, #1c2c6b 48%, #2a3f8f 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.hero-content { position: relative; z-index: 1; max-width: 640px; }
.hero-eyebrow {
    text-transform: uppercase; letter-spacing: .16em;
    font-size: .72rem; font-weight: 700; color: #9fb4ef; margin-bottom: .35rem;
}
.hero-title { font-size: 2.1rem; font-weight: 800; margin: 0 0 .5rem; line-height: 1.1; }
.hero-sub { color: rgba(255, 255, 255, .82); margin: 0 0 1.1rem; line-height: 1.6; max-width: 560px; }
.hero-pills { display: flex; flex-wrap: wrap; gap: .6rem; }
.hero-pill {
    display: inline-flex; align-items: center; gap: .45rem;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 999px; padding: .38rem .85rem;
    font-size: .82rem; font-weight: 500;
}
.hero-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: #35e08a; box-shadow: 0 0 0 3px rgba(53, 224, 138, .25); }
.hero-pill.pill-warn { background: rgba(255, 193, 7, .18); border-color: rgba(255, 193, 7, .4); color: #ffe08a; }
.hero-action { position: relative; z-index: 1; }
.btn-hero {
    display: inline-flex; align-items: center;
    background: #fff; color: var(--nz-navy-800);
    border-radius: 11px; padding: .7rem 1.25rem;
    font-weight: 700; text-decoration: none;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .18);
    transition: transform .15s ease, box-shadow .15s ease;
}
.btn-hero:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0, 0, 0, .24); color: var(--nz-navy-900); }
.hero-orb { position: absolute; border-radius: 50%; z-index: 0; }
.hero-orb-1 { width: 300px; height: 300px; right: -70px; top: -120px; background: radial-gradient(circle, rgba(25, 198, 234, .35), transparent 65%); }
.hero-orb-2 { width: 220px; height: 220px; right: 130px; bottom: -140px; background: radial-gradient(circle, rgba(124, 92, 255, .3), transparent 65%); }

.stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.6rem;
}
@media (min-width: 768px)  { .stat-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1200px) { .stat-grid { grid-template-columns: repeat(6, 1fr); } }
.stat-tile {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    padding: 1.15rem 1.25rem;
    color: #fff;
    min-height: 132px;
    box-shadow: 0 8px 20px rgba(20, 30, 60, .12);
}
.stat-ic {
    width: 42px; height: 42px; border-radius: 12px;
    background: rgba(255, 255, 255, .2);
    display: grid; place-items: center;
    font-size: 1.25rem; margin-bottom: .7rem;
}
.stat-label { font-size: .82rem; font-weight: 600; opacity: .92; }
.stat-value { font-size: 2rem; font-weight: 800; line-height: 1.1; margin: .05rem 0 .15rem; }
.stat-desc { font-size: .76rem; opacity: .8; }
.stat-blue   { background: linear-gradient(135deg, #2f6bff, #1d4ed8); }
.stat-violet { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
.stat-cyan   { background: linear-gradient(135deg, #06b6d4, #0e7490); }
.stat-indigo { background: linear-gradient(135deg, #5568e0, #3730a3); }
.stat-green  { background: linear-gradient(135deg, #10b981, #047857); }
.stat-rose   { background: linear-gradient(135deg, #f43f5e, #be123c); }

/* ---- Generic panel card (recent campaigns etc.) ----------------------- */
.panel-card { background: #fff; border-radius: 16px; box-shadow: 0 2px 8px rgba(20, 30, 60, .07); overflow: hidden; }
.panel-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1rem 1.25rem; border-bottom: 1px solid var(--nz-border);
    font-weight: 700; color: var(--nz-navy-800);
}
.panel-link { font-size: .88rem; font-weight: 600; color: var(--nz-navy-700); text-decoration: none; }
.panel-link:hover { color: var(--nz-cyan); }
.panel-body { padding: 1.25rem; }
.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--nz-muted); }
.empty-state i { font-size: 2.2rem; color: #c3cbdd; display: block; margin-bottom: .5rem; }

/* Legacy status badges (still used in tables) */
.badge-status-Draft { background-color: #6c757d; }
.badge-status-Queued { background-color: #0dcaf0; }
.badge-status-Sending { background-color: #ffc107; color: #212529; }
.badge-status-Completed { background-color: #198754; }
.badge-status-CompletedWithErrors { background-color: #fd7e14; }
.badge-status-Cancelled { background-color: #adb5bd; }
.badge-status-Failed { background-color: #dc3545; }

/* ==========================================================================
   LOGIN — split screen
   ========================================================================== */
body.auth-body { background: #fff; }
.auth-split { display: flex; min-height: 100vh; }

.auth-panel {
    flex: 1 1 50%;
    position: relative;
    overflow: hidden;
    background: linear-gradient(150deg, #0d1b45 0%, #14265e 55%, #1e2f74 100%);
    color: #fff;
    display: flex;
    align-items: center;
    padding: 3rem 3.5rem;
}
.auth-panel-inner { position: relative; z-index: 1; max-width: 480px; }
.auth-panel-logo {
    display: inline-block; background: #fff;
    border-radius: 14px; padding: 10px 16px; margin-bottom: 2rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .25);
}
.auth-panel-logo img.nuzn-brand-img { height: 40px; width: auto; display: block; }
.auth-headline { font-size: 2.4rem; font-weight: 800; line-height: 1.15; margin: 0 0 1.1rem; }
.auth-headline .accent { display: block; color: #ff5a54; }
.auth-panel-sub { color: rgba(255, 255, 255, .8); line-height: 1.65; margin: 0 0 2rem; max-width: 440px; }
.auth-features { list-style: none; padding: 0; margin: 0; display: grid; gap: 1.15rem; }
.auth-features li { display: flex; gap: .95rem; align-items: flex-start; }
.feat-ic {
    flex: none; width: 44px; height: 44px; border-radius: 12px;
    background: rgba(255, 255, 255, .1);
    display: grid; place-items: center; font-size: 1.2rem; color: #5fd6f0;
}
.auth-features strong { display: block; font-weight: 600; margin-bottom: .1rem; }
.auth-features span { color: rgba(255, 255, 255, .72); font-size: .9rem; }
.auth-orb { position: absolute; border-radius: 50%; z-index: 0; }
.auth-orb-1 { width: 340px; height: 340px; right: -90px; top: -110px; background: radial-gradient(circle, rgba(25, 198, 234, .3), transparent 65%); }
.auth-orb-2 { width: 260px; height: 260px; left: -110px; bottom: -120px; background: radial-gradient(circle, rgba(124, 92, 255, .28), transparent 65%); }

.auth-form-side {
    flex: 1 1 50%;
    display: flex; align-items: center; justify-content: center;
    padding: 2.5rem; background: #fff;
}
.auth-form-card { width: 100%; max-width: 410px; }
.auth-form-logo { margin-bottom: 1rem; }
.auth-form-logo img.nuzn-brand-img { height: 46px; width: auto; display: block; }
.auth-tagline { font-weight: 600; color: var(--nz-navy-800); margin-bottom: 2rem; font-size: 1.02rem; }
.auth-tagline span { color: var(--nz-cyan); }
.auth-title { font-size: 1.9rem; font-weight: 700; color: var(--nz-navy-800); margin: 0 0 .25rem; }
.auth-title-sub { color: var(--nz-muted); margin-bottom: 1.5rem; }

.field-group { margin-bottom: 1.05rem; }
.field-label {
    display: block; font-size: .76rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .05em;
    color: #55617d; margin-bottom: .4rem;
}
.field-input { position: relative; }
.field-icon { position: absolute; left: .95rem; top: 50%; transform: translateY(-50%); color: #9aa3b8; }
.field-input .form-control {
    height: 48px; padding-left: 2.6rem; border-radius: 11px;
    border: 1px solid #dfe3ec; background: #f7f9fc;
}
.field-input .form-control:focus { background: #fff; }
.field-eye {
    position: absolute; right: .55rem; top: 50%; transform: translateY(-50%);
    background: none; border: none; color: #9aa3b8; cursor: pointer; padding: .3rem .4rem;
}
.field-eye:hover { color: var(--nz-navy-700); }
.auth-form-row { display: flex; align-items: center; justify-content: space-between; margin: .2rem 0 1.3rem; }
.auth-remember { display: flex; align-items: center; gap: .5rem; font-size: .92rem; color: #55617d; cursor: pointer; user-select: none; margin: 0; }
.auth-remember .form-check-input { margin: 0; }
.btn-auth-submit {
    width: 100%; height: 50px; border: none; border-radius: 11px;
    background: linear-gradient(135deg, #14265e, #1e2f74);
    color: #fff; font-weight: 700; font-size: 1rem; cursor: pointer;
    box-shadow: 0 8px 20px rgba(20, 38, 94, .3);
    transition: transform .15s ease, box-shadow .15s ease;
}
.btn-auth-submit:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(20, 38, 94, .4); }
.auth-foot-note { text-align: center; margin-top: 1.5rem; font-size: .85rem; color: #8a93a6; }

@media (max-width: 991.98px) {
    .auth-panel { display: none; }
    .auth-form-side { flex-basis: 100%; }
}

/* ---- Legacy auth-card fallback (Register / other auth views) ---------- */
.auth-wrapper { min-height: calc(100vh - 120px); display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; }
.auth-card { width: 100%; max-width: 440px; border-radius: 1rem; }
.auth-brand-logo { max-width: 300px; margin-inline: auto; }
.auth-brand-logo img.nuzn-brand-img { width: 100%; height: auto; display: block; }

/* Brand image base */
.nuzn-brand-img { display: block; width: auto; }
